thorium-nova
thorium-nova copied to clipboard
Ship Map Editor
Needed Tasks
- [x] #163
- [x] #164
- [x] #165
- [x] #166
- [x] #167
- [x] #168
- [x] #169
- [ ] #170
- [x] #171
Discussed in https://github.com/Thorium-Sim/thorium-nova/discussions/161
Originally posted by alexanderson1993 January 3, 2022 There's a lot of stuff that the ship map enables, but we need a way to create those maps in the first place.
Ship maps are configured as part of a ship template, and consist of three parts.
SVG layers
Each deck will first be defined with an SVG file that shows a graphical layout of that deck, with one SVG for each deck. Any images, lines, or diagrams can be used in these SVGs, but there will be guidelines for making sure the deck diagrams have a consistent appearance. SVGs are preferred since you can infinitely scale them without losing resolution, but it could be configured to work with transparent PNGs too.
As far as scale is concerned, we'll treat one SVG point as one meter. The expectation is that the deck SVGs will be able to layer on top of each other so they have everything lined up properly between decks.
In the future, there can be an in-app SVG editor, but for 1.0, we'll expect ship map SVGs to be created by hand or using an image editor like Adobe Illustrator. So, decks will consist of:
- A name
- An order
- An SVG image
Graph Nodes / Rooms
The purpose of the deck map is to allow entities to travel throughout the ship. Knowing where to move can't be done with an SVG alone. A graph of nodes is also required. Nodes represent places that these entities can travel, including junctions in hallways, turbo lifts for traveling between decks, and rooms.
Nodes are overlayed on top of the SVG layers and created using an in-app editor, which is described below.
Rooms are special nodes which have some extra features.
Rooms can be named, which lets the crew see what the room is for, have the room included in a list, and let the crew search for rooms by name.
Rooms can also be given icons, which are PNGs or SVGs. Rooms without icons will have a generic icon.
Rooms are assigned a radius. This represents the relative area that the room occupies on the ship map. When a crew member is inside a room, they'll be able to move about the room within that radius which makes it appear more realistic.
Finally, rooms have system assignments, which connects that room with a specific system. For example, cargo can be transferred between rooms. Rooms with the "probe launcher" assignment will allow probe casings in that room to be used for probe construction. Multiple systems can be assigned. Rooms without specific icons might be able to use an icon associated with the assigned system.
Edges
Edges complete the graph by connecting nodes together. They can connect nodes on the same deck, or connect nodes between decks. Only one edge can connect two nodes, but nodes can have many edges.
Edges can be given weights, which change the speed that entities traverse that edge by multiplying the entities speed by the weight. By default, the weight is 1. Higher weights make the entities move slower; lower weights move entities faster.
Editing the Ship Map
Creating and editing the ship map is a simple process:
- First, create and name a deck and upload an image for it. The image is stored in the file system with the plugin, not in the .yml file for the ship template.
- Next, nodes are added. An editor palette allows configuring the node properties, and the node can be dragged around to change its position.
- Finally edges are added between nodes. Clicking and dragging with the edge tool allows edges to easily be created. A "Add Edge" button allows edges to be created between decks without clicking and dragging. Edges can be selected to change the weight.
What this enables:
- Cargo containers for transferring cargo
- Crew members, who operate as AI agents, with motivations and objectives
- Utility maps for power, water, heat, etc.
- A* path finding for any moving entities.
What to comment on
If you see anything amiss about this, or have better ideas, let me know. Also, if you have ideas for things that can be enabled by these features, comment on those below. If there are no objections within a week or so, I'll start creating feature issues for the tasks needed to create this.