A tool for creating and editing custom shapes for the game Reassembly.
- Visual shape editor with grid snapping
- Edit vertices and port positions
- Support for different port types (THRUSTER_IN, THRUSTER_OUT, etc.)
- Multiple scales per shape
- Import and export shapes.lua files
- Project generator for creating new Reassembly mods
- WebAssembly support for running in browsers
Run the application normally to open the shape editor:
cargo run
To generate a new Reassembly mod project structure:
cargo run -- --generate-project [project_name]
If no project name is provided, it will create a directory called "reassembly_mod" with the following structure:
reassembly_mod/
├── shapes.lua # Sample custom shape
├── shape_reference.lua # Template shapes for reference
├── blocks.lua # Sample custom block
├── factions.lua # Custom faction template
├── regions.lua # Region template for placement in galaxy
├── cvars.txt # Configuration variables
├── README.md # Instructions
├── preview_placeholder.txt # Reminder to create preview image
├── ships/ # Directory for faction ships
│ └── 20_starter.lua # Placeholder starter ship
└── extra_ships/ # Directory for additional ships
This provides everything you need to start creating a Reassembly mod.
- Install Rust and Cargo: https://www.rust-lang.org/tools/install
- Clone this repository
- Build and run the project:
cargo build --release
cargo run --release
You can build and run the shape editor in a web browser using WebAssembly:
- Install wasm-pack:
cargo install wasm-pack - Install a simple HTTP server (like Python's
http.servermodule)
On Windows:
build_wasm.bat
On Linux/macOS:
./build_wasm.sh
- Start a local HTTP server in the web directory:
cd web
python -m http.server
- Open your browser and navigate to http://localhost:8000
The shape editor should now be running in your browser!
When running in a browser environment:
- The "Browse" button will open the browser's file picker to select files
- Imported files are read directly in the browser without server uploads
- Exported files are automatically downloaded to your downloads folder
- All file operations work locally, and your data never leaves your computer
This project is open source.
- Based on the Reassembly modding documentation by Arthur Danskin
- Uses the
nomcrate for parsing Lua shape files - Built with egui for the user interface
This editor allows you to create, edit, and export custom block shapes for Reassembly mods in the .lua format. With this tool, you can:
- Create new shapes with vertices and connection ports
- Import existing shapes from
shapes.luafiles - Edit and modify shapes with a visual interface
- Export your shapes to Lua format for use in Reassembly mods
- Launch the application
- Use the grid and zoom controls at the top to adjust your view
- Create a new shape or import existing shapes
- Click "Новая форма" (New Shape) in the top panel to create a new shape
- Click on the canvas to add vertices
- The shape will automatically form by connecting these vertices
- The first vertex is highlighted in gold
- In the left panel, you'll see a list of all shapes
- Click on a shape to select it for editing
- Each shape has an ID and a name that you can edit
- Select a vertex by clicking on it
- Drag to move a selected vertex
- Use the controls in the side panel to modify vertex coordinates
- Click the "X" button to delete a vertex
Ports are connection points on the edges of your shape:
- In the "Порты" (Ports) section of the side panel, click "Добавить порт" (Add Port)
- Set the edge number (0-3, counting from the bottom edge clockwise)
- Set the position (0.0-1.0, normalized along the edge)
- Select a port type:
- DEFAULT: Standard connection
- THRUSTER_IN: Thruster input
- THRUSTER_OUT: Thruster output
- WEAPON_IN: Weapon input
- WEAPON_OUT: Weapon output
- MISSILE: Missile connection
- LAUNCHER: Launcher connection
- ROOT: Root connection
- NONE: No special properties
- Set the import file path in the top panel (default is
shapes.lua) - Click "Импорт" to import shapes from the specified file
- Or click "Импорт shapes.lua" for the default file
- Set the export file path in the top panel (default is
shapes.lua) - Click "Экспорт" to export shapes to the specified file
- Or click "Экспорт shapes.lua" for the default file
The shapes.lua file format follows this structure:
{
{101, --Shape_Name
{
{
verts={
{5, 5},
{5, -5},
{-5, -5},
{-5, 5}
},
ports={
{0, 0.5},
{1, 0.5, THRUSTER_IN},
{2, 0.5, THRUSTER_OUT},
{3, 0.5}
}
}
}
}
}In this structure:
- Each shape starts with an ID (e.g.,
101) - After the ID, you can add a comment with the shape name
- The shape definition includes vertices (
verts) and ports - Vertices are defined by x,y coordinates
- Ports are defined by:
{edge_number, position_on_edge, [optional_type]}
- Enable "Snap to Grid" for more precise vertex placement
- The shape area is displayed in the upper right corner of the shape
- Use Ctrl+Z to undo and Ctrl+Y to redo actions
- Use the middle mouse button to pan the view and the mouse wheel to zoom
After exporting your shapes, use them in your Reassembly mod by referencing the shape ID in your block definition:
{
{
1, -- Block ID
group=40, -- Your group
name="My Custom Block",
shape=101, -- This is the shape ID we defined
fillColor=0x4b3d47,
durability=1,
growRate=1,
},
}This project uses GitHub Actions for automated building on multiple platforms:
The project is automatically built for:
- Windows
- macOS
- Linux
- WebAssembly
You can find the workflow configuration in .github/workflows/rust-build.yml.
- Automatically builds when pushing to the main branch
- Builds on pull requests to ensure changes work on all platforms
- Creates downloadable artifacts for each platform
- Builds the WebAssembly version for web deployment
- Runs tests to verify functionality
You can manually trigger a build through the GitHub Actions interface:
- Go to the "Actions" tab in your GitHub repository
- Select the "Rust Build" workflow
- Click "Run workflow" and select the branch to build from