Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .github/img/all-menu.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .github/img/to_cave.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .github/img/to_dwellings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .github/img/to_mfcg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .github/img/to_viewer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified .github/img/to_village.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 19 additions & 11 deletions README.RU.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

Работа с данными построена на принципе proto-first, но с сохранением поддержки старых json-форматов экспорта. Если Вы планируете создавать свое решение с использованием данного генератора, рекомендую рассчитывать только на бинарные proto-файлы так как импорт/экспорт в json сфокусирован в первую очередь на поддержке старых вариантов и первоначальных watabou-генераторов. proto-файлы в свою очередь гарантируют долгосрочную поддержку даже в случае добавления нового функционала - старые сохраненные файлы будут поддерживаться и в новых версиях, без потери обратной совместимости.

Импорт работает только с расширенной версией экспорта - старые экспортированные файлы (watabou-экспорт) не откроется на редактирование в MFCG так как в файлах нет нужных полей для восстановления на редактирование.

### Формирование бинарных файлов

Все бинарные файлы формируются на основании proto-файлов которые лежат в папке: [protobuf](./protobuf)
Expand Down Expand Up @@ -53,32 +55,38 @@

Работа ещё не завершена; Окончательная цель - получить полностью самодостаточный генератор и редактор который не требует никаких внешних ресурсов и способен в удобном формате описывать целый мир, начиная от высокого уровня (планета) и заканчивая низким (дома, поляны и пещеры)

### Что было изменено в целом:
### Что было сделано в целом:

- Эти генераторы теперь полностью локальные. То есть они могут работать без интернета: все подключения внутренние, а загружаемые файлы включены в проект.
- Реализована максимальная автоматизация. Вы можете удобно собрать всё под свой кейс, взаимодействуя только с конструкторами и JSON-параметрами.
- Я написал `openapi.json` для генераторов и сделал его доступным напрямую через RapiDoc.
- Я изменил подход к маршалингу, сделав его proto-first.
- Я добавил импорт/экспорт в бинарный файл: чистый protobuf. Обратная совместимость сохранена.
- Я попытался стандартизировать контекстное меню так, чтобы пункты в разных генераторах находились в одних и тех же местах и имели одинаковые названия. Я также добавил функциональность для тех генераторов, у которых её не было (`Permalink...`, `Fullscreen`).
- Я добавил возможность открывать города и деревни прямо в 3D-просмотрщике (`View in 3D`).
- Я сделал диалоги более дружелюбными (например, теперь явно сообщается, в чём проблема при импорте).
- Я добавил префиксы для экспортируемых файлов (`*.palette.mf.json`, `*.mf.json`), чтобы было понятно, что к чему относится, не заглядывая внутрь.
- Я опубликовал это как отдельный [веб-ресурс](https://maphub.webtools.download), включая [PWA](https://en.wikipedia.org/wiki/Progressive_web_app), что позволяет установить его как приложение, которому не нужен интернет.
- Создан `openapi.json` для генераторов, оно доступно напрямую через RapiDoc.
- Изменен подход к маршалингу, сделав его proto-first.
- Добавлено импорт/экспорт в бинарный файл: чистый protobuf (импорт для MFCG и Village работает только с расширенными файлами экспорта, так как стандартных недостаточно для того что бы восстановить карту на редактирование). Обратная совместимость сохранена.
- Стандартизация контекстных меню, чтобы пункты в разных генераторах находились в одних и тех же местах и имели одинаковые названия. Были переформированы группы ради максимального улучшения UI. Также добавлена функциональность для тех генераторов, у которых её не было (`Permalink...`, `Fullscreen`).
- Добавлена возможность открывать города и деревни прямо в 3D-просмотрщике (`View in 3D`).
- Диалоги сделаны более дружелюбными (например, теперь явно сообщается, в чём проблема при импорте). Так же добавлены прелоадеры для тяжелых операций по типу экспорта PNG.
- Появились префиксы для экспортируемых файлов (`*.palette.mf.json`, `*.mf.json`), чтобы было понятно, что к чему относится, не заглядывая внутрь.
- Исправлено множество мелких багов для краевых условий.
- Добавлен новый функционал (обработка колесика мышки в MFCG и Dwellings, а так же сложная линейка для MFCG)
- Опубликовано это как отдельный [веб-ресурс](https://maphub.webtools.download), включая [PWA](https://en.wikipedia.org/wiki/Progressive_web_app), что позволяет установить его как приложение, которому не нужен интернет.

### Планы на будущее:

- ~~Перенести импорт/экспорт палитр в proto.~~
- Добавить экспорт для Cave/Glade Generator.
- Добавить возможность импортировать схемы из файла для всех генераторов, кроме City Viewer (поскольку у City Viewer уже есть импорт).
- ~~Добавить возможность импортировать схемы из файла для всех генераторов, кроме City Viewer (поскольку у City Viewer уже есть импорт).~~
- Добавить 3D-визуализатор для зданий (отдельный или просто расширить функциональность City Viewer).
- Добавить расширенный режим экспорта, который переносит имена, подписи и другие поля.
- ~~Добавить расширенный режим экспорта, который переносит имена, подписи и другие поля.~~
- Добавить генерацию указателей Cave/Glade в Medieval-Fantasy-City/Village Generator.
- После расширенного экспорта станет возможно связать Cave/Glade/Dwellings Generator и Medieval-Fantasy-City/Village Generator.
- Сделать отдельно собираемым или расширить текущую сборку списком сохранённых карт и палитр прямо в приложении.

## Галерея

### Все контекстные меню одной картинкой

![all\-menu](.github/img/all-menu.png)

### Как изменилось контекстное меню

#### Cave/Glade Generator
Expand Down
44 changes: 26 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,33 @@

[Перейти к Русской версии](./README.RU.md)

## Technical part
## Technical details

### Build and publishing
### Build and deployment

To build, it’s enough to run `npm run build` so that the project is fully built into the `dist` folder.
To build, run `npm run build` the project will be built into the `dist` folder.

To make it available locally in the browser, run `npm run preview`.
To make it available locally in your browser, run `npm run preview`.

When deploying to a server, it’s enough to move the contents of the `dist` folder to the root.
For deployment on a server, copy the contents of the `dist` folder to the web root.

### Other features
### Other notes

This project is built based on predefined values and page templates; to make changes, it’s enough to interact with these files:
This project is built from predefined values and page templates; to make changes, it’s enough to work with these files:

- [package.json](./package.json)
- [static.config.mjs](./static.config.mjs)
- [pages.config.mjs](./pages.config.mjs)

If needed, you can “cut out” only one specific generator — at the code level they are self-contained and independent of their neighbors.

Work with data is built on the proto-first principle, while keeping support for older JSON export formats. If you plan to create your own solution using this generator, I recommend relying only on binary proto files, because JSON import/export is primarily focused on supporting older variants and the original watabou generators. Proto files, in turn, guarantee long-term support even if new functionality is added — old saved files will be supported in new versions without losing backward compatibility.
Data handling follows a proto-first approach, while keeping support for older JSON export formats. If you plan to create your own solution using this generator, I recommend relying only on binary proto files, because JSON import/export is primarily focused on supporting older variants and the original watabou generators. Proto files, in turn, guarantee long-term support even if new functionality is added — old saved files will be supported in new versions without losing backward compatibility.

### Binary file structure
Import only works with the extended export format — older exported files (watabou export) won’t open for editing in MFCG, because those files don’t contain the fields required to restore a map for editing.

All binary files are generated from proto definitions located in the [protobuf](./protobuf) directory.
### Generating binary files

All binary files are generated from proto files located in the [protobuf](./protobuf) directory.

Import accepts both raw binary proto objects from root structures and objects wrapped in a typed envelope with CRC32.

Expand All @@ -47,7 +49,7 @@ Root structures:

## About the project

This project is a consolidation into one project of map generators by [watabou](https://github.com/watabou/) that he published at [watabou.github.io](https://watabou.github.io). Not all of them are publicly available, and even what is available is written in a not-so-popular language.
This project brings together the map generators by [watabou](https://github.com/watabou/) that he published at [watabou.github.io](https://watabou.github.io). Not all of them are publicly available, and even what is available is written in a not-so-popular language.

I took the web version implemented in JS and made many changes to it.

Expand All @@ -57,28 +59,34 @@ The work is not finished yet; the final goal is to get a fully self-contained ge

- These generators are now fully local. That is, they can work without the internet: all connections are internal, and the downloaded files are included in the project.
- Maximum automation has been implemented. You can conveniently assemble everything for your use case by interacting only with constructors and JSON parameters.
- I wrote `openapi.json` for the generators and made it available directly via RapiDoc.
- I changed the marshalling approach, making it proto-first.
- I added import/export to a binary file: pure protobuf. Backward compatibility is preserved.
- I tried to standardize the context menu so that items in different generators are in the same places and have the same names. I also added functionality for those generators that didn’t have it (`Permalink...`, `Fullscreen`).
- `openapi.json` has been created for the generators; it’s available directly via RapiDoc.
- I changed the serialisation approach, making it proto-first.
- I added import/export to a binary file: pure protobuf (import for MFCG and Village only works with extended export files, because the standard ones aren’t enough to restore a map for editing). Backward compatibility is preserved.
- Context menus have been standardised so that items across generators are in the same places and have the same names. Groups were reorganised to improve the UI as much as possible. Functionality was also added for generators that didn’t have it (`Permalink...`, `Fullscreen`).
- I added the ability to open cities and villages directly in the 3D viewer (`View in 3D`).
- I made dialogs more user-friendly (for example, it now clearly reports what the problem is during import).
- Dialogs have been made more user-friendly (for example, it now clearly reports what the issue is during import). Loading indicators were also added for heavy operations such as PNG export.
- I added prefixes for exported files (`*.palette.mf.json`, `*.mf.json`) so it’s clear what relates to what without looking inside.
- Many small edge-case bugs were fixed.
- New functionality was added (mouse-wheel handling in MFCG and Dwellings, and an advanced ruler for MFCG).
- I published it as a separate [web resource](https://maphub.webtools.download), including a [PWA](https://en.wikipedia.org/wiki/Progressive_web_app), which makes it possible to install it as an app that doesn’t need the internet.

### Plans for the future:

- ~~Move palette import/export to proto.~~
- Add export for Cave/Glade Generator.
- Add the ability to import schemes from a file for all generators except City Viewer (since City Viewer already has import).
- ~~Add the ability to import schemes from a file for all generators except City Viewer (since City Viewer already has import).~~
- Add a 3D visualizer for buildings (separate or just extend City Viewer functionality).
- Add an advanced export mode that transfers names, labels, and other fields.
- ~~Add an advanced export mode that transfers names, labels, and other fields.~~
- Add generation of Cave/Glade pointers in Medieval-Fantasy-City/Village Generator.
- After advanced export, it will be possible to link Cave/Glade/Dwellings Generator and Medieval-Fantasy-City/Village Generator.
- Make it separately buildable or extend the current build with a list of saved maps and palettes directly in the app.

## Gallery

### All context menus in one image

![all\-menu](.github/img/all-menu.png)

### How the context menu changed

#### Cave/Glade Generator
Expand Down
2 changes: 1 addition & 1 deletion languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -494,5 +494,5 @@
]
}
},
"introHtml": "<p>This page is a compact hub for several procedural generators of maps and floor plans. The idea is simple: open a tool, quickly get a result, tweak parameters if needed, and export it for any purpose.</p>\n<p><b>Why a separate hub?</b> When you work with multiple generators, it\u2019s easier to have a single entry point with clear descriptions, a unified style, and fast access to exports\u2014in one place, in one style, and fully compatible with each other.</p><p><b>Key info:</b></p><ul><li>Quickly sketch a variant with <span class='kbd'>Enter</span> (\u201cregenerate\u201d).</li><li>Change style/labels/settings via the context menu (right\u2011click or long\u2011press on mobile).</li><li>Export to PNG/SVG; JSON/PROTO is needed for the 3D viewer or third\u2011party tools.</li><li>Example workflow: make a village and detail a specific house with the floor\u2011plan generator.</li></ul><p>This page started as a weekend hobby; all generators are written by <a href='https://{{PRIMARY_SOURCE}}' target='_blank'>watabou</a>, and the improvements and consolidation into a single page were done by <a href='https://{{GITHUB}}' target='_blank'>sunsung</a></p>"
"introHtml": "<p>This page is a compact hub for several procedural generators of maps and floor plans. The idea is simple: open a tool, quickly get a result, tweak parameters if needed, and export it for any purpose.</p><p><strong>How does this hub differ from watabou generators?</strong></p><ul><li>Everything is available locally as a PWA even without internet; all links are internal. You don’t depend on the internet and it works conveniently in a single window.</li><li>The context menu has been redesigned. No more issues when switching to another generator: everything is in the same places and predictably consistent.</li><li>Fixed bugs that caused the app to crash in watabou generators.</li><li>Added various small things that improve UX.</li><li>Import is implemented (!!!!). Now you can save a map to open it later, or from another device, and continue editing.</li><li>All export formats are described with protobuf, which greatly simplifies integration if someone wants to use the generated maps in their products.</li></ul><p>This page started as a weekend hobby; all generators are written by <a href='https://{{PRIMARY_SOURCE}}' target='_blank'>watabou</a>, and the improvements and consolidation into a single page were done by <a href='https://{{GITHUB}}' target='_blank'>sunsung</a></p>"
}
Loading