rajesh_kumar at March 24th, 2009 01:51 — #1
Hello hai to every one
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.
hyper at March 24th, 2009 15:58 — #2
Do you have a game written so you could do so in the first place?
rajesh_kumar at March 25th, 2009 00:31 — #3
No.But i want to know how do that before starting a project.Because don't want to struggle in middle of the project.
Thanks in advance.
hyper at March 25th, 2009 00:35 — #4
You're trying to recreate The Sims I assume. Honestly, I'd have no idea off the top of my head.
Good luck though.
rajesh_kumar at March 25th, 2009 00:39 — #5
Can any one tell me what are the possible things for do crowd simulation
rajesh_kumar at March 25th, 2009 01:27 — #6
thank you for your wish hyper
rouncer at March 25th, 2009 01:33 — #7
Set up a "character" structure or object and make this the centre point for all activity that revolves around the characters.
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->
//perform collision detection
rajesh_kumar at March 25th, 2009 03:29 — #8
Thank you rouncer its simple and nice
But what are the other concepts and algorithm needed to do this
Thanks in advance
rouncer at March 25th, 2009 03:45 — #9
Get something simple running first, and see what you can come up with yourself - then come back with a more specific question and ill try to help you out.
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.
sol_hsa at March 25th, 2009 04:09 — #10
There's a reason why there aren't any games on the market where characters react like "real world characters". Every example is limited.
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 =)
mattias_gustavsson at March 25th, 2009 04:45 — #11
just pick actions randomly, and do them for a randomly selected period of time.
Players won't be able to tell the difference from that or a more complex simulation.
fireside at March 25th, 2009 07:56 — #12
I think the best place to start for something like that is A Star path finding. Generally you have a map, probably made of squares, but it could be nodes. Then the character makes decisions, perhaps random, or perhaps with a hierarchy of motives programmed in and moves to different locations and does things. You can do a search for A Star and find some tutorials to get you started. There are some pretty good ones around. It's best to start with simple games and work up. So, having monsters that jump and shoot at the main character when they come by is a simple form of AI. Games like the Sims have something like a million lines of code so you have to pare down your expectations a bit.
alphadog at March 25th, 2009 16:51 — #13
As Mattias states, the goal should not be to fully model reality, which would be painful to process in real-time, but to create a model that seems plausible and fits in with the needs. As Sol_HSA illustrates, do you need to simulate a crowd as "decoration", such as in GTA, or is it central to your game, as in Sims?
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...
alphadog at March 25th, 2009 16:58 — #14
BTW, take a gander at this:
And, if you want a taste of how complicated it can get:
First, establish what you need and do no more. IOW, make sure you don't forget the KISS principle.
zebeste at March 25th, 2009 17:11 — #15
I was just doing some research for AI a little earlier today and one of the things I found may be of use to you.
Hope it helps.
delinkx at March 26th, 2009 01:45 — #16
what u need related to crowd simulation ?
rajesh_kumar at March 26th, 2009 03:00 — #17
Thank you for all above guy's
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
delinkx at March 26th, 2009 04:12 — #18
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.
hyper at March 26th, 2009 19:24 — #19
people's moving from A to B,
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
Else if Player's X > Objective