Jump to content

[1.0.4] YongeTech Tech Trees Plugin (v1.3)


yongedevil

Recommended Posts

YongeTech Tech Trees Plugin

version: 1.3

last tested with Kerbal v1.0.4

Kerbal Stuff Link

Source on GitHub

Xi4qKoj.jpg

About the Mod

The Tech Trees Plugin provides support to make creating and using custom tech trees easier.

  • Allows part unlocks to be listed in the TechTree ConfigNode rather than having to edit every Part ConfigNode.
  • Adds support for using custom textures to create icons for the tech tree.
  • Adds a tree selection window to let the player select a tree for each new game.

Installation

Copy the contents of GameData into the Kerbal GameData folder.

Known Issues

This mod tracks parts by their name field. This means it does not work properly when multiple parts have the same name.

Both this mod and ModuleManager (on version 2.6.5 as of this writing) attempt to edit the tech tree of the current game. This mod's changes should have priority.

If you would like to disable the option to select a tech tree and the conflict with ModuleManager change the "allowTreeSelection" field in PluginData/YongeTech_TechTreesExpansion/config.xml from '1' to '0'. This will keep support for the TechTree ConfigNode additions and custom icon support, but remove the option to select a tech tree.

Tech Trees

YongeTech: Great Big Sky – Wide and shallow tech tree. Feel free to use as an example on how to setup a tech tree with this mod.

Using a Tech Tree

When starting a new Science or Career game a window will appear asking you to select a tech tree to use. Pick a tree from the drop-down list and below it will show the description and some stats for that tree.

Total Cost and Total Nodes are the total cost to researcher all nodes on the tree and the total number of nodes in the tree. These numbers exclude hidden nodes. The tiers for the nodes are those nodes that can be researched at that tier of the Research and Development facility.

Creating a Tech Tree

Create a new TechTree ConfigNode and place in your mod. This mod will locate and add any TechTree ConfigNodes to the list automatically.

The TechTree should be setup like normal with some additions shown in the code below:


TechTree
{
title = Sample TechTree
description = An incomplete TechTree showing the basic setup
unlockAllStartParts = True

RDNode
{
...
Unlocks
{
part = solidBooster_sm
part = probeStackAdapter
part = standardNoseCone
part = sensorThermometer
part = basicFin
}
}
...
}

TechTree ConfigNode:

title: The name of the tree. Displayed in the tech tree selection window when starting a new game. (approximately a 45 character limit)

description - Single paragraph description of the tree for the player. Displayed in the tech tree selection window when starting a new game. (approximately a 400 character limit)

unlockAllStartParts: (optional) If set to True the mod will unlock all parts attached to the starting node(s), that is all RDNodes with an entryCost of 0. This is only relevant if No Entry Purchase Required on Research is disabled in difficulty settings.

Unlocks ConfigNode:

part: name of a part to unlock with the parent RDNode.

Custom Icon Textures

The mod will create icons for use in a tech tree from any png or tga files it finds in folders named “RDSimpleIconsâ€Â. The icons will have the same name as the image file, without the extension.

.../RDSimpleIcons/customIcon_tech.png will become "icon = customIcon_tech"

Tech Tree Converter

The YongeTech Tech Tree Converter helps convert existing tech trees by filling in the Unlocks nodes for all techs. It will add all parts that:

  • Have a TechRequired of that node.
  • Are not listed in another tech node's Unlock section.

It writes the filled out TechTree to a txt file in the mod's directory. It performs this conversion for all TechTrees installed, and it also dose not name the output files in any meaningful way. It is necessary to inspect the output files to locate the correct tree and then add the title and description fields to it.

Licence

Permission is hereby granted, free of charge, to any person obtaining a copy

of this software and associated documentation files (the "Software"), to deal

in the Software without restriction, including without limitation the rights

to use, copy, modify, merge, publish, distribute, sublicense, and/or sell

copies of the Software, and to permit persons to whom the Software is

furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in

all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR

IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,

FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE

AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER

LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,

OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN

THE SOFTWARE.

Edited by yongedevil
updated to v1.3
Link to comment
Share on other sites

Yes, the main intent for the mod is to avoid having to setup edits for each individual PART node. As an added benefit though, with the part unlocks stored in with the TechTree it is easy to have multiple trees installed and pick one to be active.

Link to comment
Share on other sites

I made a small update to the mod (v1.1) to fix undoing other mod's changes to the TechRequired field. This was causing a problem with the unlocks for additional features in MechJeb.

I don't have much else planned for this mod now, but I have a short list of features that should be possible. I can look at adding the following if there is demand for them:

Option to link a texture to the tech tree for the selection window. This would give the player a visual cue to remember each tree. This could be a small logo, or a link to open a larger image such as a preview of the tech tree.

Option to move all parts that are, by default, unlocked by one tech to another. This would allow creating tech trees without worrying about mod parts getting lost in the missing techs.

Tech tree debug tools. This would be an option to enable debug messages for a tech tree and could check for some problems such as:

  • Missing default tech nodes, which can cause parts added to those node by mods to not show up unless the parts are specifically reassigned.
  • Parts whose TechRequired doesn’t exist in the tree. Basically the above problem but only checks installed parts.
  • Unknown part values in the Unlocks. These can be legitimate if you add support for mod parts not currently installed, but they could also be typos.
  • Duplicate part values in the Unlocks.

And I am sorry I wasn't able to get the mod out sooner. I put this aside due to the ModuleManager conflict for about a month (28 days according to commit logs) because it seamed it might be a dead end. Normally I don't have a problem with being incompatible with another mod that does the same thing (both this mod and ModuleManager edit the TechTree for saved games), but ModuleManager dose too many other very useful things to ask people to uninstall for this mod. In the end though, the workaround was one of those simple solutions that make you feel like an idiot for not seeing sooner. :P

Link to comment
Share on other sites

One small UI tweak would be good. There's nothing on that start-screen to indicate there's a drop-down menu to list the available tech trees, nothing to show that there is an alternative available.

I don't think I see this every time, but the same symbol as used on a Windows scroll-bar is common. That's in Unicode, at U+25BC and called the Black Down-Pointing Triangle. â–¼

The first time I tried the plug-in I did wonder if the other tech tree had been installed properly.

Link to comment
Share on other sites

Updated to v1.2 with an arrow for the dropdown button. Thank you Wolf Baginski.

Also made sure the stock tree will always be first in the list.

EDIT (2015-06-24): Updated to v1.2.1 to fix and error where the plugin crashed if given two parts with the same name. It still won't handle the parts correctly, but it won't crash.

Edited by yongedevil
update to v1.2.1
Link to comment
Share on other sites

I'm working on YongeTech versions of the Stock tree (more as a reference source) and the Community Tech Tree.

Thread here: http://forum.kerbalspaceprogram.com/threads/127408-Using-the-YongeTech-tech-tree-plug-in

Since most Tech Trees seem to contain the Stock Tree and add to it, having a full YongeTech version of the stock tree seems useful as a resource, even with YongeTech able to use the stock tree.

I have some testing yet to do, before I release test versions.

Link to comment
Share on other sites

Feature suggestion: automatic node positioning depending on parent nodes.

I'm sorry, but I think it is too complex a problem for me. However, if anyone knows of any simple solutions I can take a look at it.

I'm working on YongeTech versions of the Stock tree (more as a reference source) and the Community Tech Tree.

That seams like a very good idea and it got me thinking that it would be handy to have the game print out a list of parts attached to a tech node, which led to the realization that it should be quite simple to just have the game print out a complete TechTree node and fill in the Unlocks node with parts automatically. Basically it could convert from the Stock or a ModuleManager tree into a YongeTech tree.

If this is as easy as I think it is I will have something rudimentary tomorrow (out tonight, holiday). And apologies to you Wolf Baginski since it sounds like you've done a lot of this work already.

Link to comment
Share on other sites

I'm sorry, but I think it is too complex a problem for me. However, if anyone knows of any simple solutions I can take a look at it.

Maybe simpler positioning then? For Tech Tree creator to specify column and row, not absolute position.

Link to comment
Share on other sites

First, a updated to v1.3. This adds support for .dds icon textures.

Second, the Tech Tree Converter is working. This will fill out the Unlocks node for any installed tech trees by adding all parts that:

  • Have a TechRequired of that node.
  • Are not listed in another tech node's Unlock section.

The output is written to files inside the ConvertedTrees directory.

To use install the tech tree you wish to convert and start Kerbal. The Tech Trees Plugin does not have to be installed for this. Once the main menu loads you can quit and look inside ConvertedTrees for the output. Find the tree you were trying to convert, sorry about not giving them meaningful names. You will have to add the "title" and "description" fields and renamed the file to .cfg.

This is obviously limited to converting one tree at a time, and it is not the fastest process in the world. I suggest removing the plugin when done with it, or at least setting the "enable" field in the config.xml file to 0.

Link to comment
Share on other sites

Maybe simpler positioning then? For Tech Tree creator to specify column and row, not absolute position.

That certainly qualifies a simple solution.

I've done some experiments to see how nodes can be moved around and it looks like it might not be possible to do so without editing the file. Having the game edit the .cfg files is not the best practice. Another option is a separate program to do the coordinate conversions, which honestly isn't really worth the effort for such a simple task. However, it wouldn't take much effort to add such a feature to the Converter. It wouldn't be the most user friendly solution but the plugin already exists to assist in creating TechTrees.

Would that still be useful enough to be of interest? You would have to launch Kerbal to generate the output file with the converted positions before releasing the tech tree.

Link to comment
Share on other sites

Would that still be useful enough to be of interest? You would have to launch Kerbal to generate the output file with the converted positions before releasing the tech tree.

I think yes. You still need to launch KSP before releasing the TechTree, just to check.

Link to comment
Share on other sites

  • 1 month later...

Ohh

It seem to be a useful mod (so much better syntax than stock). I wish this existed months ago..

I have a feature request:

- to be able to define multiple tree (with unique id) and be able to assign one (other than the default) at a savegame (via a ScenarioModule field, for example)

Use-case: to create scenario with dedicated small tech tree, in the same game installation than normal games (i don"t want to force people to clone their ksp for each scenario i make).

(When/if i have time, i may look into it to add this feature, it shouldn't be too hard)

Link to comment
Share on other sites

  • 5 months later...

@yongedevilThis is awesome, awesome, awesome!  Especially when used with the "Kerbal Mod Admin" mod.

I've been doing everything in Notepad++.  Needless to say it was taking forever.

Any chance we could get a recompile to 1.0.5?

Edited by Probus
I forgot to say please :)
Link to comment
Share on other sites

  • 1 year later...
  • 10 months later...
This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...