fegennari / 3DWorld

3D Procedural Game Engine Using OpenGL
GNU General Public License v3.0
1.15k stars 89 forks source link

A bigger demo? #17

Closed GrimPixel closed 1 year ago

GrimPixel commented 1 year ago

I saw the mod Grand Theft Auto: Stars & Stripes. It could be taken down for copyright infringement any time. I am thinking about building something in real world and inexperienced in 3D stuff. In my opinion, if there is a 1:1 Hawaii built with your program, it could be noticed. How do you think?

fegennari commented 1 year ago

That GTA mod is for an older game and the map isn't nearly the size of the entire U.S. Sure, it's big, but modern game engines and computers can handle that size of a map.

3DWorld supports importing heightmaps up to 32k x 32k pixels. I already have a 16k x 16k heightmap of the Puget Sound area that I used for some of my scenes. The difficult part here is getting the image data. Something of 32k x 32k at 16-bit resolution would be 2GB of height data. If that was a 1m DEM, it would be 32x32 Km in width and height. A 10m DEM would be 320x320 Km.

You're interested in Hawaii. Do you mean just the Big Island, or the entire island chain? The entire thing is some 1500 miles across. I could probably get the Big Island in a single 10m DEM, or something equivalent. Do you know where I can find this heightmap data? Any format that could be converted into a 16 bit grayscale image would work.

Note that I would prefer to generate my own terrain because the point of this project is the procedural generation. But I'm willing to try and import Hawaii for fun.

GrimPixel commented 1 year ago

Glad to know that. I meant the State of Hawaii as a whole. Actually, I took that comma as a decimal separator, so it is 999 times larger than I thought. There are small and famous islands like Malta and Singapore for consideration. The GIS elevation data at USGS The procedural generation is where the most efforts are put in. Real-world locations can be a supplement and attract more people, I think.

fegennari commented 1 year ago

Sorry, what's 999 times larger than you thought? Hawaii? The GTA Stars & Stripes map?

USGS elevation data is a pain to work with. First of all, it comes in rectangular tiles that have to be stitched together at the borders. You generally can't get something like a whole state in one piece. They're aligned to latitude and longitude rather than the borders of states/regions. Second, they follow latitude and longitude lines, so they're curved rather than square. That means they don't stitch nicely at the boundaries or form clean rectangles. Third, they often come in text files with headers rather than images. Or something like geoTIFF, which requires using a custom image loading library. Or you have to sign up to download some custom tool for working with these datasets.

I've spent many hours doing this in the past, for example to create my heightmap of the Berkeley area. I would much rather have someone else put together a single large texture that I can use directly.

I got my Puget Sound image from here: https://www.cc.gatech.edu/projects/large_models/ps.html If you can find something like this for Hawaii, I can try it out.

GrimPixel commented 1 year ago

I read the area of Hawaii and there is a comma in the number. I took that comma as a decimal separator.

Thank you for explaining that. Other sources like ALOS don't seem to be better. I found the Blender addon BlenderGIS. I guess it could save some efforts.

I would like to ask if you plan on its integration with Godot? There are already some procedural-generation repos of Godot addons and they are not so active yet.

fegennari commented 1 year ago

I've never heard of ALOS before. It looks like they have maps with different types of info, but I'm not sure if they have downloadable high resolution heightmaps.

The BlenderGIS module is for importing heightmaps from online and from the various geo/DEM formats in Blender. Can Blender export a heightmap? I always thought it was only for creating meshes and models. If there's a way to get a heightmap from that flow it could work, though I'm not sure what the max resolution would be.

I wrote my own game engine. I don't plan to integrate with any other game engines. The internals are all custom classes and APIs I wrote and aren't really designed to be modular plugin pieces. Of course everything I wrote is open source, so there's nothing stopping someone else from trying to do this. I would probably even help with that project, but I doubt I would have time to do it myself. It really depends on the scope. Are you talking about just the terrain component? The vegetation? Cities and buildings? There are many different procedural generation systems in 3DWorld.

GrimPixel commented 1 year ago

ALSO data is under “dataset”, like Global PALSAR-2/PALSAR/JERS-1 Mosaics and Forest/Non-Forest Maps It requires registration.

There is a post How do you export a height map from Blender GIS?. There is a section in its wiki DEM import freeze Blender.

The procedural generation in general is absent in Godot. The only repositories like Godot Procedural Generation are not actively developed.

Zireael07 commented 1 year ago

@GrimPixel: Procedural generation in Godot is a thing, there's at least 1 project which generates rail tracks, and quite a lot of projects that procedurally generate levels using gridmaps

fegennari commented 1 year ago

I'm going to close this issue for now since there's no more activity in this thread and I'm not planning on doing this right now. I may get back to terrain rendering at some point once I'm done with city/building creation and the procedural generation side of 3DWorld. Thanks for your input and suggestions!

GrimPixel commented 1 year ago

Hey. Just want to tell you about a new tool that converts GIS data into scenes: https://scenefromgis.14egaming.com/

fegennari commented 1 year ago

Thanks for the link. I would like to look at the source code, but I don't think the GitHub page for that project is up yet.

GrimPixel commented 1 year ago

I got an idea: generate scenes based on hashing. I saw that in Mount & Blade, wherever I go, same scenes are used in different locations. I think if hashing based on the position guarantees that each place is unique. Other factors for hashing can be considered as well, to make a place different in different time and influenced by different cultures.

fegennari commented 1 year ago

I'm not sure what you mean by hashing. I already use the location as the random seed for procedural generation, which may be the same thing. I haven't done anything with time or cultures.

GrimPixel commented 1 year ago

Ah, yes. The seeds.