Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
78d31b0
Remove static Editor usage in DataStore
PRiewe-SSA Jan 20, 2026
5251321
Verify sample scenario can be loaded into editor DataStore
PRiewe-SSA Jan 20, 2026
2cd65f5
Expose mod save
PRiewe-SSA Jan 20, 2026
d533a96
Expose mod save
PRiewe-SSA Jan 20, 2026
6f7ca6a
Some serialization fixes
PRiewe-SSA Jan 20, 2026
53888fa
RSpell serialization cleanup
PRiewe-SSA Jan 20, 2026
6ddd49e
Serde cleanup of items, themes, tattoos, signs, clothing, weapon
PRiewe Jan 21, 2026
77b5a8b
Fix tests
PRiewe Jan 21, 2026
e447dfb
Editor deserialization/serialization roundtrip fix and test for all r…
PRiewe Jan 22, 2026
43b6fcd
Update CLAUDE.md
PRiewe-SSA Jan 23, 2026
baaaa6f
Automatic code cleanup
PRiewe-SSA Jan 23, 2026
a9e4b2e
Cleaning up storage objects
PRiewe Jan 27, 2026
284dead
Auto cleanup
PRiewe Jan 27, 2026
d48de96
Merge branch 'feature/shared-UIDStore' of https://github.com/PRiewe/n…
PRiewe Jan 27, 2026
9db0d3f
Auto cleanup
PRiewe Jan 27, 2026
d43b9fe
Merge and replace MVStore with interface
PRiewe Jan 11, 2026
3ff54e4
Test cleanup. Still has serialization issues
PRiewe Jan 27, 2026
5c6e444
Rename UIEngineContext to GameContext (temporatily, for easier merges)
PRiewe Jan 27, 2026
2df3ba1
Most serialization fixed (Except UIDStore)
PRiewe Jan 14, 2026
d8f0abf
Checkpoint
PRiewe Jan 14, 2026
f0a9653
Builds and 75% of tests OK
PRiewe Jan 28, 2026
f43f7f6
Fixed for clean tests
PRiewe-SSA Jan 28, 2026
f87d827
Remove unused adapter classes
PRiewe-SSA Jan 28, 2026
1001fd0
Merge branch 'feature/mergeWIthMVSerialization' of https://github.com…
PRiewe Jan 28, 2026
85ab790
Game runs
PRiewe Jan 28, 2026
0ddac3a
Make some Engine static functions private
PRiewe Jan 28, 2026
9a2bbd4
Make Engine.post static function private
PRiewe Jan 28, 2026
e19321f
Make more Engine static functions private
PRiewe Jan 28, 2026
36832cb
Delete Engine static fields
PRiewe Jan 28, 2026
f0ef2fd
Game working (again)
PRiewe Jan 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
42 changes: 39 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ Neon is a roguelike game engine written in Java 21, consisting of:
- **neon**: The main game engine and editor
- **darkness**: A sample game built with the engine

The project is currently being migrated from Java 1.7 to Java 21, with recent changes including upgrading from Nashorn to GraalVM for JavaScript scripting support.
The project has been migrated from Java 1.7 to Java 21, with key changes including:
- Upgrading from Nashorn to GraalVM for JavaScript scripting
- Migrating from MapDB/JDBM to H2 MVStore for persistent storage
- Adopting Google Java Format for code formatting

## Build and Development Commands

Expand All @@ -27,9 +30,34 @@ This creates `target/neon-<version>-jar-with-dependencies.jar` which can be run
java -jar target/neon-<version>-jar-with-dependencies.jar
```

### Running the Application
After packaging, the JAR can be run directly. The application will start with a main menu where you can:
- Start a new game using the "darkness" sample game
- Load a saved game
- Open the editor to create/modify game content

The main entry point is `neon.Main`, which initializes the Engine and Client with bidirectional LocalPort communication.

### Running Tests
```bash
# Run all tests
mvn test

# Run a specific test class
mvn test -Dtest=ClassName

# Run a specific test method
mvn test -Dtest=ClassName#methodName
```

### Code Formatting
The project uses Google Java Format via the `fmt-maven-plugin`:
```bash
# Format all source files (runs automatically during build)
mvn fmt:format

# Check formatting without making changes
mvn fmt:check
```

## Architecture
Expand Down Expand Up @@ -192,8 +220,16 @@ The engine uses **GraalVM Polyglot** for JavaScript scripting:
- Located in `darkness/scripts/` directory

## Java 21 Migration Notes
The project is migrating from Java 1.7 to Java 21:
- **Branch**: `feature/java21` (main development branch for migration)
The project has been migrated from Java 1.7 to Java 21:
- **Scripting engine**: Migrated from Nashorn (removed in Java 15+) to GraalVM Polyglot
- **Compiler**: Now uses Java 21 source/target with `maven.compiler.source/target` set to 21
- **Storage**: Migrated from MapDB/JDBM to H2 MVStore for persistent collections
- **Formatting**: Google Java Format automatically applied during build
- Some legacy code may still exist from the Java 1.7 era and should be modernized as needed

## Testing
The project uses JUnit 5 (Jupiter) for testing:
- Test files are located in `src/test/java/`
- Uses Mockito for mocking (version 5.11.0)
- XMLUnit for XML comparison testing
- Integration tests exist for critical systems like serialization (`DataStoreIntegrationTest`)
2 changes: 1 addition & 1 deletion darkness/objects/crafting.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<items>
<craft id="shirt_chain" result="shirt_chain" raw="iron" amount="2" cost="1000" />
<craft id="shirt_chain_craft" result="shirt_chain" raw="iron" amount="2" cost="1000" />
</items>

4 changes: 2 additions & 2 deletions darkness/objects/items.xml
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@
<stats slot="shirt" />
</clothing>
<list id="shirt">
<creature id="wool shirt" l="1" />
<creature id="silk shirt" l="10" />
<item id="wool shirt" l="1" />
<item id="silk shirt" l="10" />
</list>
<container id="chest" color="brown" char="■" />
<container id="altar" color="gray" char="Ħ" />
Expand Down
5 changes: 4 additions & 1 deletion darkness/signs.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<signs>
<sign id="s_alraun" name="alraun"><ability id="spell_resistance" size="20" /><power id="heal_p" /></sign>
<sign id="s_alraun" name="alraun">
<ability id="spell_resistance" size="20" />
<power id="heal_p" />
</sign>
</signs>
4 changes: 4 additions & 0 deletions data/locale/locale.en
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
$newGame=New Game
$loadGame=Load Game
$options=Options
$quit=Quit
Binary file added data/neon.theme
Binary file not shown.
Binary file added lib/DejaVuSansMono.ttf
Binary file not shown.
17 changes: 10 additions & 7 deletions neon.ini.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<root>
<files/>
<log/>
<threads generate="on"/>
<ai>2</ai>
<log>FINER</log>
<lang>en</lang>
</root>
<files>
<file>src/test/resources/sampleMod1</file>
</files>
<log>finest</log>
<threads generate="on" />
<ai>10</ai>
<lang>en</lang>
<keys>qwerty</keys>
</root>
11 changes: 8 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -144,11 +144,16 @@
<artifactId>tinylaf</artifactId>
<version>1.4.0</version>
</dependency>

<dependency>
<groupId>org.fluttercode.jtexgen</groupId>
<groupId>org.xmlunit</groupId>
<artifactId>xmlunit-core</artifactId>
<version>2.11.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.priewe</groupId>
<artifactId>jtexgen</artifactId>
<version>1.2</version>
<version>2.0</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/neon/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public static void main(String[] args) throws IOException {

// create engine and ui
Engine engine = new Engine(sPort);
GameContext context = engine.getContext();
GameContext context = engine.getGameEngineState();
Client client = new Client(cPort, version, context);

// custom look and feels are sometimes stricter than normal ones, apparently
Expand Down
Loading
Loading