frandallfarmer / neohabitat

Repository for the NeoClassical Habitat Server Project
http://neohabitat.org
MIT License
228 stars 42 forks source link

WISH: JSON Region Creation Tool/Editor #291

Closed StuBlad closed 3 years ago

StuBlad commented 6 years ago

I would like to propose we create a tool that allows you to create NeoHabitat regions with ease.

Originally, regions were created using FRED, an interactive region editor that allowed you to piece together a region onscreen, output it into Griddle format and then feed into the database.

In NeoHabitat, we converted Griddle regions by hand to JSON or used Steve’s Regionator tool to convert Riddle files to JSON (the bulk of the regions were in Riddle format thankfully).

Personally, I have created new regions simply using Notepad++ but it's not as efficient as it could be.

How do we simplify/speed up region creation without recreating something like the Fred tool? (essentially an offline version of Habitat on the C64 that utilized Fastlink).

I propose we create a tool that has the JSON schema for a region and its objects stored that allows you to add/remove an object, provide the necessary values and let you save this as a valid region JSON file.

For example, you could load up this tool and it would have the basic region skeleton that features the following:

[ { "ref": "context- ", "capacity": 64, "type": "context", "name": "", "mods": [ { "town_dir": "", "neighbors": [ "", "", "", "" ], "orientation": 0, "nitty_bits": 3, "port_dir": "", "type": "Region" } ] } ]

This skeleton may or may not be viewable, perhaps you could toggle it on and off to see the eventual JSON output at the same time.

You’d be able to click on “Add Object” and select an object from the Class List. This would then populate the JSON with a new object appropriate for that Class, with the relevant class-specific variables included. It’d then have some sort of screen featuring a list of those class-specific variables and allow you to fill those in, with the tool populating those automatically.

In an ideal world it would have a list of max/appropriate values built in to prevent you from entering incorrect values (or adding too many objects).

It’d also be good to have some default values for certain objects with common values to be automatically populated (such as the Sky object having x:0, y:0 and style: 4 pretty much exclusively in most regions).

It’s possible that this could be used as a future skeleton for a potential graphical region editor should someone choose to take up that mantle, but it sounds like a lot more work.

This would allow for faster region iteration on the fly (perhaps you could even have the ability to save a region template, so you could have a template for a region that has the default ground/sky/street to allow you to iterate on).

It would also save a bit of time when manually converting regions that were saved in the contentsVector format into JSON.

neohabitatjsonregioneditormockup

A mockup of what such a tool could look like (please excuse the terrible design, it's purely to show functionality)

StuBlad commented 6 years ago

I meant to add this before but it would be cool to have a drop down list for the style field for each object that has a description of the item (which could be taken from the Habitat Object Manual as it describes each style and it's corresponding gr_states).