Repository navigation
world: city bundles version 2, so a generated world is written and read as a bundle (GB1) - #1385
Merged
Merged
Conversation
…ad as a bundle (GB1) ARIADNE_WORLDS section 18.8, first phase. A world_geometry is written as a version 2 city bundle, the files in memory so the browser writes what natively does: - world.json: the surface table by name, every item (file, roles, surface, placement), edge walls, region, water level, the generator with its seed and params, and a content hash; - terrain.json with its heights in terrain.f32, and terrain_surfaces.u16 (one surface per cell: the nav and contact materials); - a glb per mesh item, one mesh per surface, vertices in first-use order so what is read writes the same bytes again. load_city_bundle reads version 2 when a bundle has world.json; version 1 loads as before. The glb comes from assimp's glTF 2 exporter: the model handler's write and a new write_model_to_memory fill what used to throw. read_model_from_memory gains an exact mode (no joined vertices or generated normals, lines kept), and lines read back. generated_world_bundle writes a generated world (geometry()'s items, the needles, the water level, the generator), and generated_world_params_json round-trips its params. Tests (world_bundle_v2_test): a glb reads back exactly; a world reads back with the same terrain, cell surfaces, items, roles, placement and face surfaces, and writes the same bytes again; a directory reads as memory does; bad bundles say why; a generated world reads back as the same world, the same params make the same hash; two loads simulate to the same state hash and the loaded terrain is the generated one to Jolt.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The first phase of ARIADNE_WORLDS §18.8 (design in #1380): a generated world can be written as a city bundle and read back as the same world.
Version 2 bundle (version 1 still loads unchanged).
city_bundle_byteswrites the files in memory:world.json: the surface table by name, every item (file, roles, surface, placement), edge walls, region, water level, the generator with its seed and params, and a content hash (city_bundle_hash: SHA-256 over every other file, in name order);terrain.jsonplusterrain.f32(heights, north first), andterrain_surfaces.u16(one surface per cell: the nav and contact materials);load_city_bundlereads version 2 when a bundle hasworld.json.write_city_bundlewrites the files to a directory, andcity_bundle_memory_readerreads them from memory.glb through assimp. The model handler's
writeused to throw. It now exports through assimp's glTF 2 exporter, and a newwrite_model_to_memorydoes the same without a file.read_model_from_memorygains an exact mode (no joined vertices, no generated normals, lines kept). Builds without assimp throwunsupported_model_file_type, and the tests skip there.Generated worlds.
generated_world_bundlewritesgeometry()'s items, the needles, the water level and the generator.generated_world_params_jsonandgenerated_world_params_from_jsonround-trip the params, for the seed-and-hash path.Tests (
world_bundle_v2_test, MSVC Release, all pass):The existing CityBundle, PhysicsWorldGeometry, AriadneData and model tests pass (77 in ctest).
Not in this PR: the dataset path (GB2), the renderer (GB3), the lab's save (GB4), clients (GB5). The props' LOD rungs,
streets.jsonandground.pngcome with the renderer.