Jump to content
Sign in to follow this  
dafuzzyone

How to Keep Civilians from Committing Vehicular Manslaughter?

Recommended Posts

So, I'm currently using the Civilian Occupation System and I'm also pairing it up with this: http://www.armaholic.com/page.php?id=27485

Through that way, at least that's how I had it planned, the pedestrians won't get killed every 20 seconds by cars passing by. To my dismay, I noticed it doesn't work at all for civilians and civilian vehicles. Funny enough, I know that this tends to be how vanilla ARMA does it, but it seems like it doesn't matter whose driving the vehicle but rather what car the faction belongs to. Is there any way I could potentially rectify this situation at all to involve civilians? I would love to make a town that doesn't have dead bodies everywhere. I've been looking over the PBO file, but I haven't been able to connect the dots.

Note: I know how to take out the moving vehicles, but I want to keep them in.

I also found this link to be helpful. Been pouring over it currently. http://forums.bistudio.com/showthread.php?183813-tank-and-man-harmony

Edited by DaFuzzyOne

Share this post


Link to post
Share on other sites

Well, guess you can just wait for BI to fix it, in fact, they seem to have a fix ready for testing anytime soon.

Share this post


Link to post
Share on other sites

Really? Shit, I didn't even hear about this. I can't say I've been this excited for a fix before! Cheers!

I really hope they let publicly release the date soon before it escapes my memory!

Edited by DaFuzzyOne

Share this post


Link to post
Share on other sites

As Oukej mentions a few posts after that one, this fix may (probably) not help hit and runs to pedestrians civs or soldiers.

Share this post


Link to post
Share on other sites
wait for the Sidewalks DLC 2019 :D

Mmmmm...better yet, wait for "ArmA 3: Grand Theft Auto Reborn" in 2018, HA! :p

Share this post


Link to post
Share on other sites

I really dug deep into AI, FSMs and similar stuff, like authentic civilian behaviour (go to beach if it's warm and good weather, go inside if it's raining, assign them workplaces, let them go there for predefined work hours and stuff like that) just out of curiosity.

AI driving was another issue, solved it somewhat decently with a half "assed" solution to send every civ in front of a vehicle a few metres away from the road at an 90° angle.

Works fine for one single car, but a performance hog for multiple cars.

Really curious about the announced fix.

On the other hand there's a VBS video (no idea how much of what you see is vanilla VBS) that shows civilians walking on the sidewalks only, not like you'll see in arma, where they're fond of walking a good chunk in the road, even if there's enough space on the sides.

Here's the

, you can clearly see this at 1:22, with civilians only crossing the road at zebra crossings, while staying on the sidewalks.

Is there any way to get something like this in arma?

Can only think of using FSMs with setDestination and agents, mapping proper paths would be a nightmare though and probably not very performance friendly.

I already checked sahrani to see if it's somehow baked into the map, but even placing civilians in safe mode on the sidewalk makes them walk onto the road before heading to their waypoints, like mentally showing me a middle finger.

That's probably one of the last unsolved arma mysteries to me.

Cheers

Share this post


Link to post
Share on other sites

That video looks amazing, Grumpy Old man, too bad it's for VBS. Look at the crowd there! And there's hardly any frame drop? Dafuq, BiS? D: It actually looks like the town is populated.

Well, I just hope they can somehow configure civilians to stick to the side of the road eventually. It seems like such a simple thing. oh well, I have to deal with no moving vehicles in the meanwhile sadly.

<3 the replies back so far.

Share this post


Link to post
Share on other sites

Agree, that video was an eye opener. Hard to believe this is a few years old already. Is the code base of VBS that much different than that off ARMA?

What if you are able to spawn civilians as agents with a reduced damage model, basically more or less just like the rabbits. Then you could have a civilian agent population just for creating some immersion in city's. Wouldn't that be great...?

Share this post


Link to post
Share on other sites

Somehow my post vanished.

I made a civilian FSM for agents, been able to spawn around 2000 on the entire map,

with enablesimulation, hideobject and using variables to save current states,

the FSM can be exited so there's actually 0 cpu power being used on those agents out of sight.

FPS with around 100-150 civilians active is around 45-55 with my 4770k and 770,

reducing that number to 80 civs active gives me nearly no fps loss.

Civs got their own jobs, stay at the work place during their individual assigned shifts and use their free time to go shopping,

to the beach, visit nearby cities and of course they need some sleep too, the older they are the less sleep they need/get (but only after work is finished, being unemployed has its advantages here).

The entire population is permanent, no agent is being respawned

and the player can interact with them through a semi dynamic conversation system,

can get intel from them, ask about recent events and ask them where all their women went.

so there's actually stuff going on aswell.

Looking at that pic there's ~250 civs in the town and it still looks pretty empty.

Gu8o8HE.jpg

But I'm giving away too much already, hoping no one will find this thread, heh.

However something weird is happening if I'm getting close to 3500 agents (around 3000 civs and ~500+ animals) on the map, they sometimes shift into a bugged state, warping halfway into the ground having the arms spread down their sides with the entire body blinking.

Probably the engine getting the better of it, heh.

The biggest bottleneck with this approach is totally the GPU, the character detail is just too high to allow higher framerates with more than 80 civs and a 770.

Share this post


Link to post
Share on other sites

The coding can be done regardless of that video being helpful or as offense material against BI to fix up arma which of course they should.

However, as I have said, this can be done by creating a trigger on nearby units or vehicles, and then getting the distance of the closest target to slow down or stop.

Here is an example: (I am not on ArmA 3 at the moment, but it should be something like this)

_target = _vehicle nearobjects ["unit_classname", 30];
_targetDist = _driver distance _target;
_vel = velocity _vehicle;
_dir = direction _vehicle;
_speed = 10;



If (_targetDist < 30) Then


for "_i" from _vel to 0 step -1 do
{

 for "_o" from 0 to 3 do
 {
  _vehicle setVelocity [
  (_vel select 0) - (sin _dir * _speed), 
  (_vel select 1) - (cos _dir * _speed), 
  (_vel select 2)];

 };
};
};

Kind Regards,

Rawner135/Ranwer

NOTE: It's suggested that you take lessons in Physics and IPT

Edited by Ranwer

Share this post


Link to post
Share on other sites
Somehow my post vanished.

I made a civilian FSM for agents, been able to spawn around 2000 on the entire map,

with enablesimulation, hideobject and using variables to save current states,

the FSM can be exited so there's actually 0 cpu power being used on those agents out of sight.

Great initiative! I reckon you don't need to spawn that many Civ's though. Perhaps follow the same guidelines as with BIS ambient life. Spawn civs within the player radius and only in urban areas. Line of sight in urban areas is limited so you can keep the spawn (de-spawn) radius quite small.

Did you manage to get them walking on the pavements or are they all over the place?

Share this post


Link to post
Share on other sites
Somehow my post vanished.

I made a civilian FSM for agents, been able to spawn around 2000 on the entire map,

with enablesimulation, hideobject and using variables to save current states,

the FSM can be exited so there's actually 0 cpu power being used on those agents out of sight.

FPS with around 100-150 civilians active is around 45-55 with my 4770k and 770,

reducing that number to 80 civs active gives me nearly no fps loss.

Civs got their own jobs, stay at the work place during their individual assigned shifts and use their free time to go shopping,

to the beach, visit nearby cities and of course they need some sleep too, the older they are the less sleep they need/get (but only after work is finished, being unemployed has its advantages here).

The entire population is permanent, no agent is being respawned

and the player can interact with them through a semi dynamic conversation system,

can get intel from them, ask about recent events and ask them where all their women went.

so there's actually stuff going on aswell.

Looking at that pic there's ~250 civs in the town and it still looks pretty empty.

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

But I'm giving away too much already, hoping no one will find this thread, heh.

However something weird is happening if I'm getting close to 3500 agents (around 3000 civs and ~500+ animals) on the map, they sometimes shift into a bugged state, warping halfway into the ground having the arms spread down their sides with the entire body blinking.

Probably the engine getting the better of it, heh.

The biggest bottleneck with this approach is totally the GPU, the character detail is just too high to allow higher framerates with more than 80 civs and a 770.

Interesting information re performance with # of agents/units, thank you.

I too am working on some advanced AI logic, have some idea of how you went about it, hope it goes well!

Are you working with agents or units? If agents, don't you have issues with animation and moveTo/etc.? 1.44 they won't budge for me with moveTo/doMove/setDestination/etc.

Great initiative! I reckon you don't need to spawn that many Civ's though. Perhaps follow the same guidelines as with BIS ambient life. Spawn civs within the player radius and only in urban areas. Line of sight in urban areas is limited so you can keep the spawn (de-spawn) radius quite small.

Did you manage to get them walking on the pavements or are they all over the place?

some of us don't like the Truman Show effect of things winking out of existence around the corner :)

I suppose there are ways to do it with virtual AI and only have them rendered (via createAgent or createUnit) when in radius, but that sounds quite complex to maintain an abstract unit

Edited by MDCCLXXVI

Share this post


Link to post
Share on other sites

AI are walking on sidewalks but barely so, they're always one leg into the road.

I prefer to spawn them at mission init, way faster since simulation doesn't run yet.

The number of civs is not that much of a problem when using agents, can easily run 5x as much on screen than using units.

With most recent adjustments I can run 350 active civs in Zargabad, ~280 in takistan (tested at rasman and nagara) with fps not dropping below 35.

spgJdTc.jpg

Once you leave those dense areas and only enter small villages fps usually are capped at 60, barely ever dropping to 55.

Again, I'm running a 4770k at 4.5 and a 4gb 770.

For now I limited the civ count to 1 civ per building around 400m of the town location, with a max of 150 + (random 150*0.3).

Gives an authentic feeling to locations that are pretty small and ignores weird configured maps (huge cities defined as nameVillage etc)

I'm using agents, disable the AI stuff like FSMs etc., and run my own civ.fsm.

On top of that I pull all possible data out of the map at mission init, like building positions,

towns, specific job related buildings, selectBestPlaces etc.

Really helps to improve performance a ton. Just imagine running BIS_fnc_buildingPositions for 3000 civs every once in a while, heh.

some of us don't like the Truman Show effect of things winking out of existence around the corner

I tried some user made SP mission "sandboxes" back in A2 and now in A3, I absolutely dislike it when I scout out an area, move in and suddenly there's AI spawning 200m in front of you (especially when it's tanks).

You can totally avoid that with a somewhat smart approach and a bit of planning.

I suppose there are ways to do it with virtual AI and only have them rendered (via createAgent or createUnit) when in radius, but that sounds quite complex to maintain an abstract unit

setDestination works fine to me, for some unknown reason I can't get AI dogs to run to a position, no matter if spawned as units or agents, even disabling the animal behaviour variable doesn't do anything.

Civilians are working fine.

Share this post


Link to post
Share on other sites

Wow that looks pretty impressive Grumpy.

I've been looking to put civs in my mission, but it's going to be one of the last things on the list as I need to see how the performance is up to that point.

is your own civ fsm ran on each agent, or do you use an overall "master" process to assign them to do stuff?

You can totally avoid that with a somewhat smart approach and a bit of planning.

Agreed, harvesting/caching units is totally believable if you do it with a bit of thought. :)

Share this post


Link to post
Share on other sites

is your own civ fsm ran on each agent, or do you use an overall "master" process to assign them to do stuff?

This is getting into politics now!

Share this post


Link to post
Share on other sites

I've been looking to put civs in my mission, but it's going to be one of the last things on the list as I need to see how the performance is up to that point.

is your own civ fsm ran on each agent, or do you use an overall "master" process to assign them to do stuff?

Performance is a very important aspect, that's true, luckily as mission designer it's up to you how to utilize that.

Luckily the majority of the civilian population needs to get some sleep, that's when most action is gonna happen.

Towns won't be a "no action" zone though, but I'm not gonna give away more than that, heh.

Every civ runs his own execFSM, with the FSM being exited once the simulation on the civ is disabled.

All important variables being either stored in a missionnamespace variable or on the civ.

Share this post


Link to post
Share on other sites

I never understood the real difference between an agent and a unit. Where can I can some detailed info (havent't found it on bis wiki) or just a short summary ?

Grumpy Old Man, you're teasing us like hell !! Where can we find info to populate our missions with civ like yours ? Is your script available somewhere ?

Thx ! :)

Share this post


Link to post
Share on other sites
I never understood the real difference between an agent and a unit. Where can I can some detailed info (havent't found it on bis wiki) or just a short summary ?

Grumpy Old Man, you're teasing us like hell !! Where can we find info to populate our missions with civ like yours ? Is your script available somewhere ?

Thx ! :)

Agents are basically a raw version of a unit, as far as I understand it.

There's also no group needed for an agent, similar to a vehicle.

Units come with their predefined routines needed for combat, agents don't, they basically can't handle weapons (as far as I tried, heh).

Agents are usually used for animals, since the cpu cost is minimal.

Always thought releasing this as a seperate package, right now it heavily depends on other functions in my library and splitting them up and having it work would be too much work right now.

I'd rather release the entire package containing all the other good stuff and make it as modular as possible.

We'll see about that, heh.

Share this post


Link to post
Share on other sites
Somehow my post vanished.

I made a civilian FSM for agents, been able to spawn around 2000 on the entire map,

with enablesimulation, hideobject and using variables to save current states,

the FSM can be exited so there's actually 0 cpu power being used on those agents out of sight.

FPS with around 100-150 civilians active is around 45-55 with my 4770k and 770,

reducing that number to 80 civs active gives me nearly no fps loss.

Civs got their own jobs, stay at the work place during their individual assigned shifts and use their free time to go shopping,

to the beach, visit nearby cities and of course they need some sleep too, the older they are the less sleep they need/get (but only after work is finished, being unemployed has its advantages here).

The entire population is permanent, no agent is being respawned

and the player can interact with them through a semi dynamic conversation system,

can get intel from them, ask about recent events and ask them where all their women went.

so there's actually stuff going on aswell.

Looking at that pic there's ~250 civs in the town and it still looks pretty empty.

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

But I'm giving away too much already, hoping no one will find this thread, heh.

However something weird is happening if I'm getting close to 3500 agents (around 3000 civs and ~500+ animals) on the map, they sometimes shift into a bugged state, warping halfway into the ground having the arms spread down their sides with the entire body blinking.

Probably the engine getting the better of it, heh.

The biggest bottleneck with this approach is totally the GPU, the character detail is just too high to allow higher framerates with more than 80 civs and a 770.

Wow, that's impressive. I've been using the Civilian Occupation System script for my server, and we get an average FPS at about 30-35 with about only 40 civilians spawned in. I'm glad to see bigger numbers are possible!

I'll be looking forward to see what will come from this!

Note: I love your other stuff as well! I might check those out actually.

The coding can be done regardless of that video being helpful or as offense material against BI to fix up arma which of course they should.

However, as I have said, this can be done by creating a trigger on nearby units or vehicles, and then getting the distance of the closest target to slow down or stop.

Here is an example: (I am not on ArmA 3 at the moment, but it should be something like this)

_target = _vehicle nearobjects ["unit_classname", 30];
_targetDist = _driver distance _target;
_vel = velocity _vehicle;
_dir = direction _vehicle;
_speed = 10;



If (_targetDist < 30) Then


for "_i" from _vel to 0 step -1 do
{

 for "_o" from 0 to 3 do
 {
  _vehicle setVelocity [
  (_vel select 0) - (sin _dir * _speed), 
  (_vel select 1) - (cos _dir * _speed), 
  (_vel select 2)];

 };
};
};

Kind Regards,

Rawner135/Ranwer

NOTE: It's suggested that you take lessons in Physics and IPT

Hm, how would triggers be deployed when civilians are spawned in by script? I imagine that has to employed within the script itself, not inside the map editor?

Or does that still apply? For whatever reason, I feel like this would only apply if the civilian units themselves were deployed via mission editor. Correct me if I'm wrong.

Edited by DaFuzzyOne

Share this post


Link to post
Share on other sites
On 6/11/2015 at 3:08 PM, Grumpy Old Man said:

AI are walking on sidewalks but barely so, they're always one leg into the road.

I prefer to spawn them at mission init, way faster since simulation doesn't run yet.

  Hide contents

The number of civs is not that much of a problem when using agents, can easily run 5x as much on screen than using units.

With most recent adjustments I can run 350 active civs in Zargabad, ~280 in takistan (tested at rasman and nagara) with fps not dropping below 35.

spgJdTc.jpg

Once you leave those dense areas and only enter small villages fps usually are capped at 60, barely ever dropping to 55.

Again, I'm running a 4770k at 4.5 and a 4gb 770.

For now I limited the civ count to 1 civ per building around 400m of the town location, with a max of 150 + (random 150*0.3).

Gives an authentic feeling to locations that are pretty small and ignores weird configured maps (huge cities defined as nameVillage etc)

I'm using agents, disable the AI stuff like FSMs etc., and run my own civ.fsm.

On top of that I pull all possible data out of the map at mission init, like building positions,

towns, specific job related buildings, selectBestPlaces etc.

Really helps to improve performance a ton. Just imagine running BIS_fnc_buildingPositions for 3000 civs every once in a while, heh.

I tried some user made SP mission "sandboxes" back in A2 and now in A3, I absolutely dislike it when I scout out an area, move in and suddenly there's AI spawning 200m in front of you (especially when it's tanks).

You can totally avoid that with a somewhat smart approach and a bit of planning.

setDestination works fine to me, for some unknown reason I can't get AI dogs to run to a position, no matter if spawned as units or agents, even disabling the animal behaviour variable doesn't do anything.

Civilians are working fine.

 

Hey @Grumpy Old Man, do you still have a mission with your Civ FSM lying around?

 

Would really like to try your approach since most CIV scripts tank my FPS upon reaching 20+ Civs 😞 

Share this post


Link to post
Share on other sites
3 hours ago, LSValmont said:

 

Hey @Grumpy Old Man, do you still have a mission with your Civ FSM lying around?

 

Would really like to try your approach since most CIV scripts tank my FPS upon reaching 20+ Civs 😞 

I still have it, but as stated above, it's probably better to rewrite it from scratch than having to rip it out of the framework and trying to get it running, since it relies on quite a few functions from my own library (map evaluation etc.)

 

Cheers

  • Like 1

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  

×