Skip to content

Commit

Permalink
Rebrand
Browse files Browse the repository at this point in the history
  • Loading branch information
notfood committed Aug 30, 2018
1 parent 18f3618 commit 7b5c348
Show file tree
Hide file tree
Showing 32 changed files with 151 additions and 513 deletions.
74 changes: 19 additions & 55 deletions About/About.xml
Original file line number Diff line number Diff line change
@@ -1,56 +1,20 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?xml version="1.0" encoding="utf-8"?>
<ModMetaData>
<name>Research Tree</name>
<author>Fluffy</author>
<url>https://ludeon.com/forums/index.php?topic=16120</url>
<targetVersion>0.19.1996</targetVersion>
<description>A better research tree.

&lt;size=24&gt;Features&lt;/size&gt;

automatically generated to maximize readability*.
shows research projects, buildings, plants and recipes unlocked by each research project.
projects can be queued, and colonists will automatically start the next project when the current research project completes.
search functionality to quickly find research projects.

&lt;size=24&gt;FAQ&lt;/size&gt;
&lt;i&gt;Can I add/remove this from an existing save?&lt;/i&gt;
You can add it to existing saves without problems. Removing this mod will lead to some errors when loading, but these should not affect gameplay - and will go away after saving.

&lt;i&gt;Why is research X in position Y?&lt;/i&gt;
Honestly, I have no idea. The placement of projects (nodes) is automated to minimize the number of crossings between dependancies (edges), and reduce the total length of these edges. There are many possible scenarios in which this can lead to placements that may appear non-optimal. Sometimes they really are non-optimal, sometimes they just appear to be so. See also the &lt;i&gt;technical&lt;/i&gt; section below for more information.

&lt;i&gt;Can I use this with mod X&lt;/i&gt;
Most likely, yes. Added researches and their requirements are automatically parsed and the tree layout will be updated accordingly. ResearchPal implements a lot of the same functionality as this mod, and the research queue will likely not work correctly if both mods are loaded.

&lt;i&gt;This looks very similar to ResearchPal&lt;/i&gt;
Yep. ResearchPal is based on a legacy version of this mod that was kept up-to-date by SkyArkAngel in the HCSK modpack. I haven’t worked on this mod in a long time, but I recently had some spare time and decided to give it another go. Feel free to use whichever you like better (ResearchPal has an entirely different layout algorithm). You can run both mods side by side to check out the different tree layouts, but be aware that the research queue will not work correctly if both mods are loaded.

&lt;size=24&gt;Known Issues&lt;/size&gt;

The vertical labels for tech levels are drawn in the wrong location when UI scale is not 1. This is a known problem for me, the same issue appears in my Work Tab mod. As soon as I have a working solution, I’ll go and fix it.
Layouts are not perfect, if you have experience with graph layouts - please do feel free to look at the source code, and/or implement a Sugiyama layout algorithm for me that runs in C# .NET 3.5 (Mono 2.0).

&lt;size=24&gt;Technical&lt;/size&gt;
So how does this all work?

Creating an optimal layout is a known problem in the area of &lt;i&gt;Graph Theory&lt;/i&gt;. There’s serious mathematicians who’ve spent years of their live trying to figure out this problem, and numerous solutions exist. The group of solutions most relevant to our research tree (a &lt;i&gt;directed acyclic graph&lt;/i&gt;, or &lt;i&gt;DAG&lt;/i&gt;) is that derived from Sugiyama’s work. Generally speaking, these algorithms have four steps;


layering (set the &lt;i&gt;x&lt;/i&gt; coordinates of nodes, enforcing that follow-up research is always at a higher x position than any of its prerequisites, this is a fairly straightforward heuristic)
crossing reduction (set the &lt;i&gt;y&lt;/i&gt; coordinates of nodes such that there is a minimal amount of intersections of connections between nodes)
edge length reduction (set the &lt;i&gt;y&lt;/i&gt; coordinates of nodes such that the length of connections between nodes is minimal)
horizontal alignment (set the &lt;i&gt;y&lt;/i&gt; coordinates of nodes such that the connections between nodes are straight as much as possible)

The final step is the hardest, but also the most important to create a visually pleasing tree. Sadly, I’ve been unable to implement two of the most well known algorithms for this purpose;


Brandes, U., &amp; Köpf, B. (2001, September). Fast and simple horizontal coordinate assignment.
Eiglsperger M., Siebenhaller M., Kaufmann M. (2005) An Efficient Implementation of Sugiyama’s Algorithm for Layered Graph Drawing.
Luckily, the crossing reduction and edge length reduction steps partially achieve the goals of the final step. The final graph is not as pretty as it could be, but it’s still pretty good - in most scenarios.

&lt;size=24&gt;Version&lt;/size&gt;
This is version 2.15.465, for RimWorld 0.19.1996.

</description>
</ModMetaData>
<name>ResearchPal</name>
<author>notfood</author>
<url>https://ludeon.com/forums/index.php?topic=33593.0</url>
<targetVersion>0.19.0</targetVersion>
<description>Smooth painless research
# Features
- automatically generated to maximize readability*.
- shows research projects, buildings, plants and recipes unlocked by each research project.
- projects can be queued, and colonists will automatically start the next project when the current research project completes.
- search functionality to quickly find research projects.
- helptab integration, right click the researches for extra information.

# Credits:
All the work by Fluffy
Some optimizations by NotFood
Previous updates by NotFood and Skyarkangel
</description>
</ModMetaData>
Binary file modified About/Preview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions About/PublishedFileId.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
946390822
Binary file modified Assemblies/ResearchTree.dll
Binary file not shown.
6 changes: 3 additions & 3 deletions Defs/MainTabDefs/MainTabWindow.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<defName>Research</defName>
<label>research</label>
<description>Examine and decide on research projects.</description>
<workerClass>FluffyResearchTree.MainButtonWorker_ResearchTree</workerClass>
<tabWindowClass>FluffyResearchTree.MainTabWindow_ResearchTree</tabWindowClass>
<workerClass>ResearchPal.MainButtonWorker_ResearchTree</workerClass>
<tabWindowClass>ResearchPal.MainTabWindow_ResearchTree</tabWindowClass>
<order>50</order>
<defaultHotKey>F5</defaultHotKey>
</MainButtonDef>

</Defs>
</Defs>
78 changes: 39 additions & 39 deletions Languages/English/Keyed/KeyedTranslations.xml
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
<?xml version="1.0" encoding="UTF-8" ?>
<LanguageData>

<Fluffy.ResearchTree>ResearchTree</Fluffy.ResearchTree>

<Fluffy.ResearchTree.AllowsBuildingX>Enables construction {0}</Fluffy.ResearchTree.AllowsBuildingX>
<Fluffy.ResearchTree.AllowsCraftingX>Enables recipe {0}</Fluffy.ResearchTree.AllowsCraftingX>
<Fluffy.ResearchTree.AllowsSowingXinY>Enables planting {0} in {1}</Fluffy.ResearchTree.AllowsSowingXinY>
<Fluffy.ResearchTree.AllowsPlantingX>Enables growing {0}</Fluffy.ResearchTree.AllowsPlantingX>

<Fluffy.ResearchTree.LClickReplaceQueue>Left-Click to replace queue</Fluffy.ResearchTree.LClickReplaceQueue>
<Fluffy.ResearchTree.LClickRemoveFromQueue>Left-Click to remove from queue</Fluffy.ResearchTree.LClickRemoveFromQueue>
<Fluffy.ResearchTree.SLClickAddToQueue>Shift-Left-Click to add to queue</Fluffy.ResearchTree.SLClickAddToQueue>
<Fluffy.ResearchTree.CLClickDebugInstant>(DEBUG) Ctrl-Left-Click to instantly complete</Fluffy.ResearchTree.CLClickDebugInstant>
<Fluffy.ResearchTree.RClickForDetails>Right click for details</Fluffy.ResearchTree.RClickForDetails>

<Fluffy.ResearchTree.Requires>Requires</Fluffy.ResearchTree.Requires>
<Fluffy.ResearchTree.LeadsTo>Leads to</Fluffy.ResearchTree.LeadsTo>

<Fluffy.ResearchTree.QueuedNode>Already queued node</Fluffy.ResearchTree.QueuedNode>
<Fluffy.ResearchTree.MissingFacilities>Missing {0}</Fluffy.ResearchTree.MissingFacilities>

<Fluffy.ResearchTree.NoResearchFound>no research found</Fluffy.ResearchTree.NoResearchFound>
<Fluffy.ResearchTree.NothingQueued>no research queued</Fluffy.ResearchTree.NothingQueued>
<Fluffy.ResearchTree.NextInQueue>Next in queue: {0}</Fluffy.ResearchTree.NextInQueue>

<Fluffy.ResearchTree.BuildingResearchTree>Building Research Tree</Fluffy.ResearchTree.BuildingResearchTree>
<Fluffy.ResearchTree.PreparingTree.Setup>Preparing research nodes</Fluffy.ResearchTree.PreparingTree.Setup>
<Fluffy.ResearchTree.PreparingTree.CrossingReduction>Reducing crossings</Fluffy.ResearchTree.PreparingTree.CrossingReduction>
<Fluffy.ResearchTree.PreparingTree.Layout>Finalizing layout</Fluffy.ResearchTree.PreparingTree.Layout>
<Fluffy.ResearchTree.RestoreQueue>Restoring queue</Fluffy.ResearchTree.RestoreQueue>

<Fluffy.ResearchTree.ShowNotificationPopup>Show Notification Popup</Fluffy.ResearchTree.ShowNotificationPopup>
<Fluffy.ResearchTree.ShowNotificationPopupTip>Whenever you finish research, pause and show the default notification.</Fluffy.ResearchTree.ShowNotificationPopupTip>
<Fluffy.ResearchTree.ShouldSeparateByTechLevels>Group Researches by Tech Level</Fluffy.ResearchTree.ShouldSeparateByTechLevels>
<Fluffy.ResearchTree.ShouldSeparateByTechLevelsTip>Otherwise use a more dense layout (REQUIRES RESTART)</Fluffy.ResearchTree.ShouldSeparateByTechLevelsTip>
<Fluffy.ResearchTree.ShouldPauseOnOpen>Pause on Display</Fluffy.ResearchTree.ShouldPauseOnOpen>
<Fluffy.ResearchTree.ShouldPauseOnOpenTip>Whenever the game should pause when the research tab is displayed.</Fluffy.ResearchTree.ShouldPauseOnOpenTip>
<Fluffy.ResearchTree.ShouldResetOnOpen>Reset on Display</Fluffy.ResearchTree.ShouldResetOnOpen>
<Fluffy.ResearchTree.ShouldResetOnOpenTip>Clear filtering and reset scroll position.</Fluffy.ResearchTree.ShouldResetOnOpenTip>
<ResearchPal>ResearchPal</ResearchPal>

<ResearchPal.AllowsBuildingX>Enables construction {0}</ResearchPal.AllowsBuildingX>
<ResearchPal.AllowsCraftingX>Enables recipe {0}</ResearchPal.AllowsCraftingX>
<ResearchPal.AllowsSowingXinY>Enables planting {0} in {1}</ResearchPal.AllowsSowingXinY>
<ResearchPal.AllowsPlantingX>Enables growing {0}</ResearchPal.AllowsPlantingX>

<ResearchPal.LClickReplaceQueue>Left-Click to replace queue</ResearchPal.LClickReplaceQueue>
<ResearchPal.LClickRemoveFromQueue>Left-Click to remove from queue</ResearchPal.LClickRemoveFromQueue>
<ResearchPal.SLClickAddToQueue>Shift-Left-Click to add to queue</ResearchPal.SLClickAddToQueue>
<ResearchPal.CLClickDebugInstant>(DEBUG) Ctrl-Left-Click to instantly complete</ResearchPal.CLClickDebugInstant>
<ResearchPal.RClickForDetails>Right click for details</ResearchPal.RClickForDetails>

<ResearchPal.Requires>Requires</ResearchPal.Requires>
<ResearchPal.LeadsTo>Leads to</ResearchPal.LeadsTo>

<ResearchPal.QueuedNode>Already queued node</ResearchPal.QueuedNode>
<ResearchPal.MissingFacilities>Missing {0}</ResearchPal.MissingFacilities>

<ResearchPal.NoResearchFound>no research found</ResearchPal.NoResearchFound>
<ResearchPal.NothingQueued>no research queued</ResearchPal.NothingQueued>
<ResearchPal.NextInQueue>Next in queue: {0}</ResearchPal.NextInQueue>

<ResearchPal.BuildingResearchTree>Building Research Tree</ResearchPal.BuildingResearchTree>
<ResearchPal.PreparingTree.Setup>Preparing research nodes</ResearchPal.PreparingTree.Setup>
<ResearchPal.PreparingTree.CrossingReduction>Reducing crossings</ResearchPal.PreparingTree.CrossingReduction>
<ResearchPal.PreparingTree.Layout>Finalizing layout</ResearchPal.PreparingTree.Layout>
<ResearchPal.PreparingTree.RestoreQueue>Restoring queue</ResearchPal.PreparingTree.RestoreQueue>

<ResearchPal.ShowNotificationPopup>Show Notification Popup</ResearchPal.ShowNotificationPopup>
<ResearchPal.ShowNotificationPopupTip>Whenever you finish research, pause and show the default notification.</ResearchPal.ShowNotificationPopupTip>
<ResearchPal.ShouldSeparateByTechLevels>Group Researches by Tech Level</ResearchPal.ShouldSeparateByTechLevels>
<ResearchPal.ShouldSeparateByTechLevelsTip>Otherwise use a more dense layout (REQUIRES RESTART)</ResearchPal.ShouldSeparateByTechLevelsTip>
<ResearchPal.ShouldPauseOnOpen>Pause on Display</ResearchPal.ShouldPauseOnOpen>
<ResearchPal.ShouldPauseOnOpenTip>Whenever the game should pause when the research tab is displayed.</ResearchPal.ShouldPauseOnOpenTip>
<ResearchPal.ShouldResetOnOpen>Reset on Display</ResearchPal.ShouldResetOnOpen>
<ResearchPal.ShouldResetOnOpenTip>Clear filtering and reset scroll position.</ResearchPal.ShouldResetOnOpenTip>

<Fluffy.ResearchTree.NeedsRestart>Research settings changed, restart RimWorld to apply the change.</Fluffy.ResearchTree.NeedsRestart>
<Fluffy.ResearchTree.ResearchFinished>Finished research: {0}</Fluffy.ResearchTree.ResearchFinished>
<ResearchPal.NeedsRestart>Research settings changed, restart RimWorld to apply the change.</ResearchPal.NeedsRestart>
<ResearchPal.ResearchFinished>Finished research: {0}</ResearchPal.ResearchFinished>
</LanguageData>
51 changes: 51 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# RimWorld-ResearchPal

[![Version](https://img.shields.io/badge/Rimworld-A19-green.svg)](http://rimworldgame.com/)
[![License: CC BY-NC-SA 4.0](https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-blue.svg)](http://creativecommons.org/licenses/by-nc-sa/4.0/)

Smooth painless research

# Features
- automatically generated to maximize readability*.
- shows research projects, buildings, plants and recipes unlocked by each research project.
- projects can be queued, and colonists will automatically start the next project when the current research project completes.
- search functionality to quickly find research projects.
- helptab integration, right click the researches for extra information.

# FAQ
### *Can I add/remove this from an existing save?*

You can add it to existing saves without problems. Removing this mod will lead to some errors when loading, but these should not affect gameplay - and will go away after saving.

### *Why is research X in position Y?*

Lonely unconnected researches will be found on top. The rest follows a stacking algorithm.

### *Can I use this with mod X*

Should work with everything, even alongside ResearchTree. They'll have different queues though.

### *This looks very similar to ResearchTree*

This is a fork, Fluffy's ResearchTree is the upstream project, there are minor but important differences between those two projects.
ResearchPal offers a denser layout and builds it as RimWorld starts. Less scrolling for the user and in my experience no slowdowns or lag.

# Technical
It's all magic. Fluffy knows the how, I just adapt things. See their [GitHub](https://github.com/FluffierThanThou/ResearchTree/#Technical).

# License
All original code in this mod is licensed under the [MIT license](https://opensource.org/licenses/MIT). Do what you want, but give me credit.
All original content (e.g. text, imagery, sounds) in this mod is licensed under the [CC-BY-SA 4.0 license](http://creativecommons.org/licenses/by-sa/4.0/).

Parts of the code in this mod, and some content may be licensed by their original authors. If this is the case, the original author & license will either be given in the source code, or be in a LICENSE file next to the content. Please do not decompile my mods, but use the original source code available on [GitHub](https://github.com/FluffierThanThou/ResearchTree/), so license information in the source code is preserved.

# Feeling grateful?
[Buy Fluffy a coffee](https://ko-fi.com/fluffymods). They did most of the work.


## Credits:
All the work by Fluffy

Some optimizations by NotFood

Previous updates by NotFood and Skyarkangel
Loading

0 comments on commit 7b5c348

Please sign in to comment.