[B19][WIP] RimIO (Information Overload). Stream game data to external app

Started by happynev, September 07, 2018, 09:18:01 AM

Previous topic - Next topic

happynev

Motivation:
Rimworld has so much more information to offer than can be displayed at any time (in game!). I find myself constantly opening/closing game windows just to check my colonists' shooting skill or Manipulation stat and whatnot. Mods like Moody or Numbers help greatly, but take up too much space if open permanently.

Therefore i decided to write this mod AND a companion app to display the info in (near-)real time 8).
The idea is to have the companion App open on another screen (or another computer!), so the most interesting stuff can be found in one place without obscuring your game interface.

It works by collecting the relevant data every X ticks and sending it as an XML document to a remote HTTP Server.
Overhead is about ~15 millisecond every 60 ticks, but it's done on a background thread, so it shouldn't impact the game loop :)

Basic building blocks are done  :):
* Mod Options to configure data and target ip/port (through HugsLib)
* XML generation and HTTP Sender
* Export Map Data (size, wealth)
* Export Pawn Data (skills, job, health, needs, PORTRAITS  :D)
* Debug receiver (Java app) to show data
* JavaFX Gui to actually show all this in a nice way  ;D
  * Colonists with their skills, traits, health conditions etc in a sortable and possibly filterable table
     * skills displayed are filterable by passion
     * current in-game portrait for each colonist
     * selected/drafted status shown
     * red overlay for downed colonists (buggy, sometimes doesnt go away)
  * Overview Map to show pawn locations and their job targets (optionally with background image from the "Progress Renderer" mod)
* upload code to github

Planned:
* Configurable update intervals (seperate for pictures, map, pawn moods, health etc, to save some processing time)
* Export more pawn data (body parts, equipment)


Not currently planned:
* change gameplay in any way
* Localization
* Animals
* Enemies
* Multiple Maps support
* Android support. Would be nice to have this on a tablet?
* Persistent database with a history of all received data to build all sorts of graphs and basically "replay" your game

So why this thread?
I'm mostly doing this for myself, but i wanted to see if other people are also interested :-)
please share your thoughts/opinions/criticisms!

Amak

I'm very interested, especially if we can  turn it into an android app. I dont have a second screen, but android phones and tablets galor.

Edit: just saw you're not interested in an android app, but if it exports an xml through http, I should be able to make a mock browser app with an option for specifying server ip connection.

cesar.malari

I'm interested too.  I was thinking of a UI based on react in electron for an excuse to learn it :)  Of course, for the model you're looking at here, the UI is independent of the mod that you load into the game that reports the data out, so there's some flexibility there.

Alexander Wilson

I'd love to see this. Having all my pawn information on my second screen would make like much easier.

happynev

hi
sorry to leave you guys hanging like this. i stopped working on it some time ago.
reasons:
1. vacation was over
2. i found a nice minimap mod (which i can't find again for 1.0...)
3. medical tab now displays capacities (manipulation, movement etc)
4. i just made my moody window bigger
5. there is a memleak on the c# side i never identified, which causes the game to crash after ~1-2 hours. this was the first c# code i ever wrote and i never got really into it :-/
so the reasons why i made it were mostly gone...

that said: i did finish a lot of the features and was quite fun for a while (see updated the list in the original post)
and i spent way too much time skinning the java ui, so it looks like rimworld :) (sorry, no screenshots)

if anyone wants to pick it up: please do! the sourcecode for both the mod and the java companion are available on github:
https://github.com/happynev/RimIO-Mod
https://github.com/happynev/RimIO-Companion

cesar.malari

Yeah, definitely get that.  Thanks for sharing where you got with it.  I didn't even look into this far enough to realize mods were in C# :(

As for the crash, my immediate suspicion would be that some cleanup of the background processing threads would be needed, or maybe you're losing the threading lottery with the CollectGameState call (ie. it fails on a rare occasion), and an unhandled exception on a background thread results in the process getting killed.

MisterVertigo

Oh man, this sounds like it would have been really cool! I have two monitors on my PC and it would be great to have up-to-date and relevant info on my other screen. Would love to see data on my colonists without having to open menus all the time.

Unfortunately I know NOTHING about coding short of some HTML and PHP so I can't really help at all with reviving this, but I hope someone else does!
"In vertigo you will be..."

"Relax, people. It's a teeny indie game; don't kill it with love." - Bozobub