Monday, December 3, 2007

Scissor AI

Before I talk about AI and my current progress, I'll say that I made myself a nice little function to warp my character around the map by right clicking on it. Nothing big, but it sure is helpful.







Alright, so the main antagonist to the boxman character is a race of scissor people. Fitting, right? Now, they don't need to be all that intelligent, basically just chase the player out of their area and chop him up. Ancillary behaviour is to just roam around (with some range of speed to establish different amounts of "determination") and probably have them sometimes fight amongst themselves, as they are vicious scissors. I would also like them to have a very simple learning scheme where they are capable of mapping limited states to good or bad outcomes (mostly just to learn that walking into water is bad, and possibly that a player carrying a rock is bad). I figure I can establish this by having limited state knowledge (where am I? is the player nearby? does the player have a weapon?), then by examining immediate outcomes, downplay states with negative outcome for a short time.

As it stands now, I've got some simple reflex agents that will watch for the player and charge them when they show up in the line of sight. The problem is that I'm using built in functions that set the aim object, which just happens to cause the AI to literally stare at the player no matter where they are. This is not the behaviour I want, they cannot be aware of the player at all times, they must happen to see the player then charge. To do this, I will have to build my own sight sensor function.







This morning, I was toying around with placement of the scissor race. I placed a marker out in the field and randomly placed n(100 now) scissor people around this marker. I soon found that when I let them all come at me, an interesting cluster pattern appears due to the collision amongst them. While this looks pretty cool, the collision also causes the player to become stuck. Immediately I thought I could overcome this by removing the collision between player objects. Of course, this caused the AI to combine on the field. It also did something crazy to the dynamic shadows produced for the AI shapes. You can see in the image that there is a yellow glow on the shadow. This is certainly not a desired effect, so I believe I will have to do something else to fix the sticking of the player. I'm thinking to just have the scissor people bounce off of the player, or the player from the AI or both.

No comments: