I have been working on Lost Horizon for the past few days now and for the most part, everything is going quite smooth. After I finish working on scrolling code, Im going to dive into how I plan on dividing up the world. I will be using an overlay of zones, color coded for the engine.
The way it will work, is instead of loading up the entire world and having the engine keep track of it, only load what is in the "green" zone, or immediately surrounding the player, and a bit of the adjacent "zones". Anything outside of the adjacent, or "blue" zone, wont be drawn and will be considered the "red" zone. I havent worked out the exact sizes of the zones them selves, but a good rough idea is the "green" zone would be the size of the game console. The "blue" zone would be half of the size of the "green" zone, and would act as a loading buffer. Once the player reaches the blue zone in one direction, the engine will unload the blue zones in the opposite direction, and turn them into red zones.
The exact implementation of how I am going to do this is a little fuzzy, and is still a bit up in the air. I could have the entire zone overlay follow the player and constantly load and unload parts of the map as new ones become available.
The other way would be to stamp the entire world with the zone layout. Each with the large size zone and half sized zones attached to them across the entire world. Same as before, I would only load blue and green zones. But since every place on the world would have the buffer zones, I would have to add a color into the scheme. Green for the zone the player is in, and blue for the adjacent zones to green zones. Red zones would follow blue zones, with the buffer zones for the red zones being black. This would prevent me loading buffer zones attached to red zones, but not attached to green zones.
For wilderness areas, anything outside of town, I will have monsters get created on the fly in the blue zones, that will wander around. Any monster that wanders into a red zone will be removed, and ones that wander into the green zone will engage thier AI for when they see a player. Hopefully this will give the illusion of the world being alive, and provide "random encounters" that seem like wandering monsters.
The reasoning behind doing these zones is it doesnt matter what is happening on the other side of the world, if the player cannot see it, and if the player cant see it, why load it? This will allow for better performance of the game, and allow me to use that saved performance for things like better AI, better spell effects or anything else that the player would enjoy.
The last thing I would like to address in this post, is town zones. This zoning system will work out differently than the color coded zoning. Since I plan on having randomly generated worlds and static towns, I am going to associate each town with level zones. The town, and the surrounding area will have the levels of the monsters and loot controlled by these zones. Since I plan on having the player start out in the same town regardless of how the map is generated, I need to control the level of the monsters around these towns to prevent a newbie town from being dominated by higher level monsters that the player has no chance in defeating. These zones will also control the level and/or amount of random dungeons generated in these zones.
I will hopefully have a rough system set up within the next few days, depending on how finishing up this scrolling code goes. I will test both color zoning ideas to see which one works out the best.
Feel free to post any comments or suggestions!
Showing posts with label zones. Show all posts
Showing posts with label zones. Show all posts
Thursday, September 10, 2009
Zones
Subscribe to:
Posts (Atom)
