Skip to content

Commit d5eded3

Browse files
committed
merge: editor-layers-upgrade into main (keep references + bobcoin)
2 parents ecf7275 + 89e706c commit d5eded3

70 files changed

Lines changed: 3386 additions & 262 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitmodules

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,102 @@
2828
[submodule "libs/commons-lang"]
2929
path = libs/commons-lang
3030
url = https://github.com/apache/commons-lang
31+
[submodule "references/aseprite"]
32+
path = references/aseprite
33+
url = https://github.com/aseprite/aseprite
34+
[submodule "references/sprite-studio-64"]
35+
path = references/sprite-studio-64
36+
url = https://github.com/tstamborski/sprite-studio-64
37+
[submodule "references/stipple-effect"]
38+
path = references/stipple-effect
39+
url = https://github.com/stipple-effect/stipple-effect
40+
[submodule "references/Raylib-Examples"]
41+
path = references/Raylib-Examples
42+
url = https://github.com/Pakz001/Raylib-Examples
43+
[submodule "references/csprite"]
44+
path = references/csprite
45+
url = https://github.com/csprite/csprite
46+
[submodule "references/raster-master"]
47+
path = references/raster-master
48+
url = https://github.com/RetroNick2020/raster-master
49+
[submodule "references/Tile-Studio"]
50+
path = references/Tile-Studio
51+
url = https://github.com/Wiering/Tile-Studio
52+
[submodule "references/voidsprite"]
53+
path = references/voidsprite
54+
url = https://github.com/counter185/voidsprite
55+
[submodule "references/GrowTools"]
56+
path = references/GrowTools
57+
url = https://github.com/GuckTubeYT/GrowTools
58+
[submodule "references/retro-game-editor"]
59+
path = references/retro-game-editor
60+
url = https://github.com/haroldo-ok/retro-game-editor
61+
[submodule "references/SpeedEd"]
62+
path = references/SpeedEd
63+
url = https://github.com/jval1972/SpeedEd
64+
[submodule "references/aseprite-guide"]
65+
path = references/aseprite-guide
66+
url = https://github.com/PandaDevOfficial/aseprite-guide
67+
[submodule "references/tilemap-studio"]
68+
path = references/tilemap-studio
69+
url = https://github.com/Rangi42/tilemap-studio
70+
[submodule "references/tilemap-editor"]
71+
path = references/tilemap-editor
72+
url = https://github.com/blurymind/tilemap-editor
73+
[submodule "references/tactile"]
74+
path = references/tactile
75+
url = https://github.com/albin-johansson/tactile
76+
[submodule "references/Simple-Sprite-Tile-2D"]
77+
path = references/Simple-Sprite-Tile-2D
78+
url = https://github.com/wmltogether/Simple-Sprite-Tile-2D
79+
[submodule "references/bottled-up-tilemap"]
80+
path = references/bottled-up-tilemap
81+
url = https://github.com/Dark-Peace/bottled-up-tilemap
82+
[submodule "references/DTile"]
83+
path = references/DTile
84+
url = https://github.com/MagnonGames/DTile
85+
[submodule "references/Pixelorama"]
86+
path = references/Pixelorama
87+
url = https://github.com/Orama-Interactive/Pixelorama
88+
[submodule "references/PixiEditor"]
89+
path = references/PixiEditor
90+
url = https://github.com/PixiEditor/PixiEditor
91+
[submodule "references/LibreSprite"]
92+
path = references/LibreSprite
93+
url = https://github.com/LibreSprite/LibreSprite
94+
[submodule "references/rx"]
95+
path = references/rx
96+
url = https://github.com/cloudhead/rx
97+
[submodule "references/piskel"]
98+
path = references/piskel
99+
url = https://github.com/piskelapp/piskel
100+
[submodule "references/blockbench"]
101+
path = references/blockbench
102+
url = https://github.com/JannisX11/blockbench
103+
[submodule "references/Cytopia"]
104+
path = references/Cytopia
105+
url = https://github.com/CytopiaTeam/Cytopia
106+
[submodule "references/goxel"]
107+
path = references/goxel
108+
url = https://github.com/guillaumechereau/goxel
109+
[submodule "references/tiled"]
110+
path = references/tiled
111+
url = https://github.com/mapeditor/tiled
112+
[submodule "references/OgmoEditor3-CE"]
113+
path = references/OgmoEditor3-CE
114+
url = https://github.com/Ogmo-Editor-3/OgmoEditor3-CE
115+
[submodule "references/grafx2"]
116+
path = references/grafx2
117+
url = https://github.com/miniupnp/grafx2
118+
[submodule "references/grafx2-dos"]
119+
path = references/grafx2-dos
120+
url = https://github.com/deverac/grafx2-dos
121+
[submodule "references/PyxleOS"]
122+
path = references/PyxleOS
123+
url = https://github.com/Dakkra/PyxleOS
124+
[submodule "libs/aseprite-file"]
125+
path = libs/aseprite-file
126+
url = https://github.com/elgopher/aseprite-file
31127
[submodule "bobcoin"]
32128
path = bobcoin
33129
url = https://github.com/robertpelloni/bobcoin

DASHBOARD.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Project Dashboard
2+
3+
This dashboard lists the status of all submodules and the project structure.
4+
5+
## Project Structure
6+
7+
- **client/**: Contains the main game client source code, assets, and logic. Uses LWJGL 3.
8+
- **server/**: Contains the dedicated game server code. Uses Netty 4.
9+
- **shared/**: Contains shared data structures, networking packets, and utility classes used by both client and server.
10+
- **libs/**: Contains external libraries used by the project. Some are included as Git submodules.
11+
- **references/**: Contains Git submodules of external open-source projects (editors, engines) used for feature research and reference.
12+
13+
## Submodule Status
14+
15+
| Path | Branch | Commit | Date | Version/Build |
16+
| --- | --- | --- | --- | --- |
17+
| libs/GeoIP2-java | HEAD | 10d5699 | 2025-12-22 | build-1 |
18+
| libs/aseprite-file | HEAD | 06b6189 | 2018-12-01 | build-23 |
19+
| libs/commons-lang | HEAD | 8b91981 | 2025-12-27 | build-1 |
20+
| libs/jinput | HEAD | 45fe725 | 2025-12-01 | build-1 |
21+
| libs/lwjgl3 | HEAD | f2cfcc5 | 2025-12-28 | build-17 |
22+
| libs/lz4-java | HEAD | be9ce57 | 2025-11-28 | build-1 |
23+
| libs/micromod | HEAD | 68f2741 | 2021-08-02 | build-1 |
24+
| libs/mysql-connector-j | HEAD | a7b3c94 | 2025-09-18 | 9.5.0 |
25+
| libs/twl-lwjgl3 | HEAD | 647ec34 | 2016-10-02 | build-1 |
26+
| libs/xpp3 | HEAD | 68498e7 | 2025-04-13 | build-1 |
27+
| libs/xz-java | HEAD | e52d9ad | 2025-11-19 | build-1 |
28+
| references/Cytopia | HEAD | b67e255 | 2025-03-28 | v0.2.1-1158-gb67e255d |
29+
| references/DTile | HEAD | 22a977f | 2018-04-04 | build-520 |
30+
| references/GrowTools | HEAD | fe146b8 | 2025-11-21 | build-76 |
31+
| references/LibreSprite | HEAD | 60eed0f | 2025-12-09 | v1.2-15-g60eed0fd3 |
32+
| references/OgmoEditor3-CE | HEAD | b2a5215 | 2022-01-19 | 3.4.0-15-gb2a5215 |
33+
| references/Pixelorama | HEAD | 4409726 | 2025-12-28 | v1.1.7-22-g44097268 |
34+
| references/PixiEditor | HEAD | 8d871a4 | 2025-12-17 | 2.0.1.18-364-g8d871a4c2 |
35+
| references/PyxleOS | HEAD | 624359c | 2017-03-26 | build-202 |
36+
| references/Raylib-Examples | HEAD | abe00d9 | 2023-02-20 | build-500 |
37+
| references/Simple-Sprite-Tile-2D | HEAD | c5ba692 | 2017-04-10 | 0.1-7-gc5ba692 |
38+
| references/SpeedEd | HEAD | 0be20dc | 2022-01-01 | build-123 |
39+
| references/Tile-Studio | HEAD | d0f5d2e | 2021-07-17 | build-19 |
40+
| references/aseprite | HEAD | d6bb24d | 2025-12-11 | v1.3.16.1 |
41+
| references/aseprite-guide | HEAD | 471c8ec | 2025-10-03 | v1.3.15.3-2-g471c8ec |
42+
| references/blockbench | HEAD | bf10648 | 2025-12-23 | v5.0.7 |
43+
| references/bottled-up-tilemap | HEAD | 7a93386 | 2023-04-07 | build-8 |
44+
| references/csprite | HEAD | 11eca90 | 2025-08-05 | latest-git-225-g11eca90 |
45+
| references/goxel | HEAD | 069c094 | 2025-12-12 | v0.15.1-53-g069c094f |
46+
| references/grafx2 | HEAD | 94b1bab | 2020-12-11 | HEAD-a17b6f6-1121-g94b1babf |
47+
| references/grafx2-dos | HEAD | 4258bdd | 2022-04-03 | build-22 |
48+
| references/piskel | HEAD | 5137332 | 2025-11-07 | v0.15.0-102-g5137332 |
49+
| references/raster-master | HEAD | 1a14177 | 2025-12-10 | v5.7R124 |
50+
| references/retro-game-editor | HEAD | 2a93781 | 2017-07-13 | build-234 |
51+
| references/rx | HEAD | 1bcbe90 | 2023-07-02 | v0.5.2-15-g1bcbe90 |
52+
| references/sprite-studio-64 | HEAD | 5661c39 | 2024-04-06 | v1.2-2-g5661c39 |
53+
| references/stipple-effect | HEAD | a47e8fa | 2025-01-30 | v1.2.3 |
54+
| references/tactile | HEAD | eb98a4c | 2022-09-07 | v0.4.0 |
55+
| references/tiled | HEAD | 64175fc | 2025-12-08 | v1.11.2-218-g64175fc9 |
56+
| references/tilemap-editor | HEAD | 758cdbb | 2022-12-07 | build-201 |
57+
| references/tilemap-studio | HEAD | ffcce44 | 2025-09-12 | v4.0.1-12-gffcce44 |
58+
| references/voidsprite | HEAD | 38a976e | 2025-12-28 | appimage-test-66-g38a976e |
59+
60+
Generated on Sun Dec 28 21:11:37 UTC 2025

FEATURES_RESEARCH.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Features Research
2+
3+
This document compiles research on features from various sprite and tile editing tools to inform the development of the internal tools.
4+
5+
## Feature Analysis
6+
7+
### 1. Layers & Project Management
8+
* **Standard Layers:** Visibility, Opacity, Locking, Blending Modes. (Aseprite, Photoshop, GIMP)
9+
* **Reference Layers:** Layers that are visible during editing but excluded from final export. (Aseprite)
10+
* **Tilemap Layers:** Layers dedicated to tile indices rather than pixels. (Tiled, Pyxel Edit)
11+
* **Parallax Layers:** Defining scroll speeds for layers for preview. (Tiled)
12+
13+
### 2. Drawing Tools
14+
* **Universal Brush:** Common interface for Pencil, Eraser, Fill, Shape, Custom Brushes.
15+
* **Pixel-Perfect:** Algorithm to remove "doubled" pixels on corners for cleaner lines. (Aseprite)
16+
* **Symmetry:** Real-time mirroring (X, Y, Radial). (Pyxel Edit, Aseprite)
17+
* **Tile Instancing:** Drawing on a tile on the canvas updates the tileset and all other instances. (Pyxel Edit)
18+
* **Shading Mode:** Locking palette to gradients, so painting "light" or "dark" shifts the pixel color index up/down the ramp. (Pro Motion NG, Aseprite)
19+
* **Contour Fill:** Filling connected pixels of the same color, but also filling diagonal connections or stopping at boundaries.
20+
21+
### 3. Selection & Transformation
22+
* **Magic Wand:** Select connected pixels of color.
23+
* **Color Select:** Select all pixels of color X in layer/frame/cel.
24+
* **Rotated Sprite:** Support for rotating sprites (lossy or non-lossy via rotation layers).
25+
* **Grid Snapping:** Snapping selections or brushes to grid.
26+
27+
### 4. Animation
28+
* **Onion Skinning:** Viewing previous/next frames with tint/alpha.
29+
* **Tags/Loops:** Defining animation segments (Idle, Walk, Run) with tags. (Aseprite)
30+
* **Cel Linking:** Reusing the same image data across multiple frames.
31+
32+
### 5. Color & Palette
33+
* **Palette Management:** Loading/Saving .pal, .gpl. Rearranging colors.
34+
* **Color Replacement:** Global swap of Color A to Color B.
35+
* **Gradients:** Generating ramps between two colors.
36+
37+
### 6. Tile Mapping
38+
* **Auto-Tiling:** Blob/Wang sets to automatically place corners/edges. (Tiled, Godot)
39+
* **Stamp Brush:** Selecting an area of tiles and painting with it.
40+
* **Collision Editor:** Defining collision polygons per tile.
41+
42+
### 7. Generative / AI
43+
* **Sprite Generation:** Text-to-Image for sprites.
44+
* **Upscaling:** Pixel-art specific upscaling (HQ2x, xBRZ, or AI-based).
45+
* **Variation Generation:** Creating color variants or slight shape variants.
46+
47+
## Priority Implementation List (Derived for Internal Tools)
48+
49+
1. **Layers (Ref & Normal)** - Essential for complex art. (Done)
50+
2. **Symmetry** - High value for character/item art. (Done)
51+
3. **Tile Instancing** - Crucial for tileset workflow. (Done)
52+
4. **Auto-Tiling** - Speed up map creation. (Done)
53+
5. **Aseprite Import** - Bridge to external tools. (Done)
54+
6. **Magic Wand** - Basic selection necessity. (Done)
55+
7. **Onion Skinning** - Essential for animation. (Done)
56+
57+
## Remaining High Value Candidates
58+
59+
* **Undo System Improvements**: The current system wraps and is basic. A robust `Command` pattern undo system is "universally useful".
60+
* **Pixel Perfect Drawing**: A very common request for pixel art tools to avoid "jaggies".
61+
* **Shading/Palette Mode**: Very useful for limited palette pixel art.
62+
* **Animation Tags**: Defining "Walk", "Run", etc. metadata.
63+
* **Generative/AI integration**: As requested in the prompt.

HANDOFF.md

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,32 @@
1-
# Handoff
1+
# Session Handoff
22

3-
**Date:** 2025-12-27
4-
**Version:** 0.1.4
5-
**Build Status:** Passing (Java 21)
3+
## Summary
4+
This session focused on modernizing the internal Swing-based Editor tools (`SpriteEditor`, `MapCanvas`, `DialogueEditor`) to include features found in industry-standard tools like Aseprite and Pyxel Edit.
65

7-
## Completed Tasks
8-
1. **Environment Fix**: Switched to Java 21 to resolve Gradle 8.8 compatibility issues.
9-
2. **Documentation**:
10-
* Consolidated `LLM_INSTRUCTIONS.md`.
11-
* Updated `docs/dashboard.md` with latest submodule status.
12-
* Updated `CHANGELOG.md` and `VERSION.md`.
13-
3. **Feature Implementation**:
14-
* Implemented "Move Map Up/Down" functionality in `Map.java` (`shiftMap` method).
15-
* Added "Move Up" and "Move Down" buttons to `ControlPanel.java`.
16-
4. **Cleanup**: Updated `docs/todo.txt` to reflect completed tasks.
6+
## Key Changes
177

18-
## Next Steps
19-
* **Undo System**: "make undo better/not wrap around/skip" is the next logical step.
20-
* **Performance**: "drawing/moving/filling/copy/paste tiles REALLY SLOW with sprite layer on and lots of Sprites."
21-
* **UI Improvements**: "pull off tile panel/ control panel. dockable?"
8+
### 1. Editor Improvements
9+
* **Layer System:** Refactored `Sprite.java` to support multiple layers (Reference, Normal). Implemented `SELayerPanel` for UI management. Export methods flatten layers for backward compatibility.
10+
* **Project Persistence:** Added `.sprproj` format (JSON/GZIP) to save editor state (layers, visibility, opacity) without data loss.
11+
* **Universal Brushes:** Refactored `SECanvas` to use a `Brush` interface. Implemented `Pencil` (with Pixel Perfect mode), `Eraser`, `Fill`, and `Magic Wand` brushes.
12+
* **Selection Tools:** Added non-rectangular selection support using `boolean[][] mask` in `SelectionArea`.
13+
* **Pixel Perfect Drawing:** Added algorithm to `PixelBrush` to remove L-shaped corners during freehand drawing.
14+
* **Dialogue Editor:** Added a live `DialoguePreviewPanel` to visualize text rendering (color tags, pauses, page breaks) in real-time.
15+
* **Map Editor:** Implemented "Tile Instancing" (editing tiles directly on the map) and "Auto-tiling" (4-bit edge masking).
16+
17+
### 2. Infrastructure
18+
* **Submodules:** Added ~30 submodules in `references/` for research. Updated `libs/` submodules.
19+
* **Dashboard:** Created `DASHBOARD.md` listing all submodules and project structure.
20+
* **Roadmap:** Updated `ROADMAP_EDITOR.md` and `FEATURES_RESEARCH.md` with findings and status.
2221

23-
## Notes
24-
* The project is now fully compatible with Java 21.
25-
* The "Merge Project" feature from the previous session is confirmed to be compiling and integrated.
22+
## Directory Structure
23+
* `client/`: Main game code.
24+
* `server/`: Game server.
25+
* `shared/`: Shared logic.
26+
* `references/`: External research repos.
27+
* `libs/`: Dependencies.
28+
29+
## Next Steps
30+
* **Undo System:** The undo system works (`CompoundEdit`) but could be more robust (limit stack size, memory usage).
31+
* **Animation Features:** Timeline view, Tags (Idle, Walk).
32+
* **Visual Dialogue Graph:** The current editor is text-based with preview. A node-based editor would be a massive improvement.

ROADMAP_EDITOR.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Editor Roadmap
2+
3+
This roadmap outlines the prioritized implementation of features for the Bob's Game Editor (Legacy Swing Editor), based on research from industry-standard tools like Aseprite, Tiled, and Pyxel Edit.
4+
5+
## Phase 1: Foundations (Immediate Priority)
6+
These features are essential for any usable editor and are currently missing or underdeveloped.
7+
8+
1. **Layer System** [COMPLETED]
9+
* **Description:** Move from a single flat image to a multi-layer stack.
10+
* **Status:** Implemented. Includes `List<Layer>` model, Composite Rendering, and `SELayerPanel` UI.
11+
* **Note:** Layers are flattened to a single image on export for game engine compatibility.
12+
13+
2. **Project Persistence** [COMPLETED]
14+
* **Description:** Save editor state (layers, visibility, opacity) to a dedicated project file (`.sprproj` / JSON).
15+
* **Status:** Implemented. Uses `SpriteProject` class with GZIP+Base64 encoding for pixel data.
16+
* **Why:** Enables non-destructive editing and resuming work with layers intact.
17+
18+
3. **Universal Brush System** [COMPLETED]
19+
* **Description:** Abstract the drawing logic so "Pencil", "Eraser", and "Pattern Stamp" share a common interface.
20+
* **Status:** Implemented. `Brush` interface created with `PixelBrush`, `EraserBrush`, `FillBrush`. Added `SEToolsPanel`.
21+
* **Requirements:** `Brush` interface, `PixelBrush`, `ShapeBrush`, `PatternBrush`. Support for "Custom Brushes" (using a selection as a brush).
22+
23+
4. **File Format Support (Interoperability)** [COMPLETED]
24+
* **Description:** Interoperability with standard tools.
25+
* **Status:** Implemented `AsepriteImporter` and `AsepriteParser`. Can import `.ase`/`.aseprite` files (Indexed Mode).
26+
* **Goal:** Import `.ase` / `.aseprite` (Aseprite) files. This allows users to create art in Aseprite and bring it into the engine.
27+
28+
## Phase 2: Workflow Enhancements
29+
Tools that speed up the creation process.
30+
31+
5. **Selection Tools** [COMPLETED]
32+
* **Description:** Robust selection capabilities beyond rectangles.
33+
* **Status:** Implemented `MagicWandBrush` and mask-based `SelectionArea`.
34+
* **Goal:** Magic Wand (Color Select), Polygon Lasso, "Select All of Color".
35+
36+
6. **Symmetry / Mirror Drawing** [COMPLETED]
37+
* **Description:** Real-time mirroring of drawing operations on X and Y axes.
38+
* **Status:** Implemented Y-Axis symmetry (Quad symmetry supported). Updated `SECanvas` rendering and `setPixel` logic.
39+
* **Why:** Standard feature in Pyxel Edit, Aseprite, Tiled.
40+
41+
7. **Onion Skinning** [COMPLETED]
42+
* **Description:** See previous/next frames faintly while animating.
43+
* **Status:** Implemented via `SECanvas.repaintBufferImage` rendering prev/next frames with alpha blending.
44+
* **Requirements:** Animation timeline integration.
45+
46+
## Phase 3: Advanced Features
47+
Differentiation features that provide unique value.
48+
49+
8. **Tile Instancing (Pyxel Edit Style)** [COMPLETED]
50+
* **Description:** Editing a tile on the map updates the source tile and all other instances of it instantly.
51+
* **Status:** Implemented `tileEditMode` in `MapCanvas`. Allows drawing pixel-level edits directly on the map.
52+
* **Why:** Huge time saver for tilemap creation.
53+
54+
9. **Auto-tiling (Wang/Blob)** [COMPLETED]
55+
* **Description:** Automatically selecting the correct tile variation based on neighbors (corners, edges).
56+
* **Status:** Implemented 4-bit (16-tile) Edge Auto-tiling logic in `AutoTiler` and integrated into `MapCanvas` as `autoTileMode`.
57+
58+
10. **Reference Layers** [COMPLETED]
59+
* **Description:** Layers that hold reference images but are excluded from the final export/game data.
60+
* **Status:** Implemented `isReference` boolean in `Sprite.Layer`. Updated export methods (`getAsIntArray`, `outputPNG`, etc.) to skip these layers. Added UI toggle in `SELayerPanel`.
61+
62+
## Execution Plan (Next Steps)
63+
64+
All major features from the roadmap have been implemented.
65+
66+
1. **Refine & Polish:**
67+
* Ensure all new features (Timeline, Animation List, History) work smoothly together.
68+
* Verify Undo logic with the new `UndoManager` features.
69+
2. **Maintenance:**
70+
* Keep submodules updated.
71+
* Monitor for regressions in legacy game functionality.

VERSION.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.5
1+
0.1.6

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ test {
8282
sourceSets {
8383
main {
8484
java {
85-
srcDirs = ['src/main/java', 'libs/twl-lwjgl3/src']
85+
srcDirs = ['src/main/java', 'libs/twl-lwjgl3/src', 'libs/aseprite-file/src/main/java']
8686
}
8787
resources {
8888
srcDirs = ['src/main/resources', 'res']

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
org.gradle.java.home=C:\\Program Files\\Java\\jdk-21
1+
# org.gradle.java.home=C:\\Program Files\\Java\\jdk-21

libs/aseprite-file

Submodule aseprite-file added at 06b6189

references/Cytopia

Submodule Cytopia added at b67e255

0 commit comments

Comments
 (0)