Mapgen Explorer

Thanks for the inputs ! :slight_smile:
And let me prototype with these ideas.

Here is the version 0.2 that implements (some) of your inputs :). What is not in this version will be in the next one.

As it should, here is the git, the release, the changelog and some screenshots:

I hope this makes the mappers’ life easier, and the cdda work even richer.

While making this release, I came to two of remarks / questions / brainstorming content:

  • I think there is an extra non matching } at the end of gfx/HitButton_iso/tile_config.json (at least of my json parser).

  • In “gfx/ChestHole32Tileset_iso/tile_config.json”, the tile entry around line 129 is missing an “id”. I wonder if that is expected.

  • Zhilkin, can you point me to the best way to determine the color of the fonts for the pseudo-terminal non-tileset rendering?

Cheers,

Thanks for your dedicated work.

Thanks! I’ve created Removed extra curly brace in HitButton_iso json by ZhilkinSerg · Pull Request #23625 · CleverRaven/Cataclysm-DDA · GitHub to fix it.

@Chezzo, will you bother with updating ISO tileset after normal one is done?

You can take RGB values from here - https://github.com/CleverRaven/Cataclysm-DDA/blob/master/data/raw/colors.json

A couple of things to fix in 0.2:

  • Application closes after that error, though it would be better to fallback to some working tileset.

image

  • Some tiles are starting to be displayed in previously selected tilesets if you switch between tilesets:

Blockhead

HitButton_iso

Blockhead with some tiles from HitButton_iso

RetroDaysTileset10

Blockhead with some tiles from RetroDaysTileset10

D:\HP\My Games\cataclysmdda-0.C\gfx\RetroDaysTileset20 really do not have retrodaystiles20.png and retrodaysfallback20.png

It is just a 2x scaled version of 10 pixel tileset.

Wrong parsing when “terrain”: is at end of file.

Here is the version 0.3 that solves the unwanted merging of tilesets and a couple of other improvements on the renderding. It is not yet as good as the game (wrong rotation, does not handle multiple png tileset, etc.) but it is getting there :slight_smile:

As it should, here is the git, the release, and the changelog.

I created a function to check the validity of all the files in the repo (e.g. check for undefined symbol, out-of-bound coordinates, unexpected entries [misspelled], etc.). I am using it as a test, but I assume it can also be used a quick test when changing mapgens.

Here is the report on a clone of the cdda repo I just did. You can re-generate it by clicking on “analysis/Scan for Potential Errors”.

In the report, I see some undefined characters i.e. character than don’t match any palette. I wonder if there are reserved character (e.g. < > and for the stairs, z for the zombies) or if those are unexpected. There is also some mapgens with inconsistent row sizes. Here again, one of the character might be some kind of modifier.

Zhilkin. About the color of the character for the terminal mode. Thanks for the link. But how do you match a character (or a symbol) to a color string i.e. “p -> t_pavement -> BLUE”?

Also, thanks for the quick fix about the } :slight_smile:

I have some question about the “chance” field. In some of the code and the documentation, the acceptance probability seems to be “rndUniform(0,chance)==0” i.e. 1-in-”chance”. In some other places, there is some reference that the acceptance probability is chance/100 i.e. chance is a probability expressed in percentage. I made some test with both version, and there is always some situation that seem off (either too much of too little generated items).

By any chance, anyone know about it? There might also be special cases like it seems to be the case with monsters and distance to cities.

In the next release, I’ll work on making the editor more usable (undo, find, not messing up the json formating, etc.) and I’ll add support for the “overmap specials”.

Cheers, :slight_smile:

You should look for terrain colors in terrain definitions jsons, e.g. https://github.com/CleverRaven/Cataclysm-DDA/blob/master/data/json/terrain.json. And there is similar file for furniture - https://github.com/CleverRaven/Cataclysm-DDA/blob/master/data/json/furniture.json. Mods can add more terrain and furniture definitions.

There are no default mapgen palettes, so these unmatched characters are most probably errors. It is great we have this kind of check now.

For example, Q in data/json/mapgen/ags_station.json was "Q": "t_pavement", but this definition was deleted in https://github.com/CleverRaven/Cataclysm-DDA/commit/0eebba300bfdaef15c53db88926a09f67d01ef74#diff-fdfd42264316ecba09736063dfa8b293. There is also { "ter": "t_gas_tank", "x": 3, "y": 5 } command iniside of place_terrain which places mentioned terrain where the Q is, so it should really be like "Q": "t_gas_tank". and the place_terrain could be empty.

Overmap terrains have size of 24x24 characters.

If om_terrain node contains a single value.valid rows node inside of object node will have exactly 24 rows 24 characters wide each, but if om_terrain contains X rows of Y values (e.g. https://github.com/CleverRaven/Cataclysm-DDA/blob/master/data/json/mapgen/prison_1.json), then valid rows nods inside of object node will have 24X rows with 24Y characters wide each.

Cool! Very useful for devs, modders and the like.

Good work so far!

Some feedback I have after using it for a bit:

  • Furniture needs to be moved to a separate tool
    The amount of furniture needed for a reasonably complex building makes the dropdown box super unwieldy.
  • To add to that, an icon based palette rather than the current dropdown box would significantly improve workflow, again, the thing just gets way too cluttered. The dropdown in general is just very difficult to use.
  • Tools for adding items, item_groups, vehicles, monsters, and NPCs
  • Multi-tile furniture sprites tend to connect to things they shouldn’t be (floors, walls, other furniture)

Here is the version 0.4 that introduces (among other things) the “auto-reload” feature”:

.

The idea is for the mapper (i.e. you :)) to use your own external editor.

Here is the git, the release, and the changelog.

_Fuji. What about a separate window showing the palette in a table (like Excel) and with the following columns: The symbol (e.g. “t_concrete_wall”), the tile (as an image + sprite id), the mapped character (e.g. “X”), the layer (e.g. “terrain”, “fourniture”, “trap”), and the number of occurence in the current mapgen. In addition, the user could sort and filter any entry according to any column.

That would definitely be better.

The main reason the dropdown doesn’t work is that there’s just too many things in it to get a good idea of what you’re working with, even if you split up categories. For example, the overmap I’m currently working on has about 60 tile definitions to sit and scroll through. (there’s actually 90 in the list, due to furniture definitions on floors other than the default fill tile getting duplicated.)

Here is the version 0.5 that introduce the Palette Viewer and the Json Formatter.

The git, the release, and the changelog.

.

This should make it easier to manipulate the tiles :slight_smile:

Hope this helps.

I like it :+1::+1:

Just one more issue. Because of how furniture with non-default floors works, terrain definitions that also have a furniture definition need to get culled

Okay. This is/will be in the next release :slight_smile:

Anything else you have in mind that could improve the editor usability? Like some cumbersome actions that you are repeating a lot, or hard to notice common mistakes.

A “publisher could not be verified” message appears when downloading the windows64 executable.

Only bug I could find is the tile defined by the “fill_ter” tag not appearing in the terrain listing.

Apart from that, allowing the coordinate tool to give rectangle coordinates would speed up special placement a bunch. Or just tools for the different item/monster/vehicle spawners.
Item_group placement or example:
{
“group”: “elecsto_diy”,
“chance”: 60,
“repeat”: [ 4 ],
“x”: [ 10, 15 ], <- Defines placement rectangle
“y”: [ 14, 12 ]
},