How does GTA generate unique characters?

Adfa6cf87d3749a0e1acd928285b3f23
1
WDR 106 Jun 05, 2013 at 14:03 procedural

Hello… My apologies if this has already been asked or in the wrong place. The section was titled AI, so I’m pretty sure I’m in the right place. Now, my doubt is in regard to the upcoming sandbox title ‘Grand Theft Auto V’. Now, I’ve read the new features of the game and two of them in particular caught my eye. First one was, “Every pedestrian is unique. No pedestrian looks the same or behaves the same as another pedestrian. A pedestrian once seen in the game is not seen again unless it’s the same person”. Now, what I took to understand from this is the AI mimics real life more accurately where no one person is similar to another. My question is, with thousands of pedestrian models appearing around in the game, what sort of method did Rockstar Games use or would anyone use to render thousands of unique characters with their unique animations in the game? Obviously, despite the long development time, they might not have created character models for every character as that is inefficient and time consuming. So, how did they do it? Do they use some sort of a randomizer program similar to those used by character creations in RPGs/MMOs?

Second one was, “Every NPC reacts differently to the player and each NPC reacts differently to each of the three protagonists. Also, every NPC has multiple different reactions to each situation”. Now, I know that most of the human animation in video games nowadays is achieved with the help of motion capture. Keeping that in mind, are all these thousands and thousands of unique animations done with the help of motion capture? Because if that’s true, then the way I see it, it would be a very time consuming and costly affair. Unless they are done using a similar randomizing program like the pedestrian models. Are they done using a randomizing program like the pedestrian models? If so, how are the randomized animations synced with the randomized models so as to not seem odd and out of place and seem very fluid and natural?

I hope I made myself very clear. Sorry for not providing a source to these statements as I forgot where I have read this information, but I am very sure that it was a legitimate website. And the game also does boast of a very highly detailed and realistic environment, so I’d say the information is believable. Please clarify these doubts for me. Thank you. :)

11 Replies

Please log in or register to post a reply.

6837d514b487de395be51432d9cdd078
0
TheNut 179 Jun 05, 2013 at 15:25

With procedural generation, it’s not all that difficult to randomize the appearance of characters. Most games these days already offer you a level of customization, such as adjusting facial features, skin tones, body features, etc. The most common method of doing this is called body morphing, where you have a just a portion of the geometry that identifies the new shape in that area and you linearly interpolate between the base mesh and the morph target. When you establish those parameters, all that’s left is for you to use an RNG and some rules to dynamically construct your characters. Some rules are of course necessary since you don’t want mutants running around your world (ie: morph defects due to high level of morphing). Clothing is more of the difficult problem to solve since you need to physically design them and setup their skeletons to map with the body shape. I’m pretty sure you’re not going to see to many designs in the game. Perhaps just enough to add diversity, but not everyone is going to be wearing their own custom label.

They likely won’t have tons of unique animations in the way that you believe. There will be unique animations during cutscenes, but they are preordained. They likely produced a set of common animations, perhaps with some variations, and may control most of that through programming. Answering a cell phone may look identical on all pedestrians, but they may have added some variations such as being scared while making a call, fumbling, being courageous by calling you out on a crime, etc. These are all predefined and are selected at runtime based on certain variables. The idea is to give the illusion of diversity, but in time you will recognize the limits of their game.

Adfa6cf87d3749a0e1acd928285b3f23
0
WDR 106 Jun 05, 2013 at 15:48

So, you’re saying that there are a limited number of variations, but an infinite (presumed infinite) number of combinations of these variations give the illusion of being diversely unique. Is this the same technique used by Euphoria animation engine, which claims that “the characters’ actions and reactions are synthesized in real-time” or do they use a completely different method altogether?

Source: http://en.wikipedia….oria_(software)

EDIT: I do understand the limitation of clothing, as I have seen characters with the similar body type having similar clothing and characters with different body type not sharing the same type of clothing.

B20d81438814b6ba7da7ff8eb502d039
0
Vilem_Otte 117 Jun 05, 2013 at 17:16

Ad RNG: Every existing random-number-generator is not actually random, but just pseudo-random and once he hits the same value again. F.e. Mersenne Twister is one of the long-period random number generators (RNG) with period equal 2\^19937-1.

If you do the math (not computational this time, but analysis), you realize that actually every random number generator is fully deterministic, and thus never gives you infinite variations (as the number of variantions is defined by period of RNG, and by all means it is finite) -> so I have to state that from the math point of view, the Rockstar is lying.

Ad Euphoria: It really isn’t anything new - look up inverse kinematics, there are projects already using it (and there were several years ago). It just needs a lot of fine-tuning. The problem is, these animations are mostly usable for walking, running, maybe jumps, keeping balance during fight, but the resulting animation is of lower quality than animation captured by motion capture. Of course simulating fight through it is just weird and doesn’t look good \~ mocap still wins, in my opinion in both, price of animations and quality.

Ad clothing: Plus in real life you don’t have zillion of brands, you have just a bunch of em (so actually this will keep realism).

Adfa6cf87d3749a0e1acd928285b3f23
0
WDR 106 Jun 05, 2013 at 19:55

I see… I get it. I understand fully now, thanks. I did watch a Euphoria demo. Seems the characters were dancing than reacting. Mo-cap is best in my opinion too. But when it was written that animation without keyframing and without actors was used, I thought it was more efficient. Quite misleading. Thanks, anyway. I’m working on creating a physics engine as my B. Tech. project. This informations help me better. :)

P. S.: Why was the name of the topic changed? :huh:

A8433b04cb41dd57113740b779f61acb
0
Reedbeta 167 Jun 05, 2013 at 20:37

@Vilem Otte

from the math point of view, the Rockstar is lying.

Well, they’re not claiming they give you infinite variations…they said “A pedestrian once seen in the game is not seen again unless it’s the same person.” So as long as the number of combinations and the RNG period are at least the population of their fictional city, it should be ok. :) (And besides, it’s marketing talk, not engineer talk…we all know how marketing folks like to “distort” engineering statements sometimes. :))
@WDR

P. S.: Why was the name of the topic changed? :huh:

I didn’t change it, but the old title was “How is it done?” which is very vague. It was probably changed to be more specific and thus of more use to people browsing, searching, etc.

B20d81438814b6ba7da7ff8eb502d039
0
Vilem_Otte 117 Jun 05, 2013 at 20:50

@Reedbeta

Well, they’re not claiming they give you infinite variations…they said “A pedestrian once seen in the game is not seen again unless it’s the same person.” So as long as the number of combinations and the RNG period are at least the population of their fictional city, it should be ok. :) (And besides, it’s marketing talk, not engineer talk…we all know how marketing folks like to “distort” engineering statements sometimes. :))

Ah… that’s true, their world might have finite number of pedestrians. The question is, how good it will be. From games I’ve played, when one stated something about randomness, it ended in low-diversity things that were randomized. As time went on, the game started to be boring. I prefer to play detailed games (often hand-crafted), with good and solid storyline and interesting (all time interesting) environment. But of course thats subjective.

In the end, I fear that the pedestrians might look boring and all-the-same (e.g. too similar).

OT: I think, that The Nut changed the name of topic … as he was the only one from staff, who actually made a post here before I started to spam :ph34r: (It’s always interesting to investigate “side-quests” (read off-topic), in this case “Who changed the topic name” :D )

A8433b04cb41dd57113740b779f61acb
0
Reedbeta 167 Jun 05, 2013 at 21:23

Yes, I’ve worked on a couple of open-world games with randomly generated NPCs, and we did it by basically mix-and-matching different pieces. For instance we might have 20 different heads, 10 different torsos (with different clothes on) and 5 different lower bodies (with different pants, shoes etc.) plus some random choice of accessories like hats, scarves, backpacks, shades, etc. We didn’t even tweak features using blend shapes or anything, though we did do color-shifting in the shaders to create different skin, hair and eye colors.

With all of the different possible combinations you’d have a lot of variety, but there was still a sameness to them - they all had to play a lot of the same animations, so they had to be on the same skeleton and you couldn’t have a lot of variation in overall body proportions. You could do some tweaks like making some characters 10% taller or shorter or making their shoulders/hips a bit wider/narrower, but that was it - any more and you’d mess up the animations too much.

The animations were kind of the same way - there might be a few different walk cycles, and a bunch of variations of “reaction” animations, like appearing startled or angry, or approving or whatever. Those would be played when the player did something attention-getting. Each NPC might have a random number or two that represents how they feel about the player (do they like him / hate him etc.) and that would influence the choice of animations. That’s the kind of system where I could easily see a marketing guy saying “Every NPC reacts differently to the player and has multiple different reactions to each situation”. I don’t know what R* is doing in GTA exactly, but I bet it’s not too different from this.

Adfa6cf87d3749a0e1acd928285b3f23
0
WDR 106 Jun 05, 2013 at 22:45

Ok… NOW I understand clearly! Marketing guys have been known to stretch the truth. I’ve seen games that were not worth the hype that was created for them. In any case, all this helps. Thank you very much. Thumbs up to all youse! *thumbs up* :)

2be978711309afd8811873291659b328
0
Ernesto89x 101 Jun 14, 2013 at 17:02

I am developing a procedural NPC generator for UDK, for this reason I need to know some of the used techniques. I know that in Left4Dead one of these was implemented for the generation of the hordes, but I don’t know none of their particularities. Could somebody indicate me some reference to look for information?

B20d81438814b6ba7da7ff8eb502d039
0
Vilem_Otte 117 Jun 14, 2013 at 18:18

I could point you to http://www.valvesoftware.com/publications/2010/gdc2010_vlachos_l4d2wounds.pdf, which shows how to differentiate characters with wounds (in this case, zombies). Although it’s good for zombies, you still need to actually generate unique characters.

Look through this http://www.seas.upenn.edu/\~cis568/presentations/animated-crowd-rendering.pdf, http://http.developer.nvidia.com/GPUGems3/gpugems3_ch02.html, http://on-demand.gputechconf.com/gtc/2013/presentations/S3002-GPU-Crowd-Simulation-Analysis.pdf to get basic idea… I’ll try to summarize.

You break your characters to several pieces (head, torso, legs, arms, … w/e). You have several variantions for these (or you can parametrize them with bones f.e.), so you can make fat, thin characters, nice and ugly, etc. Next parametrization are textures. You make several face textures, different eye textures, etc. Again, you parametrize between them. You can also break face texture to several. One for face, one for hair, etc. This allows you to make bearded dwarves, black people, white people, etc. You can use different assets (different armor/clothes, boots, etc. etc.).

The thing is, the more things you can parametrize, the better the generator is. Although the people mustn’t be somehow too strange (having huge arms, etc. - so you have to somehow clamp possible parameter values), and mustn’t be too similar (which might be a problematic task).

Sadly I can’t give you any example app or source for people … as I currently use only schematic placeholders for characters.

2be978711309afd8811873291659b328
0
Ernesto89x 101 Jun 17, 2013 at 14:46

I make this post because I think it will appeal.
Using metaheuristics algorithms is good practice for the generation of parameters, these allow the controlled generation of states based on an objective function (OF). I like the “Haming distance “ because this can account for differences between one state and another.