Author Topic: Engine/Server ignoring modifications to ship support capacity  (Read 559 times)

Titanicus

  • Sentient
  • **
  • Posts: 61
  • Karma: +3/-0
    • View Profile
Hello. :)

I am attempting to change the scaling on how much Support Capacity support ships take when they are attached to a Flagship.

For example, currently, a size 100 support ship requires 100 support capacity. However, I want a size 100 support ship to instead take pow(100,0.6) support capacity.

The reason for this is that I have modified the scaling of ships to put less emphasis on volume.

In the client GUI, I modified the "updateCost()" function successfully, which allows me to order the correct amount of supports via the flagship menu. However, after ordering them, the game engine quickly corrects this and *actually* only orders their normal size = supply value.

I then went into the server scripts and changed the getSupportSupplyFree() (in ShipConstructible.as) as well as addSupportShipConstruction() (in Construction.as) to allow me to hopefully tell the server that yes, the flagship does indeed have enough supply with my new scaling.

Code snippets for both are located here:
http://pastebin.com/BKx4kmD4

and here:

http://pastebin.com/3XmdUNei

I spent a few more hours looking for a way to modify the way the engine behaves in terms of how much support capacity a ship consumes, but have not managed to turn up anything else that allows me to touch it.

I would appreciate help very much. :)

GGLucas

  • Dr. Evil
  • BMS Staff
  • Delusional
  • *
  • Posts: 1877
  • Karma: +300/-6
    • View Profile
Re: Engine/Server ignoring modifications to ship support capacity
« Reply #1 on: March 07, 2015, 08:21:29 AM »
Most of the logic as relates to a fleet's supports is in LeaderAI.as. You'll want to look at anywhere where SupplyCapacity, SupplyUsed and SupplyGhost are used. These will usually be modified by some count multiplied by a design size. Sadly there's no unified way to change the mapping of size -> supply, it's always assumed to be 1:1 everywhere.

Titanicus

  • Sentient
  • **
  • Posts: 61
  • Karma: +3/-0
    • View Profile
Re: Engine/Server ignoring modifications to ship support capacity
« Reply #2 on: March 07, 2015, 09:11:29 AM »
I took a look in LeaderAI but thought it was primarily for the AI's use... Does leaderAI also have some server-side code related to support capacity that humans can use?

PS. What does "supplyGhost" mean? I haven't seen any notes related to it in the code.

GGLucas

  • Dr. Evil
  • BMS Staff
  • Delusional
  • *
  • Posts: 1877
  • Karma: +300/-6
    • View Profile
Re: Engine/Server ignoring modifications to ship support capacity
« Reply #3 on: March 07, 2015, 09:33:48 AM »
The AI in LeaderAI refers to the ship's AI and behavior, not the empire's. SupplyGhost is the amount of support capacity that's being used for ships that are currently in a 'ghost' state (dead, but still recorded, they show up as (-xx) on the UI).

Titanicus

  • Sentient
  • **
  • Posts: 61
  • Karma: +3/-0
    • View Profile
Re: Engine/Server ignoring modifications to ship support capacity
« Reply #4 on: March 07, 2015, 07:03:47 PM »
Interesting. Well you were right and all the logic for handling that was in the leaderAI file. I guess I discounted it because generally to me AI means control processes with logic such as can/cannot do xxxx built into another part of the engine. In any case, i'm sure if you don't expect to use anything except volume scaling this all makes 100% sense. :)