Jump to content
Sign in to follow this  
igneous01

A cpu friendly way to have a large crowd of civilians?

Recommended Posts

So i have decided to make a mission that involves UN forces protecting a presidential rally from possible rioting or attacks from rebels or civilians.

The idea is great and all for what im trying to do, but the biggest problem is the civilians themselves.

I want to simulate a large crowd of people blocking the sides of the road, and possibly have a random selection of these civilians pumping their fist or playing another random animation (I have this script worked out)

however i have some issues getting this to work:

- I cant have 144 civilians in their own groups just to make them play some animation - i need to have some room for other people as well

- Civilians in groups tend to space out and scatter, rather than cluster themselves into tight crowds - disableai works for these groups and none for special, however, the lag from the ai trying to reform on their leader (because this is still being processed) causes huge fps drops when lets say 3 groups of 40 civilians per group are present.

- I cant get them to play the animation script when their movement is disabled.

- Because the animations are looped, there are alot of while loops happening per each civilian the animation is attached, also hogging cpu

So, does anyone have a solution for getting a crowd of civilians to stand like walls, maybe loop an animation over, and still be cpu friendly?

Share this post


Link to post
Share on other sites

Is a firefight going to break out in an amongst the crowd?

Because you could always just show the crowd in a cutscene, add an ambient rally sound and block off the streets leading to the square with roadbloacks, which would be completely in that situation.

Share this post


Link to post
Share on other sites

thats what i want to go.

im using the cheap method here, civilians present trigger and using civis = thislist to get all civilians.

however im not sure how to divide that into groups (need a refresher on that)

now i have a new problem, i have civilians attached to a 0% independant leader, and have them to setcaptive false (using same method above, independant present trigger to return all indeps)

except when i go to switch them back to false, they dont setcaptive back to false, and they dont even recieve weapons either.

im at a loss as to why it isnt working

here is first trigger

independant present:

Inre = thislist; {_x setcaptive true} foreach Inre

now im testing with a radio trigger

activation:

{_x setcaptive false; nul = [_x] execVM "Armed.sqf"} foreach Inre

it works, if setcaptive is default to false, however once its true, it stays true and doesnt get turned off, and my armed script does not kick in.

what could be the problem?

Share this post


Link to post
Share on other sites

because after they are set to captive false with no leader, they revert to their leader side, or in this case their own side wich is civilian, so your arm trigger does not work because it detects no independents, could maybe work to spawn a new independent leader and make him leader of their group again, and then run the weapon script and delete the leader after.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×