Worklog for Baystep Productions

Project Viral

Return to Worklogs

Procedural Generation(Posted 2011-07-28)
I started with the Procedural Generation of the levels. I'm starting out simple right now so here's the outline of my current algorithm (its really simple right now)...

-Start by filling the grid with grass tiles.
-Create up to 200 tiles of "dirt" tiles at random locations.
-Iterate the map 3 tiles and "grow" these dirt tiles by using random switches.. ie:
If Rand(0,1)=True And x>0 Then Layer0[x-1,y].frame = 6
This creates randomly shaped pools of "dirt"
-Iterate it again to fill in any patches by the rule if more then 2 sides are dirt, fill it in with dirt.
-Finally iterate one last time to create the "borders" and transitional frames between dirt and grass.

Then I move on to the resources or units. In almost the same fashion as before.
- Create 100 "tree" tiles at random locations that are above "grass" tiles.
- Iterate this 2 times just like the "dirt" grow method but again only if its on "grass" tiles.
Repeat the above for "rock" tiles but only on "dirt" tiles.

This method works. Its probably not the most efficiant but considering I only generate the map at game start, 500ms to 1000ms isn't too bad right? Plus I'm too lazy to make tilesets for more detailed maps right now. (I'm on a laptop so drawing is a choir.

In future versions I have a possibly realistic approach? Which is to hold a heightmap array with values between 0 and 8 (integers). Probably by using a sort of diamond-square algorithm. And set all tiles at 0 to water. Then use the height for the density of certain tile types to render. Then probably use an almost "lifecycle" type growth generation to grow these patches based on their height and surrounding. IE: grass is less likely to grow in lower altitudes while grass is.


Intro(Posted 2011-07-26)
I'm creating this work log not only to document the progression of the game but also to kinda hold the idea and rights of the game as well.

So to start out, the game is a top-down tile based game. It's really got multiple genre style fused together. For instance, your personal character plays out almost RPG style. While your influence on the world around you acts in an RTS style. (same goes for the community). The enemy AI is very Shoot 'em up as they really only one goal and that is to get together and destroy whatever it is your doing.

Right now, I'm developing the "single player quick game" mode for it to kind of get the mechanics working. Then I'll move on to Single Player Campaign. And finally introduce the MMO into it with a hopefully massive multiplayer section.