Patrol paths
-
Invaluable work gibbon
I carry the Buck Danny tut (printed & stapled) around in with my “paper” dev files (my backpack… lol) but even he drew a few blanks on paths & their use… mainly in the “adding new ones” variety… I myself hate the things and rarely use them in custom systems, due to lack of good knowledge on the matter… but there are still those vanilla paths… and the problems they can cause at times.
Keen eyes are focused on further findings in this area… 8-)
-
Buck Dannys tutorial is helpul, but there are gaps. I mean it’s possible for ships to carry cargo while on a patrol, you just need to know how to get round the problem.
One of the things i’m doing is checking known working paths in vanilla and figuring out by comparing them to similar paths, why they work. So far i’ve had 100% success which is clearly a good thing as they are running around in my mod on their errands being totally annoying in some cases lol.
I’ll be looking at transport paths and freighter ones next.
I’ll keep this thread updated as i experiment and add stuff to my mod.
A little run down on some of the important things,
[Zone]
nickname = Zone_SL03_path_solpoliceforce01
pos = -28022, 0, -2246
rotate = 90, -75, 180
shape = CYLINDER
size = 750, 6605
sort = 99
toughness = 2
density = 1
repop_time = 30
max_battle_size = 4
pop_type = field_patrol <<<<< ONLY CERTAIN ONES WORK
relief_time = 20
path_label = solpoliceforce_01, 1 <<<<< IF MORE THAN ONE PATH IN THE PATROL, THESE NUMBERS MUST BE CONSECUTIVE, 1,1 1,2 1,3 AND SO ON
usage = patrol
mission_eligible = True
faction_weight = sl_p_grp, 1
density_restriction = 1, patroller
density_restriction = 1, police_patroller
density_restriction = 1, pirate_patroller
density_restriction = 4, lawfuls
density_restriction = 4, unlawfuls
encounter = patrolp_assault, 2, 0.100000 <<<<< CAN BE USED BY LEGAL, ILLEGAL & BOUNTY HUNTER FACTIONS
faction = sl_p_grp, 0.100000 -
Here’s another one that works, at least for me. As usual i’ve compared it to known code and made sure the important parts are the same.
patrolp_gov_patrol
So far only come across this encounter for use with tradelanes. Important line of code in the patrol path is this one,
pop_type = lane_patrol
This defines the behaviour of the police in this case. Can be used by navy factions as well.
I’m not saying that you can’t use other population types in the encounter as i don’t have time to test all of them, but i know for a fact this one works as i’ve just spent the last hour “on patrol” with my Sol Police Force going up and down every tradelane in my Earth system. Important tip also is to make sure your faction has an entry in each base in mbase.ini where you want to run the patrol path so it should go something like this,
A. Start base (with your faction present in mbase.ini)
B. Patrol path starts from base
C. Set path along tradelane
D. Finishes at base B (with your faction present in mbase.ini)The ships will take off from base A, fly next to the tradelane giving assistance should you come under attack from some nasty pirates who’ve disrupted the tradelane, then land at base B.
Keep the above points in mind and this will work without fail, does for me lol
-
Decided to try tradelane attacks before i move onto freighters and transports.
Discovered two types of patrol path are used for these, remembering these are used in this case for pirate factions, they being,
patrolp_pirate_patrol
with the population type
pop_type = field_patrol
and the second one is
patrolp_assault
with the population type
pop_type = attack_patrol
Now then, the interesting bit. You must make a path to the tradelane, one along the stretch you want to attack, and then one leaving the tradelane. The path leading to the trade lane, the one leading along the trade lane and the one leaving the trade lane have this extra bit of code added,
attack_ids = 18 <<<<< Seen different numbers used
tradelane_attack = 30 <<<<< I suspect this is an attack chance pecentageUnsure of the meaning of the ids number as i’ve already mentioned, seen about 3 or 4 different numbers used, this might be an attack preferance or some sort of behaviour manager. Not sure
Without adding those two extra lines, naff all will happen and the pirates will simply fly the route without attacking so make sure those are added.
-
The attack_ids is (or at least should) the same as the lane_id of the lane that is to be attacked. The lane_id can be found in the tradelane zone.
Also, it seems that pop_type = attack_patrol is used far more often than pop_type = field_patrol for patrolp_assault encounters, even when the path doesn’t attack a tradelane. The use of pop_type = field_patrol seems to be confined mostly to the Liberty systems.
MK
-
mknote wrote:
The attack_ids is (or at least should) the same as the lane_id of the lane that is to be attacked. The lane_id can be found in the tradelane zone.Also, it seems that pop_type = attack_patrol is used far more often than pop_type = field_patrol for patrolp_assault encounters, even when the path doesn’t attack a tradelane. The use of pop_type = field_patrol seems to be confined mostly to the Liberty systems.
MK
Hmmm, interesting. I’ve looked through the code for Colorado and what you say seems to be how things should be. Problem i have is that the tradelane attacks still happen in my mod and the lane ids is different to the one in the patrol which maybe a recipe for something horrible about to happen. I’ll match them up and see if it still works.
Do you know what the tradelane_attack = 30 line is all about? Is it a percentage thing as i suspect?
My point about the encounters was simply to show which ones work, and both of those do. I’ve not had any crashes using the field patrol encounter as i set one tradelane to be attacked using that one and the other tradelane using the assault encounter. Both work fine.
Cheers for the info, off to test some more…
*** EDIT ***
Well tested some more, with surprising results. The tradelane_attack line indeed seems to be a percentage for the attack, the higher the number, more chance of attack. Also, while both types of encounters work, the one using the patrolp_pirate_patrol coupled with pop_type = field_patrol yields far more regular disruptions than the other encounter. Bear in mind my mod is a total conversion one and while this code maybe more liberty based, it works far more regularly. Hmmm
-
Moving on to Bounty Hunter patrol paths. These all seem to work ok although they all seem to use the same path which is this one,
patrolp_bh_assault
I’ve looked in Li01 and Hi02 for comparison. There is another patrol path which i haven’t tested which is this one,
patrolp_bh_patrol
but it doesn’t seem to be used.
The population zone used with the first patrol path has two possible options that work, they are,
pop_type = field_patrol & pop_type = attack_patrol
This whole thread invites anyone else to chime in lol. I don’t claim to know everything about these, just trying to find out how to make them stable and use recognised formats to make them work
-
tradelane_attack = 30 <<<<< I suspect this is an attack chance pecentage
Quick question regarding your suspicions. I disagree, so my question is - why? What is your rationale for suspecting it is an attack chance?
You may be right, but you’ve not said why you think this.
My view has a different (potentially wrong) opinion about what it is representing, based on this:- throughout Freelancer, what type of value is utilised as a “percentage chance”…Looking at that value, intuitively to me, it is not a percentage chance - simply based on observations of FL code from years ago.
A lot of this seems logical. So for your path label. Why do you think it must be consecutive? It seems logical and very sensible for me, but you say it must be consecutive. Can you guess why? I am guessing why, but people seem to be looking for patterns without actually thinking why the pattern may be there.
Again, with trade patrol, lane patrol - it seems obvious to me that this is defined somewhere - and not in the ini files. So where? Anyone looked to see what else may be around?
-
Hi Chips. The number is normally around 30 in most tradelane attack codes i’ve seen. I bumped it up to 80 and i get an attack nearly everytime i go through the tradelane. It seems the higher the number, the more chance i get attacked. That’s what i’ve noticed anyway.
On the consecutive path number point, that’s simple. It crashes unless it is consecutive. Say you have a patrol with three sections to it, they should be 1,1 1,2 1,3. The next patrol path should be 2,1 2,2 2,3. The simple fact is if it’s not like that, FL goes straight to a ctd. That’s why when you look at original patrol paths, they are all numbered like that. They must be unique.
As to the last point, the next point of call is to check the encounters and look up the relevant patrol ini file. In that are the various pilot jobs which you can then trace through pilots_population.ini. Still doesn’t explain why the pp’s can be buggy, but a simple ship not defined properly will happily crash a pp.
-
You might also find useful my hex offsets findings about tradelane_attck and patrol paths(see limit editing 101 thread not fox’s list(not all of them are included yet))
Buck_danny’s tutorial on encounters should have been updated long ago(it’s still really helpful anyway though).
Never had any problems with paths(until started to make them 10k)
About tradelane_attack: http://the-starport.net/freelancer/forum/viewtopic.php?topic_id=2216&forum=7
-
Gibbon wrote:
Here’s another one that works, at least for me. As usual i’ve compared it to known code and made sure the important parts are the same.patrolp_gov_patrol
So far only come across this encounter for use with tradelanes. Important line of code in the patrol path is this one,
pop_type = lane_patrol
This defines the behaviour of the police in this case. Can be used by navy factions as well.
I’m not saying that you can’t use other population types in the encounter as i don’t have time to test all of them, but i know for a fact this one works as i’ve just spent the last hour “on patrol” with my Sol Police Force going up and down every tradelane in my Earth system. Important tip also is to make sure your faction has an entry in each base in mbase.ini where you want to run the patrol path so it should go something like this,
A. Start base (with your faction present in mbase.ini)
B. Patrol path starts from base
C. Set path along tradelane
D. Finishes at base B (with your faction present in mbase.ini)The ships will take off from base A, fly next to the tradelane giving assistance should you come under attack from some nasty pirates who’ve disrupted the tradelane, then land at base B.
Keep the above points in mind and this will work without fail, does for me lol
Just a side note, it isn’t required to start and end at a base. Look, for instance, at Bw01.ini; the lane patrol starts and ends at a jump gate, and is only connected to Freeport One. Also, the patrol is patrolp_gunboats, not patrolp_gov_patrol.
MK