Saturday 13 June 2009

3D planet scripts.

Just a quick demo of the 3D planet sprite converter script, it takes 2D textures and renders them into 3D globes. It then applys lighting effects and other layers before spitting out a 2D sprite which can be drawn in the game.

I wanted to still have 3D planets but without the game dropping its FPS on older computers. Since the current 3D planets are actually 3D ( rendered in real time with lighting using directX ) they used alot more processing power than the 2D planets did with the layered sprites. This script allows me to generate 3D looking planets and spit out 2D sprites with only a single image layer. This is faster, cleaner and allows greate variation in planets.

However the downside is the script is slower than directx when drawing 3D spheres with realtime lighting. But produces nicer looking planets, the downside being I have to limit the number of renders required. The trick is to only call the script once and awhile. I am hoping to get away with running it every 10 secs if planet and sun orbits are slow enough to prevent the player noticing the offset renders.



It just requires a few bug fixes and addons, then I will make it into a handy little plugin that fits into RU externally so it can be modded in the future easily.

I also have plans to make a plugin system to allow the game to be made out of a number of independant modules which fit together and work seamlessly. The idea is that it will reduce debugging time allow flexibility to expansion and developers can work on expansions/effects/database addons seperately to the game without it changing any of the main engine code (which can cause confusing bugs and loss of speed on old computers)

No comments:

Post a Comment