irrAI 0.50 - AI module for Irrlicht [Updated 28/11/09]

Announce new projects or updates of Irrlicht Engine related tools, games, and applications.
Also check the Wiki
Post Reply
MasterGod
Posts: 2061
Joined: Fri May 25, 2007 8:06 pm
Location: Israel
Contact:

Post by MasterGod »

JP, Can you make a VC project please, I don't use Dev-Cpp..
Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
Ico
Posts: 289
Joined: Tue Aug 22, 2006 11:35 pm

Post by Ico »

Just create a new static lib project and add everything under "SRC" (excluding "main.cpp"). Setup the include folder and compile.

For future projects just use the includes and link the lib file (like you do using irrlicht).

Hope I haven't forgotten anything. :)
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

@Ico: Good suggestions there! It would certainly be easier to make teams and then assign whether that team is friendly to another team or not.

@MasterGod: As Ico says try and make the project yourself, shouldn't be too hard, if i get some time i'll try and include a VC version in the future but it will add extra work for more throughout the whole project!
Image Image Image
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

JP wrote: I guess i'll have to get some ftp software installed then.. Any suggestions?
Maybe a bit late, but you can download FireFTP, an FTP client built into FireFox from the Mozilla AddOns page. Its fairly convenient to use since you don't have to open up a seperate app.

Cheers
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Post by Halifax »

MasterGod wrote:JP, Can you make a VC project please, I don't use Dev-Cpp..
Dev-Cpp ftw! It can import VC projects. :lol:
TheQuestion = 2B || !2B
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Wow, didn't know that! :lol:

I will do a VC project as well in the future as it's one of the popular IDEs and it will copy irrlicht in that way as the examples are provided as VC and DevCPP projects.

Cheers for all the FTP suggestions, i'll have to try out that firefox one, sounds handy!
Image Image Image
Ico
Posts: 289
Joined: Tue Aug 22, 2006 11:35 pm

Post by Ico »

Think I've found a bug - I know I made some mistake somewhere too but it shouldn't happen anyway:

I created a waypoint as root, added 2 children waypoints and set their IDs to 0 and 1.
Then I added a NPC starting at node 0 - while creating the NPC the program crashes.

The AI manager was able to read both waypoints out of the scene and each one has the other node as it's neighbour set. Now I get "NPC (0) Path from 0 to 0" which causes a crash inside NPC::getPath() within last iteration as it calls iter-- on the first (and only) waypoint inside the vector (_SCL_SECURE_VALIDATE_RANGE fails).

pseudo code:

Code: Select all

createaimanager();

wpr = addscenenode();
wpr->setname("WaypointRoot");

wp1 = addscenenode(wpr)
wp2 = addscenenode(wpr)

wp1->addneighbour(wp2)
wp2->addneighbour(wp1)

createwaypoints();
addnpc();
dejai
Posts: 522
Joined: Sat Apr 21, 2007 9:00 am

Post by dejai »

Hello Jp,
I was watching some videos on AI in large scale project games and I noticed that you were seeming to have problems with 40+ NPCs within your game. I have a simple solution for this problem, Its up to you completely if you want to implement it or not but, the amount of processing power in which the NPC uses should be directly influenced by the distance in which the player is from that entity.

Within large scale games such as Halo, they use this AI illusion if you will to create the feel that all the Npcs are running at full speed. Yet what is infact happening is the npcs in the background are getting less of the processor, exactly like rendering. So in the distance all the enemies are doing is shooting and moving from side to side, yet the enemies in the foreground are at 100% capacity.

Yet, the illusion can be further portrait by having the distance dynamic or relative to the position of all the opposing entities in relation to the player. By this I mean, if all the npcs are 300 meters away, the one closest to the player still takes up the larger processor, so that the Ai distances are not static but proportional to where the enemy is in relation to other enemies and the player.

Yet keeping in mind if a npc is 300 meters away, its probably still going to have a reduced processing need, so possibly a variety of functions to determine the level or preference of processor in which a enemy should take up. For example a boss should always have preference over its minions when it comes to processing power no matter this distance, within reason of course.

I am obviously not asking you to do this, it would be quite / very hard to implement, but I hope that this may have provided something interesting to read and to think about in upcoming releases. Keep up the great work JP.
Programming Blog: http://www.uberwolf.com
Ico
Posts: 289
Joined: Tue Aug 22, 2006 11:35 pm

Post by Ico »

It fully depends on the type of your game etc. ;)

In a FPS distance based calculations might be useful but in a RTS/simulation you can't do that.

Just to name an example having a more or less bad implementation:
X³ uses accurate AI/simulation only in the area the player is in. Other areas are less accurate as you can't see them. That works very well until you use computer controlled ships to aid you. If you're in the same area as your AI ship it might happen that it crashes into other objects like ships, asteroids, etc. If you aren't there, such things will never happen which is something you can't notice without looking close but it's also more or less annoying as there are also other factors - not just collisions but fighting/attack/defense/etc. too.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Ico: Is your root waypoint an actual waypoint? It should be an empty scene node as the root, that could cause problems, maybe. What i'll do, probably before the next release, is improve the waypoint loading because at the moment it requires you to have a specific root waypoint etc, just to make it easy for my code to find them all, but this isn't really necessary and was just me being lazy to get it working initially. So possibly the new version will solve the problem, if you can send me the test scene you made then i can look into it further.

Dejai: Thanks for the suggestion, i think some way of scaling how long an AI Entity is allowed to use the processor would definetly be something useful to include and could improve performance if you've got lots of NPCs spread out so i'll keep this idea in mind. But as Ico says, maybe it's not always a good thing but it could be turned on or off by the user of the library depending on whether it suits their game or not.
Image Image Image
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Post by Halifax »

JP:

Also, another suggestion, would be FSMs. I would be more than happy to implement this for you, as I know you don't have time, but I will at least try to write up some documentation on how I would implement it to make it easier for anyone to implement.
TheQuestion = 2B || !2B
aussiedude
Posts: 20
Joined: Mon Feb 26, 2007 8:45 am
Contact:

Post by aussiedude »

@JP: G'day JP, I just gots a PM from christianclavet suggesting basically that maybe I should join this project. I just posted an AI pathfinding library here called miNav. It wasn't designed to be an ongoing project but I left it open to be updated if people requested.

Technical Specs: My library is a Generic AI pathfinding library that uses preprocessed solutions generated with the Dijkstra algorithm. It's a Map and Node based system that allows the user to create maps, add nodes, connect nodes and then calculate all pathfinding solutions for future use.

If you think that any of my code can be of use to you or if you want any help coding stuff just let me know. My coding skills are 'ok', not great. But if you need some coding done and I think I can handle it, then I'll do it... well I'll do my best. :lol:
I'm Australian... so be nice to me!
Image miNav Pathfinding Library :D
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Thanks for the offer aussiedude, i'm sure your help and code will be useful!

Halifax: The AI in my FPS game i did was FSM and that was the plan for this as well, it's basically what's going on at the moment... to a limited extent :lol:
Image Image Image
MasterGod
Posts: 2061
Joined: Fri May 25, 2007 8:06 pm
Location: Israel
Contact:

Post by MasterGod »

JP, Can you please summarize which features are working and which are WIP?
Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Pathfinding works, field of vision works but doesn't check for obstacles such as walls so the agents can see through objects but will only see things that are actually in the field of vision.

That's about it for now i think.

Progress on this will be very slow and it's not really a ready to use library at the moment i wouldn't say.
Image Image Image
Post Reply