Patrol paths
-
From Buck Danny’s Tutorial:
edit…ewww, copy and paste from a pdf looks ugly lol. Note the part at the bottom I put in bold.
Behaviour = trade (area-zones)
The behaviour is different depending on where you meet them in the area. The ships will randomly spawn in
the zone, their actual behaviour depends on where you are in the zone.
Behaviour near bases
When the ships are spawned in the vicinity of the base docking bay or ring (within normal scanrange, approx.
2K) the ships will use the docking facility when a certain condition is true, but only then. In the mbases.ini
section for the base involved you will find declarations starting with [BaseFaction] followed by “faction =
any_grp”. If the faction that is used in the encounter is also declared here than the condition is true. In that
case the following behaviour for ships originated from this faction can be observed, but for their ships only.
When you enter space from the base, there have already some ship spawned, these ships might dock.
Later ships will spawn in the docking ring and they leave the base and will fly to another random dockable
object. A sporadic spawning in the area might be noticed, followed by docking. All leaving ships have a full
cargo-hold. The commodity they carry is randomly choosen from the commodities listed in the factions
commodities list. This can be found in the commodity_per_faction.ini.
All docking ships of this faction have an empty cargohold. Other factions will not dock.
It is likely that because of this behaviour that zones with this encounter type are created near bases.
Behaviour near jumpholes and jumpgates
Ships spawn in the area, the ones with a full cargo-hold will fly to the jumphole and dock (here the
commodity-type is random choosen from the list in the commodities_per_faction.ini for this faction). The ones
with an empty cargo-hold will fly away and eventually dock elsewhere in the system.
Behaviour in the zone, away from dockable objects
The ships that spawn here will carry no cargo and will fly at cruise speed to a random dockable object in the
system.
Behaviour = trade (path-zones)
Usually the (trade) path is between a base and a jumpgate, jumphole, tradelane or other base. The ship will
follow the path one way, clockwise or counter-clockwise and then dock. Traders will spawn anywhere along
the path. After spawning the trader will start following the patrol path in either direction at cruise speed,
clockwise or counter-clockwise. The patrol path can consist of 1 leg only or a multi path pattern with virtual
waypoints. (see Path-route)
When watching an object you can observe 2 different behaviours. When you are flying along the path
towards the object, spawning ships virtually spawn from the object. When you are within approx. 1.5K of the
object, you’ll see docking ships only.
Note! If you are wondering why encounters that are obviously designed to be traders carry no cargo, your
answer can be found here. I have not come across one that carried cargo. Although the name of these
encounter types and their job suggests the (random) presence of cargo, they are not carrying cargo. In the
table on page 5 you will find quite a lot of trade encounters that have behaviour = patrol_path.
You could change their behaviour to trade as it’s name suggests. If you do so, the encounter will randomly
carry random cargo. But will also have a different behaviour, they don’t do patrols, they will fly the path only
once and dock or disappear. They will spawn alongside the path. -
@ Thaddeus
Excellent, knew somebody had the answer, well done Thaddeus. You’re quite right of course, it’s the
class_fighter_smuggler
line in npcships i was missing, had all the fighter ships defined as
class_fighter.
Means i’ll have to make some new entries of course but that should cure it. Nice one
I tried changing the behavior in MISSIONS/tradep_trade_freighter_pirate.ini and changed the behaviour line to trade, but then the dumbasses ignored the patrol path through the minefield via the tunnel i’d created, and all decided to take a shortcut through the minefield and blew themselves up lol. Guess i’ll have to live with them not carrying anything. One other option is i give them some goods in the loadouts.ini, least that way they’ll have something.
*** EDIT ***
All working as it should, all three patrol types now showing up Even got them carrying cargo lol
-
Due to the many issues associated with patrol paths, i’m still of the opinion that some of them don’t work. Now this could also be a problem at my end, but after some more than careful checking of files why do some paths work and others not? Forget the issue at the top of this thread as that was my error lol
Looking through the code of New York (Li01) where we all know the paths seem to work ok, why are all the patrol paths for legal and illegal fighter factions the same? Namely this one patrolp_assault. This is used by all the pirates, police and bounty hunters even though if you care to browse through the MISSIONS/ENCOUNTERS folder, you will come across numerous other types of patrol paths that just don’t seem to be used. I’m starting to work out why lol
*** EDIT ***
Ok, so things i’ve noticed so far. With patrolp_assault, it seems you should have this line in the patrol path, pop_type = field_patrol. They all have it, doesn’t seem to make a difference if the path goes into a nebula, asteroid field or empty space.
For those that have tradelanes in their mods, another one i came across that works is this,
patrolp_gov_patrol, which seems to be used with tradelanes because they all have the pop_type = lane_patrol line added to the patrol path.Will report back when i find some more that are stable
-
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