Important Message

You are browsing the archived Lancers Reactor forums. You cannot register or login.
The content may be outdated and links may not be functional.


To get the latest in Freelancer news, mods, modding and downloads, go to
The-Starport

Freighters. How do I make them... less stupid?

The general place to discuss MOD''ing Freelancer!

Post Fri Nov 05, 2004 3:09 pm

Freighters. How do I make them... less stupid?

It should be a simple question, but it has me stumped. Basically, I want freighters to break formation and engage in combat, just like fighters do. I do NOT want them to run away (thus turning on their cruise engines and becoming, in my mod at least, pirate food). I want them to do all of the standard behaviors seen in fighters.

Now, I've tried changing values in Pilots_Story, Encounters and other places... and thus far, it hasn't done a darn bit of good. Please, help me out here folks, I'm getting sick of watching heavily-armed and armored freighters just SIT THERE, not shooting at anything, with their cruise engines on, when I want them to fight back

Post Fri Nov 05, 2004 3:47 pm

well you need to change the pilot, because at the moment there scard littli thingys.

you need to chand this : under npcships.ini

[NPCShipArch
nickname = armed_bps
loadout = armed_bps_loadout
level = d7
ship_archetype = ge_armored_pl
pilot = viper_pilot
state_graph = FREIGHTER
npc_class = lawful, class_fighter, d1, d2, d3, d4, d5, d6, d7

NOTE: this is from my mod

Post Fri Nov 05, 2004 4:06 pm

It would be more helpful to use a real instance in this I am affraid, as showing him an excerpt of your custom npcship entry isn't actually explaining anything of what to do for him.
By the way Nighthound - I showed you an error with your custom pilot (I think it was you anyway, the pilot_viper is the same) - did you find that suggestion?

Here is an example excerpt:

[NPCShipArch
nickname = fc_lr_pi_freighter_d1
loadout = fc_lr_pi_freighter_loadout01
level = d1
ship_archetype = pi_freighter
pilot = freighter_easy
state_graph = FIGHTER
npc_class = unlawful, class_freighter, d1

[NPCShipArch
nickname = fc_lr_pi_freighter_d2
loadout = fc_lr_pi_freighter_loadout01
level = d2
ship_archetype = pi_freighter
pilot = freighter_med
state_graph = FIGHTER
npc_class = unlawful, class_freighter, d2

[NPCShipArch
nickname = fc_lr_pi_freighter_d3
loadout = fc_lr_pi_freighter_loadout01
level = d3
ship_archetype = pi_freighter
pilot = freighter_hard
state_graph = FIGHTER
npc_class = unlawful, class_freighter, d3


Now you can see the bold pilot line? All those are basically contained in a pilots population file - which gives them certain methods of acting etc. So - how to change what they do to something else....
Well - several ways, one is very simply make any easy into hard/ace.
You can use a text editor for that instead - so change ALL instances of
pilot = freighter_easy

To be

pilot = freighter_hard
instead.


OR - roughly the same, but instead - give them an alternative pilot....like a military ace instead....
pilot = pilot_military_ace

So replace all of the freighter_easy, medium, hard, ace with the pilot_military_ace instead (using a text editor and replace all command) and be done.

Post Fri Nov 05, 2004 4:19 pm

I've already tried this... here's a section from my npcships.ini:

[NPCShipArch
nickname = fc_lr_pi_freighter_d1
loadout = fc_lr_pi_freighter_loadout01
level = d19
ship_archetype = pi_freighter
pilot = pilot_pirate_ace
state_graph = FIGHTER
npc_class = unlawful, class_fighter, d19

This was what I'd tried changing the NPCShipArch for Liberty Rogue Mule pilots to. As you can see, he's using a very "non-scared" pilot, and I did a Find-And-Replace, changing all pilot entries with "freighter" in them to "pilot_pirate_ace", which you'd think would've worked. However... when engaged in combat, their escorts will break and attack, whereas the !*@*!! freighters will continue to use Cruise (which is nerfed to 70 in my mod, for reasons that will become clear when I release the first Beta).

Their refusal to A: quit using Cruise and B: Start dodging and firing back is quite irritating. If you've got free time, you can change the Cruise speed to something low and then attack any freighter convoy using Cruise... the behavior is the same. I have a sneaking suspicion that it has something to do with the Encounters parameter "sc_freighters", and the resulting behavior if a ship is classed as a "freighter" or "transport" in its ship file.

I'm going to try altering several freighters to be listed as fighters and see whether this changes anything... thanks for taking a moment to look at this, guys

Edited by - Argh on 11/5/2004 4:19:31 PM

Edited by - Argh on 11/5/2004 4:20:24 PM

Post Fri Nov 05, 2004 5:56 pm

Nope, that didn't do a darn thing. What's more, I've been able to make an observation: any ... and I repeat... ANY ship that's in Cruise is unable, apparantly, to realize that it's taking damage and then take countermeasures... like dropping out of Cruise and defending itself. I think what I'm going to do is go in and put the -cruise tag into all of the Encounters, and then set the cruise times for the engines to something... huge. I'm afraid that'll just result in ships sitting around for ages, though, waiting for their cruise engines to cut in. I don't suppose that you can put a Max_Force line into a ship's file, getting rid of the ability to Cruise altogether... hmmm. There HAS to be a way to do this, surely. If not, I'm going to have to get really clever to avoid it being an utter pain in the neck. I can't have ships being helpless targets, no matter whether they hate yer guts and are at 10% health... it's ridiculous!

I've observed this same behavior with the Liberty Rogues' fighters, the CSV, and I presume that if I keep trying to pick fights with things in cruise... with them as well.

I tried making the Munition of my standard "machinegun" be a cruise disruptor, but that didn't work- I'm guessing that Cruise Disruptors need to be a missile with an explosion (?) I'll search around here for a clue as to why putting the line cruise_disruptor = true doesn't seem to do anything to ships in cruise.

Post Fri Nov 05, 2004 7:52 pm

Yay! I have found the solution... Chips, ya might want to store this in the Great Halls of Knowledge somewhere...

Here's what's going on, and how to fix it:

In the Encounters folder, you will see lines like these:

ship_by_class = 1, 1, sc_freighters

This is what finally helped me figure this out. After doing lots of searches through FL's INIs, I tracked the path here... basically sc_freighters is just another name for class_freighters... which in turn seems to be a very broad class that covers any situation where the engine needs to pick out a freighter. How it does this is still confusing me- I very purposefully changed all of the TYPE = FREIGHTER entries earlier, in an attempt to fix my problems (boy o boy, am I glad I backed the mod up first). Basically, I don't know why class_freighter points to freighters yet, because it and sc_freighter are only used in a couple of very specific situations in the MISSIONS folder, and aren't referred to elsewhere.. nor do they seem to specifically refer to a Loadout. Obviously, I'm missing something that's buried here. Oh well, I'll explain it if I ever bother to figure it out

Basically, to get rid of the "I'm in Cruise and won't defend myself" problem, I had to change the behaviors of these silly freighters, by telling the engine that they're not in a "run away and don't shoot back" category. This was accomplished by one single replacement: I changed all instances of class_freighter to class_fighter. I think, in retrospect, that it'd have been smarter to call them gunships instead, so I'm going to my last backup of this file and doing it that way.

This has an annoying side-effect: it means that in encounters that are mainly fighters and a freighter or two, that you'll often end up with more freighters than fighters... but at least they'll defend themselves now. In my mod, this is actually a good thing... I want lots of lumbering ships to show up in certain Encounters, and I'm perfectly willing to hack up different loadouts so that I can get Formations that work for this, as well as other ones that are strictly fighters (by doing it through the loadouts, so that random chance isn't a factor). In the short term, since I wanna get back to making new aircraft, I'll just leave in any of the things that will be ships and leave them alone for now.

Post Fri Nov 05, 2004 8:58 pm

Ok, so now I've hacked things in a bit more... suitable way... and I have cracked the problem entirely.

First off, the designation "sc_freighter" is referring to the line type = FREIGHTER in Shiparch.ini. Any time an Encounter refers to freighters, it's going to:

1. Look at the available Loadouts, which are called by the Group assignment.

2. Look for any ships in the Loadouts that refer to FREIGHTER, such as Pi_Freighter (the Mule, which started this whole mess).

3. Assign one of those ships, based upon the Encounter difficulty and type.

This requires the engine to search through the local Encounters, which are set up for each Zone in a system, then to refer to faction_prop.ini, which in turn refers to npcships.ini, which ... finally... refers to a given ship hull and a Loadout, which is specified in Loadouts.ini.

This is an incredibly cumbersome and over-complicated way of doing things, imho, but it's the way that the game engine finally figures out how to randomly select a FREIGHTER. Then the behavior ... and this is what I was trying to solve, so this was the important part... is controlled by the TYPE.

So, as a less-kludgy, functional solution, I have changed all FREIGHTER entries in my shiparch.ini to CRUISER. This makes them plenty violent... they will NOT try to escape via Cruise, which is basically what I needed to have happen here.

Now, they didn't show up in Encounters until I started changing lines in them from sc_freighter to CRUISER. Be aware: this will cause Factions with CRUISERS listed in Shiparch.ini to start fielding... you guessed it... CRUISERS. Which is actually kinda fun, if you like watching cruisers kick some boo-tay In my case, it means that I'll have to change all of the CRUISERS to use the Battleship or Gunboat type, eventually, since I do want to preserve some available hierarchies of powerful warships, and I do want to be able to write Encounters for various Factions that allow them to field warships.

Now, for the (hopefully) last major icky technical challenge: how to get ships to ALWAYS spawn at a given height level. This ought to be... tricky. I'm looking forward to it

Post Fri Nov 05, 2004 10:14 pm

Just a note: changing the shiparch.ini TYPE values to anything besides "FIGHTER" and "FREIGHTER" can have some nasty side effects for players. Basically, if players are also flying those ships and you use some of the possible values like "CRUISER" or "CAPITAL", your steering becomes weird.

Next, in answer to your original question, look in your pilots_population.ini file for "freighter_job". Look for the lines that say:

scene_toughness_threshold = equal
flee_scene_threat_style = equal

And change them to something like:

scene_toughness_threshold = hardest
flee_scene_threat_style = hardest

There you go, now your freighters will fight back and you don't have to change all the other stuff.

Post Sat Nov 06, 2004 5:34 am

Hmm. You're certainly right about the Freighter steering. Lemme test it a bit, and make sure that they won't sit in Cruise and just get pounded... that's the main issue here... I can't have ships that just sit there getting mauled. I'm not even averse to making all of the Freighters into Fighters if it fixes that problem... so if this relatively simple change does it, great, I was getting tired of re-writing Encounters anyway

Post Sat Nov 06, 2004 11:15 am

...back from experimentation...

Something is special about FREIGHTER, LIFTER, ARMORED, and TRANSPORT designations. The ship AI definately does not engage in combat agressively when these designations are used.

Try to duplicate my results at home: set Cruise_Speed to something ridiculously low, like 30. Then attack a transport or freighter with escorts (gently enough that it's not dead, hehe). You'll watch it "fire up" the Cruise Engines, and then it won't fight back. You can sit off it bow right in front of its turrets, and it still won't fight back. Bummer... too bad they're so stupid

Its Escorts, on the other hand, will break off and attack. Now, maybe something's wrong with my setup, but changing Pilots_Story and other settings has had zero effect on this behavior whatsoever. After replacing just about everything from the defaults in the SDK and messing with this again, I am really quite certain that certain ship designations are used as AI shorthand for their behavior.

Switching FREIGHTERS to CRUISER means that I'll have to have duplicate entries in ship_hull, etc., just for players to buy, or I can change their designation to FIGHTER, which means that they'll show up in Encounters more often than usually is the case, unless I go back through npcships and the systems' ini files and tweak.

You've gotta understand... I'm not building yer typical "more stuff in Space" mod here. I'm going to have to rebuild a lot of things to get what I want, anyhow. So long as the !*!*@! freighters, Heavy Transports and other things engage in combat (even after they think they've "entered Cruise countdown", which is the problem), I'm happy. I think I'm just going to make them Fighters, because switching them to Cruisers and having duplicate entries everywhere is quite an annoying prospect...

Post Sat Nov 06, 2004 12:40 pm

...back from yet MORE experimentation...

Sigh. It's not the FREIGHTER designation, after all. I went back through everything, cleared all bad entries, and then opened up a clean npcships.ini file, and then edited the behavior of all the freighters, so that they used a "fighter ace" profile.

Now my freighters will fight back. But transports won't. I suspect that, like wasabe was saying earlier, now I've gotta go back to the pilots_population and fix those pesky Transport pilots so that they, too will be... uh... violent... instead of engaging in Ghandi-like non-violence when confronted by my death-dealing aircraft.

BTW, in case anybody cares, I'm having a blast playing this mod. As soon as I get a proper model/skin/loadout/blah figured out for the Liberty Rogues, I'm going to release a Beta.

Oh, and btw... I have figured out how to remove all the jumpholes and gates, after all, so I'm keeping Li01 as the start. Which... pretty obviously hoses any attempt to use this mod single-player, but do I care? Nah. I'm having too much fun blowing things away with my machineguns

Post Sat Nov 06, 2004 5:05 pm

Argh, you're making it too hard on yourself. If you do what I suggested, it will result in NPC freighters that do not run away. I am 100% positive about this.

Look in your pilots_population.ini file (not your pilots_story.ini file!) for "freighter_job". Look for the lines that say:

scene_toughness_threshold = equal
flee_scene_threat_style = equal

And change them to:

scene_toughness_threshold = hardest
flee_scene_threat_style = hardest


If your freighters have weapons, they will stay and fight. Of course, if they don't have any weapons, they will run away.

In order for this to work, those ships need to be defined as "FREIGHTER"s in your shiparch.ini file, you must not have edited your freighter encounter files (like area_trade_freighter.ini), and in your npcships.ini file, they need to have the class_freighter for the npc_class. For the pilot, it's not that important, but I always give them a good pilot. But the pilot is not what effects them running away - their job is what effects them running away. If you look in your encounter file, like area_trade_freighter.ini, you will see that for freighters, they have the pilot_job of "freighter_job", and that is what effects their behavior (like when they run away and when they stay and fight).

Post Sat Nov 06, 2004 5:26 pm

Wasabe, I got it... I even got Transports to quit being so passive

Picking a fight around New York as a pirate is bad for your health now, with the changes in the game right now... it's actually exciting to be a pirate

Basically, I changed pilots_population.ini... almost everybody is rated as "ace" now, and the Freighter and Transport pilots have been given fighter-pilot Ace ratings. I've also carefully tweaked Freighter_Job and Transport_Job, which also factors into their passiveness... freighters which get attacked will chase you off for a short period, while fighter pilots will chase you 30K or more... which with the Xenos (who're flying the only fully-modded ship in the game right now, the player's starter ship)... gets super-exciting, because unlike in the original game, you can't put Cruise on and leave them behind. Cruise causes the AI to give up the chase... using thrusters, you have to flee the whole distance listed for the Job before they'll give up... and there's nothing like being chased by 4 Xeno pilots who're armed about as well as you are for 30K (at 430 KPH, over water that will smash you flat if you run into it) to get your pulse pounding.

Man, I've never had this much fun playing FL... it's not like "uber-super mods", where you're just getting aced by ships whose shields you can't penetrate... you really feel like the AI is giving you a run for your money... you feel like an ace when you can actually win against 4 Xenos, trust me.

Trust me, this is like nothing I've ever seen in a mod up 'til now... when firefights break out, every ship gets actively involved... and freighters with only a few turrets equipped in their Loadouts have become just as dangerous as the one flown by human players... it's so cool to watch them dodging and trading shots with one another, and scary to watch a pair of Rhinos pour a wall of firepower at you...

Now I'm going to get back to the Most Important Thing... replacing the Bloodhound with a suitable aircraft... and then I'll release another Alpha. I've decided not to call it a Beta until all of the spacecraft that you normally see in NY have been replaced with appropriate aircraft... and then I can start worrying about the ships and hovercraft. I want to get some player feedback soon, though

Edited by - Argh on 11/6/2004 5:33:05 PM

Edited by - Argh on 11/6/2004 5:34:39 PM

Post Sun Nov 07, 2004 9:21 am

TRANSPORTS!?! Thats like asking for free loot. Can you imagine a transport thrusting at you? I think it running you over would do more damage then shooting you..

Post Sun Nov 07, 2004 10:40 am

Hehe, not in my mod, it ain't Transports actually fight back, and even now, with weapons that are relatively weak, they do a surprisingly good job.

Eventually, Transports will become Blimps, but that's another story. Let's just say that I think that in my little game universe, "free lunches" are more difficult to get. On the other hand, the fighters are a lot more deadly, too, so if you concentrate on a Transport, his escorts may get on your six and perforate you

Return to Freelancer General Editing Forum