minicraft-plus-revived icon indicating copy to clipboard operation
minicraft-plus-revived copied to clipboard

Rewrite coordinate system

Open Makkkkus opened this issue 3 years ago • 6 comments

Currently, we have two coordinate spaces in the game; one for entities, and another for tiles. Moving between these two is pretty easy and can be done with a simple bitwise operation, but that doesn't make it optimal.

We should instead make entities and tiles use the same coordinate space, for ease of use.

In the old system this would be done with:

int tile = entityPos >> 4;

While in the new system you can just do:

int tile = (int) entityPos;

It isn't such a big change on the surface other than that the latter would be much more intuitive, but this will make movement much more accurate and specific, as well as easier to work with.

Makkkkus avatar Sep 07 '21 11:09 Makkkkus

Is anyone actively working on this? If not, I would like to be assigned to this

lino-levan avatar Dec 15 '21 17:12 lino-levan

I am questioning whether or not this would actually be a good change to make, since the point of the original system is that: even in the entity coordinates, they are stored as an integer, and there is therefore no floating-point-error. So changing to this system could decrease performance possibly.

afyber avatar Mar 24 '22 21:03 afyber

Basically I don't think it's a good idea

I'll wait for you opinion, though

afyber avatar Mar 24 '22 21:03 afyber

The point of this was to fix issue #172, so that we could do floting point calculations, and woudn't the performance impact be miniscule?

Makkkkus avatar Mar 25 '22 09:03 Makkkkus

Good point.

afyber avatar Mar 27 '22 19:03 afyber

It's been a few years, sorry about that. I don't know if this makes any sense. I don't see how #172 is related to this in any way?

lino-levan avatar Aug 13 '23 16:08 lino-levan