PDA

View Full Version : I've learned how to push AC1's crowd density beyond limits (a bunch of pics)



Farlander1991
12-04-2016, 02:18 AM
Hey guys. We all like crowds, right? Well, at least I do. After Unity though, the amount of crowds in other games seems... small. So I always wanted to find a way to get more crowds on AC. And I managed to do so on AC1 on PC version.

Now, AC1 has a setting 'MaxNumNPCs' in its .ini files, which, naturally, controls the maximum amount of NPCs spawned at the same time. The thing is, even if you set the amount to a very high number, the game doesn't let you anywhere beyond the min-max threshold of 60-105. So I used other means to do so. And here are some comparison pictures.

So, here's the souk in Damascus with amount of NPCs set to 0. You can see that there's only 'active' people there - guards, the jug carriers, etc., basically only those that serve a gameplay purpose.



http://i.imgur.com/8YMFj5o.jpg

http://i.imgur.com/irYrQ9g.jpg

http://i.imgur.com/OuRDKrM.jpg


Here's the same souk with the NPC density set to the original max of 105.


http://i.imgur.com/YazdthS.jpg

http://i.imgur.com/C65fzZs.jpg

http://i.imgur.com/nTwOnRm.jpg



As you can see, it's a bit more lively now. So it's time to set the amount of NPCs beyond maximum. For my first test run after learning how to change the max amount of NPCs, I decided that no need to start small and set it to 10000. And here's the result when I got to the souk...


http://i.imgur.com/pDhm3gR.jpg


Oh ****...


http://i.imgur.com/70xF9bA.jpg

http://i.imgur.com/z0w9ehV.jpg

http://i.imgur.com/OLXYm5w.jpg



Oh ****.... That's a lot of people :D That's kinda awesome! And the cool thing that I found out is that even with the max amount set to ridiculous degrees, the density percentage between areas stay, so the souk is very crowded, but some streets - not so much.



http://i.imgur.com/4fz2w0I.jpg



Though in general I think it creates a much livelier atmosphere in cities.



http://i.imgur.com/kxhxsvp.jpg



Though I can't seem to fix the issue with the distance, to see more NPCs from farther away. Though there aren't that many very tall buildings in AC1 so that's not much of an issue overall, here's what happens when I climb the area near the cathedral of Acre.



http://i.imgur.com/l2uTLZl.jpg

http://i.imgur.com/7NrCLHs.jpg

http://i.imgur.com/FzdBZZB.jpg

http://i.imgur.com/pomc7X5.jpg



You can see how many NPCs disappear in the distance as I climb higher, even though when I leap of faith back they reappear and streets are pretty crowded.



http://i.imgur.com/cOxZk3u.jpg



But even with that issue that I don't know yet how to fix, I still think it's very cool to see AC1 with this amount of people in the streets.

Lysette88
12-04-2016, 03:37 AM
Could you please elaborate what "other means" beside MaxNumNPCs you changed to achieve this effect - I find this very cool and the game has performance capacity to support more NPCs anyway.

Sigma 1313
12-04-2016, 03:47 AM
I think the NPC distance is due to some variable like draw distance. Even as you run sometimes you can see the final real time shadows being "drawn in" nearby rather than the older baked on shadows.

SixKeys
12-04-2016, 04:15 AM
Oh my gosh, please let me know how to do this. I've always wanted to see AC1's streets more crowded. Does it affect performance a lot, BTW?

Have you tried this during missions where there's a large gathering of NPCs as part of the plot? Like the execution with Majd Addin?

Farlander1991
12-04-2016, 11:04 AM
I'm not sure how appropriate this is for official forums (I do have the official game version of course, but the way to achieve this might not be considered fair), but I used Cheat Engine. Basically, if you're in the game and have Crowd Density set to max, you need to search for the value 105 in CE, and then in the game change Crowd Density to min, get back to CE and have a 'next scan' for the value 80, and there will be one address that has changed from 105 to 80 and that's what controls the max amount of NPCs (it also overwrites the value in the .ini file, though I noticed that I can't get the same effect by just editing .ini). So you add it to the address list and change that value. I tried to create a saved table but it seems the address is different every launch of the game.

Overall it doesn't affect performance a lot, though sometimes on my laptop I get a 5-7 FPS drop rate in comparison to standard performance. Mind you, this was tested on my laptop which is 5 years old now, so that's to be expected. I don't think there will be any big differences on today's rigs.

I've tested it with Majd Addin execution. Basically, I can say that this affects only places where NPCs are created dynamically. So in Tamir's assassination you should see differences because it happens in the souk, but for Majd Addin the NPCs are created specifically for the scene (and guards block pathway to the location which makes it impossible for dynamically created NPCs to pass through into the area).



http://i.imgur.com/F1mJE6N.jpg



It looks like that both when NPCs are set to 0 and 10000. However, I would like to note that with max NPCs set to 10000 (not sure if it happens with the original 105) when I got closer an additional line of crowd appeared, which didn't happen with NPCs set to 0.



http://i.imgur.com/x9cxCBA.jpg



In general though, I think that Majd Addin's scene in particular has enough NPCs already for it to feel dense and crowded. And it creates some really nice views in locations that might've felt barren with the original max amount of NPCs.



http://i.imgur.com/gbJqNYW.jpg

Megas_Doux
12-04-2016, 04:40 PM
This looks really, really cool.....

Lysette88
12-04-2016, 09:13 PM
It does, but if I understand the process to achieve this correctly, it would require a change of the parameters mentioned IN EVERY GAME SESSION - which could get annoying pretty quickly. so thank you for showing us, but I guess I will not go through the hassle of doing that. It is still awesome to see, that the game would be able to support that amount of NPCs.

Farlander1991
12-04-2016, 09:18 PM
It does, but if I understand the process to achieve this correctly, it would require a change of the parameters mentioned IN EVERY GAME SESSION - which could get annoying pretty quickly. so thank you for showing us, but I guess I will not go through the hassle of doing that. It is still awesome to see, that the game would be able to support that amount of NPCs.

It literally takes less time than it is to load a saved game or exit the game without Alt+F4 :) Though that shows issues with AC1's UI flow more than anything, but still.

crusader_prophet
12-04-2016, 09:27 PM
Hey guys. We all like crowds, right? Well, at least I do. After Unity though, the amount of crowds in other games seems... small. So I always wanted to find a way to get more crowds on AC. And I managed to do so on AC1 on PC version.

This is pretty neat man. Thank you for sharing! Seeing AC1's streets more crowded is pretty cool for me. Always wanted that in AC1. I play on PS4, so I guess no way for me to do this. :(

HDinHB
12-04-2016, 11:01 PM
That's pretty cool. I haven't played WD2 yet, but I've heard complaints that the streets of San Francisco don't feel as busy as they should. Maybe Unity made Ubi overly cautious in some respects.


@crusader_prophet - you can often pick up older PC games for a few bucks, and even if you have a less than top of the line PC you should be able to play AC1.




http://i.imgur.com/opk4S1Y.png

SixKeys
12-05-2016, 04:35 AM
AC1 should run on max settings even on old computers. Mine is five or six years old and I can max out the first three AC games without a hitch.

Farlander: I figured that might be the case for scenes where a large crowd was created specifically for the scene, thanks for confirming it anyway. Is 10,000 the highest number you can generate or could one theoretically push it even further? I'm thinking Unity levels of crowd density.

Farlander1991
12-05-2016, 08:17 AM
AC1 should run on max settings even on old computers. Mine is five or six years old and I can max out the first three AC games without a hitch.

Farlander: I figured that might be the case for scenes where a large crowd was created specifically for the scene, thanks for confirming it anyway. Is 10,000 the highest number you can generate or could one theoretically push it even further? I'm thinking Unity levels of crowd density.

This was a mistake on my part when creating the thread, but one important thing to note is that we're not actually creating crowds with this, we change the amount of possible NPCs existing at the same time. So it's not 'put 10000 NPCs', but 'there can be 10000 NPCs at once'.

The logic behind crowd creation and density remains controlled by the game, which I'm not sure how it works, but it's why in some locations like the souk there would be a lot more people than in some other locations, because the game itself tries to make more NPCs there, we're just raising the limit.

That said, the number is important. When I've put 50000 as the limit, it actually broke and didn't generate a single NPC. So maybe it makes sense to experiment with limits less than 10000 (I'm not sure if it makes sense to experiment with values like 15000 or 20000, but you can try) - worst case scenario is that there won't be any difference between that and 10000, and best case possibility is that it would actually work better and generate more NPCs with that limit a bit lower.

Lysette88
12-05-2016, 03:52 PM
Well, it is eventually a 2-byte integer with the highest positive value of 32767 and if you go higher than this (with 50,000) it will be a negative number and you see the same as with MaxNumNPCs=0.

Farlander1991
12-05-2016, 04:37 PM
Well, it is eventually a 2-byte integer with the highest positive value of 32767 and if you go higher than this (with 50,000) it will be a negative number and you see the same as with MaxNumNPCs=0.

That's what I thought as well, only the Cheat Engine marks the value as 4-byte so the threshold should be much higher. That may be an issue with the program, though, and it actually is 2 bytes.

Lysette88
12-05-2016, 04:49 PM
It might just be listed as 4-byte, because in a 32-bit environment it is often better for performance to have values aligned to 32-bit borders, but that does not mean, that the values are interpreted as 32-bit values, they could well be just 2-byte or 1-byte or even be used as boolean values, even they use 4-bytes in memory. Aligning variables to 32/64 bit borders makes access of a variable faster, guess that's why.

Farlander1991
12-05-2016, 05:13 PM
It might just be listed as 4-byte, because in a 32-bit environment it is often better for performance to have values aligned to 32-bit borders, but that does not mean, that the values are interpreted as 32-bit values, they could well be just 2-byte or 1-byte or even be used as boolean values, even they use 4-bytes in memory. Aligning variables to 32/64 bit borders makes access of a variable faster, guess that's why.

Thanks, didn't know that :)

cawatrooper9
12-06-2016, 04:35 PM
Neat!

I'd love for Ubisoft to use AC1's crowds for inspiration. AC1's crowds might be some of my favorites, along with ACB.

Unity's were pretty, just wish they were a little more reactive.

Lysette88
12-06-2016, 11:07 PM
Neat!

I'd love for Ubisoft to use AC1's crowds for inspiration. AC1's crowds might be some of my favorites, along with ACB.

Unity's were pretty, just wish they were a little more reactive.

What do you mean by this exactly?- Unity crowds react to thrown money pouches, they scatter and run away in panic if there is some shooting, they just do not make a lot of fuzz when they are pushed, but guards might still get aware of this socially unacceptable behavior of forcefully pushing people. I mean these people have far more important problems to deal with than to be overly annoyed by being pushed, so it does not really make me wonder, that they get over with pretty quickly. Did you mean the gentle push in AC1 and AC2 with it resp. the lack of it?

cawatrooper9
12-08-2016, 04:00 PM
What do you mean by this exactly?- Unity crowds react to thrown money pouches, they scatter and run away in panic if there is some shooting, they just do not make a lot of fuzz when they are pushed, but guards might still get aware of this socially unacceptable behavior of forcefully pushing people. I mean these people have far more important problems to deal with than to be overly annoyed by being pushed, so it does not really make me wonder, that they get over with pretty quickly. Did you mean the gentle push in AC1 and AC2 with it resp. the lack of it?

They scatter a little, but they'll be hanging right next to a dead body in 30 seconds. Go play AC1 again and notice how utter chaos erupts when Altair makes a kill in a city square.

And yeah, the crowds actually had physics which was nice (if not also sometimes frustrating).

Farlander1991
12-08-2016, 06:18 PM
They scatter a little, but they'll be hanging right next to a dead body in 30 seconds. Go play AC1 again and notice how utter chaos erupts when Altair makes a kill in a city square.

And yeah, the crowds actually had physics which was nice (if not also sometimes frustrating).

I actually haven't tested out chaos with increased NPC count. Dunno why, I really should just to see how it works when there's a lot of people.

But having replayed AC1 some months ago (so with normal crowd density), I can say it's got the same issues. Chaos happens only with the NPCs who see the act (they run away), but it doesn't really spread, so a couple dozen seconds later you also have people hanging around dead bodies as well (and guards walking around asking who did this). Not to mention that also NPCs react negatively to when you kill someone, but not when you fight someone, so you can have situations like, if they didn't see you kill a guard but see you fighting a guard, even among bunch of dead bodies, they can just look at you as if you're fistfighting someone.

So this makes me really interested in what'll happen when the amount of NPCs rises to a much larger amount. But I'll be able to check that only in a couple days.

Lysette88
12-08-2016, 06:47 PM
But this is pretty "normal" behavior of crowds. As long as there are just a few or they have actually seen the crime, people tend to run away as well in real life. But once a few spectators are there others will flock to them and soon you have a large amount of spectators around a crime scene. So this is not weird at all, but just how people behave. It might not be the most clever move, but that is what people are like.

SixKeys
12-08-2016, 07:04 PM
But this is pretty "normal" behavior of crowds. As long as there are just a few or they have actually seen the crime, people tend to run away as well in real life. But once a few spectators are there others will flock to them and soon you have a large amount of spectators around a crime scene. So this is not weird at all, but just how people behave. It might not be the most clever move, but that is what people are like.

The problem is that they still don't act like normal people. After a few minutes have passed, instead of crowding around nervously, the NPCs begin to walk past the corpse with hardly a second glance. This became especially noticeable in AC2. Perhaps back then it was due to technical limitations, but in the new games they should have NPCs react to bodies until it's properly disposed of. (It's even more ridiculous when a shifty, hooded man dumps the body into a nearby haycart and that makes the NPCs relax and forget about the problem.)

Farlander1991
12-09-2016, 07:52 AM
So I've tested out a bit of chaos in AC1 today, in the souk as per first example. The reason I chose it is because as a market the game spawns tons and tons of NPCs there, and it's also a tight spot, so a pretty good way to stress the system. Mind you that because souk is a more extreme example, you won't see this thing everywhere (most of the streets in AC1 are pretty open, with crowd density not as high), but because the amount of people is amplified, the issues that I talked about NPCs reactions become more noticeable too.

So I started a fight with the guards, not killing yet anybody, and everyone watched. All well and good, because there was no killing and NPCs react to kills specifically.



http://i.imgur.com/riYC56R.jpg



But then after the kill, happens what I've mentioned. Only those who have seen it directly react to it in terror. When other NPCs approach they still become 'curious' and start watching. So what happens is that there's a group of people that runs in chaos, and then another group of people starts gathering to watch.



http://i.imgur.com/BvCHXsy.jpg



You can see on the screen above that a few people have already started watching the fight, while others around them are running away in terror. This all happens because, as I've mentioned in one of my blog posts (https://stanislavcostiuc.com/2016/08/28/why-assassins-creed-series-isnt-social-stealth-and-what-to-do-about-that/), in AC NPCs don't transmit information.

After the fight, happens what I've mentioned before. People approach, say some phrase, and then move on. The problem is that NPCs can't step over guards' bodies. So they try to find another route. And with such a blocker, it can literally clog up the NPC trafic with them starting walking one into another.



http://i.imgur.com/pCadGlW.jpg



I did not test chaos on more open streets/areas. As I've said, I think it will be less problematic there. Well, at least there won't be clogging like this. But with more NPCs, some of the issues with the reaction system can become more apparent. For example, with the original max density of 105, because it was relatively sparse, it takes longer for a second group of watchers starting to form during a fight, so the fact that NPCs don't transmit information to one another is less noticeable.

All that said, I still think ****tons of NPCs in AC1 is absolutely freaking cool :D I tried to find a way to raise the amount of people in AC2, but I'm not sure that will be possible. The thing is, in AC2 because crowds have a gameplay element (blend), it seems that they were all placed in a specifically designed way, like monks in AC1 (and in AC1 the gameplay NPCs like monks and guards and jug carriers are always there), so if there's a group of people standing in one location, it will stand in that one location every time, if a group circles around some buildings, it will circle around those buildings. Maybe with some deviations, but that would be part of their logic. But the point is, even though it seems the crowd density value has stayed in AC2 (at least I presume that's what I found), changing it doesn't change the amount of people because they're not random walking NPCs anymore.

SixKeys
12-09-2016, 09:43 AM
That last screenshot may not be how the gameplay was intended, but damn if it doesn't look awesome with so many people in the souk. That throng of people is what I imagine a truly crowded market would have looked like in those days. I wish it was possible to generate those kinds of crowds everywhere.

It's always interesting to read these posts from a game dev's perspective, like your explanation about why the same thing isn't possible in AC2. With proper immersion it's easy to lose sight of how much smoke and mirrors goes into creating the illusion of a living world, how all these things adhere to strict rules and how those rules affect other systems.