There is a lot of moaning comming from people looking at their mech collection, being intimidated by the gigantic heap of skill points to be assigned which is so huge it blots out the sun.
There have been suggestions for easing the burden of assigning skillpoints, like filling in the complete path from the root node to the chosen node. I'd like to take a closer look at another suggestion: Saving specific skill assignments as templates.
To make this feature happen, there need to be two functions: saving a template and loading a template.
This leads to the question of what format to use to save skill tree templates in.
I'd like to suggest using JSON since:
- It is a human readable format, enabling people to exchange skill tree templates via forum/email
- It is a human readable format, making debugging easier
- It is not as verbose as other human readable formats, e.g. XML
- It is simple yet powerfull
- Good parsing libraries are readily available, f.e. RapidJSON https://github.com/miloyip/rapidjson/ (available under a permissive open source license [MIT license/JSON license])
A skill tree in JSON could look like this:
{ "skilltree" : [ { "node_id" : "Range 1", "state" : "active" }, { "node_id" : "Range 2", "state" : "active" }, { "node_id" : "Target Info Gathering 1", "state" : "active" }, { "node_id" : "Target Info Gathering 2", "state" : "inactive" } ] }
What we see here is a JSON object with a member named skilltree which contains a JSON array of JSON objects. The objects inside the array model the skill tree nodes, the outside object is just a container.
This small example has four nodes: Range 1, Range 2 and Target Info Gathering 1 are active, while Target Infor Gathering 2 has been bought, but is inactive.
Notice that nodes which have not been bought yet do not need to be saved. Thankfully, all nodes in the tree have unique IDs.
Saving a template
When a player clicks on the (then newly added) save template button, a dialog will be shown. The user will be able to navigate to a place on their harddrive where they would like to store the template file. A checkbox will allow users to choose between exporting active and inactive nodes, or just active nodes. Upon confirmation, the saving operation is carried out.
To save a template, visit each tree in the skill forest, visit each node whithin that skill tree and if that node is active (or, if it is inactive and inactive nodes are to be exported), it is coverted to a JSON object.
Loading a template
When a player clicks on the (then newly added) load template button, a dialog will be shown. The user will be able to navigate to a saved template file. A checkbox will allow the user to choose between adding the template to the skill tree or overwriting the skill tree with the template. Upon confirmation, the JSON document is parsed in. If overwriting is chosen, all nodes in the skill forest are deactivated (e.g. set inactive). All nodes are then sorted by level in the tree and skill tree, e.g. Range 1 before Range 2, both into a list for the firepower tree. Then, each list is iterated and each node in turn set to the new status. The user then has to click apply changes to save the changed skill tree.
Ofc, there is a caveat: If a node is deactivated in the tree and activated in the template, the user should be able to choose between using XP or GXP to activate such nodes.
The state changes for nodes would be
(old state, state in template) -> result
(not bought, active) -> active
(not bought, inactive) -> inactive
(inactive, active) -> active (but player needs to choose XP vs. GXP)
(inactive, inactive) -> inactive
Nodes which are not in the template will be either (re-)set to inactive on overwriting or will not be touched on adding a template.
Moving nodes into the right order into the right list on loading could be sped up using a precomputed map
node_id -> (list, index_in_list)
e.g. Range 1 -> (firepower, 0)
and using level-order node indices (similar to a breath first search https://en.wikipedia...th-first_search).
I don't know how gui widgets in cryengine work and have no clue about MWO internals, so I can not judge the time needed for implementation + debugging precisely, but it should be doable within one or two weeks.
Edit: A similar mechanism could be used for client side saving/loading of mech loadouts.
Edited by Exilyth, 19 May 2017 - 03:10 PM.