The Daily Click ::. Projects ::. The Orphanage
 

Project: The Orphanage
Project Started: 21st February, 2008 Last Update: 27th May, 2009
Project Owner: ben mercer Project Members:
Project Type: Tactical shooter/Survival horror Project Progress:

An annoying conclusion
Posted 3rd Apr 09, by ben mercer  
This is a classic case of a game's scope expanding beyond what the original code is capable of. To cut a long story short, I'm re-writing the AI, yep the soldier AI. Sounds like a right blow and it feels like one too but I came to the annoying conclusion that it was the only feasable way to proceed.

I'll explain my reasoning. The soldier AI has never been rewritten completely; ever since the very first (and very crappy) version of the game I demoed on TDC the fundamental code of the soldier AI has been the same. Since then more and more features have been bolted on and the code slowly became horribly inefficient and horrible to maintain. When I started re-writing the monster AI, I realised the monsters could do most of the stuff the soldiers can, and in better and more reliable ways- and the code is so much more compact and well organised. It was at this point the idea of rewriting crossed my mind. I was having a fight with some soldiers just to try and make up my mind and the fact that more than about 3 soldiers fighting caused slowdown swayed me... in my mind that is just not acceptable because in itself it limits the scope of the game.

Right, thats the bad news done with. The good news is that I am well into the writing of the new AI codebase. I have all of their behaviours specified- in many cases its just writing what I wrote before in a more organised fashion. There is one key difference however, and that is pathfinding. In the old AI code, soldiers gave the illusion of spatial awareness by moving to and from pre defined cover points- which in most cases worked quite well, but in cramped indoor spaces they often had trouble pursuing the player. With the new pathfinding system the AI find their way around any environment with no trouble at all- they seem so much smarter already. The pathfinding system which is based around Alien's advanced path movement object (not APFO which requires the NET update) also supports moving to cover and a range of other manouvers inherantly. The AI can now not only follow patrol paths in their unaware state, but also move around the map to objectives. For example a squad can move across the map to a certain location and set up patrols there. When they are traversing the map they don't just walk there, they properly move from to cover to cover, watching each other's backs as they go.

I'll also feel a lot better when I release the open source because I was ashamed of the old soldier AI code! People always said it was impressive and I always thought "if only they knew how bad it looked under the hood..."

Posted by Chloe Sagal 3rd April, 2009

can i have your brain?
 
Posted by BeamSplashX 3rd April, 2009

Seconded.
 
Posted by W3R3W00F 3rd April, 2009

Third-ed...

Sounds painful, man- I imagine it is...
 
Posted by Neuro 6th April, 2009

If I could wrap my head around pathfinding I'd be set for any game idea that popped in my head.

After all this time I'm still eagerly anticipating this game!
 
Posted by ben mercer 21st April, 2009

Hehe well I am kind of cheating in that the pathfinding algorithm is built in to the APM object, I did write an A* algorithm for MMF2 myself, but it was REALLY slow.

Still since it is a hybrid between path following and free movement, theres still a heavy amount of jiggery pokery involved to get the AI to behave itself.
 


 



Project Forums


Favourite

Advertisement

Worth A Click