protobuf format mismatch between this and current worldengine?

Open
#2 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
java
Domain
backend

Research direction

Start with WorldFileLoaderTest.java and reproduce the failure using seed_17824.world alongside seed_1534.world. Compare how the loader handles the two protobuf formats and identify the compatibility boundary. Done means the current WorldEngine world file loads without the missing-required-fields error and the relevant test passes.

Written by the indexing model from the issue text.

Description

I've tried to use this project to import information from a world file into a Java program (to paint a more detailed river map and a lake map, for example).
But even replacing

public void loadWorld() throws IOException {
    InputStream is = WorldFileLoaderTest.class.getClassLoader().getResourceAsStream("seed_1534.world");
    WorldFile.World worldFile = WorldFileLoader.fromInputStream(is);
    assertEquals("seed_1534", worldFile.getName());
}

with

public void loadWorld() throws IOException {
    InputStream is = WorldFileLoaderTest.class.getClassLoader().getResourceAsStream("seed_17824.world");
    WorldFile.World worldFile = WorldFileLoader.fromInputStream(is);
    //assertEquals("seed_17824", worldFile.getName());
}

in WorldFileLoaderTest.java (after placing the freshly generated seed_17824.world next to seed_1534.world in the filesystem) results in

Tests in error: 
  loadWorld(org.worldengine.world.WorldPainter): Message missing required fields: name, height, heightMapData, heightMapTh_sea, ...

A quick look with ghex into both seed_17824.world and seed_1534.world reveals that they look quite different (obviously only showing the first couple of bytes):

0A 09  s  e  e  d  _  1  5  3  4 10 80 08 18 80 08  " 80 98 C0 04 0A 80
 H 09 00 00 00 00 00 00 00 00 09 00 00 00 00 00 00 00 00 09 00 00 00 00

vs.

08 EE CA BD BB 05 10 80 80  L 1A 0A  s  e  e  d  _  1  7  8  2  4 20 D5
0E  ( F3 06  2 F3 D2 8E 07 0A FD 83 01 09 C2 F5  (  \ 8F C2 D5  ? 09 C2
F5  (  \ 8F C2 D5  ?
Dominant language
Protocol Buffer
Stars
7
Forks
2
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.