Loading sprites (big map) XNA

Started by
1 comment, last by Jakob Krarup 10 years, 8 months ago

Hello, I'm trying to make a 2d game, with perspective 45º (like Tibia, Zezenia, Phobos) .

I have some doubts about the map, at the moment my map is at the client side, but I need to map the map informations at the Server side, just the sprites at the client side.

But I have many doubts about how to load it, anyone got suggestions on how to load the map to the client?

Another doubt is how to make an effective map editor, by now I can't make a very big map, or my pc would just "explode", I'm thinking of an algorithm to just load the tiles that can be visible on my screen and when I scroll it loads the other tiles.

I'm using pictureboxes in the map editor, and the max size that I could reach was something like 500 x 500 = 250000 pictureboxes of 32px x 32px. But it all gets loaded at the same time when editing the map, I needed to load it in parts, any suggestion on the best way to do it?

Hoping for answers !

Thank you,

Daniel.

Advertisement

You need to implement an paging system. You only need one picture box. And use the position of where you are on the map in your paging system to give you the tiles for that specific region.

Here's a code framework for infinite worlds implemented in XNA: http://xboxforums.create.msdn.com/forums/p/111091/664227.aspx#664227

You would have to make an implementation of IPermanentMapStorage which gets maps from a webservice.

You can probably use the rest of the code as is smile.png

/Jake

P.S. in case you are interested in seeing the newest version, which uses Perlin noise for map generation (not a requirement for the framework), it is attached to this post.

www.xnafan.net - tutorials, tools and code samples for making games :)

This topic is closed to new replies.

Advertisement