Author Topic: Mod to support overly thourogh use of geology teams.  (Read 1794 times)

0 Members and 1 Guest are viewing this topic.

Offline trabber Shir (OP)

  • Warrant Officer, Class 2
  • ****
  • t
  • Posts: 63
  • Thanked: 13 times
Mod to support overly thourogh use of geology teams.
« on: September 23, 2021, 07:36:09 AM »
This thread is to ask if anything being described may be impossible with the modding tools available, or if there may be a better way to handle this than building a mod.

Goal:

Complete a Geological Team Survey on every body in a system.

Current manual methodology:

Have a few fleets set to "Pick up idle geosurvey team" and "drop off geosurvey team at unsurveyed colony".

Problem 1: Occasionally I need to intervene to split up the teams because after a while I always end up with one fleet carrying all the teams and all the teams on one colony.

Problem 2: If I have a colony on a body, then it is not available for the establishment of CMCs and the automatic commander assignments has a good chance of giving it a governor that would be more useful elsewhere. So, I do not want a lot of colonies created and waiting for the teams, the colonies should be created on bodies needing a survey, and then the colonies should be abandoned after the survey if not being otherwise interacted with.


Mod Ideas:

The pipe-dream ideal solution that is not happening any time soon:
An upgrade to those default orders such that they create colonies as needed, abandon colonies that they remove teams from (if not referenced by anything else), reserve colonies they are in route to, and not choose to drop off on colonies that are reserved or have a team already. If that is simpler than it sounds, let me know and I might come back to it.

Concept A: the first/prototype feature that I know should be possible because it is just reading the database and printing lists on the screen. Regrettably it only addresses Problem 2.
  • Button that opens a window which contains 3 lists and a button to refresh each list.
  • First list is existing populations on bodies which have not completed a geological team survey.
  • Second list is of system bodies without populations which have not completed a geological team survey.
  • Third list is populations which are unused and have completed a geological team survey. Things to check for to determine if they are unused include: installations, civilian orders, ship orders, teams, ground units, shipyards, policies, and industry jobs

Concept A's stretch goals (AKA things that might be so easy after I learn the API that I do them to make dev and debug easier):
  • make the list be clickable things which when clicked open the economics window (pop) or system window (body) with the indicated entity selected
  • generate an event to notify the player when list 1 drops below some length (to let the player know they need to make more colonies and probably purge unused ones)
  • include create colony and abandon colony buttons to the list items for the 2nd and 3rd lists

Concept B is a modification to the default orders to partly address Problem 1 and Concept C is some automation of button clicking on Concept A. But I have changed my mind about detailing those here now. I can edit the OP if concept A turns out to be less painful than I am anticipating.

I would especially like feedback for people who have actually dug into the API on whether the "stretch goals" are well supported.
 

Offline trabber Shir (OP)

  • Warrant Officer, Class 2
  • ****
  • t
  • Posts: 63
  • Thanked: 13 times
Re: Mod to support overly thourogh use of geology teams.
« Reply #1 on: September 23, 2021, 04:26:18 PM »
It is looking like the UI is going to be the hard part of the basic idea. Gettign the data for the lists is just passing the SQL I already have 75% figured out to fetch().

The stretch goals are looking to be split half way down the middle but luckily in a good way.

Navigating the pops to the economic window is just calling zoom_to_pop, but actually handling the abandoning of the colony seems to need a very risky and unsafe execute() call.

Navigating somewhere useful when clickign a body would be a lot of fidgiting with the nodes directly but a button to create the colony would just need to invoke add_colony, so zoom_to_body_on_map should be good enough for the navigate behavior.

Running code at the end of a turn and rate limiting it to 30 days for performance seems to be trivial with connect_increment_end() but I cannot find any support for generating a custom event and in a first pass would likely resort to either a log_auto_fleet with a dummy fleet ID or popup_alert. It may be that as I get deeper into the UI node manipulation it will become obvious how to do the alerts, but I doubt it since they can manifest in multiple places.