My Dissertation Project [Intelligent Agents]

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
Post Reply
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

My Dissertation Project [Intelligent Agents]

Post by JP »

Last friday i had my presentation of my final year project (dissertation effectively) to the people who would be marking it. It went pretty well i think, can't complain, they said it looked good and i just need to do a good writeup now.

They suggested that i could show it to a group of people and see what they had to say about it, so i was wondering if anyone had some time then they could possibly try and look at it.

Firstly i should say that it is coded in Jirr, a java-binding for Irrlicht, so you need java installed on your PC, but i would think that most people will probably have that from internet based games etc. If it doesn't work for whatever reason then just post and i can see if i can find out what the problem is!

Secondly i should actually give a little info on what it is! It's basically a "game" which is based on a first person shooter. But there is no user interaction as such. The focus is completely on the intelligence of the bots which i created so that was what i had to concentrate on so it's not really a game and is lacking graphically. Over the summer i intend to improve it somewhat to make it a more impressive piece of work!

Unfortunately it's a bit crap on some systems and the only 2 systems (of 5 tried) it's worked on are a friend's and my PCs. On my dad's PC and the uni lab pcs it only runs at about 1fps, when i can get between 80 and 200 fps on my pc. And on my girlfriend's laptop it took about 30 seconds to a minute to "warm up" to around 20-30 fps but had some weird behaviour and didn't display things properly. (incidentally if anyone can suggest why this might be then that would be great. The uni lab computers are basically more powerful than my own PC, faster processor and identical graphics card, but they are used for running a load of research stuff in the background which could have caused it).

So i've uploaded it to the iinternet and hope some of you can even just download it and see if it actually runs on your PC so that i can state some sort of percentage of PCs that it'll work on. Also if you can check that it displays everything properly. And if you feel very helpful or intruiged by it and it runs ok then you could watch what the agents actually do and comment on how good you think the "AI" is and such.

Here's the link for those interested (Megaupload - 6.75mb)
User Guide .doc (Megaupload - 0.5mb)

Here's how to actually run it:
Download the .zip file and then extract it and the folder structure should be FYP\..., not FYP\FYP... or anything else

What you then have to do is place it at the root of a drive, so in your C drive for example like so: C:\FYP. Then inside the FYP folder there are two .bat files which can be used to run the program and demos. You'll have to edit those so that they work based on which drive you put the folder in. At the moment they're set to run from an F drive, but you may not have one, so open the .bat files in notepad and change the part which says "F:\FYP\Classes\;" to "C:\FYP\Classes\;" (where C is the drive you put it in, duh!) do that to both .bat files and it should work.
The "Run Program" .bat file runs the program and gives you some options to choose from such as how many agents and what game style etc. (domination means that when one agent collects 100% of the resources the game ends, endurance means that the game never ends). The "Run Demo" .bat file gives the choice of a few selective situations which show certain features of the AI.

Reading the user guide is useful to find out what buttons are useful and such!

Here's some pictures which shows what it's meant to look like and all the parts of the interface that should be there (on some systems the clock and fps counter don't show for some bizarre reason).

Image
Ooo split screen...

Image
Yes i know it looks rather bland but i didn't have time to make it look graphically good as the focus was on the AI

Image
Optimus Prime gets pwnd by Johnny 5


I'm afraid that as of the moment (and until summer, if ever) there is no user interaction as such. All you can really do is change the camera views, but there are 4 stunning cameras to choose from!! A satellite cam from above, showing the whole environment, or an fps cam which you can fly around to choose where you want to see the action from, or a 3rd person view from behind the agent of your choosing, or a split screen view of all the agent's 3rd person cams.

So basically there you go, that's what i've slogged over since the start of last summer :lol: It's not as impressive as i'd have liked, didn't get to implement a lot of stuff and when an agent wants to flee from an enemy it does it in a really bad way cos i couldn't get a clever way working the night before the demo and my brain was frazzled!

You can see from the pictures what it should look like so anyone who can give it a little look is awesome!

I hope everything's explained ok and that some of you will check it out! Thanks in advance for anyone who's even looked!
Last edited by JP on Tue Mar 28, 2006 9:54 am, edited 1 time in total.
Image Image Image
Nick_Japan
Posts: 98
Joined: Mon Dec 13, 2004 11:47 am
Location: Japan

Post by Nick_Japan »

Interesting stuff - Just watched the fleeing : mid attack demo, which was very impressive! I need to fiddle about more to get a feel of what they're doing, but it would be interesting to know the kind of decisions they're making. For example, I can't see a huge difference between 'Exploring' and 'Hunting' - although I'm sure there is one, could you elaborate on their behaviour? Is it purely line-of-sight or do they remember things like where they last saw their opponent or which direction they ran in?

Boring but important - it runs fine on my machine, which is a laptop: PentiumM 1.6 1GB RAM ATI Mobility Radeon 9700 WinXP Pro, and I'm getting around 25 fps. I haven't noticed any possible bugs yet except that on the Seeking : successful seeking demo, Optimus Prime shoots once at Johnny5, J5 shoots back a load of bullets really quickly, destroys OP, and then wanders down a bit and starts constantly spinning around in a circle. His current action label flicks between 'scanning ammo' and 'scanning health', and although there is plenty of both on the map he doesn't go towards anything. When OP respawns there is no change.

BTW, you but Bristol/Birmingham on your location thing - you're not at Bristol Uni are you?
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Hi! Many thanks for checking it out and everything sounds like it's running quite well, except you're getting a rather low fps it seems, i normally get 80-100fps on the demos (as they're small mazes) and then lower to around 40 i think on the main program (as it's a larger maze mainy i think).

I live in Bristol "by default" with my parents and go to Uni in Birmingham, and will be graduating (fingers crossed ;) ) this summer!

I'll post up some descriptions of what the demos are actually showing as some of them might not be so clear to see what the interesting stuff is :lol:

Exploring basically makes the agents move forward until they come to a wall or a cell they've visited before and then they'll either turn to an available, unvisited direction and continue again or plot a path to the next nearest unvisited cell. Hunting on the other hand is rather boring and unintelligent, i didn't really get round to trying anything clever there, they just basically pick a random place in the environment and plot a path there, when they get there they do the same again. So all it really does is keeps them moving and looking for enemy agents, there are a few ways that i thought that could be done better like patrolling or guarding a certain area, but as i said didn't have the time to look into it really, over the summer maybe i will!

The agents have a field of vision which you can see represented by a, very faint, triangle in front of them, the two furthest points are shown up better by a projectile billboard (bad choice probably cos it can sometimes look like a projectile flying around! :lol: ). The agents can only see an object (powerup or enemy agent) if that object lies inside that triangle and is not obscured by a wall. If an agent is attacking another agent and that target somehow leaves the attacking agent's field of vision then they will turn in the direction suggested by the target's last position and direction to try and find them again and if they still can't see them then they'll plot a path to their last location to try and catch up with them.

On that seeking demo the Optimus Prime bot is basically a "dummy bot" who's only reason for being there is to shoot once at Johnny 5 so that J5 starts searching for his attacker, so that's ok there as it's just for demonstration of the seeking feature.

The continuous spinning on the spot means that J5 is on top of an unspawned powerup which he wants, that's what his experience level does if there is an unspawned powerup. I'm not sure if i mentioned the experience levels before but there are 3, as stated by the number in the lower left of their picture in the GUI. And it just means that at a higher experience they are "more intelligent" and "more likely" to beat an agent of lower experience. I believe that is the case but i've got to do some testing so i can actually state it in my report! As you said J5 just waits there for health and ammo whereas there is plenty elsewhere in the map but unless he's already seen a powerup he doesn't know where any is, so i guess he hadn't seen the other powerups. The only information that the agents start with is a full map of the maze (something which is halfway removed in the FOV & exploration demo where the agent actually creates a map of his own of the maze, the ouput can be seen in Images\agentMap.jpg or something like that). I'm not sure why the current state label would flicker between health and ammo, i've never seen that before i don't think, i'll have a look into it!

Thanks very much again!
Image Image Image
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Here's some explanation to what the demos show:

1 - Tracking:
Johnny5 sees Optimus Prime but OP doesn't see J5. J5 shoots at OP and as OP moves out of J5's FOV J5 turns in the direction OP went to continue shooting at OP. If OP goes behind a wall J5 can't see him any longer by turning and so J5 goes to OP's last known location before disappearing. The 3 secondary options just show the shooting styles of the 3 experience levels of the agents.


2 - Fleeing:
Both agents start facing each other and so can see each other so both must decide whether to attack or flee.

Part 1: J5 has much less health than OP so J5 wants to flee, while OP wants to attack

Part 2: J5 has slightly less health than OP so they both want to fight, but after a shot or two J5 is at a disadvantage and so wants to flee while OP still wants to fight (probably)

Part 3: J5 is experience 0 and so will never consider fleeing unless runs out of ammo, so wants to fight, as does OP as he is much stronger.


3 - Seeking:
OP spawns with J5 at the limit of OP's FOV and J5 facing the other way. OP is a "dummy" agent who will do nothing but shoot once at a target in his FOV. So OP shoots J5.

Part 1: J5 is the same experience as OP and hence has the same FOV so when he's turned round 180 degrees he can see OP and so starts attacking him.

Part 2: J5 is a lesser experience than OP and so turns round 360 degrees without seeing OP due to J5 having a smaller FOV. As J5 does not find his attacker he then flees.

Part 3: J5 has poor health when he is hit and so flees as he's not strong enough to seek an unknown strength attacker.


4 - Experience Levels:
Pit 2 agents of different or same experience against each other and see who wins, should be the higher experience who performs better.


5 - Search Algorithms:
J5 is told of the location of some resources in the environment and must plot a path to get them.

Part 1: Exp0, cannot find a path due to the limitations of GBFS

Part 2: Exp0, can find a path due to the placing of the resources

Part 3: Exp1, can find a path but it's a "round about" path

Part 4: Exp2, can find a path and is the shortest one possible


6 - Unspawned Powerups:
J5 starts off requiring health and knows atleast one location to get some (straight in front of it). Another location it may know is the one just round the corner.

Part 1: Goes to the first powerup, picks it up and still needs health so stays there waiting for it to respawn.

Part 2: Goes to the first powerup, picks it up and still needs health so finds the next nearest known location (round the corner). After picking that one up it still needs more health so goes back to the first location which still hasn't respawned so goes back to the second locations etc.

Part 3: Goes to the first powerup, picks it up and still needs health. As it has just picked up the current one then it knows that it will be a 60 second wait and so goes to the next nearest one (round the corner), still needs health after that so goes back to the first one and waits there, scanning the area.

Part 4: Goes to the first powerup, picks it up and still needs health. This time it doesn't know about the second powerup round the corner so this is the only one to its knowledge so it waits for it to respawn whilst scanning the area.


7 - Exploration & FOV (& mapping):
J5 in an environment which it explores and maps the environment at the same time, effectively when it sees a wall it puts the location of that wall onto a map. The output of the map can then be seen in Images\agentMap.jpg, compare it to Images\radar.jpg to see how much of the environment was mapped and whether it's accurate.

Part 1: Using the FOV to "visit" cells so that not every single cell must be physically visited in order to explore the whole maze.

Part 2: Not using the FOV to "visit" cells, so must physically visit every single cell.


8 - Full Demo:
Problem of fleeing.
J5 begins facing OP who is facing the opposite direction. J5 is weaker than OP and so flees away from OP who does not see J5 so just explores in the direction it was facing. J5 then sees Blade who flees from J5 as it is weaker than J5, but J5, being stronger wants to fight Blade. Then Hueteotl appears on the scene who is
stronger than J5 and so J5 flees from Huet ignoring the weaker Blade now as Huet is a threat (this last bit doesn't always happen though
:oops: )
Image Image Image
hybrid

Post by hybrid »

What technqiue are you using to describe the AI? Hardwired logic, neuronal nets, ...? Are the agents able to learn, or is the AI fixed for each scenario?
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

It's hard coded basically as a finite state machine, similar to Unreal Tournament javabots. My intial idea was to use a hierarchical task network but i ended up doing the FSM instead. Effectively a control unit of nested if statements which decide on what the agent needs to do like attack a target or collect health etc.

They don't learn really, it's fixed apart from the fact that they "get better with experience" so the longer they've been in the environment and the more agents they've killed the better they get, that's limited to only 3 experience levels though.
Image Image Image
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Just thought i'd say that at the moment i'm implementing a human player option into my project now.

On wednesday i submitted my dissertation so everything i do from now on is just to improve the quality for my own needs and as it's not part of the project now i actually want to make the game playable and improve the graphics and such.

I won't be doing very much now i just drove home from uni today and i never work on travelling days and so i fancied fiddling to make some minor improvements. So after tonight i probably won't do a huge amount more until after my exams are finished in june/july.

Will post any interesting updates that i get done!
Image Image Image
Post Reply