Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Simulator Enhancements (03/13/24)

Author Topic: Toying with engine boost systems and how the AI uses them - Help please!  (Read 4004 times)

AxleMC131

  • Admiral
  • *****
  • Posts: 1722
  • Amateur World-Builder
    • View Profile

I'm currently playing around with some custom ship systems for the mod I'm working on, but I'm having a dilemma about a particular engine-boost system I've got and how the game handles it in terms of function and AI.

For the sake of context, I'll give out the details of this ship system in the same way they are presented in the description in-game:

"Kick-Boost: Activates an auxiliary independent booster that rapidly accelerates the ship up to a high speed for a short time, generating some flux on activation. The booster will also reignite the ship's main engine if it has been flamed out. G-forces encountered during the boost disrupt targetting systems, and weapons are temporarily unable to fire*."

* ... but shields still function.

Those experienced with modding this sort of thing will immediately notice that any ship systems that have an effect on the ship's engines (Burn Drive, Manoeuvring Jets) won't work if the ship is flamed out. Through testing I have discovered this occurs for any ship system that has the type "ENGINE_MOD" in the '.system' file.  However, if I change this type to, say "STAT_MOD" it will operate even if the ship is flamed out, thereby achieving the secondary bonus of this Kick-Boost ability: Reigniting a flamed-out engine.

Unfortunately, if I have the type as STAT_MOD but I leave the AI-type as "BURN_DRIVE" (assuming this key means that the AI will attempt to use the system in similar situations to the Burn Drive system), the game crashes the moment I engage autopilot and gives me an error message. Thankfully I can - and for the time being have - changed the AI type to "DAMPER_FIELD", which is the most appropriate of the valid Stat-Mod AI types I can find (some of the others being Ammo Feeder and Temporal Shell). The game has no problem with this.

Now, this setup works alright for now, but it does result in the AI using the ability at some questionable moments. I could change it back to being an ENGINE_MOD type with the BURN_DRIVE AI, but I'd lose the ability to restart the ship's engines if disabled. Anyone have any suggestions for alternative methods or system/AI 'types'? I'm not particularly savvy with code, but I can read and mostly understand the relevant game files.
« Last Edit: March 01, 2017, 02:16:44 AM by AxleMC131 »
Logged

Chaos Farseer

  • Lieutenant
  • **
  • Posts: 98
    • View Profile

Perhaps ask Tartiflette? Some of his SCY ships have an Engine Jumpstart ship system (and its sole job is to undo a flameout). Taking a quick look at the .system file indicates that it is of the type STAT_MOD, although it has its own custom AI. So, you might need to write one?
Logged

Nick XR

  • Admiral
  • *****
  • Posts: 712
    • View Profile

FWIW, for me, really going through the AI Overhaul mod made clear how to mod various aspects of SS. 

http://fractalsoftworks.com/forum/index.php?topic=10992.0

Look through there and check the out AI relating to when to use a ships special systems.  That should hopefully give you some inspiration for how to proceed.

AxleMC131

  • Admiral
  • *****
  • Posts: 1722
  • Amateur World-Builder
    • View Profile

Perhaps ask Tartiflette? Some of his SCY ships have an Engine Jumpstart ship system (and its sole job is to undo a flameout). Taking a quick look at the .system file indicates that it is of the type STAT_MOD, although it has its own custom AI. So, you might need to write one?

Aye, I know about SCY's Engine Jumpstart system (not gonna lie, got inspiration from there) although I've never seen it used. Custom AI though you say? I was trying to find where the system AI types are located in Starsector's code, but couldn't find them. A custom AI for the "Kick-Boost" system would ideally use it: A) when the ship's engine is flamed out, B) as a speed boost to get INTO combat, or C) as a speed boost to get OUT of combat. Perhaps SCY Nation's framework is a better place to look for that; thanks!


FWIW, for me, really going through the AI Overhaul mod made clear how to mod various aspects of SS. 

Look through there and check the out AI relating to when to use a ships special systems.  That should hopefully give you some inspiration for how to proceed.

I'll make a note to check that out. There seems to be an awful lot of documentation, which is an awesome start. XD
Logged

Tartiflette

  • Admiral
  • *****
  • Posts: 3529
  • MagicLab discord: https://discord.gg/EVQZaD3naU
    • View Profile

Aye, I know about SCY's Engine Jumpstart system (not gonna lie, got inspiration from there) although I've never seen it used.
The effect is kinda subtle but I guarantee you it is used. Ships with this system rarely stay flamed out for long.
Logged
 

AxleMC131

  • Admiral
  • *****
  • Posts: 1722
  • Amateur World-Builder
    • View Profile

Aye, I know about SCY's Engine Jumpstart system (not gonna lie, got inspiration from there) although I've never seen it used.
The effect is kinda subtle but I guarantee you it is used. Ships with this system rarely stay flamed out for long.

Haha, nice of you to pop in. :D Don't worry, I trust it exists, I just haven't had the pleasure of playing your wonderful SCY Nation mod (yet) or seeing video footage of the system in action.

Needless to say, my own "Kick-Boost" system is anything but subtle. ;)
Logged

Midnight Kitsune

  • Admiral
  • *****
  • Posts: 2846
  • Your Friendly Forum Friend
    • View Profile

FWIW, for me, really going through the AI Overhaul mod made clear how to mod various aspects of SS.  

Look through there and check the out AI relating to when to use a ships special systems.  That should hopefully give you some inspiration for how to proceed.

I'll make a note to check that out. There seems to be an awful lot of documentation, which is an awesome start. XD
Please, PLEASE DON'T use that mod as source of help as it has all sorts of issues, especially with modded games! I'm talking full on crashes using any of the most popular mods like SCY, Templars or BRDY
Edit: It crashes on many faction mods because they have custom ship systems that use AI flags, which are generally the best way to write custom ship systems and other things like that. If you must use AI Overhaul as a reference, please use several others as well.
« Last Edit: March 02, 2017, 03:31:23 PM by Midnight Kitsune »
Logged
Help out MesoTroniK, a modder in need

2021 is 2020 won
2022 is 2020 too

AxleMC131

  • Admiral
  • *****
  • Posts: 1722
  • Amateur World-Builder
    • View Profile

Please, PLEASE DON'T use that mod as source of help as it has all sorts of issues, especially with modded games! I'm talking full on crashes using any of the most popular mods like SCY, Templars or BRDY
Edit: It crashes on many faction mods because they have custom ship systems that use AI flags, which are generally the best way to write custom ship systems and other things like that. If you must use AI Overhaul as a reference, please use several others as well.

Oh really?  :o Well perhaps never mind then...
Logged