LiveSplit help with Factorio variables?

Enhance your gameplay with these tools. This category is also the right place for tools useful for modders.
Mod databases, calculators, cheatsheets, multiplayer, scripts, libs and other useful stuff that is not strictly in-game mods.
Post Reply
Ekelbatzen
Long Handed Inserter
Long Handed Inserter
Posts: 50
Joined: Mon Sep 15, 2014 9:38 pm
Contact:

LiveSplit help with Factorio variables?

Post by Ekelbatzen »

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.
Specs: 3770k, 16GB DDR3, 1060, Win10 x64, latest experimental via Steam

User avatar
prg
Filter Inserter
Filter Inserter
Posts: 947
Joined: Mon Jan 19, 2015 12:39 am
Contact:

Re: LiveSplit help with Factorio variables?

Post by prg »

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!

Ekelbatzen
Long Handed Inserter
Long Handed Inserter
Posts: 50
Joined: Mon Sep 15, 2014 9:38 pm
Contact:

Re: LiveSplit help with Factorio variables?

Post by Ekelbatzen »

Writing files is slow, also I would want to avoid writing a mod if possible.
Specs: 3770k, 16GB DDR3, 1060, Win10 x64, latest experimental via Steam

Rseding91
Factorio Staff
Factorio Staff
Posts: 13198
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: LiveSplit help with Factorio variables?

Post by Rseding91 »

Ekelbatzen wrote:Writing files is slow, also I would want to avoid writing a mod if possible.
Writing files takes virtually zero time and the API already exists to do it fully without needing to add or change anything.
If you want to get ahold of me I'm almost always on Discord.

User avatar
cpeosphoros
Inserter
Inserter
Posts: 40
Joined: Fri Dec 23, 2016 10:57 pm
Contact:

Re: LiveSplit help with Factorio variables?

Post by cpeosphoros »

Rseding91 wrote:
Ekelbatzen wrote:Writing files is slow, also I would want to avoid writing a mod if possible.
Writing files takes virtually zero time and the API already exists to do it fully without needing to add or change anything.
I can attest for that. Writing a line to a file takes less than 1 millisecond: viewtopic.php?f=135&t=38996

Ekelbatzen
Long Handed Inserter
Long Handed Inserter
Posts: 50
Joined: Mon Sep 15, 2014 9:38 pm
Contact:

Re: LiveSplit help with Factorio variables?

Post by Ekelbatzen »

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.
Specs: 3770k, 16GB DDR3, 1060, Win10 x64, latest experimental via Steam

Post Reply

Return to “Tools”