Jump to content
  • Advertisement
Sign in to follow this  
luzarius

How many tiles was ultima online? How big was it?

This topic is 4415 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Anyone know how many tiles a single shard had in ultima online? One more question, how should my game world be represented at the server level? I am making a tile based game and I was using a 2 dimensional array to store data for each x,y tile. If I make the 2 dimensional array too big I run into problems. Luzarius

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by luzarius
If I make the 2 dimensional array too big I run into problems.


Don't try to hold your whole map in an array.

Share this post


Link to post
Share on other sites
Quote:
Original post by Fruny
Quote:
Original post by luzarius
If I make the 2 dimensional array too big I run into problems.


Don't try to hold your whole map in an array.


Can you recommend me another technique or point to an article that discusses this?

Share this post


Link to post
Share on other sites
Do not create large arrays on the stack: use dynamic allocation or a std::vector. Chop your map down in smaller chunks which can be loaded and unloaded as appropriate: it'll keep memory usage down. Take a course on data structures. Do not bother with two dimensional arrays: learn to fake it: arr[row][col] → arr[row*row_size+col]

Share this post


Link to post
Share on other sites
Quote:
Original post by Fruny
Do not create large arrays on the stack: use dynamic allocation or a std::vector. Chop your map down in smaller chunks which can be loaded and unloaded as appropriate: it'll keep memory usage down. Take a course on data structures. Do not bother with two dimensional arrays: learn to fake it: arr[row][col] → arr[row*row_size+col]


Thanks man that sounds good.

Share this post


Link to post
Share on other sites
Also - use several small maps that can be loaded / unloaded as required, rather than trying to keep the whole world in RAM at any one time. Keeping everything loaded only really has an advantage if the whole world has players constantly passing through it (where loading in and out can actually cause problems, unless you use a caching system) In practice, it's more likely that your players will congregate in hotspots (around monster spawns etc). Use this to your advantage and read up on texture management - this is actually pretty close to what you need to do with area maps.

Share this post


Link to post
Share on other sites
Quote:
Original post by Fruny
Do not bother with two dimensional arrays: learn to fake it: arr[row][col] → arr[row*row_size+col]

*cough* arr[row*col_size+col] *cough* [wink]

Share this post


Link to post
Share on other sites
no way on earth did ultima online use static tile allocation, and I'd bet money that the server side of things didn't even keep a listing of tiles at all, but instead a sort of optimized version of the data, meant to reduce space. Let the player figure out that they are standing on grass, the server doesn't give any concern to it. The server only needs to know when the player has attempted to cross a boundry they were'd supposed to, and where actual moving/movable objects are in relation to eachother. The player can have all the bloat they need to, but you should still only load the map in chunks as was already mentioned.

Personally, last way i did it was to have my map files with an offset list in the start of the file, which specified the starting point and the size of the given map blocks [blocks that were coordinate chunks X by Y in size, or in my case, 32 tiles by 32 tiles in size, which i suppose wold be X by X]. When the player moved sufficiently far away from a block, it was deleted [no reason to keep coordinate 0,0 when the player is over at 198,392], and the new block was loaded up [in my case, using the exact same memory].

Share this post


Link to post
Share on other sites
Quote:
Original post by Evil Steve
Quote:
Original post by Fruny
Do not bother with two dimensional arrays: learn to fake it: arr[row][col] → arr[row*row_size+col]

*cough* arr[row*col_size+col] *cough* [wink]


*cough* *cough* *splurge* When I read row_size I interpret it as row length not number of rows and when I read col_size I think column height (length) not number or columns. Therefore *choke* *choke* I'd stick with Fruny's arr[row*row_size+col]

Share this post


Link to post
Share on other sites
Quote:
Original post by xstreme2000
*cough* *cough* *splurge* When I read row_size I interpret it as row length not number of rows and when I read col_size I think column height (length) not number or columns. Therefore *choke* *choke* I'd stick with Fruny's arr[row*row_size+col]
Ah, that's true. That's one reason I always refer to the number of rows or columns.

Sorry for derailing the thread...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!