Internal Demo That Is
I have been looking forward to creating the visual demo to show off the AI so far, and so today has been fun. Had to jump back to the core module about ten times to refine and clean more of the code and resource usages, but eventually the visits became less frequent and I could start playing inside the demo.
By demo, I mean a prototype with terrain, physics, player gun sticking out, assets scattered here and there, and the hero of the hour, our AI character. As I write this he is running about, doing his patrol, reloading his gun and using the newly associated physics capsule to control his progress through the scene. Any hills he runs over them, obstructions he stops and of course the player cannot run through him and he cannot run through the player. It's all very civilized. That is not to say he is finished, and not by a LONG chalk! He acts rather scatty when standing still, he does not melee, he does not seem to see me half the time, his general movement behavior is erratic and generally he does not behave like he does in my AI prototype. Friday will be about calming him down and getting him looking as good in the demo as he does in the AI proto room.
The physics integration with the character went very smoothly, thanks to a bit of thinking before I started coding. I was going to attach the physics to the visual object and leave the AI entity object to act as the 'advance scout' to reflect the characters mind. After reflection, I realized I want his projected future position to have the physics awareness so he does not project his final destination through recent rubble and other dynamic obstacles. To do this, I simply decoupled the object from DarkAI, and then used a velocity force on the newly created physics object using the AI entity coordinates. I grabbed a screenshot showing this trinity of 'entity position, physics object position and visual object position' but my PC ate it so I am guessing fate wants you to wait for an even better shot.
I also spotted that my physics prototype and therefore most of the module was using hard coded resource values. I will need to deal with this as such code will totally trip up the final integration step.
The Next Bit
My main goal, aside from the bits and bobs above, is to add health, shooting and impact deaths to the demo prototype on Friday. This way I can shoot the character, he can shoot me and we can have a good combat simulation. Before I moved over to demo work, and part of the clean-up of the code, I added two more characters to the AI proto and it was great to see them in action. Even though I had not coded it, the AI entities would flank me, some would fire, some run up to me and kick me, others retreating to reload and as few as three characters kept my player pretty busy almost all of the time. I have a good feeling that players of Reloaded games will get some decent high octane game-play.
My artist has been plagued with power cuts and it's possible I won't get my combat building before the demo day which is Monday. The good news for all concerned is that with some liberally scattered sand bags, more characters roaming the hills and a functioning player weapon, I should be able to demonstrate a variety of AI behavior in the actual terrain setting which was my goal three weeks ago.
Three weeks seem to have come and gone! The more I build feature upon feature, and start to see the combined results, the more I am convinced I have no earthly business writing such an ambitious piece of software. This is no longer an augmentation of an existing product, it's a bottom-up rewrite of almost every component and considering the last one took almost 2 years I am amazed I have gotten this far. Fear not readers, I am not feeling the strain or loosing faith, I am simply gobsmacked that me and a few guys have cobbled this together in a relatively short time and it's starting to look seriously good. More than that, the potential of this product is insane, and I would not be surprised that Lee splits in two at some future point just to keep up with the ideas that need coding.
I will see if I can prepare a nice screen shot or video for you Friday (probably posted Saturday early hours) as we're in demo country now and the visuals are much much nicer!