This is a tool for SpatialOS world authoring using the open source Tiled map editor.
The objective is to be able to convert back and forth between a SpatialOS snapshot file and several Tiled map files.
Dependencies:
- The
spatialCLI tool (available for various OSes from here) - Gradle 4.x or higher installed and on your PATH
Run spatial worker build TiledWorker to import the SpatialOS Java SDK dependencies and generate the schema generated code.
Run spatial local worker launch TiledWorker toSnapshot to generate a snapshot outputted to snapshots/test_world.snapshot.
I'll fix this up to take better args soon, I promise.
Run spatial local worker launch TiledWorker toMaps to generate a tiled project from snapshots/test_world.snapshot and saved to worlds/generated_world.
At the moment, the snapshot generator expects a world resource directory that follows the following format (defining maps, tilesets, and img folders).
my_world/
--maps/
----map_with_trees.tmx
----map2.tmx
----map_test.tmx
--tilesets/
----tileset_forest.tsx
----tileset2.tsx
--img/
----forest_tiles.png
----lake_tiles.png
Run gradle test from within workers/tiled or workers/tiled/worker to run the unit tests.
File -> New -> Project from existing sources...
and open SpatialTiled/workers/tiled.
To run from within IntelliJ instead of through spatial build and spatial local worker launch, set up a run configuration with the main class Launcher and the arguments: toSnapshot <path/to/SpatialTiled>.
In order to aggravate my dear friend Fabian, this tool is written in Scala and deliberately makes use of dangerous features and antipatterns.
Highlights include:
- XML DSL
- Implicit classes for generated code
- Nested
for-yieldblocks Anyinmatchclausesassertstatements scattered everywhereimport scala.collection.JavaConversions._
Please don't take this code seriously. Please don't show it to my current or future employers.
- Clean up remote resource code and remove local resources
- Support layer properties
- Object layer support