Results 1 to 15 of 94

Thread: StompyNZ's Config Editor and Mod DB

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Colony Founder StompyNZ's Avatar
    Join Date
    Apr 2015
    Posts
    3,459
    Rep Power
    1

    StompyNZ's Config Editor and Mod DB

    INTRO
    Back in August 2015 I found myself playing on a lot of modded servers, and the problem I had was working out what changes had been made. This gave birth to the idea of a GUI interface to the xml config files, with support for mods as well.

    http://7days2mod.com/ was born as a result of this. What started out as just the blocks, items and recipes quickly grew into a GUI for the entire config of 7days to die. Along the journey to today I discovered a lot about xml and interacting with it via php. The first iteration converted the xml into an array, but that caused a lot of other problems, then I looked at simple_xml, but that too had issues I wasn't happy with. The third complete re-write of the system was the one I finally settled on, using php's DOMDocument class and XPath and I have found this to be a very useful way of navigating xml. This system has nice built in functions for creating consistently clean, well formatted code (ideal when using xml compare tools).

    CONFIG GUI
    http://7days2mod.com/ has both a GUI view mode, and an XML view mode, which lets you see the data in nicely formatted and sortable/filter enabled tables and detailed views, as well as a color enhanced xml view.


    The GUI view mode has links from the data to relevant parts elsewhere in the data. For example in the detailed blocks/items view things like materials, buffs, gun parts, recipe ingredients, upgrade/downgrade blocks etc are all click-able links that take you to the detailed view of those nodes.
    In addition to this there are the recipes for each block/item and what books are required to learn those recipes, lists of what loot containers/groups they are found in, entities that drop them in loot, the materials view lists what blocks/items have that material and so on.
    I will showcase most of these features in an intro video when I get a chance to record it as listing everything here would take far too long
    On the table views you can sort on each column (shift-click to sort multiple columns at once), you can filter every column with a fuzzy search, both of which are pushed to the url so that you can pass sorted and filtered links to others (for example http://7days2mod.com/_blocks#&sort(b...model%2C%2C%2C shows all blocks that contain model in the shape property, sorted by Shape and then Model)
    You can also change which columns are displayed on the table view via the Select Columns button. Which columns are shown are controlled via config files and future plans include the ability to customize which columns are displayed which a user will be able to save to their profile.
    The Nodelist view (http://7days2mod.com/_blocks_nodelist/view=showcount) shows all of the unique nodes found in the files that have this feature (currently blocks, items, buffs, materials, entity_classes) with a number in brackets to show how many times it was seen.


    MODS
    When it comes to Mods, the system works like this: http://7days2mod.com/ModName/ModVersion/_page (where _page is the name of the section, for example /_blocks or /_recipes), so for example the vanilla code is found at http://7days2mod.com/7d2d/14.6/, however http://7days2mod.com/7d2d/ will also point to the currently selected master version (editable via the Mod Admin page), and http://7days2mod.com/ by itself points to the vanilla mod and latest version. If the mod doesn't include a file that is found in the vanilla code then when you try to view those sections the vanilla code will be shown instead, with a note to indicate it is showing vanilla info.
    Each Mod has its own landing page where you can provide any info you want for your mods, including links to additional resources such as dll downloads, instruction guides, forums posts, etc

    CONFIG EDITOR
    Some time around early November it became apparent with the XPath system that creating a full fledged xml editor was possible and so work began on this side of the system. The system for this is now in place and the finishing touches on the Save Mod feature is close to complete (work keeps interfering with the time I can spend on finishing this). To access the editing functions requires logging in to the site via steams OpenID system.
    The goal of this tool is to allow Mod creators to showcase their code and also be able to edit with a powerful editing tool, but also to allow casual players who like a mod to be able to find all the juicy details of the mod without having to read confusing xml code, and even create a sub version for their own use with tweaks to the original mod. Mod owners will be able to see these sub versions and can choose to publish them under their Mod.

    XPATH
    XPath Actions: One way to do edits is through the XPath action system. The strength of this system over something like notepad is in the ability to make vast changes in just a few simple steps, as well as a complete version/edit history and also the ability to apply XPath actions to any config weather vanilla or modded.
    For example http://7days2mod.com/_xpath?xpath=//...%22Loot%22]/.. would find all blocks with the <property name="Class" value="Loot"/>
    With this search you could then append a node to all of those blocks in one step with the 'Append' action and <property name="description" value="this is a loot container"/> as the xml code.
    This generates a file for the xpath search and action, and an action file with the xml to be used. With those generated files you could then apply the same xpath action to any mod.
    This method also allows for the parent mod (or master mod as I have named it) to be easily changed via the Mod Admin section and then the config generated based on the new base configs selected (for example: an easy way to update a mod when new patches are released)
    It will also allow xpath modlets to be created and then the ability to include these modlets into any mod via a page of checkboxes etc. The modlet can for example add a weapon to the items, and also include it in relevant loot containers.

    XML EDITING
    You can now edit the xml via one of two javascript editors. Codemirror editor is similar to notepad and you can in fact copy/paste between the two programs via this editor.
    The GUI edit is a javascript called Xonomy and allows for context menus and code validation.


    PLANNED FEATURES
    Some of the major planned features are:
    • Finish the Published mods auto listing page.
    • Show properties from extended blocks/items in the table view and details pages (currently entity_classes has this function on the detailed view) - Done but too slow so needs recode
    • Allow custom views to select which table columns are shown by default.
    • Loot tree view, with the loot containers expanded out (current just a flat view is available, for example: http://7days2mod.com/_loot_container/id=11) with drop percentage probabilities included.
    • Mod CSS editing to further customize the look of a mod GUI. Currently only the banner image for the mod can be changed.
    • Random Entity wizard - Select a group of templates and ranges for variables such as walktype/speed etc and have the wizard create those entities randomly and generate the classes and spawning to include them.
    • RWGmixer wizard - for creating a custom rwgmixer with checkboxes for which prefabs to include etc
    • API - this system will be created for the editing interface, if people find a need for it I will open it to cross domain access. This system could also allow for a modlet to be run on servers or by server manages to allow for config updates to be pushed to servers without the need to download.
    Last edited by StompyNZ; 06-07-2016 at 04:43 AM. Reason: Updated Info

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •