Home World Forum
Stars! AutoHost web forums

Jump to Stars! AutoHost


 
 
Home » Stars! Clones, Extensions, Modding » Stars! Extensions » Stars!tools: merging and fuel usage
Stars!tools: merging and fuel usage Sun, 18 March 2018 09:35 Go to next message
mrvan is currently offline mrvan

 
Officer Cadet 1st Year

Messages: 220
Registered: May 2014
I wrote some very simple python-based tools for stars.

I don't expect these to be directly useful for anyone, but if they are, good for you Smile

https://github.com/vanatteveldt/starstools/

Currently contains two tools:

  • [merge.py]
    Downloads and merges .m files of you and your ally and creates an html index with archive. Uses the m/h file merger from https://github.com/tupelo-schneck/stars (thanks!). I run it in a cron job outputting to a password protected public html folder (so the new merged .m file is automatically available when a new turn is in)
  • [fuel.py]
    Calculate fuel usage and booster requirements for a given trip, including slowing down and AR decay.


Neither of them is meant to be generally useful and a lot of stuff is hard coded. So, if you want to use it you probably either need to adapt some things or make them more general.

Pull requests welcome Smile

Feel free to reply/mail/pm if you have any technical questions, suggestions, or remarks!


[Updated on: Sun, 18 March 2018 09:38]

Report message to a moderator

Re: Stars!tools: merging and fuel usage Sun, 18 March 2018 10:51 Go to previous messageGo to next message
XAPBob is currently offline XAPBob

 
Lt. Commander

Messages: 957
Registered: August 2012
mrvan wrote on Sun, 18 March 2018 13:35

[*] [fuel.py]
Calculate fuel usage and booster requirements for a given trip, including slowing down and AR decay.
[/list]


Did you add in IS growth as well? Wink

Report message to a moderator

Re: Stars!tools: merging and fuel usage Sun, 18 March 2018 11:20 Go to previous messageGo to next message
mrvan is currently offline mrvan

 
Officer Cadet 1st Year

Messages: 220
Registered: May 2014
Not yet, but should be easy enough. Main thing is to testbed a couple runs to see whether fuel per turn is based on pre-growth or post-growth cargo. Since overflow is dumped on a target world it would make sense if move is before growth, but who knows what stars! does internally Smile

Edit: just did a very small test. Sent a MF (fuel mizer, mass 59kt) a distance of 76.38 ly with 100 colonists in a mizer.

Actual fuel consumed: 199mg
Interface fuel indication: 199mg
Calculation for 100 kt cargo: 169/200 * 77 * 3.6 * 0.85 = 199
Calculation for 107 kt cargo: 176/200 * 77 * 3.6 * 0.85 = 207

So, it seems that the order is [AR decay] -> [move] -> [IS growth], which means that the changes required for fuel.py would be

- add an --is=PGR option that adds growth after every move
- instead of assuming ships are full, assume that you want to end with a full ship (if a colonizer is included in the fleet) or with an overfull ship (if no colonizer) with an option to override.

I can add this if you want, I want thinking of testbedding some IS races anyway now that the 'new beginner rematch' game is on hold...


[Updated on: Sun, 18 March 2018 11:35]

Report message to a moderator

Re: Stars!tools: merging and fuel usage Mon, 19 March 2018 09:30 Go to previous messageGo to next message
ricks03 is currently offline ricks03

 
Officer Cadet 1st Year
Creator of TotalHost and Stars! utilities
Created TotalHost and Stars! utilities

Messages: 221
Registered: January 2012
Location: NC
mrvan wrote on Sun, 18 March 2018 11:20
Not yet, but should be easy enough. Main thing is to testbed a couple runs to see whether fuel per turn is based on pre-growth or post-growth cargo. Since overflow is dumped on a target world it would make sense if move is before growth, but who knows what stars! does internally Smile

...

So, it seems that the order is [AR decay] -> [move] -> [IS growth], which means that the changes required for fuel.py would be

- add an --is=PGR option that adds growth after every move
- instead of assuming ships are full, assume that you want to end with a full ship (if a colonizer is included in the fleet) or with an overfull ship (if no colonizer) with an option to override.

I can add this if you want, I want thinking of testbedding some IS races anyway now that the 'new beginner rematch' game is on hold...

That's awesome; I think you've found a new entry for the Stars! Order of Events (AR Decay): http://www.starsfaq.com/order_events.htm


[Updated on: Mon, 19 March 2018 09:31]




https://www.irelandbybicycle.com
http://totalhost.sinister.net:999
https://github.com/ricks03/TotalHost

Report message to a moderator

Re: Stars!tools: merging and fuel usage Fri, 30 March 2018 19:45 Go to previous message
mrvan is currently offline mrvan

 
Officer Cadet 1st Year

Messages: 220
Registered: May 2014
XAPBob wrote on Sun, 18 March 2018 10:51
mrvan wrote on Sun, 18 March 2018 13:35

[*] [fuel.py]
Calculate fuel usage and booster requirements for a given trip, including slowing down and AR decay.
[/list]


Did you add in IS growth as well? Wink


Added! Smile

It also runs 'scenarios' for different warps, e.g. suppose you want to send a colonizer and two freighters with LH6 engines to a world 166.65 miles:

$ starstools/fuel.py --is=20 --engine=lh6 166.65 pcol 2pfr
Computing IS pop (Colonizers, so full on arrival)
Warps: [8, 8, 7] Boosters: [1, 1, 1] IS Pop 564
Warps: [7, 7, 6, 6] Boosters: [0, 0, 0, 0] IS Pop 513


You have two options, warp 8 for 3 turns with a booster (assumed fuel transport because of IS), or 4 turns at warp 7 without boosters. You should take 564 pop in the first case, assuming you want pop to be full on arrival since it's a colonizing mission.


ricks03 wrote on Mon, 19 March 2018 09:30

That's awesome; I think you've found a new entry for the Stars! Order of Events (AR Decay): http://www.starsfaq.com/order_events.htm


Yeah, it should be somewhere before fleet moving. Most interesting thing is the client doesn't seem to be aware, so it overestimates fuel use ( https://starsautohost.org/sahforum2/index.php?t=msg&th=5 582&start=0&rid=1803)


[Updated on: Fri, 30 March 2018 19:46]

Report message to a moderator

Previous Topic: Request for source code of any and all utilities
Next Topic: Stars! decryption
Goto Forum:
  


Current Time: Wed Feb 01 08:15:42 EST 2023