Ambient Civilian Traffic module

ArmA 2 editing; configs, modeling, missions, textures, terrain etc.

Moderators: Lone Wolf, Snake Man

Post Reply
T_Rex
FreeFalcon
Posts: 848
Joined: 2001-03-04 23:01:01
Location: here

Ambient Civilian Traffic module

Post by T_Rex » 2009-11-03 18:24:39

I'm working up a module that can be placed on a map with the Ambient Civilian module, that will create civilian traffic. There's a thread at OFPEC, but it is down, and I am pretty close to having a decent public beta to release.

The idea is that, similar to the JTD FireAndSmoke, there will be a hpp file in \userconfig\JTD that contains some user-customizable options. Generally, though, as ALICE spawns civs, there will be a chance that an additional civ will spawn, with a vehicle (and perhaps passengers, if appropriate), and drive around. Sometimes out of the city, and sometimes to the city from elsewhere. It should all clean up after itself, too.

(I guess this is an announcement of an announcement.) ;)

Here is a link to the most recent beta of the module, though:
http://www.mediafire.com/file/jg5ndw4vq ... ON1030.zip

Use is pretty simple:
Place an Ambient Civilian module on the map.
Place a JTD Ambient Civilian Traffic module on the map.

**REQUIRES CBA/XEH.
Sic Semper tyrannosauro.

Snake Man
Commander-In-Chief
Posts: 9338
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC
Contact:

Re: Ambient Civilian Traffic module

Post by Snake Man » 2009-11-04 06:56:50

Thanks for posting here, I guess there is always PMC Tactical if all others fail... ;)
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

T_Rex
FreeFalcon
Posts: 848
Joined: 2001-03-04 23:01:01
Location: here

Re: Ambient Civilian Traffic module

Post by T_Rex » 2009-11-04 14:17:09

hehe

You *know* I love PMC. :) Sometimes, you just want someplace comfortable to get feedback instead of the TERRIBLE signal to noise ratio at something like BI forum.

Don't get me wrong, BI forum has some great resources and ideas, and it is *the* place to really release stuff. But, I've found you have to sift through alot of crap to get anything decent.

IMHO, naturally. :)
Sic Semper tyrannosauro.

T_Rex
FreeFalcon
Posts: 848
Joined: 2001-03-04 23:01:01
Location: here

Re: Ambient Civilian Traffic module

Post by T_Rex » 2009-11-05 14:02:48

New version:
http://www.mediafire.com/file/gjmw2oekj ... ON1104.zip

Functionally, this will be the public beta version. I want to change the icon, and figure out what issues/tweaks there may be.

The zip has 2 files, the pbo and the hpp. The pbo goes into the \addons\ subfolder of your choice (ideally, @JTD\addons\) ;) and the hpp goes into \userconfig\JTD just like the FireAndSmoke addon uses.

The hpp has the following user-customizable parameters. (Unlikely anyone will really tweak these, but you never know.)
//Config settings for JTD_ACTON - ambient civilian traffic module.

// define percentage (zero to 1) of ALICE-spawned civs that will spawn traffic
// value greater than 1 becomes 1
// default is 1

#define JTD_ACTON_percent 1

// Traffic maximum concurrent vehicles allowed.
// default 50

#define JTD_ACTON_max 50

// Max cargo allowed percentage (zero to 1) - will modify randomization of cargo amount
// default 1

#define JTD_ACTON_maxCargo 1

// Minimum cargo allowed percentage (zero to 1) - will modify randomization of cargo amount
// default 0

#define JTD_ACTON_minCargo 0

// default vehicles
// can add custom vehicles by adding the "name"
// note that if you add a vehicle with a "crew" (like a military vehicle) the entire crew will spawn

#define JTD_ACTON_DEFAULT_vehicles ["Ikarus", "hilux1_civil_1_open", "hilux1_civil_2_covered", "hilux1_civil_3_open", "Lada1", "Lada2", "LadaLM", "car_hatchback", "car_sedan", "datsun1_civil_1_open", "datsun1_civil_2_covered", "datsun1_civil_3_open", "Skoda", "SkodaBlue","SkodaRed", "SkodaGreen", "tractor", "tractorOld", "UralCivil", "UralCivil2", "VWGolf", "TT650_Civ"]

// default civilians
// can add custom civs by adding the "name"

#define JTD_ACTON_civs ["Assistant", "Citizen4", "Profiteer2", "Functionary1", "Functionary2", "Citizen1", "Citizen2", "Citizen3", "Doctor", "Profiteer1", "Profiteer3", "Profiteer4", "RU_Assistant", "Rocker1", "Rocker2", "Rocker3", "Rocker4", "SchoolTeacher", "Villager1", "Villager2", "Villager3", "Villager4", "Woodlander1", "Woodlander2", "Woodlander3", "Woodlander4", "Worker1", "Worker2", "Worker3", "Worker4"]

// Define percentage (zero to 1) of time spawned civ will be armed with AK
// default is .5; make 0 if no civs to be armed
#define JTD_ACTON_civAK .5
Couple things - I had to create an array of civilians because the BIS function spawnGroup doesn't appear to spawn civilians.
http://forums.bistudio.com/showthread.php?t=89751

And yes, you can arm some of the civilians. :) In most places where there is conflict, the civilians at least have access to some kind of firearm (usually an AK). At this point, this only affects the civs spawned for the vehicles, but I've used it in a different context to arm ALICE civs.

Also, there is a chance that the passenger seats will also be occupied by riders. Carpooling is important for the environment, even in Chernarus. :)

Otherwise, it is pretty simple.

Place the ALICE module. Place the JTD Ambient Civilian Traffic module. Go from city to city and see the civs drive around.
Sic Semper tyrannosauro.

T_Rex
FreeFalcon
Posts: 848
Joined: 2001-03-04 23:01:01
Location: here

Re: Ambient Civilian Traffic module

Post by T_Rex » 2009-11-24 15:51:17

Updated version!
http://www.mediafire.com/file/moy5e2zmz ... TON_01e.7z

This one allows for mission makers to specify/override the hpp settings. :)
Sic Semper tyrannosauro.

T_Rex
FreeFalcon
Posts: 848
Joined: 2001-03-04 23:01:01
Location: here

Re: Ambient Civilian Traffic module

Post by T_Rex » 2010-05-16 02:26:44

Ok ladies, alpha version (really more like beta, but close enough) of version 2 is here:
http://www.mediafire.com/file/nuzr2d1zo ... TON_2a.zip

Anyway, there is a readme, but it could probably stand to have a fuller pdf to really detail how it works. There is quite a bit changed in the mechanics of it, but here is the portion of the readme that covers the major changes:
ADDITIONAL FUNCTIONALITY IN VERSION 2

Implementation:
ALICE -
This is the same implementation as in version 1. Place an ALICE module, and the traffic will spawn any time an ALICE civ spawns.


Config cities/towns -
By default, civs will spawn in all cities/towns identified in the config for the island. However, this is time-consuming at the start of a mission if there are many such cities/towns. Plus, on a map with many cities/towns, it is possible to quickly run out of available groups to spawn civs in. Something is different from ArmA1, and the trigger formulation I used before now results in civs being spawned immediately. So, the first ~100 groups of civs will be assigned to the first cities/towns in the config.

Markers -
By placing markers in areas where you want civs, they will only spawn in those locations. To accomplish this, you MUST set the JTD_civMarkerArray variable.

JTD_civMarkerArray - array - default = nil;
** This is required to designate which markers will spawn civs. In the init line of the module, write:
this setVariable ["JTD_civMarkerArray", ["nameofmarker1", "nameofmarker2"]];

In that example, you have named the markers nameofmarker1, nameofmarker2. You can have as many markers as you need. Also, you can overlap or "nest" markers in various areas. Have a big marker over an entire city, then smaller markers in neighborhoods where you want more dense concentrations of civs.
I've tested all 3 implementations in Utes, Pantera and Chernarus (and elsewhere). The marker way is really best from a designer perspective, and while the city function method is easiest, it really isn't workable for maps like Chernarus, and even Pantera, where there are many defined cities in the config. (I'm going to have to build in some error-catching or limit the city functionality somehow.) ALICE is the best balance between easy and effective in that instance.

Anyway, apologies for mistakes that are sure to be in there. I am (again) pushing the edge of my scriptological skeels with this. You all are just along for the bumpy ride! And thanks for the support.
Sic Semper tyrannosauro.

Snake Man
Commander-In-Chief
Posts: 9338
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC
Contact:

Re: Ambient Civilian Traffic module

Post by Snake Man » 2010-05-16 08:45:12

Thanks for posting.

I prefer plain text readmes, they are easy to read and so worth. Of course when you get into heavy use/need of images, then PDF's come along nicely.

Also, you don't happen to have some promo videos for it?
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

T_Rex
FreeFalcon
Posts: 848
Joined: 2001-03-04 23:01:01
Location: here

Re: Ambient Civilian Traffic module

Post by T_Rex » 2010-05-16 17:38:18

Ah... video.. that's not a bad idea! :) I've certainly used plenty of utube tutorials for various things. I should do something like that to both promote this and to show how to use it.
Sic Semper tyrannosauro.

Snake Man
Commander-In-Chief
Posts: 9338
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC
Contact:

Re: Ambient Civilian Traffic module

Post by Snake Man » 2010-08-19 06:48:44

Any updates?

Also I'm probably totally confusing these two things together, but have you seen what Shuko (shk in BIS forums) is working on? youtube link.
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

T_Rex
FreeFalcon
Posts: 848
Joined: 2001-03-04 23:01:01
Location: here

Re: Ambient Civilian Traffic module

Post by T_Rex » 2010-08-19 13:04:59

Ah - no, not so much in terms of updates. Well, sorta. :)

I had decided against further development of this, since OA seems to implement many of the things I had either already done, or was working on. But now, it seems like there are still MP issues with it, which I think mine resolves.

So, it was off, but now it might be back on! :)

And I *hadn't* seen SHK's stuff! I'll see if he's posted at BI, and if not, I'll PM him. :)
Sic Semper tyrannosauro.

T_Rex
FreeFalcon
Posts: 848
Joined: 2001-03-04 23:01:01
Location: here

Re: Ambient Civilian Traffic module

Post by T_Rex » 2010-11-05 14:35:16

Simultaneous release at BI of this....

Here is a dev version. If I get some positive feedback, I'll make this an 'official' version.
Download:
http://www.mediafire.com/file/u3szfamiw ... N_02dev.7z

This DOES NOT include the hpp. It should work with the one from earlier. (Actually, it may even work without one, but I haven't really tested that yet.)

Readme stuff:
Readme for the JTD Ambient Civilian Traffic module for ArmA2
Ver. 02b-dev Nov. 5, 2010

JTD:
-- DMarkwick
-- ReconPathFinder
-- TRexian

Thanks to:
OFPEC
SNKMAN for modulizing posts
Rommel @ OFPEC for ideas
=====================================================
***IMPORTANT INFO***
The JTD_ACTON_config.hpp file now must go into a new folder, <ArmA2 root>\userconfig\JTD\. If you do not have this path/folder, make one. The archive is set up to make it automatically, if necessary.

=====================================================

Description:
This module, when placed in a mission, will generate civilians and civilian vehicles which will travel around the area.

Caveat:
This addon is very near to being obsolete, based on the improvements by BI of their ALICE implementation. I, for one, am happy to see my own work being superceded! I do still believe, though, that this addon can fill a narrow niche within the community. This addon does not rely on certain models, so it can be used on any map (as far as I know). It also allows the incorporation of custom civilians and vehicles, in case Chernorussian or Takistani civilians would be out of place. Plus, it just gives more flexibility for mission makers as to where civs spawn.

Requirements:
None
Optional:
- ALICE - the BIS Ambient Civilian module
- SILVIE - the BIS Ambient Vehicle module

Issues:
Framerate hits when a bunch of things spawn. Civs are generally persistent, once they spawn, they will continue to exist until killed, unlike BI modules

=====================================================
Installation:

The archive contains a folder structure \@JTD\addons - simply extract the archive someplace and place the @JTD folder in your ArmA2 root folder. There is also a folder structure for \userconfig\JTD - place the userconfig folder in your ArmA2 root folder, also. There is also a \keys\ folder that contains the JTD bikey - place this file in the \keys\ folder in your ArmA2 root folder.

(This is the same installation as the JTD_FireAndSmoke addon, which you should already have.) ;)

********************
LICENSE:

This package, as a whole and separately, is released under the terms and restrictions of the Creative Commons License - Attribution Non-Commercial Share Alike (cc by-nc-sa), which is hereby incorporated by reference into this document.

The contents of this package can be modified and built upon, as long as the resulting product is non-commercial, and includes attribution to JTD and/or Trexian. Such resulting products ("derivative works") must be licensed in the same manner as this package.

The author of this product may be interested in additional uses and/or licenses upon request.

In the spirit of community sharing, without which this addon wouldn't exist in the first place, all scripts can be viewed and purloined for further use, with credits, as long as the addon itself remains intact as per the official release.

=====================================================
Usage:
The module itself is found in the Modules portion of the editor, under JTD Ambient Civilian Traffic.

Module settings:
The first place the module 'looks' for variables is to itself, for certain setVariables. In the init field, use the following variables to over-ride the user hpp variables:
JTD_percSpawn = JTD_ACTON_percent;
JTD_maxSpawn = JTD_ACTON_max;
JTD_maxCargo = JTD_ACTON_maxCargo;
JTD_minCargo = JTD_ACTON_minCargo;
JTD_civAK = JTD_ACTON_civAK;
JTD_civArray = JTD_ACTON_civs;
JTD_cars = JTD_ACTON_DEFAULT_vehicles;
JTD_weapons = JTD_ACTON_wepArray;

For example, if you wanted to make a mission that had no civilians with AKs, then, in the init field of the game logic you would put:
this setVariable ["JTD_civAK", 0];

This would replace the local user's hpp value. You can also use this to substitute your own vehicles or civilians in the arrays, etc.

The second place the module will 'look' is the user's hpp settings.

Finally, there are default values for each of the settings.
JTD_percSpawn - number 0-1 - default .5;
Percentage chance that a civ will spawn.

JTD_maxSpawn - number - default 50;
Max number of civs that spawn.

JTD_maxCargo - number 0-1 - default 1;
Max percentage of available cargo slots that will be filled with civs.

JTD_minCargo - number 0-1 - default 0;
Min percentage of available cargo slots that will be filled with civs.

JTD_civAK - number 0-1 - default .25;
Percentage chance that civilians get weapons. (Set to 0 to disable.)

JTD_civArray - array;
Array of civilians that will be spawned. There is a default for Chernorussians:
["Assistant", "Citizen4", "Profiteer2", "Functionary1", "Functionary2", "Citizen1", "Citizen2", "Citizen3", "Doctor", "Profiteer1", "Profiteer3", "Profiteer4", "RU_Assistant", "Rocker1", "Rocker2", "Rocker3", "Rocker4", "SchoolTeacher", "Villager1", "Villager2", "Villager3", "Villager4", "Woodlander1", "Woodlander2", "Woodlander3", "Woodlander4", "Worker1", "Worker2", "Worker3", "Worker4"]

JTD_cars - array;
Array of cars that will be spawned. There is a default that is Chernorussian:
["Ikarus", "hilux1_civil_1_open", "hilux1_civil_2_covered", "hilux1_civil_3_open", "Lada1", "Lada2", "LadaLM", "car_hatchback", "car_sedan", "datsun1_civil_1_open", "datsun1_civil_2_covered", "datsun1_civil_3_open", "Skoda", "SkodaBlue","SkodaRed", "SkodaGreen", "tractor", "tractorOld", "UralCivil", "UralCivil2", "VWGolf", "TT650_Civ"]

JTD_weapons - array - default is stock A2:
Array of weapon choices for civs.
["Colt1911", "Makarov", "Huntingrifle", "AK_47_M", "AK_47_M"]

JTD_traffic - boolean - default = true;
Option to not spawn any traffic, just civilians. Set to false to disable the spawning of traffic - only pedestrians will spawn.

How to Spawn:*

1) Markers - you can designate areas to spawn civilians by placing and naming markers on the map. In the init line of the JTD ambient civilian module, place the array of those markers as a setvariable. For example:
this setVariable ["JTD_civMarkerArray", ["civmarker1", "civmarker2",
"civmarker3"]];

The module would then spawn civilians in those markers. The module settings would only apply to the markers listed in that module. So, you could have several modules handling different areas of civs.

2) Module-location (default) - in the absence of ALICE or an array of markers, the location of the module on the map will be the center of a 50x50 marker in which civs will spawn. In this case, there is an additional variable JTD_moduleRad that can chance the radius (an array [RadA, RadB]) for the spawning. To make the civs spawn in a 100x50 area, in the init line of the module:
this setVariable [JTD_moduleRad", [100,50]];

(The direction of the module, and the spawn zone, will always be North.)

You can place multiple modules, with different settings, on the map. You can also combine this method with the marker-array method, if you want.

*
This version removes the ability to use in conjunction with ALICE. BI has developed ALICE to the point where it was no longer necessary. Thank you BI! :)

=====================================================
***What's the downside?***

There may a performance hit for a mod of this nature. Also, the presence of civilians (some armed) and traffic can cause missions to play differently than expected.

***What should I watch out for?***

If you use JTD_ACTON in the ArmA2 editor, and you preview the mission, then you will get an addon dependancy written into the mission.sqm file. Exactly the same as if you'd used any other addon in your mission. If you wish to have your mission JTD_ACTON independent you should manually remove this entry with a text editor.

***What's next?***
I believe this addon is very near to being obsolete, which does not sadden me one bit. BI is doing an excellent job of upgrading their ambient civilian implementation with each release. As I said above, this is an addon for a narrow niche. I am not sure how much more to add to this, frankly!
Sic Semper tyrannosauro.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests