Forum

> > CS2D > Maps/Editor > Map tile limits
Forums overviewCS2D overview Maps/Editor overviewLog in to reply

English Map tile limits

4 replies
To the start Previous 1 Next To the start

old Map tile limits

MikuAuahDark
User Off Offline

Quote
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!

old Re: Map tile limits

DC
Admin Off Offline

Quote
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.

old Re: Map tile limits

MikuAuahDark
User Off Offline

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

old Re: Map tile limits

Alistaire
User Off Offline

Quote
user MikuAuahDark has written
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.
To the start Previous 1 Next To the start
Log in to reply Maps/Editor overviewCS2D overviewForums overview