Jump to content
Sign in to follow this  
TRexian

JTD Ambient Civilian Traffic module

Recommended Posts

Hey Ice - in case it matters, I don't know that the houses actually have to be "closed", they just need the right memory points. If you can add them to existing models, great. Also, I've kinda thought of just creating generic models with those memory points to allow them to be placed more manually, if that makes sense.

Anyway, from the ALICE Biki:

number of buildings with door (memory points called "AIDoor1", "AIDoor2", ...)

Share this post


Link to post
Share on other sites

I know how it works, we added the "doors" to A1 buildings we use on Duala. All houses are open on Panthera, therefor civilians cannot "hide" inside?

Share this post


Link to post
Share on other sites

Sounds exciting! Can't wait for both next Duala and especially the Desert one (I like sand :)).

Unfortunately I haven't had much luck with the rarity thing TRexian.

I placed the ALICE Module alone and in its init line put:

BIS_alice_mainscope setvariable ["vehicleRarity", ["ffaa_civil_agf_4",0.1,"Assistant",0.9,"Citizen1",10,"Citizen2",10,"Citizen3",10,"Citizen4",10,"Doctor",10,"Functionary1",10,"Functionary2",10,"Pilot",10,"Policeman",10,"Priest",10,"Profiteer1",10,"Profiteer2",10,"Profiteer3",10,"Profiteer4",10,"RU_Assistant",10,"RU_Citizen1",10,"RU_Citizen2",10,"RU_Citizen3",10,"RU_Citizen4",10,"RU_Doctor",10,"RU_Functionary1",10,"RU_Functionary2",10,"RU_Pilot",10,"RU_Policeman",10,"RU_Priest",10,"RU_Profiteer1",10,"RU_Profiteer2",10,"RU_Profiteer3",10,"RU_Profiteer4",10,"RU_Rocker",10,"RU_Rocker2",10,"RU_Rocker3",10,"RU_Rocker4",10,"RU_SchoolTeacher",10,"RU_Villager1",10,"RU_Villager2",10,"RU_Villager3",10,"RU_Villager4",10,"RU_Woodlander1",10,"RU_Woodlander2",10,"RU_Woodlander3",10,"RU_Woodlander4",10,"RU_Worker1",10,"RU_Worker2",10,"RU_Worker3",10,"RU_Worker4",10,"Rocker1",10 ,"Rocker2",10,"Rocker3",10,"Rocker4",10,"SchoolTeacher",10,"Villager1",10,"Villager2",10,"Villager3",10,"Villager4",10,"Woodlander1",10,"Woodlander2",10,"Woodlander3",10,"Woodlander4",10,"Worker1",10,"Worker2",10,"Worker3",10,"Worker4",10,"Worker4",10,"Worker4",10]]; BIS_alice_mainscope setvariable ["civilianCount","50"];

Which, according to the biki should have disabled everything (number 10) apart from the women, the arab guy and the assistant. When I tried it out, everyone was spawning like normal. I then tried switching the extremes, same result.

Of course its possible that I misunderstood how the rarity thing works.

Share this post


Link to post
Share on other sites

Ok, lads, wee update.

I have re-structured the spawning of civs, to divorce it from the BI functions spawnGroups and spawnVehicle, so it will strictly look at the civilian array when spawning. I've also *seriously* cleaned up the scripting so it is more efficient, or at least looks more efficient. :) Just ironing out a wrinkle with a new function that gives the civs guns, but I think I have it sorted.

@ Harlow - probably won't have anything ready by Sunday, though. :( On the vehicleRarity issue, maybe try calling it civilianRarity instead? It almost looks like there's a typo with what the variable is called? Indeed, in the ALICE main sqf, it referst to the variable "civilianRarity":

_unitrarity = if (format ["%1",_logic getvariable "civilianRarity"] == "<null>") then {[]} else {_logic getvariable "civilianRarity";};

Haven't tracked down how the number works, though, so your guess is as good as mine on that issue. :)

Will take a bit longer (probably a couple weeks) for me to completely wean this from ALICE. In fact, I may make it a boolean, so that people can choose whether to use ALICE or not. I'm not sure how easy that will be, yet, though, in terms of setting up my own trigger, etc.

Share this post


Link to post
Share on other sites

This is outstanding and pioneering work Trex. Your work on this has given me a lot of insights on some interfacing with ALICE that I am looking at...so, thanks for this module and the work going into it!

Share this post


Link to post
Share on other sites

Thanks. :) Ironically, I remember reading your Sahrani electrical grids stuff, and found that amazing and immersive! Funny how inspiration/motivation can come full circle.

But, now you've piqued my curiosity about what other interfacing with ALICE you're working on! ;) Perhaps a PM or link to your work?

On a related note, I think I've figured out a potentially simpler addon to achieve a similar effect with this. I'll mention it here, in case some other developer wants to follow up on it.

In the ALICE config, there is a certain action:

class CfgCivilianActions
{
class BIS
{
	class drive
	{
		condition = "_twnthreat <= 1 && _twnthreat >= 0 && !isnil 'bis_silvie_mainscope' && {_x getvariable 'ALICE_threat' <= 1} count _nearbyTowns > 0 && getnumber(configfile >> 'cfgvehicles' >> typeof (_this select 0) >> 'woman') == 0;";
		fsm = "ca\modules\alice\data\actions\safe_drive.fsm";
		rarity = 0.01;
		locked = 1;
		canRepeat = 0;
	};
};
};

It seems like someone could rig a config to change the rarity and probably the conditional to see if ALICE could spawn more drivers indigenously. That's pushing the edge of my ability to config and test, though.

Share this post


Link to post
Share on other sites
Thanks. Ironically, I remember reading your Sahrani electrical grids stuff, and found that amazing and immersive! Funny how inspiration/motivation can come full circle.

But, now you've piqued my curiosity about what other interfacing with ALICE you're working on! Perhaps a PM or link to your work?

Funny indeed! Thanks for the kind word in turn!

As far as what I am working on...I am actually working on the succesor to SEG for A2/Chernarus (still very early in development as I have only been back scripting for a few weeks after a two year hiatus and the electrical "infrastructure" on Chernarus is a lot more complex than Sahrani).

As you may recall SEG only controlled the street lamps on Sahrani because there was no good/easy/practical way to deal with other light sources. However, with the addition of ALICE in A2 there are house lights to consider (part of the house effects component of ALICE along with chimney smoke). I got the idea from reading a post by Andy455 where he brilliantly (pardon the pun) included the ALICE houselights in his code.

I think Andy's idea is great because it would be lacking to turn off street lamps but not house lights when power to an area is cut off. However, I need to expand on it because like in SEG, my current project will also allow the mission maker to have players manually shut down power without having to damage the substations. In order to do this, I need to be able to turn off the house lights and then later turn them on again if power is restored without interfering with how ALICE handles each house. This is where your work has been extremely helpful in helping me navigate through ALICE.

On a related note, JTD city functions has inspired me to look at using the principles you established within it to see if I can later implement a universal electrical grid addon that will work on any island as long as crucial location information (city centers, neigbors, etc.) are properly defined for the island (this project is still a ways off though...)

So, again thanks, and I may hit you up for some advice if you don't mind!

Share this post


Link to post
Share on other sites

Aah.. I'll try renaming it to CivilianRarity and see what that does. But awesome news on your update though :)

About tomorrow -- no problem at all at all. The game on Sunday will be on Chernarus anyway, using standard civilians (we'll be using the arab civilians in a few weeks still), but I will be using your addon on there and and will let you know how things get on with the full house there! Looking forward to it actually.

Share this post


Link to post
Share on other sites

@Harlow - sounds good! :)

@LG - that solution by Andy is, indeed, brilliant! And, it would actually meld well with the city functions, that can get the location of urban areas! On that note, I'm also planning on re-vitalizing the city functions to get the Ambient Traffic apart from ALICE. I'll let you know how that goes. I don't think there'll be a major overhaul - but those were some of the first serious scripts I wrote, so maybe there will be! If you have any ideas or see areas for additional functionality, let me know.

I'd love to dissect DAC and be able to have non-rectangle/oval shapes, but... I think I'd need a brain cell infusion for that... ;)

Share this post


Link to post
Share on other sites

Update:

Well, I'm working through a 75-90% rewrite of the whole system. In the last 24 hours, I've kinda reached a decent alpha stage. :)

Goals:

- spawn civs only from civ array (if specified) - done

---- (this effectively makes it non-dependent on ALICE, also)

- allow mission designer to use markers to specify where to spawn civs - done

- spawn traffic in a similar way to the original module - done

- if no markers specified, use city functions - still testing

- modifier for how many civs to spawn within designated area - not implemented

- change spawning methodology to better reflect whether the marker is a circle or rectangle - not implemented

No timeline for the new version - at least a couple weeks. (3-4 weeks is the old joke.) ;)

Share this post


Link to post
Share on other sites

TRexian: please also test on Panthera 2.6, cities should be connected to at least 2-3 neighbours for AI to travel to.

Share this post


Link to post
Share on other sites

Sure. :) Getting tired of testing on Utes, anyway. ;)

Does it have theater-specific civs, or can I just use the BI default?

Share this post


Link to post
Share on other sites

Heya TRexian,

great to see your progress! Sounds awesome :)

If you need any extra multiplayer testing done, let me know and we'll give it a go!!

Share this post


Link to post
Share on other sites

No doubt I will. :)

I'm hoping that this addresses the waypoint issue for vehicles in MP, too.

I'll also probably include that trash module as an option, too.

Share this post


Link to post
Share on other sites

Cool :) Looking forward man!! Will definitely save from having to manually place the upcoming Isla Duala civvies (or currently the FFAA Arabes).

Share this post


Link to post
Share on other sites

I wonder what ALICE 2 will have in Operation Arrowhead.... traffic maybe? :D (Look at the top of the dropdown list.)

ALICE2.jpg

Would be kinda cool if (another) one of my projects is made redundant by actual in-game features. :)

Share this post


Link to post
Share on other sites

I was reading those earlier and I'm pumped to see it. The whole town spawn feature is pretty wicked in and of itself. And 3 maps!(I hope)

---------- Post added at 03:43 PM ---------- Previous post was at 03:42 PM ----------

TRexian: please also test on Panthera 2.6, cities should be connected to at least 2-3 neighbours for AI to travel to.

How are you setting this up on your maps?

I see some stuff but it's just a few cars in a few places.

Share this post


Link to post
Share on other sites

Hey 'zilla - was that question to me or Ice? :)

One thing I'm implementing is a way to use markers to set the areas where the civs will spawn, not just cities/towns.

Share this post


Link to post
Share on other sites

Heya IceBreakr-

This spot might look familiar:

ACT_02a_Panthera01s.jpg

;)

That's an early test on 2.6, with just ALICE. Basically, the same implementation as the first version of my module, which means that the old version should work. I think. :)

It also looks like the city functions... function.

ACT_02a_Panthera02s.jpg

That's a good sign. :)

Edited by TRexian

Share this post


Link to post
Share on other sites
Hey 'zilla - was that question to me or Ice? :)

One thing I'm implementing is a way to use markers to set the areas where the civs will spawn, not just cities/towns.

Sorry missed it.

It's directed at either of you. The marker thing sounds like a great idea.

Are those pictures from a new version of this Module? That looks awesome.

Share this post


Link to post
Share on other sites

Yeah, sorta. :)

I'm afraid that, as it is evolving, it is becoming more complicated (I guess that's part of what "evolution" means). I'll probably need to make a pdf to document how to fully use it. However, the basic functionality will remain - I'm just layering additional options over it.

One of my "design standards" is that stuff should work without any input from the user. That is, there should be some nominal, default gameplay by just placing the module. (Ideally, it won't even *need* the hpp - so that should reduce the emails/PMs I get, too.) After that, the hpp, or the variable settings are tweaking/personalizing.

So, the layers I'm planning on adding:

- No need for ALICE: there will be a CPU cost to spawning my own civs, but if someone doesn't want to use ALICE, they don't have to.

- To allow for no ALICE: the city functions will spawn civs and traffic.

- So as not to spawn everywhere: the ability to use markers to specify what areas will spawn civs and traffic. So, if a mission only takes place in one city, there's no reason to spend the CPU cycles spawning civs elsewhere. This will require the mission maker, though, to list the marker names in a variable in the init line of the module. Not a big deal, but it will require the pdf manual. ;)

I also recently came across a script that generates "gaussian" random numbers. That is, the randoms should generate in a bell curve. For me, that is cool because I can generate spawn points that tend to be towards the center of an area. In cities/towns, that tends to be where people congregate, so it should provide a more organic feel to the spawning.

Otherwise, the "feel" of the module should be about the same.

Share this post


Link to post
Share on other sites

Ok ladies, alpha version (really more like beta, but close enough) of version 2 is here:

http://www.mediafire.com/file/nuzr2d1zozg/JTD_ACTON_2a.zip

I'm reluctant to have the wonderful community mirrors host it yet, only because it has only been tested by me, and it isn't signed. If you guys decide you want to, no problem, but if this goes well, I'll probably have a signed version within a week or so.

(Famous last words, those.) ;)

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.

Feedback is not only requested, but required. :)

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.

Share this post


Link to post
Share on other sites

Can a certain percentage of civs be made to WALK from one town to another?

And if they can be made to walk, can they be made to hitchhike if you stop to pick them up?

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  

×