Wednesday, 14 August 2013

Wednesday More AI Cleverness

The Growth of AI

Amazing to watch a brand new AI behavior grow and unfold, it really is. Like watching a baby grow up super super fast, with the bonus of being able to program out all the annoying crying :)  I think I prefer computer babies!

The AI Story So Far

The AI prototype now as a few more cool features like the ability to open and close off doors and windows in real-time, forcing the AI path finders to choose another route. Very important!

Aside from the many small features, the one that has kept me up to almost 3AM (against my decision to stop at 12 midnight) was the container path system. It turns out DarkAI has a rudimentary container connection system but it requires a few more bells and whistles before it can compete with what I have been building in DBP code.

Right now, my AI entity can start on the terrain circling a building on patrol, spot me, then chase me into a room and up some stairs, I can dive through the window but he does not have 'leap' yet so I lose him, but he can still see me through the window. The AI entity realizing he cannot reach me that way, recalculates and figures out a slightly longer route to the ledge I am now standing on. It appears a second ladder drops from the roof of the building to this ledge, and there is a ground floor ladder which reaches the roof. Off the AI entity trots, back down the stairs, and by now it's been a long while since he saw me escape, which means I could be somewhere other than the ledge, so to keep me on my toes he reverts to a Patrol mode, walks out the door and continues his route. One point in his patrol route allows him to spot me still standing on the ledge platform.

Now here comes the smart bit. The AI entity was instructed to 'remember' that the stairs inside the building to the window and the ledge did not work out too well 'a failure' in fact. He then thinks about another route that does not include the staircase that lead to failure (at the moment this is all he is programmed to remember). He then plots the alternative route, up the long ladder across the roof and down the shorter ladder to the ledge, which he does right away. On descending the second ladder, I am once again in his line of sight and he registers to fire.

All the above currently works in the AI system and with the addition of more containers, more paths, more obstacles and more enemies and allies, the complexity only increases to present a very dynamic combat area to navigate. Naturally there will be tweaks on the way, but the bulk of the 'path finding' is in place and I am happy with the behavior exhibited.

Character Animation

At present, all the above AI described is using debug models and artwork, ideal for testing behaviors and values, e.t.c.  I do feel though that leaving the character model out for too long will create problems come the 'union' of AI entities which move in a cludgy manner and the high quality character art that needs to walk, run, dodge and climb in a smooth liquid performance.

These two elements can remain separate but there are key hooks in both that need to be coded carefully. I am tempted to start this work before the week is out, probably while I am waiting for AI inspiration.  This is when the general public will see the AI prototype and in one voice go 'Oooooo'.

Signing Off

I am keeping today's blog short as it's 3AM and I was supposed to be resetting my body clock for the weekend - Grr.  Still, I quite enjoyed the AI tinkering and look forward to the next steps on Thursday.  The census is that my art skills are painful at best, so I am inviting a regular reader with a panache for art to produce for me a banner which I can slap on pre-release screenshots that read the slogan "Disclaimer: Visuals/gameplay/sounds are not representative of final product".  With this, I can start posting visuals again ;)

4 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Hello Lee,

    very good work on FPSCR! :) I really look forward to the alphas.

    I have put together a quick disclaimer graphic that you can just throw on media that goes up to 1200 pixels height and 3000 pixels width, so you should have every screenshot covered. That "line" is extendable, as it is only a black layer with 50% opacity.

    Use it however you want.

    http://i.imagebanana.com/img/2olkbdk3/tgcdisclaimer.png

    Greetings,
    Jan

    PS: Forgot my greetings, which are very important for me. :P

    ReplyDelete
  3. Curious. If you give all or a group of enemies the same ai script will they all be a clone and animate at the exact same time.the same animations and decision. As that happens in x10 and 9.

    ReplyDelete
  4. Greetings Lee and compliments for the great Ai work, i think AI is a crucial part of FPSC:R project, that thing "the last was a wrong decision" for path is a great solution, will the AI system share the information to other enemy? or the decision is connected to only one enemy? i mean an enemy try a path and he find that is a failure, then find a new succesful path and remember it, other enemies will try the successful path first?
    another important thing, will be possible to prevent that an enemy (or group) open one or more doors? if enemies are programmed to open doors then could we have some sort of keypad protected doors? so only the player that know the right code could open it.. maybe could have a slider for the door behaviour "all can open", "only player can open", "player must open first, then all can open" in addition to the "button operated", "need key (or object) to open" etc..
    thank you!
    Have a great 15th of August

    ReplyDelete