Saturday, November 17, 2007

Terrain rendering

This is an early preview of the terrain rendering engine. It's using a heightmap generated from Terragen which is then imported as a grey scale bitmap. The program is rendering the mesh without any material textures but does use a precalculated ambient map.

The ambient light map is calculated by using a ray-casting algorithm to estimate the angle of the horizon at various angles for each vertex on the height field. Using these angle values, an approximation of the sky lighting contribution can be made.

The next step for lighting is to calculate the sun contribution. Using the same ray-casting algorithm the angle of the horizon will be stored in a horizon map. This can then be compared with the angle of the sun to determine if a point is in shadow or in direct sun light. The added benefit of using a horizon map is that the angle of the sun can be changed with light and shadow being generated dynamically, so different times of day can be simulated.

Pixel shaders are going to be used to incorporate the lighting and materials. I hope to also support bump mapping to give the terrain a more rough 'feel' to it.

Change of project direction

After some careful consideration and weighing up the advantages and disadvantages, I have decided to change the project so it will no longer be a Java applet embedded in a webpage, and will instead be an offline application that can be downloaded and played single player or multiplayer, internet or LAN. The game will now be written in C++ and use OpenGL for the graphics rendering.

The main reason for this change is that I was finding Java to be quite a limitation and although this was pushing me to write well optimised code, I was unhappy with the quality of the graphics. Graphics is certainly the strongest aspect of my programming skills and it would seem a shame to limit myself so much in this area of the game. The game will now feature a fully 3-D environment making use of available graphics hardware. Lighting and effects will be used by writing custom vertex and pixel shaders.

The game will still remain cross platform, and will be released for Windows, Mac OS X and Linux. I will be using the SDL library to handle input, sound, window management so the porting to other platforms should be fairly trivial.

Tuesday, September 11, 2007

Concept soldier


I sketched a soldier as part of the concept art for warring states as shown above. I'm now going about making it into a 3-D model for the game.

On some other notes, I've set up a subversion repository for version control and the code is progressing quite nicely. The basic rendering system is in place with an isometric style map being drawn and culled correctly, and sprites in the game are sorted and displayed correctly.

Saturday, September 1, 2007

Interesting youtube video

I stumbled across this youtube video which has some really interesting background about the weapons used during the warring states period in china. It will be a very good reference to make when designing the units in the game:

Monday, August 27, 2007

First preview of assets


Here are some of the model designs that I have been working on for the game. The models will all be pre-rendered and used as sprites in the game. As can be seen I haven't added textures or materials yet but the structures are taking shape.

Blog started!

I've started this blog to record the development of my final year university project. It will be an online multiplayer real time strategy (RTS) game which will be played through a web browser. The game will be written in Java and aims to feature multiplayer as well as a challenging computer AI as a single player option.

The name 'Warring States' refers to the period of time that the game will be set. This was a time in China's history where the country was split into seven seperate states, each at war for the control of the known world. In multiplayer games, each players will choose which faction they want to play as, and the single player game will feature a campaign mode which will follow the state of Qin who aim to unite the country.

I hope to update this blog whenever I implement anything particularly interesting. I plan to release a public beta for testing when the game reaches a stable state.