Game Development Community

General advice - Which is the best pack

by David McDonald · in General Add-On Discussion · 10/15/2009 (1:10 am) · 8 replies

Hi folks,
As many of you have been around longer than myself I'm seeking advice on the best packs to meet my needs.
Specifically the AI side of things. I understand there's nothing that will do everything but any advice on the best kit(s) to get and where I would need to focus my won code or if I could modify the exiting kit code would be appreciated. Starting points are good I suppose ;-)

1. Roaming NPCs - i.e. given a radius they would roam about, avoiding statics
1a. Would be nice if there could be some interaction (talking?)

2. Given a point in the world path their way there. It doesn't have to be the most efficient path but would be some distance away

3. Usual waypoint marker pathing

4. Multiple "Factions" or teams with varied responses ranging from friendly to aggressive. Something where I can script the response based on a reputation or attitude parameter

5. Merchant NPCs

Thanks folks. I am sure there's a bevvy of advice on approaches ;-)

#1
10/15/2009 (12:57 pm)
There really isn't a pack or resource at the moment that covers all of these elements so you're going to have to combine several to get this functionality.

1. For Path-finding you'll want to look at the ImmersiveAI or Dan Kellers Resource

They are by far the best options on the site for pathfinding at the moment, the Immersive system is weaker on the pathing (it autogenerates the waypoint grid for terrains but currently no option to generate for interiors).

With Dan Kellers resource you place objects in mission editor and it generates meshes within them - this takes more work than with Immersive but works on terrain and interiors plus with Dans resource he has a built in Wander() function - here's the movement code you can use with his resource

Quote:
- findPathTo This takes either a point or an object as an argument, and simply finds a way to the point.
- findCoverFrom This also takes a point or object, and finds a place hidden from it.
- searchCover This takes no arguments, and makes the bot go to the nearest place it can't see.
- sneakUpOn This takes either a point and a vector or an object as an argument. It finds a path to the point or the object that can't be seen by it.
- wander This takes a distance as an argument and wanders around for this distance.

2. Covered by the first point.

3. Again covered by point 1, they can both work with markers you just replace the setMoveDestination() call with whatever the function implemented is i.e. findPathTo() with Dans resource

4. The Universal AI Starter Kit might be an option you can develop from it has teams implemented but I don't believe you can vary Aggression levels or things like that, also not all that's mentioned on the tin is as it seems i.e.

Quote:Advanced movement and navigation that requires no nodes or mesh. Bots can follow their selected target or use basic pathing.

The movement isn't advanced AI it's a basic movement using Line of Sight tests for obstacle avoidance it won't cover you pathing mentioned in your second requirement.

The Immersive AI system implements some AI characteristics i.e. Happiness, Money, Fatigue and shows how they can be used to vary what the A.I. character does if an A.I> char needs food if he's rich he'll buy it, if he's happy he's less likely to steal food than if he's sad.

Also it implements different types of AI i.e. Entertainer, Bandit, Soldier so that some types are more likely to steal than others.

BUT the immersive AI resource doesn't implement Teams - so you could either combine with the Universal AI or there is a teams resource on the site you could include for free.

5. Not aware of any resource that covers NPC, you may want to look at the Yack Pack for NPC dialogue, an inventory system resource for storing stock and then probably the ImmersiveAI system is your best bet for coding the reasoning (i.e. pricing of objects weighted dependant on NPC's happiness and whether you're on the same side, etc).

In terms of installation - Universal AI Starter Kit is the easiest by far (all script based), Dan Kellers resource is easy too and the Immersive AI will take a little work going through the thread and implementing fixes.

Hope that helps.

There are other kits being worked on for A.I. - I know at least 3 others that are being worked on but they aren't available right now and I'm not sure when they'll be released.
#2
10/15/2009 (3:05 pm)
@ David McDonald

I'm just going to let you know what the The Universal AI Starter Kit can do.

1. Depending on exactly what you mean by "avoiding statics", The Universal AI Starter Kit does allow for NPCs to roam in a given area.

1a. The Universal AI Starter Kit has a basic conversation system which can be built upon.

2. The stock version of my kit likely won't fill your need here, but it is relatively easy to integrate Dan Keller's A* system with The Universal AI Starter Kit.

3. The Universal AI Starter Kit can use waypoint marker paths.

4. With The Universal AI Starter Kit you can have an unlimited number of different teams, but opposing teams are always considered to be hostile.

5. While the stock version of my kit doesn't a merchant system, one could be added with relative ease; using the dialogue system as a base.

#3
10/15/2009 (6:04 pm)
Thanks guys,
I was actually following the thread around Universal AI and A* inclusion which seemed like Deepscratch and the others have nutted that out.

Thanks for the responses, I appreciate the advice.

All good resources and as I fully expected there'll be a fair bit of building upon the base to get the final result I am after.

Looks like the resources+UAI+Yack Pack for a start ;-)
#4
10/16/2009 (4:54 am)
@David - I'd forgotten that the Universal AI kit had the dialogue stuff in it, you may want to check that out before buying the Yack Pack as it may cover your needs anyway.

But other than that it's a good choice of combinations
#5
10/22/2009 (12:45 am)
As a follow up (and again thanks for the advice guys), I'm nearing the point I want to start looking at the AI so could use some further detail on the UAI Twisted if you don't mind (or anyone else who has played with the kit)

Quote:1. Depending on exactly what you mean by "avoiding statics", The Universal AI Starter Kit does allow for NPCs to roam in a given area.

Two types. what I term World Statics such as non-destructible buildings and props like fences, and dynamic statics such as crates which a player may drop in the street or a vehicle that is left in different locations.

Quote:4. With The Universal AI Starter Kit you can have an unlimited number of different teams, but opposing teams are always considered to be hostile.

Understanding there would be some work for my team here to adapt the system, but is it feasible to build upon the 'always hostile' setting by changing the team settings dynamically or even altering the system to have levels of hostility?
Alternatively, how is the information stored? If the number of teams is unlimited what would be the drawbacks of making each player a single member team with hostile/peaceful settings between every other player?

The objective with this is a larger multiplayer/AI environment where differing factions would have differing opinions to others but the opinion could change in the course of the game.

Cheers
#6
10/22/2009 (1:19 am)
Quote:Two types. what I term World Statics such as non-destructible buildings and props like fences, and dynamic statics such as crates which a player may drop in the street or a vehicle that is left in different locations.

Sorry, I guess I wasn't clear. When I asked about "avoiding statics", I knew what you meant by "statics"; I was more asking what you meant by "avoiding". But basically, in the stock version of the kit, if by avoid you mean "doesn't run into them and look stupid" then the answer is yes, it does avoid static objects. If you meant "the AI can go around objects without following the player" then the answer is no (unless you add in a navigation system such as A*).

Quote:Understanding there would be some work for my team here to adapt the system, but is it feasible to build upon the 'always hostile' setting by changing the team settings dynamically or even altering the system to have levels of hostility?

The Universal AI Starter Kit comes stock with the ability for bots and players to change teams at any point in time without reloading or respawning. But you will have to set a few things up, like exactly when you want them to change teams, and what team you want them to change to.

Quote:Alternatively, how is the information stored? If the number of teams is unlimited what would be the drawbacks of making each player a single member team with hostile/peaceful settings between every other player?

Making a system such as that would require a reworking of the team system. Currently there's one value for each bot/player that stores what team they are on, then all other teams are considered hostile.

Quote:The objective with this is a larger multiplayer/AI environment where differing factions would have differing opinions to others but the opinion could change in the course of the game.

If you're talking about an MMO, be aware that you may need to make some performance and networking adjust to the AI.
#7
10/22/2009 (4:41 am)
I'd agree with what Twisted has said on that one, especially regarding performance side for Larger multiplayer environments.

Quote:The objective with this is a larger multiplayer/AI environment where differing factions would have differing opinions to others but the opinion could change in the course of the game.

Unfortuntely Torque derives the AIPlayer class from Player class and therefore inherits a lot of unnessary crap required for human controlled characters but not required for an AI player.

None of the AI kits or resources here have great performance - both UAI and ImmersiveAI rely heavily on Torquescript which is just very slow and you'll start to hit bottlenecks somewhere around 40-50 AI chars for Immersive AI if you look in the thread for it you'll see some discussion on performance there and improvements made when one of the guys here ported the code into C++.

How far you need to go with performance will really depend on how many AI chars you want in game?
#8
10/22/2009 (5:00 am)
Many thanks Twisted & Andy,
It's given me the food for thought I needed.

I've always expected that the AI side of things will be a load that should be on it's own HW and part of the challenge we'll be facing will be exactly as you say, handling the NW side of things.

I'm sure we'll find our happy medium with some hard work but it looks like UAI will save us a lot of the effort for a start and give a good ground 0.

Thanks again.