Currently compatible with RimWorld Alpha 8 through Alpha 15 (A8-A15).
RimSearch is a tool for creating a nice neat png of your research tree based on your current set of mods.
This tool looks at your active mod list and generates a research tree graph. Once the tree is generated, you have the option to move nodes around within their own level, the level is determined by the research prerequisites. After you are satisfied with the changes, press [enter] to export to a png (RimSearch.png) or [escape] to exit without exporting. Currently does not save node placement changes except as the finalized bitmap.
There are two small windows which will give you information while editing the tree. One is the control window which simply lets you know the editors controls and the other is the info window which will tell you about a selected research tech. This window also includes a list of the files which define the research and you can load the xml directly by clicking on the file in the info window.
Place RimSearch in the same directory as your RimWorld application directory (where RimWorld[Version][Platform][.exe] is located) and launch it from there.
changelog
Updated 11.07.2016
Adds support for A14. ("totalCost" is now "baseCost")
Backwards compatible with older versions (looks for "totalCost" (A8-13) then "baseCost" (A14) if it's not found).
Updated 20.04.2016
The program will now check for abstract parents within a single file, no bad-xml cross-file-cross-references for abstract parents. Would need to completely re-write the tool for this to happen. Tested against RimWorld Alpha 13 (build 1135).
Updated 14.08.2015
Adds child high-lighting to show where a tech will lead to. Helpful for users when deciding what branch of a complex tree they want to research next.
Added full source and project file of RimSearch. This will probably be the last update of this version of the program.
Updated 28.07.2015
Fix so xml files will open properly. I derped in some of my code changes.
Updated 28.07.2015
Added support for full directory structure transversal. (/MyMod/Defs/ResearchDefs/Some/Weird/Path/ToMy/File.xml)
Info window now truncates the displayed xml file path so the window doesn't become huge. (MyMod...File.xml)
Fixed small bug with selected/highlighted research being exported with the selection highlights.
Directly exports a png instead of a bmp.
Control window will move itself to a different corner of the screen if the mouse gets too close.
No longer opens a console window and by default does not log. Logging can be enabled by the /lF[:Filename] command-line switch.
Updated 09.06.2015
Changed colour scheme (still hard-coded), improved UI (highlights tech tree on selected/hovered tech).
F5 reloading of all xml!
New Info Window! Tells you:
Cost of research
Total Research to Tech (cost of all parent research plus itself)
xml files which define the research, click on a file to load it in your xml editor!
Updated 09.06.2015
Bug-fix for research with no prerequities tag. Code was correct, compiler generated bugged output.
Updated 08.06.2015
Program now properly prunes extraneous branches which could be shared between techs with the same children.
Updated sample pic to show a heavily modified research tree.
Updated 08.05.2015
Added UI which allows final editing of bitmap before exporting or discarding changes.
Updated 14.04.2015
Now loads BOM encoded files properly! No need to convert, should work out of the box.
Place RimSearch.exe in your RimWorld directory.
Execute it.
It will dump a log to the console and RimSearch.log.
When it says "Done", press any key to close the window.
It will now write RimSearch.bmp.
Outputs RimSearch.log and RimSearch.bmp
Updated 10.04.2015
Provides a much cleaner output. See attached. Sorry still about UTF-8 w/o BOM, I'll port the sources now that I have the "dirty" logic done.
[attachment undeleted due to age not being too old as I had uploaded replacements but the SQL query is too limited to get access modifiers]
[attachment deleted by admin - too old]
Nice idea, but it hangs on core research
Quote from: mrofa on April 12, 2015, 05:40:25 AM
Nice idea, but it hangs on core research
QuoteCrappy xml library I used (this was done quick'n'dirty in *cough*).
If your XML file is encoded differently, it will let you know by crashing.
Yeah, you need to convert your xml encoding from UTF8 to UTF8 without BOM. I plan on re-writing this in a better language which will obviate this need. I coded it in freeBASIC using the ext library and freeBASIC has limited support for UTF (read: virtually non-existant).
Now that I have the logic complete I plan on re-coding it in C# (both to make it so it can read the xml and to improve my C# skills).
Anyway, if you take the 30 seconds to convert the encoding (RimWorld doesn't care/need about BOM in the mod xml files), it's actually a powerful tool for validating your mods research tree. After convering EPOE I noticed it had redundant research links (if C needs B and B need A, C doesn't explicitly need A), see the bottom of the first posts RimSearch.png (simple prosthetics).
Now that I have the bridges properly joining I will hopefully get this converted "soon" but there are some major language differences.
Lastest update (bridges join properly) and sample output from mod I am working on (which completely redefines the tech-tree):
[attachment deleted due to age]
Soo whats a Bom in this <?xml version="1.0" encoding="utf-8" ?> :P ?
This should help some.
Download the attached file and extract it to your RimWorld Directory (you can see what it does by editing it in a text editor) along with the RimSearch.exe. Then open up a powershell prompt and run the following (please not this can have security implications, however in order to run a powershell script you have downloaded you need to):
Set-ExecutionPolicy -scope currentuser bypass
All this does is allow the current user to execute downloaded powershell scripts.
You then need to change the directory to where RimWorld is located, on my machine it is at ""
cd D:\Games\RimWorld\RimWorld727Win
Then you want to run the script, which will remove any XML BOM encodings from your ModsConfig.xml in your profile as well as all xml files in your RimWorld directory.
.\removebom.ps1
you should see the following output:
Removing UTF8BOM from ModsConfig.xml
Removing UTF8BOM from all xml files in current directory recursively
...
Building research links...
Building relationship tree...
Building node reference list...
Adding bridges...
Sorting nodes...
Assigning node render placement...
Done
If you press any key it will export the image to RimSearch.bmp
I do not take credit for the removal of the BOM script, all due credit is in the script itself.
[attachment deleted due to age]
Quote from: mrofa on April 14, 2015, 03:07:09 AM
Soo whats a Bom in this <?xml version="1.0" encoding="utf-8" ?> :P ?
The BOM is the first three (hidden) bytes of the file - 0xEF, 0xBB, 0xBF. It's the Byte Order Mark.
Updated, now I manually load the xml, check for BOM and just skip those bytes when passing the zstring to the xml parser. Seems to work fine.
So one more thing, throw some message "Press button to export to bmp", since if i wouldnt read bvierra post i wouldnt know that :D
Apart from that its AWSOME!
And a question, wont de BOMing break the game or something ?
It doesn't deBOM the file and it no longer requires the files to be deBOMed.
When RimSearch says it's "DeBOM...", it's just doing some pointer math to skip the 3 BOM bytes at the start before passing the memory block to the xml parser. No actual conversion takes place.
And RimWorld itself doesn't care if the Research.xml's are marked BOM or not since the BO they are encoded in is the native machine endian (x86 uses little-endian which is what RimWorld wants).
I wonder would it be to much work to be able to put custom templates for backgroud, research fonts, research box and the connetion lines ?
heh, after I convert the source, sure.
Right now it's kind of hard-coded and uses the standard 8x8 bitmap console font with a 200x48 "exclusive zone" per node. Connection line colours are just randomly picked, however bridges always use their parents colour. I also want to make it so you can move nodes up and down in a level group, etc, etc.
But, I do appreciate your feedback since you are one of the "veterans" of RimWorld modding. I hope you find some small use for this (and I know I did while designing my tech-tree).
Well im thinkering a research for clutter atm and even with its current fuction i would say its a must have for research :)
Updated to be "more" user friendly. Now 0.000000000001% easier to use.
Its crashing now on reading modconfig.xml
What the derp...?
Can you send me the log file? Perhaps I've borked something which doesn't show up for me...
RimSearch
Mod directory: Mods\
Building library...
Locating ModsConfig.xml...
xml: C:\Users\Mrowa\AppData\LocalLow\Ludeon Studios\RimWorld\Config\ModsConfig.xml...
It shows this and i get good old windows error that application crashed.
old versions work thrugh :P
wth??? I didn't change anything to do with xml at all in this update. That code is exactly the same as the earlier release. What I did change was the export function which now is two-part (user editing and then bmp export).
I shall investigate and see if I can duplicate this.
ok, mrofa, if you would be so kind as to try this version (attached to this specific post) and let me know the log results if it fails and just let me know in general if it works, that would be gre-e-e-e-e-at.
[attachment deleted due to age]
I always get "Could not locate game mods directory!" even though I placed the exe in the rimworld folder...
My rimworld folder is on dropbox though, could that have anything to do with it?
Here's my folder layout:
11/05/2015 11:13 <DIR> .
11/05/2015 11:13 <DIR> ..
06/05/2015 14:53 <DIR> appdata
05/12/2014 21:17 673 Credits_FreeSounds.txt
11/05/2015 10:19 <DIR> modpacks
11/05/2015 10:19 <DIR> Mods
09/05/2015 02:02 1.451 psi-settings.cfg
05/12/2014 21:17 884 Readme_Modmaking.txt
22/04/2015 18:37 1.003 Readme_SaveFiles.txt
05/12/2014 21:17 290 Readme_Translations.txt
11/05/2015 01:40 257.024 RimSearch.exe
11/05/2015 11:13 202 RimSearch.log
23/04/2015 00:37 11.619.328 RimWorld785Win.exe
11/05/2015 07:54 <DIR> RimWorld785Win_Data
23/04/2015 04:27 61.249.804 RimWorldAlpha10fWin.zip
23/04/2015 00:37 <DIR> Source
10/05/2015 00:55 198.840 Stargate.xml
09/05/2015 02:30 69 StargateBackup.xml.bak
23/04/2015 00:37 18 Version.txt
Quote from: Neal Raven on May 11, 2015, 05:21:18 AMI always get "Could not locate game mods directory!" even though I placed the exe in the rimworld folder...
It's in the same place as RimWorldNNNWin.exe and can't find Mods\ in the same directory??? ie:
Some Directory Containing RimWorld\
+ Mods\
+ RimWorldNNNWin.exe
+ RimSearch.exe
If it can't find it that case, the runtime library for this compiler is borked. I'm not doing anything strange to get the directory, just calling the runtime function to return the local directory structure filtered for the mods path, specifically:
Const As String ModsDir = "Mods"
If( Dir( ModsDir, fbDirectory ) = "" )Then
'' Derp, not found :(
EndIf
Where fbDirectory is a library constant (bitwise flag) filtering file table attributes (ie, entries with only the directory bit set so, no files). If that is failing then there is nothing I can do about the runtime library short of writing and submitting a patch but I would need to know what specifically caused the error which I can't reproduce locally (not that I want to write compiler patches). Otherwise, it's switch tool chains (which I was going to do anyway, this was just originally a quick'n'dirty program).
Quote from: Neal Raven on May 11, 2015, 05:21:18 AMMy rimworld folder is on dropbox though, could that have anything to do with it?
Well, it might actually. If I create a symlink to a directory located somewhere else, the runtime library is fooled because the Windows file system resolves the symlink and returns everything you'd expect as if the file/directory was local. Using a 3rd party tool which emulates such behaviour, like dropbox, may interfere in that it's not a believable liar and my program correctly identifies it's not there. That is the runtime may be using to low a level API to access the files and dropbox isn't "deep enough" to trap it. But, since the runtime is the standard crt lib (c runtime library) which is installed with Windows, it should be smart enough to trap that.
But it's not a symlink actually. The folders are just ordinary folders, besides being monitored by dropbox. Asking the directory flagbit should still return true, I'd guess. (The appdata folder in there is symlinked though (as in, it's the destination for the actual symlink in my appdata folder, so I can sync my savedata. But I don't think this should matter much here.)
I'll try again later today by turning the dropbox.exe off instead of just pausing the sync-process.
Its working now and i like the new options :D
Hmm, when I copied my folders to Temp and ran it there it didn't work either. But when I clean installed RW in my Temp, it did work on that one. So it's definetely something fishy going on in my proper installation files...
Edit: it's also not a symlink issue, as it was able to find my symlinked appdata folder as evidenced in the log:
RimSearch
Log Openned: 09:04:19 05-12-2015
Mod directory: Mods\
Building library...
Locating ModsConfig.xml...
xml: C:\Users\[edited]\AppData\LocalLow\Ludeon Studios\RimWorld\Config\ModsConfig.xml...
Creating xml tree..
Mod: Core
xml: Mods\Core\Defs\ResearchProjectDefs\ResearchProjects_Misc.xml...
Creating xml tree..
Importing xml...
Imported
xml: Mods\Core\Defs\ResearchProjectDefs\ResearchProjects_Ship.xml...
Creating xml tree..
Importing xml...
Imported
Mod: EdBModOrder
Mod: EdBInterface
Mod: EdBPrepareCarefully
Mod: LessIncidentTrolling
Mod: Icons
Mod: GlitterTech
Mod: Apothecarius
Mod: ProjectArmory300
Mod: ERT 1.6- ResearchConsole
Mod: Clutter
Mod: Miscellaneous_HiRes
Mod: More Vanilla Turrets
Mod: Turret Collection
Mod: Turret Collection Overkill
Mod: Common
Mod: AutoHuntBeacon
Mod: VeinMiner
Mod: MoreHair
Mod: AnimuHair
Mod: MD2Base-6
Mod: MD2Droids-3
Mod: MD2Storage-3
Mod: MD2Fortifications-2
Mod: MD2Industry-5
Mod: MD2Manufacturing-9
Mod: MD2Power-3
Mod: ED-Core
Mod: ED-AutoLoader
Mod: ED-Plants24H
Mod: ED-DeepStrike
Mod: ED-Embrasures
Mod: ED-LaserDrill
Mod: ED-OmniGel
Mod: ED-PersonalNanoShields
Mod: ED-ReverseCycleCooler
Mod: ED-Shields
Mod: ED-Stargate
Mod: ED-Vent
Mod: M&Co. Common
Mod: M&Co. MMS
Mod: MedicineKitCrafting 1.3.5
Mod: Glassworks
Mod: FloorLights
Mod: CryptoHax
Mod: BionicReplacementsCrafting 1.0
Mod: Backstories-u2
Mod: Armor Crafting 1.0
Mod: AlphaMuffalo1.7
Mod: AdvancedLamps
Mod: MIRV Artillery 1.2.5
Mod: NeurotrainerCrafting 1.0
Mod: PowerSwitch
Mod: ReplacementOrganCrafting 1.0
Mod: RW_A2B-0.10.0
Mod: TilledSoil
Mod: Weapon Crafting 1.3.75
Mod: OmniStorage
Mod: OmniMedical
Mod: OmniLighting
Mod: OmniFactions
Mod: OmniJoy-Darts
Mod: NonLethals
Mod: M&Co. MiningHelmet
Mod: M&Co. AlertSpeaker
Mod: NanoFusionReactor
Scanning all research...
Scanning for missing nodes...
Building relationship tree...
Calculating node depths...
Adding bridges...
Sorting nodes...
Assigning node render placement...
Done
Rendering Tree:
I'm glad it's working for people and reduce the amount if info logged to basics/errors. Further, my local copy now also injects missing research prerequisites and makes them red for easy identification.
I'm also looking at getting it to tell more about the tech when hoving the mouse including, files which define it in mod order, highlighting the parent tree and directly opening the file(s) the tech is defined.
Much better then the graphic I used for Glittertech which never saw the light of day.
Quote from: SamMuch better then the graphic I used for Glittertech which never saw the light of day.
heh, right now it's just vector graphics and a raster font.
I've done a small update on it because it suddenly crashed on my while working on my personal modpile (after integrating Fishing Industry I ran it again to give me the new tech and *BOOM*).
The crash actually had nothing to do with Fishing Industry, it had to do with the Community Core Library (WIP) which added a "hidden" tech (self-prerequisite) and *that* caused the crash (resolved tech level to -1, derp). Now, it handles such techs (I down-extended the arrays from 0 to 99 to -1 to 99). So, it can handle 101 levels of tech now, each level can have 100 techs in it, for a total of 10100 techs. I can extend that if need be but I build a matrix array for faster placement instead of constantly re-iterating the tech tree, I can do a fast loop through the array.
While I had the source open and in front of me, I finally got around to the branch pruning too. Now branches which could previously have been logically shared are.
It's really useful! Thanks E!
Research tree from my modpack. (http://i.imgur.com/l98mquh.png)
Now i can see what i should fix without searching in tons of xmls!
Thanks, it's tech trees like that that I decided to make the program. After trying to map out the tech tree in Paint Shop Pro by manually scanning xml for maybe half an hour I said, "f*ck this sh*t," and in an hour wrote v0.0.0.1 of the RimSearch tool. Then the debugging and improvements.
Anyway, this saves me time when integrating mods into my personal modpile and figured it would be useful to others too. I'm glad you find it useful and seeing as in less than 24 hours more than a couple people downloaded the latest update, others must find it useful too.
Next update:
+ More info when hovering the mouse over tech
. Defining files in load order
. Directly opening files
. Things unlocked by tech
. Research cost
. Total tree-to-point research cost
+ Ability to scan Community Core Library (WIP) AdvancedResearchDefs
. Things unlocked by Advanced Research (multi-tech)
. Recipes unlocked by Advanced Research
Hopefully I will be able to get Community Core Library into a usable state for Alpha 11. I've been using it in my modpile while working on it and I've refined quite a bit (removed some because it's just not feasible like all NPD and hopper related code) but it still needs work for a proper public release.
ETA for RimSearch and Community Core Library:
Second tuesday in Novebuly. ;p
1000101, every time I run rimsearch on a w7 32bit rimworld a10 with a LARGE pile of mods I get a crash on Apothecarius. attached is the output log from the last run, btw rimworld run with the modsconfig stack also attached
[attachment deleted due to age]
I took a look at Apothecarius and the only thing is that Soylent Green research doesn't have a prerequisites tag and that causes the crash.
My code actually tested but a compiler code generation error optimized it out. Switched to a more robust means of checking and it doesn't crash anymore (in that particular situation).
OP updated with bug-fix.
Thanks for reporting.
Why am I bumping this? I don't know. But I do know that I updated it after quashing a couple compiler related bugs (seriously, how does "If( ptr )Then..." not equate to "If( ptr <> NULL )Then..." I don't know but now I force the checks even though they should be implicit).
New info window, F5 reloading, tech highlighting, different bugs to crop up, it's got it all! See OP (https://ludeon.com/forums/index.php?topic=12064) for details!
sorry to upset you, BUT I just downloaded and tested (on the SAME modstack) and it is STILL crashing in Apothecarius, are there ANY possible dependencies that could be causing the issue??
Ok, so after searching around, running RimSearch in a debugger, etc, etc...it's a combination of two things, Apothecarius' terrible xml and the xml library choking on said terrible xml.
Apothecarius' "research.xml" has a space on line 16 between "<prerequisites>" and "<li>" and that is causing the crash, even though it shouldn't.
Unfortunately I can't fix that as it's in the xml parser. Just remove that space and it seems to work. The reason it didn't happen to me yesterday is that after loading the xml to take a look at it, I prettied up the xml so it was readable and had actually removed that.
So, Apothecarius is crashing for two reasons:
1) No <prerequisites> in Soylent Green, my bad code now fixed, and;
2) A space between two xml tags on the same line, not my bad code, but still bad code and nothing I can do to fix that one.
I had a look for what is "correct" xml syntax but my search was inconclusive on whitespace between tags on the same line. From what I can tell, it should be allowed and therefore the library I am using has bad code.
So, make sure the xml is formatted correctly (which I'm not 100% sure Apothecarius is properly formatted) or at very least isn't too wanked (and Apothecarius' xml formatting is definitely wanked).
Edit:
No worries about "upsetting" me. :) In the software world, "bugs happen" :)
as a fellow pogrammer(and have been programming since 1979), I do have an idea exactly how frustrating subtle bugs are to find and fix espeically in a unpaid urgent situation, which is why I used the defusing emotition statement,
and thank you for identifying the actual cause of the problem
WOW!!! That's supergreat thing!
And I know how to make it uber-supergreat (if you ever have time for this) - show somehow buildings that are unlocked with each research. Either on big picture or in info box for selected tech. ::)
That's been on my todo list for a while now, as well as Community Core Library (https://ludeon.com/forums/index.php?topic=14172.0) Advanced Research in regards to showing buildings and recipes unlocked.
Updated today.
Minor bug fixes, small improvements, optimizations, png exporting instead of bmp.
Edit:
Fixed a small bug where it wouldn't load the xml files in an external editor. Sorry to anyone who downloaded it already.
Updated to play nice with Alpha 13.
Handles abstract parents in a single file! Not the xml specification breaking which RimWorld supports.
No download file :(
confirmed lack of attachment
message is
[attachment deleted due to age]
« Last Edit: April 20, 2016, 03:45:33 PM by 1000101 »
Fixed
Stupid forums...deleting my brand new files...not letting me just replace them...gotta fail at being smart...
Updated for A14 change of "totalCost" which has become "baseCost".
Does this require DotNet 4 / 4.5 ?
When I run this currently, nothing happens - no window, no output, not errors. But I also think I'm running an old version of Dotnet.
I don't suppose it's because I'm running a portable batch script, eh ?
"RimWorld1241Win.exe -savedatafolder=SaveData"
hmm, I should actually add the -savedatafolder command-line switch to RimSearch to handle that. Currently it looks for the ModsConfig.xml in the default location.
As far as system requirements, this is a native 32-bit application for Windows so you don't need anything except a Pentium (80586) or compatible CPU, 16MB RAM and Windows 95 or later. ;)
This looks like it has a lot of potential. However, when it created my research tree it tried to squeeze together 97% of my techs into three tightly-packed vertical columns and linked most of them to Electricity and Microelectronics Basics. With countless lines connecting to those two techs, this makes the chart very hard to read. The lines overlap so much I can't tell exactly what is pointing to what.
Would it be possible, in a future version, to try to get it to space these out horizontally in a way that makes it much easier to read? IMO, that would make this much more useful.
P.S.: Perhaps it has something to do with how I have several dozens of mods?
It builds tiers of research based on their parents, recursively. If you have a lot of research depending on a single parent then they will all be on the same tier and it can make for one big mess. :P
I have considered updating the interface to account for those nasty spiders nests though. The only problem is time... :(
Can you upload the file again? please!!!
so I've spent quite a bit of time trying to find a way to edit the research tree with no luck; so that I could lock certain mod-implemented items behind research rather than having those items from the start of the game. Would you happen to know if there's any way to create new research options that allow me to lock these items behind it and then using this tool to organize those new research trees?
@manelmp66:
The download links are at the bottom of the original post. They seem to be there for me...?
@deadlydullahan:
The program shows a list of files which define the research defs. You can click on those to open the files. The research tree is pretty simple to edit and modify, just remember that the last mod loaded takes precedence. So make your own "research tree mod" which simply overrides the mods linking the tree as you like. You can do this with RimSearch open and just hit 'F5' to reload the tree from the files (be sure to save the xml files before refreshing the tree).
Is there any (alternate?) download for the tool? Original attachment seems to have been deleted.
I was trying to create a graph of my current mod set (Lovely ingame layout here (http://images.akamai.steamusercontent.com/ugc/87093707062886107/F52EA392A2E0A0399CE207EA4A3C70540D477616/?interpolation=lanczos-none&output-format=jpeg&output-quality=95&fit=inside%7C2048:1152&composite-to%3D%2A%2C%2A%7C2048%3A1152&background-color=black)), was thinking about scanning the xmls, building a nice graph and dumping it all out into graphviz, but since someone else already wrote the code, I'd happily take that as a starting point... Sadly... no code to look at :(
I'm not really modding RimWorld anymore and don't plan on re-uploading this. The code was written in FreeBasic as a proof of concept (originally) but I never ported it over to C# (actually, I did and people in Discord have seen it and have copies). In any event, this can be considered dead.