Skip to content

Instantly share code, notes, and snippets.

@Jezza
Created August 1, 2021 12:29
Show Gist options
  • Select an option

  • Save Jezza/b7b7f1c0dbf423549d3ce4dc0efeec5b to your computer and use it in GitHub Desktop.

Select an option

Save Jezza/b7b7f1c0dbf423549d3ce4dc0efeec5b to your computer and use it in GitHub Desktop.
There's three core ideas behind this system.
1) The Overseer/mastermind/master/head bot.
It's main duty is to "look at the bigger picture".
It has knowledge of funds, loans, ships, marketplaces, etc
It will decide when to, for example, purchase a new ship.
Or take out a loan.
Or pay a loan back.
It will also take on the duty of assigning "pilots" to ships.
2) The pilots
In reality, this means assigning a "strategy" to the ship.
Or in other words, giving exclusive control of a ship id to a strategy.
The strategies could vary as the bot expands, but for now,
my initial impl will just contain a couple of straightforward pilots.
a) Probe
The probe will be assigned to ships whose sole duty is to fly to a marketplace,
and just collect data.
It won't do much else.
It'll collect marketplace data, and hand it off to the overseer to collate and catalogue.
This information will be available for all pilots (Obviously of particular interest to the traders).
b) Trader
A trader will have a duty of determining trade routes.
Using information that's provided by the overseer, it'll be able to determine routes, cost, trip time, etc
On a higher level, the overseer doesn't _care_ about the actual trip it takes, or anything.
That's up to the trader to determine the best course of action.
3) Communication between pilots and the Overseer.
One issue that this system would face is trader decisions.
A trader needs to make good decisions, but to do that, it needs information.
But due to the whole "the pilot does the dirty work", the overseer can't, by design, know what it wants to do.
And therein lies the issue.
If a trader needs a material, but it knows of none within the "trading database", how does trader deal with it?
There's a couple of solutions that spring to mind:
a) The overseer handles the request
Simply implementing a channel of "requests" and "events", we should be able to request things of the overseer.
eg: "I need this cargo", "I've found this cargo"
This could lay the groundwork for a couple of extensions later on.
As an idea off of the top of my head, a treasurer.
It would deal with all of the money, and approve or deny money requests.
Also an idea would be to create another tier between the Overseer and the Pilots themselves.
Creating an "Admiral" system means that it could do things like:
When it receives an event from a trader saying "I would like this cargo"
it could send a request to the overseer to grant it another ship to search for this cargo.
and once it found it, just setup that ship as a probe to monitor that cargo/marketplace
b) Inform the overseer that it would like to switch jobs, as it can't find the the cargo it's looking for,
or maybe there's no good trading routes.
At this point, it can tell the overseer that hey, there's no work for me here, we need to expand our information network.
The overseer would be able to assign the ship to a Probe pilot, and it would proceed to gather more information.
Rinse and repeat.
Any of these solutions would work, and a hybrid system of both of these solutions would probably be the best route.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment