Technology Info

Home
About
Downloads
FAQ
Development News
Technology Info
Known Bugs
Screenshots
Links

In case any of you are wondering how I'm implementing the various features of the game, this page should answer your questions. Feel free to ask me anything, and I'll try to answer it as best as I can.

Programming Languages Used:

I'm using Visual Basic 5 for the main .exe, and Visual C++ 5 to make the dll.

Game Structure:

DirectX stuff and other small things go in the Visual Basic exe, so it's easier to add some features.
Most of the game functions (collision detection, particle system, forces, etc.) are in the dll so they run fast.
Several variables are shared between the exe and dll, mainly the terrain and variables related to it.

Terrain Format:

Internally, the map is represented by 32bits per pixel - 24bits for colour, and 8 bits for flags (e.g. passable, destroyable, etc.).
The file format is currently a 24bit .bmp, but it will soon change to include the flags. In the future it could also be generated 'on the fly', like Liero or NiL.
The entire map is held in an array in Visual Basic.

Collision Detection:

For particles, I draw a line from the current position to the new position. The program checks if it hits anything on the way.
For the player, it is almost the same except it draws lines on the leading edges of the player.
All the collision detection is done using the terrain in the VB array.

Particles:

The particles are kept in a linked list, to allow quick removal and adding of new particles.
Particles will be associated with a 'particle script', basically allowing the particle to do almost anything.
Particles will also have an 'owner', to determine who killed who, and mass, which is used with forces.

Forces:

Forces are things like gravity, magnets, and repulsion. If you want gravity in a map, add a constant force pointing downwards. If you want everything to be attracted to the center of the map, add a strong attraction force there.
Explosions also cause things to be repelled from them, so a particle, on hitting a wall, could add a repulsion force to push stuff away from it.
Of course, how much things are pushed away depends on their mass.
Soon I will have another type of force: forces from a line. This could be used to simulate fans, anti-grav pads, or whatever.
Forces are also kept in a linked list, for quick adding or removal of forces.

Rendering:

The player is simply blitted from a surface containing all the sprites to the screen.
The particles are rendered in the dll. For now they're just dots, but they'll be sprites soon enough.
The terrain is a bit more complicated:
There are 4 surfaces, each as big as the screen, that hold the terrain immediately around the player. The sections that can be seen by the player are blitted to the screen.
As the player moves around, sections from the VB array are copied to the surfaces and shown as necessary.
Eventually I'll have a background, shown beneath the terrain
There will also be alpha-blending for special effects, e.g. explosions, flashes, fading trails, and so on. This will be accomplished using an assembly routine.

Networking:

I haven't done much with this yet, but it will probably be server and client. So a server would be made, and clients would connect to it.