jMonkeyEngine / jmonkeyengine

A complete 3-D game development suite written in Java.
http://jmonkeyengine.org
BSD 3-Clause "New" or "Revised" License
3.78k stars 1.12k forks source link

TerrainGridTestData.zip: Missing assets. TerrainGrid/testgrid_x_y_z.j3o. #2002

Closed capdevon closed 1 year ago

capdevon commented 1 year ago

The TerrainGridTileLoaderTestclass cannot load the j3o terrain files because they are not present in the .zip file I downloaded the zip file locally and verified that indeed the j3o files are not inside it.

package jme3test.terrain.TerrainGridTileLoaderTest

StackTrace:

mag 07, 2023 6:44:34 PM com.jme3.terrain.geomipmap.grid.AssetTileLoader getTerrainQuadAt
WARNING: Could not load terrain grid tile: TerrainGrid/testgrid_-1_0_-1.j3o
mag 07, 2023 6:44:34 PM com.jme3.terrain.geomipmap.grid.AssetTileLoader getTerrainQuadAt
WARNING: Could not load terrain grid tile: TerrainGrid/testgrid_-1_0_0.j3o
mag 07, 2023 6:44:34 PM com.jme3.terrain.geomipmap.grid.AssetTileLoader getTerrainQuadAt
WARNING: Could not load terrain grid tile: TerrainGrid/testgrid_-1_0_1.j3o
mag 07, 2023 6:44:34 PM com.jme3.terrain.geomipmap.grid.AssetTileLoader getTerrainQuadAt
WARNING: Could not load terrain grid tile: TerrainGrid/testgrid_2_0_1.j3o
mag 07, 2023 6:44:34 PM com.jme3.terrain.geomipmap.grid.AssetTileLoader getTerrainQuadAt
WARNING: Could not load terrain grid tile: TerrainGrid/testgrid_-1_0_2.j3o
mag 07, 2023 6:44:34 PM com.jme3.terrain.geomipmap.grid.AssetTileLoader getTerrainQuadAt
WARNING: Could not load terrain grid tile: TerrainGrid/testgrid_0_0_2.j3o
mag 07, 2023 6:44:34 PM com.jme3.terrain.geomipmap.grid.AssetTileLoader getTerrainQuadAt
WARNING: Could not load terrain grid tile: TerrainGrid/testgrid_1_0_2.j3o
mag 07, 2023 6:44:34 PM com.jme3.terrain.geomipmap.grid.AssetTileLoader getTerrainQuadAt
WARNING: Could not load terrain grid tile: TerrainGrid/testgrid_2_0_2.j3o
stephengold commented 1 year ago

Indeed, the ZIP file consists mostly of PNGs; there are no J3Os in the ZIP. It's been a long time since this app actually tested the AssetTileLoader.

capdevon commented 1 year ago

Upon further research, it appears that the files are located at this path: https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-testdata/src/main/resources/TerrainGrid/testgrid_0_0_0.j3o

capdevon commented 1 year ago

I would suggest removing this useless statement block that can cause confusion and adding a comment that specifies to add the jme3-testdata.jar file to the classpath before running the TerrainGridTileLoaderTest class.

        File file = new File("TerrainGridTestData.zip");
        if (!file.exists()) {
            assetManager.registerLocator(
                    "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/jmonkeyengine/TerrainGridTestData.zip",
                    HttpZipLocator.class);
        } else {
            assetManager.registerLocator("TerrainGridTestData.zip", ZipLocator.class);
        }
stephengold commented 1 year ago

I'll delete the statement block. jme3-testdata should already be in the classpath.

stephengold commented 1 year ago

The initial location of the camera is (0, 256, 0), which puts it near the edge of the map. In particular some non-existent tiles such as "testgrid_-1_0_0.j3o" .

The camera's initial location ought to be closer to the center of the map. For instance:

        this.getCamera().setLocation(new Vector3f(300, 256, -400));

Even then, if you travel far enough in a single direction, you will eventually hit non-existent tiles.

stephengold commented 1 year ago

Changed the initial camera location at 400be336.