Littlelostpoly

View Original

Code Progress

Originally Posted July 23, 2008

Been meaning to write an update on the progress of the mod for a while but have been engrossed by tests on the Source engine which I will explain later. Anyway for now I will give an update on some of the great progress that has been made so far. 

NPC LODing, Culling and Adaptive AI – Complete!

This was one of the first things I wanted to concentrate on, and with the help of Jacob and R_Yell I finally have a really efficient AI system! As described earlier I wanted a system that could cull out any NPCs at a certain distance and also force them to sleep at another. On top of that we also designed a system which adjusts the distances of each of these states based on how many AI are on the screen at once. So if there are 50 NPCs in view then the system will adjust the sleep radius so that, for example, any AI outside of a radius of 512 units will be told to sleep while zombies closer will have full AI.

The Results:

This system works amazingly well, with many cvars which allows me a lot of freedom when tweaking later to get performance right, based on how well the rest of the game performs (with art etc).

The culling system had some hiccups along the way, initially, we thought it would be easy to just set the NPCs to have the nodraw and non-solid parameters (along with frozen AI) and although it performed pretty well, we had a problem with overloading Sources default sound channels, as each zombie requires a channel. Our second approach was to destroy the NPC altogether when culled, leaving only a simple marker behind, and spawning a new one back when in visual range again. This method worked great, and since fixing a few spawning issues, it seems to be a much cleaner, efficient method.

Here is an example here shows how many NPCs the mod can handle compared to the standard source engine:

Episode 2 engine:

The Willows:

Efficient environment: WIP

I think I’ve pretty much got it sussed now. I have decided upon a set draw distance which should allow me to have a pretty good density of Art and AI, and am going to try to stick to it while designing the rest of the game; however I have left room for adjustment if necessary.
Below is a screenshot showing draw distance and projected art density (note: these models are for performance testing only, and are not representative of the final look at all):

 *Problem with pics – will fix tomorrow*

As you can see the fog will hide the draw distance nicely and with a well designed skybox, should blend out the background without a noticeable border.

Headcrabs: Gone!

Incremental Zombie Health: Up and running!

(I also have a nice convar to tweak how much zombies’ health increases per kill so I can balance it better later on.)

Dream Features:

Finally R_Yell was also awesome enough to code in some of my dream features such as:

Headshots with proper tweak-able regional damage! For some reason this is not enabled by default – the convars were there but they did nothing) Now I’ll be able to experiment with insta-kill headshots to see if they work from a game play point of view.

And regenerative health! This is great as I now don’t have to worry about how to implement a med kit distribution system on the map. There are also cvars for tweaking regeneration rate etc.

So as you can see a lot of milestones have been passed over the past week and I’m really excited as to the possibilities that are now in front of me. I’m really looking forward experimenting with them further to see what can be done to make them work really well with the game design.

What next?

There are a few more things I’d like to try and get implemented into the mod before I get started on designing the map and game play, I’m looking into them myself at the moment but am hoping I can get a little more help from R_Yell and Jacob to get them implemented. These are:

Navigation system: again would help immensely with helping the player find their way around the map.

Iron sites: This is something which I have been thinking about more and more lately and am now really keen on the idea of having it in the mod, not only for the immersion it will help create, but also for the game play possibilities it would present me with.

Visuals to compliment the regenerative health: I would REALLY like to loose the HUD altogether, maybe only keeping a small ammo counter for your weapon, but also loosing the health display completely, instead relying only on visual and auditory aids to represent how injured you are.

Again, these are not entirely necessary, but I think they would add A LOT to the gameplay.

Final Note:

Will be looking into iron sites coding tutorials via the web in the meantime to see if I can pick anything up and will also contact Jacob and R_Yell to see if they can help me get in some of these last few features!