Mobile objects(AI in game)
#1
Posted 24 March 2009 - 05:51 AM
I want to make the characters in a game world react has real world characters.Example going to job,waiting for bus,driving cars,teasing others,fighting with others.Some one please guide me.I don't know where to begin and which algorithms suitable for this.
--Rajesh--
#2
Posted 24 March 2009 - 07:58 PM
#3
Posted 25 March 2009 - 04:31 AM
Thanks in advance.
#4
Posted 25 March 2009 - 04:35 AM
Good luck though. :)
#5
Posted 25 March 2009 - 04:39 AM
#6
Posted 25 March 2009 - 05:27 AM
#7
Posted 25 March 2009 - 05:33 AM
I actually make all my games like this, cause it suits anything from a 2d shooter to an adventure game.
here you have a position on the map, any conversations that the character says in the game are stored in this structure.
collision detection and all ai is done here too.
every frame of the game iterate through the list of instantiated characters like this->
int i;
for(i=0;i<CHARACTERS;i++)
{
if(character[i].active)
{
//perform collision detection
//ai
//render character
}
}
#8
Posted 25 March 2009 - 07:29 AM
But what are the other concepts and algorithm needed to do this
Thanks in advance
#9
Posted 25 March 2009 - 07:45 AM
What your asking is too broad, I might as well point you to a game programming book I cant go an explain the whole thing to you, would take 10 pages and a good proof reading.
Just get some guys walking around and when they bump into each other they say "hi" that would be the beginning.
#10
Posted 25 March 2009 - 08:09 AM
- Sims is probably the most complex. All characters have set of needs that grow, and when something overflows (like having to go to the toilet), the character overrides whatever it was doing to try to fulfill this need. Still, without guidance, the characters don't really manage..
- Black & white had some primitive learning things. Character does some random action, and if the player punishes (or rewards) the character, it is less (or more) likely to do said random thing again.
- GTA pedestrians just walk around randomly. More advanced characters (like fleeing opponents) know how to use vehicles etc, but it's not all that complicated.
- Hitman series characters are pretty pre-scripted, and if anything unusual happens, the more complex actions (like go to the bar and get a drink) are disturbed and the characters turn into generic "hunt the player" mode.
- Settlers series characters have a job, and it's pretty simple: woodcutter seeks wood, chops it down, drags it to a pile. Someone else's job is to move the pile to the sawmill, etc.
I could go on, but do I need to?
In order to have a fully functional town of a couple hundred characters living their lives, interacting, etc, would probably be a lot of work. If nothing else, it would be a debugging hell. Still, I have some game ideas that are based on exactly such a system =)
#11
Posted 25 March 2009 - 08:45 AM
Players won't be able to tell the difference from that or a more complex simulation.
- www.mattiasgustavsson.com - My blog and current projects
- www.rivtind.com - My Fantasy world and isometric RPG engine
- www.pixieuniversity.com - My Software 2D Game Engine
#12
Posted 25 March 2009 - 11:56 AM
#13
Posted 25 March 2009 - 08:51 PM
The more advanced ones (as in more realistic, but also much harder to code up) are agent systems because they represent each person individually, ie. as an agent. An agent is really a combination of rules, FSMs, pathfinding and collision detection code that responds to events and information about the environment.
This is a not an easy field. You may want to start by learning about AI in general, then about pathfinding and FSMs, then try to find out more about city simulations, depending on the depth you need in your game...
#14
Posted 25 March 2009 - 08:58 PM
http://www.red3d.com/cwr/ibm.html
And, if you want a taste of how complicated it can get:
http://www.swarm.org...Swarm_main_page
First, establish what you need and do no more. IOW, make sure you don't forget the KISS principle.
Have fun!
#15
Posted 25 March 2009 - 09:11 PM
http://www.cs.ucl.ac.../Crowds/EGUK03/
Hope it helps.
#16
Posted 26 March 2009 - 05:45 AM
delinkx.com/blog
portfolio.delinkx.com
hostfields.com
#17
Posted 26 March 2009 - 07:00 AM
i need
people's moving from A to B,
vehicle's moving from A to B,
people's have to react for events(ex:accident's,especially when interact with player)
almost like GTA crowd's
#18
Posted 26 March 2009 - 08:12 AM
so for motion, u need to have a collision detection algorithm. to simulate the behaviours u need to use a behaviour model and based on that do the decision making. A Star or D star for your motion planning.
interactions for events. u need to build a knowledge based human behaviour model.
delinkx.com/blog
portfolio.delinkx.com
hostfields.com
#19
Posted 26 March 2009 - 11:24 PM
rajesh kumar said:
vehicle's moving from A to B
That's very simple! :) Set an objective point (assuming it's on a squared grid):
If Player's X < Objective Player's X++ Else if Player's X > Objective Player's X--
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users












