This week I’ve been finishing up my map exporter and the results have been pretty good. I’ve managed to get the point where I’m considering this iteration as complete. As with everything though, there’s still a lot more that it needs to be able to do, but there’s enough there for me to be loading something into the game and get on with actually creating the game :)


First things first, I’ve broken the map mesh up into an arbitrarily sized grid. This means that once its imported into the game only the sections that are on screen will need to be rendered. This actually proved to be a pretty difficult task, with me going through several differing methods before starting again and ending up with something pretty simple. Originally I was trying to take the outline data (the outline for the tessellation algorithm that I talked about in my last post) and break this up, however it was proving quite difficult due to all the specific scenarios it would have to handle. The method I finally went for was to go back to the tiled data, and break this up into sections, then pass all of these through the algorithms I talked of last time. It took quite a bit of re-jigging to get it to work, but I’m happy with the results.


Next I added borders to the map, to make it look more 3D. This was actually pretty simple in the end, I simply iterated through the outline data and added an extra quad to the mesh for each vector. It was then just a case of tidying up the corners and I had a nice looking 3D map!


Of course no 3D mesh looks 3D without lighting. Since performance is an issue, I want to be doing as few lighting calculations at run-time as possible, so I’ve baked the lighting into the vertex colour data. This also means I can have as many point lights in the map as I want, as long as I can come up with some way to fake the lighting on any moving objects moving passed them. Check out the screen shot for a nicely lit example :)



I’ve now got this all outputing to a nice and clean binary file ready for me to import it into the game for next week! So hopefully I’ll have some screenshots of it running on device for next week. :-)

March 20, 2011 at 8:36 pm by Copey
Category: Blog, Windows Phone 7 Game
Tags: , , , ,