Hi,
I want to help speedrunners do an autosplitter for Factorio and could also use some help from some dev programmers.
Background:
LiveSplit is a timer for speedrunners which supports scripts to watch game memory and do splits automatically.
A good indicator for when to split would be completion of research.
Now I don't know what to look for in those millions of game variables and before I search blindly, some dev help would be appreciated.
The question:
How is a single research value represented in the code/memory? Is it binary, an enum, a weird int?
I can understand if you don't want to give infos about your codebase, I think a mod which uses the api to help LiveSplit would also be possible, but that would be more complex.
LiveSplit help with Factorio variables?
-
- Long Handed Inserter
- Posts: 53
- Joined: Mon Sep 15, 2014 9:38 pm
- Contact:
Re: LiveSplit help with Factorio variables?
Just use game.write_file() in an on_research_finished event handler, then watch for changes to the resulting file?
Automatic Belt (and pipe) Planner—Automate yet another aspect of constructing your factory!
-
- Long Handed Inserter
- Posts: 53
- Joined: Mon Sep 15, 2014 9:38 pm
- Contact:
Re: LiveSplit help with Factorio variables?
Writing files is slow, also I would want to avoid writing a mod if possible.
Re: LiveSplit help with Factorio variables?
Writing files takes virtually zero time and the API already exists to do it fully without needing to add or change anything.Ekelbatzen wrote:Writing files is slow, also I would want to avoid writing a mod if possible.
If you want to get ahold of me I'm almost always on Discord.
- cpeosphoros
- Inserter
- Posts: 40
- Joined: Fri Dec 23, 2016 10:57 pm
- Contact:
Re: LiveSplit help with Factorio variables?
I can attest for that. Writing a line to a file takes less than 1 millisecond: viewtopic.php?f=135&t=38996Rseding91 wrote:Writing files takes virtually zero time and the API already exists to do it fully without needing to add or change anything.Ekelbatzen wrote:Writing files is slow, also I would want to avoid writing a mod if possible.
-
- Long Handed Inserter
- Posts: 53
- Joined: Mon Sep 15, 2014 9:38 pm
- Contact:
Re: LiveSplit help with Factorio variables?
I experimented with using the logger and such, but I solved it now differently.
It would also be difficult for the user to define where the file will be located at, since these scripts mostly only offer checkbox settings.
I found boolean variables for single researches, but could not find easy pointers with a pointer scan.
Now my script watches the UI research text on the top right.
It may be language dependent and break every update, but the speedrunner won't have to install the mod additionally to the script, besides me still not trusting slow hard drives which have a bad day.
It would also be difficult for the user to define where the file will be located at, since these scripts mostly only offer checkbox settings.
I found boolean variables for single researches, but could not find easy pointers with a pointer scan.
Now my script watches the UI research text on the top right.
It may be language dependent and break every update, but the speedrunner won't have to install the mod additionally to the script, besides me still not trusting slow hard drives which have a bad day.