Main

Game Development Archives

August 27, 2007

War of the cubes:update

Over the last week I have been busy trying to integrate a few more things into the game. I am happy that I have managed to now integrate ODE (Open Dynamics Engine) into my game and now the cubes obey the laws of physics! They fall more realistically, handle collisions and also orient themselves correctly along the terrain. Further I have also done some internal cleanups to allow me to use level definition files to load/unload levels dynamically.

I will upload a few more screenshots later which show collision handling and physics in action.
The next stage is going to be writing an unit loader allowing me to describe physical attributes of objects in config files and later to see how I can make the whole thing scriptable.

Essentially providing hooks into the unit AI's via Lua or python. This would allow me to expand Simutron AI without having to constantly recompile the game source code and also allow me to model complex AI behaviour and test it out in realtime.

Can you digg it? Bookmark This

August 22, 2007

War of the cubes : Code

I think i have reached a point at which the basic infrastructure in the code base is relatively stable. I now manage the code in a local SVN repository and here's a first snapshot of the code base. Things you will need to build this

- Ogre 1.4
- OIS 1.0RC
- CEGUI 0.5
- libconfig http://www.hyperrealm.com/main.php?s=libconfig
- State Threads 1.8 http://state-threads.sourceforge.net/

How to run the program
----------------------------------
- make
- ./TerrainRenderer
- Right click on the terrain to create cubes. camera movement using keyboard keys
shift+up/down to lookup and down, shift+left/right to strafe.
- Hit ESC to get rid of the main menu which doesnt do anything right now anyway:p
- create around 50-100 cubes and just watch them kill/clone and commit suicide.
- They output a lot of text to stdout which i use for debugging for now you can probably /dev/null it.

Known bugs:)
--------------------
- sometimes clicking on the terrain doesnt create a cube, this is due to the way I am doing raycasting to figure out if the click lands on a terrain. I am in the process of fixing it this usually happens if the camera is beyond the dimensions of the terrain.

- cubes dont follow terrain strictly , this is due to me adding +3 to the cube's y position and i think some LOD issues.

- GUI buttons don't do anything yet:p

NOW the code: Download file

and a few screenshots


Can you digg it? Bookmark This

August 20, 2007

War of the cubes:Update Warning Long Post!

Over the last week I have made some significant amount of progress in the game/simulation whatever. There were a couple of ideas I had been toying with essentially how to pass messages between game objects and how they should react to events etc.

The solution I am came up with is that objects now each have a Priority based Event Queue. Events can be sent to objects to by adding to this queue and since I its priority based we can assign different priorities to the events eg USER EVENT, AI EVENT, IMMEDIATE EVENT.

- USER EVENTS - any event triggered by a user eg. click on the unit,commands to the unit by a user.
- AI EVENTS- more useful while a unit is being controlled by an AI. The AI need not be a master AI it can be like a Group AI thread created by a user. Eg A User creates a group out of a bunch of units and sends them out on a reconnaissance mission. One unit in the group identifies an incoming hostile and it can send events to all its group members to prepare for the incoming hostile etc. The Message passing is also useful in simulations to trigger events eg if more than 3 simutrons ( yes thats my name for actors:p ) are near a simutron it can randomly ask a simutron to clone itself .

- IMMEDIATE EVENTS - These must be highest priority events eg A simutron got shot and needs to die. We can decided to process event that lead to the units death first before handling other user commands.

One thing I forgot to do is sort it based on event time priority. At this time I am not sure if that is the right approach probably I should just use event time as a sorting criteria and not the type of event or just have 3 separate event queues per simutron.

Right now the simulation ignores priorities as all the events are currently simulation events and its just simutrons signalling to each other to die or clone themselves or die of loneliness.

I also added more states to each simutron. A simutron's state machine looks like the following right now


CREATED ->ACTIVE -> DEAD->DESTROYED

-CREATED - The simutron is growing to life and won't process any events in this state( useful or doing a creation animation)
-ACTIVE - Simutron is ready and will process events now as well as fire off events based on certain conditions being met.
-SLUMBERING (not shown will update diagram later)- Simutron will process incoming events but will not trigger any events by itself nor do any checks. Its like a sleep state for the simutron.
-DEAD - Simutron is dead and will not process any more events. Useful to start playing a death animation.
-DESTROYED- Simutron is done dying! release all resources now.

I will expand this state machine as the game develops but for now its sufficient. Now the code I have implemented allows me to just add a seed population of simutrons and just watch them kill/clone other simutrons.

As of now I have the flexibility to easily change the simulation logic and try out different simulations. The current simulation is a variant of Conway's Game of Life but there are a few bugs I need to fix with it:) Mainly, the creation rate of simutrons is far higher than their death rate leading to a few thousand of them on screen and bringing the simulation to a halt! What I would like to achieve is a stable population of simutrons using simple rules.

Screenshots/video to come!

Continue reading "War of the cubes:Update Warning Long Post!" »

Can you digg it? Bookmark This

August 14, 2007

War of the Cubes!

Mostly a game dev rant and a collection of my thoughts on dealing with some Game Dev issues :)

My previous post talked about how I intended to start writing a game and use that to explore different aspect of game development. Over the last two weeks I have spent quite a bit of time coding. The focus of the program has been to develop the basic framework for a game/simulation.

I can say that I am 15% there now:p. What do I have in place,
- Integration with CEGUI for GUI elements,
- Integration with OIS for handling events from keyboard/mouse ( sorry no joystick support:p)
- Integration with State Threads for unit AI.

The first two are fairly standard stuff and was mostly figuring out the API calls etc. The game isnt much right now it just loads up a terrain and allows you to use a free look camera to explore the terrain. The camera can't roll though for obvious reasons as its not a flight simulator that I am designing. Also I dont allow the camera to go below the terrain again for obvious reason, but I am yet to limit it on the sides which I will do soon.

I decided that I wanted to write some kind of simulation/strategy game. One thing I have always wondered is how does one control a few thousand entities on screen at the same time and I thought this will be a good chance to understand a bit about AI programming.

Most games can be modelled as glorified state machines, with each unit in the game running its own little state machine. The only difference between a game and a simulation is the human input which allows modification of simulated behaviour. Now instead of modelling each entity's state machine and running through them in a loop every step, I thought why not try something different.

Enter StateThreads :)

Continue reading "War of the Cubes!" »

Can you digg it? Bookmark This

August 3, 2007

Game Programming and more

After a really long time I was browsing around on Ogre etc yesterday and visited Amit Patel's Gaming blog @ http://simblob.blogspot.com/. Amit Patel's blog has always had some very interesting articles on certain aspects of game development like Pathfinding etc. His articles on A* pathfinding are amongst the best you can find on the net.

After reading his blog I felt inspired once more to seriously spend sometime on game development. But this time around I dont want to set the bar very high as in most cases I end up abandoning the effort midway. The objective this time is not to write a full blow game but to experiment with certain aspects of game programming one thing at a time and just slowly increase my knowledge of game programming. As of yesterday I have configured/installed Ogre and OIS etc and wrote the first few lines of code to tie all that together and open a RenderWindow.

Next step to integrate OIS and CEGUI to understand how to build menus etc and switch between menu and game. I haven't decided what game I will write or whether I will write one even or will it just be a bunch of programs to learn about individual mechanics. But I am in no hurry to decide. Also one thing I have decided is I am not going to waste my time doing 3d Modelling etc, just going to use damn Square boxes for everything and focus on getting the coding right.

If and when I find people to do modelling/artwork I will worry about such things:) Till then Glorious Cubes/Spheres/Cones it is for all models. Previously I would spend so much time building 3d models that I would just get frustrated and drop the whole project. This time around I hope I can avoid 3d modelling and make my life easier.

I will try to post demo videos of what I achieve from time to time !

Can you digg it? Bookmark This

About Game Development

This page contains an archive of all entries posted to Travelogue in the Game Development category. They are listed from oldest to newest.

Events is the previous category.

Gaming is the next category.

Many more can be found on the main index page or by looking through the archives.

Creative Commons License
This weblog is licensed under a Creative Commons License.

Links

Powered by
Movable Type 3.34