Thứ Ba, 27 tháng 8, 2013

Tuesday Tribulations

Every Flavor Bean

A common problem when writing AI is the increasing sophistication of the logic as you compound conditions on top of each other. Should a character duck before reloading, when should they run for cover and reload, do they have the time to reload while stood up without being shot, what if the player springs on them mid-reload?  As you can imagine there are multiple permutations for every single animation event the character can perform.

As such, my progress goes much slower than I would have liked, probably because I like to tinker and get things 'just so'. I am realizing all too clearly that such an attitude will keep me in AI land for months if I let it.

Story So Far

The current AI prototype is looking good now, with the character patrolling and running, ducking, running while ducking, strafing when stood, tracking down the player, finding cover before reloading and most recently, climbing the staircase up and down using proper animation which finds the steps perfectly. The animation needs improving but the mechanism has been added to the state engine to get the character to the foot of the stairs, play the animation, adjust the world position of the character and resume any previous state the character was in.

This same mechanism I can use for the ladders and intend to do so and remove the last of the hack code present in the prototype.  I also plan to accelerate adding features for the character, and fiddle less so I can get some serious progress made.

Right now the character can put up a decent fight, hiding behind cover, retreating the reload, and finding new paths to the player (thanks to a strange Search Area bug) which means combined with the character running event, your foe can run at you from seemingly random directions and spraying you with bullets.

I am not 100% happy with the character so far, not least because you can still catch him doing silly things like reloading but I can still see a bit of him round the corner, or standing point blank in front of me shooting with very little strafe. I am considering adding a melee attack at this close range as it might solve the problem and improve the dynamic all in one go.  Fighting at more distant ranges with cover objects works very nicely.

Signing Off

I am not too miffed about today's progress despite wanting to have done more. It's still over 10 hours graft and it moved the prototype forward in valuable ways.  I do feel I need to press down harder on the gas now, as we still need to see character physics adding, player weapon functionality, health logic, grenades, doors, e.t.c. All this will be needed for an 'ace' demo!

Không có nhận xét nào:

Đăng nhận xét