Forum

> > CS2D > Maps/Editor > Map tile limits
ForenübersichtCS2D-Übersicht Maps/Editor-ÜbersichtEinloggen, um zu antworten

Englisch Map tile limits

4 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt Map tile limits

MikuAuahDark
User Off Offline

Zitieren
I am just lazy to calculate 2^32/32 and it returns 67108864 then it reminds me to CS2D and the Editor where there is a entities that located at -2^31. Well i think you can't go there because later you gonna get those problems:
1. EXECEPTION_ACCESS_VIOLATION
2. Take too long to get there

But i think that problem above is wrong, depending on my calculation, it seems that you can't go more than 67108863 tiles because (maybe) the camera posision is stored as 32bit signed integer. Moving more causes you to teleported to negative tiles. So it's just like that you already travelling around the world, because you would get back to same spot again.

Is that true or not?
Sorry for my english!

alt Re: Map tile limits

DC
Admin Off Offline

Zitieren
It's true. There are always limits but in this case they are so incredibly high that you won't have any problems with them in practice (so 2. applies unless you are very bored).

The scrolling position/offset is saved as two 32 bit signed integers (for x and y). So scrolling for a very long time will at some point result in a wrap around. However the scroll offset is saved in pixels while the entity positions are saved in tiles. Resulting in a 32 times larger range for entity positions. You will never be able to scroll to an area which can't be saved as tile position. And even if you would be able to do so: The game probably wouldn't crash because the variables would be wrapped around.

alt Re: Map tile limits

MikuAuahDark
User Off Offline

Zitieren
Thanks for the answers, but i have 1 question
Does the scroll offset gonna changed to 64bit on future version?

alt Re: Map tile limits

Alistaire
User Off Offline

Zitieren
user MikuAuahDark hat geschrieben
Thanks for the answers, but i have 1 question
Does the scroll offset gonna changed to 64bit on future version?


64 bit is 18,446,744,073,709,551,616 - 18 billion billion pixels, which would make for 576,460,752,303,423,488 - 576 million billion tiles in both directions. Why on earth would you need that.
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antworten Maps/Editor-ÜbersichtCS2D-ÜbersichtForenübersicht