Victoria 3 save files data analytics notes

The idea is to feed data from vi3 save files to some streaming system like Kafka + kSQL, slice and dice that data into a wide set of dimensions and provide some high-level dimension view on an entire economics flow

For example - create a graph of resources to materials to consumer products and calculate various money flows

The first window should be a graph of all resources with all ingress and egress profitability if possible to get a picture of an economy of a country

  • It would be good to see that % of $ consumers income is spent on it
  • Get the number of open vacancies per state or type of building
    • the per type of building can be shown via the building list table

https://www.reddit.com/r/victoria3/comments/ye55jj/cant_get_save_game_editing_to_work/https://www.reddit.com/r/victoria3/comments/yg4s7e/how_to_editdecrypt_victoria_3_save_files/

package main

import (
    "archive/zip"
    "fmt"
    "io"
    "log"
    "os"
)

func main() {
    r, err := zip.OpenReader("autosave.v3")
    if err != nil {
        log.Fatal(err)
    }
    defer r.Close()

    for _, f := range r.File {
        fmt.Printf("Contents of %s:\n", f.Name)
        rc, err := f.Open()
        if err != nil {
            log.Fatal(err)
        }
        _, err = io.CopyN(os.Stdout, rc, 8000)
        if err != nil {
            log.Fatal(err)
        }
        rc.Close()
        fmt.Println()
    }
}
zip_binary_all
zip_text_all

Use tree-spliter to parse CW DSL

Extract graph nodes from parsed tree-sitter nodes

#tcs #vi3 #mods