• If you have a mod, tool or prefab, please use the Resources section. Click Mods at the top of the forums.

A19e Nitrogen - UNSTABLE

Status
Not open for further replies.
Awesome!

Would love to chat with you regarding your generation approach. I'm still actively working on my generator too, I've gone down a detour a bit because I thought it would be interesting to generate a map with a maze in it, but I'm pretty much up to generating roads and towns, would love to hear your thoughts.

 
Some technical details:

[POIs]

The POIs are selected from an included list, in a format such as this:

skyscraper_01,DOWNTOWN,2,-1,93,134,87,citycenter

(Name, 7dtd zone, face-north-direction, y-offset, wide (x), high (y), deep (z), NitroGen zone

the zone defines where it will be placed (on mountain, on a farm, only in cities, in trailerparks)

New POIs can be added simply by inserting a new entry with the Prefabs name, and its dimensions (can be seen in the prefab editor).

NitroGen can load any POI included with the game, so its also using several from Navezgane and some good looking work-in-progress POIs.

The POIs are placed onto the terrain at its chosen location (depending how high that settlement is allowed to be). Since the POIs have a very rigid base-floor, the terrain is smoothed to a plateau at this location. Else they would hang in the air, and we dont want that the happen ...

[ROADS]

Here a preview map that can be generated: (8K map, generates in about 4 minutes)

roads.jpg


The roads are placed between cities. They use classic map pathfinding (similar to A*) to find the route with the shortest distance, but also the least elevation change... just like people would build roads.

Then they smooth out the terrain a bit along the path and place the road-splatmap textures.

I have written the pathfinding algorithm within a few minutes as a prototype, and did not optimize it yet. A proper A* would be quite a bit faster...

-----------

The terrain hightmap is first rendered to a normal 8 bit png. Then processed by the POI mapper (roads and POI plateaus), then exported to the 16bit RAW hightmap and smoothed over.

6.jpg


10.jpg


8.jpg


9.jpg


 
Last edited by a moderator:
So.... You made an RWG generator?...

I'd like to check it out, but I'll wait in the hope that it stops requiring a separate Java...

... so, it uses its own terrain algorithms? All this seems rather complicated...i'm even confused...

Hmmm....is 32K mode possible for crazy Russians?...(or there is a limit in the game itself?)

 
Last edited by a moderator:
EDIT: I think i know what happened: Did you start it from within the zip file? It needs to be extracted first.

It has the same behavior when I do that, then not using it installation directory by using the system path.

If not, there is still an issue for it to use relative paths.

i will have a look into that.

Try to get into the directory with the jar via the commando line, and enter

java -jar nitrogen.jar

the should make it have the right local path.

---------------

Hmmm....is 32K mode possible for crazy Russians?...(or there is a limit in the game itself?)
32K would likely blow the memory. 16k is already quite taxing on it.

For such large maps, the approach how to create the output files would have to be reworked, creating it in small chunks.

unforunately the game requires to have everything in one large file. (terrain, splat maps, etc) and does not split it into smaller chunks at world-generation. but you can populate the maps with a LOT of POIs, making the world more filled than the vanilla RWG. Several thousand POIs should give everyone a good playfield.

 
Last edited by a moderator:
I had unzipped it and clicked on the .jar file that's associated with java. I'll try the line item, but the 8k map did "more", it just never got around to generating the map. =)

 
Works for me on 4k, but nothing on 8k.

Though when playing on the 4k world I generated it has crashed 4 times in 1 hour

 
I had unzipped it and clicked on the .jar file that's associated with java. I'll try the line item, but the 8k map did "more", it just never got around to generating the map. =)
I will fiddle around with the paths a bit. Lets see if this helps.

- - - Updated - - -

Works for me on 4k, but nothing on 8k.
Though when playing on the 4k world I generated it has crashed 4 times in 1 hour
Can you see a bug coming up the the console (F1) in 7DTD?

You could try a map that places less POIs, it might be a resource problem, or the map instantiated a POI that is not in your games prefab folder.

It loaded all of them in my vanilla 17.2 installation.

 
//// but you can populate the maps with a LOT of POIs, making the world more filled than the vanilla RWG. Several thousand POIs should give everyone a good playfield.
Big worlds are just needed in order not to fill their POI, but to have a lot of space for travel.

You plan later to compile the project that he did not use the external Java?

 
Last edited by a moderator:
I have just uploaded Version 0.11. (same link)

It handles file-path a bit differently and checks for the resources before starting to generate the map.

Hope this helps to track down issues with the working directory.

- - - Updated - - -

Big worlds are just needed in order not to fill their POI, but to have a lot of space for travel.
You plan later to compile the project that he did not use the external Java?
I can later bundle it with a Standalone Java implementation. But not for now.

(It would also increase the filesize quite bit to have Java included in the Installation, Java is quite bloated.)

 
Last edited by a moderator:
Do you find your roads smoother than vanilla?
They are not really "smooth", but thats also on purpose, as I dont want the roads to looks like artificial cuts on the terrain.

...Consider them badly maintained local roads of a poor county..

The roads will have some very steep angles on very steep terrain, but in general are way smoother than the surrounding landscape.

And they are actually "build" after the terrain was generated and populated, so they can make large curves around mountains, go though valleys, avoid lakes and existing POIs.

There are still some issues when they meet the first POI of a city on higher terrain, as they might steel some soil from the POIs, wich are where placed already on flattened terrain.

Later I could include some more country side roads between towns, when the pathgeneration works faster. They are quite demanding to generate the more settlements there are.

 
Last edited by a moderator:
Hey mate,

Looks really awesome, I'm definitely going to download and try.

Hey, I'm up to doing the road generation in my program, could you share any insights as to what to research for the path finding? Like is the algorithm called something specific? Also, it looks like you're using some kind of erosion algorithm? something I've also struggled to find a decent example of.

Cheers mate.

[Edit] Yeah, nevermind on the path finding, what kind of name is A*!!

 
Last edited by a moderator:
Hey mate,
Looks really awesome, I'm definitely going to download and try.

Hey, I'm up to doing the road generation in my program, could you share any insights as to what to research for the path finding? Like is the algorithm called something specific? Also, it looks like you're using some kind of erosion algorithm? something I've also struggled to find a decent example of.

Cheers mate.

[Edit] Yeah, nevermind on the path finding, what kind of name is A*!!
Not used here, but a very interesting demonstration of using erosion on a Unity terrain ... if you want to try out dynamic erosion.

and the github source:

https://github.com/SebLague/Hydraulic-Erosion

---

For A* there are lots of tutorials. Its quite straight forward here:

-have a hightmap representation in memory

-scale it down to a usabe size (I have used a quarter of the hightmaps resolution)

-mark the position of POIs and other areas that should be avoided (by increasing the hightvalue on those areas)

-make a path between POIs (between towns), the heuristic used here are distance and elevation change.

-follow the path, and smooth the terrain along the way on the original hightmap

-in parallel draw the road splatmap pixels (there are only 2 road texture types I know of, so 2 pixel colors for the splatmap). There are some random pixels left out to make it a bit more jagged and looking overgrown.

 
My daughter downloaded your map generator last night, and we played a multiplayer game for a few hours. Thanks for sharing this - it's so much nicer to start a map knowing it's not going to end up being over half burned and wasteland. It did take a while for me to download the map once she'd started it, but it worked just fine.

The ground outside the settled areas is quite... rugged. Some high hills/mountains, yes, but also just a lot of bumpy ground. Not necessarily a bad thing, mind you, but it made running across the wild areas visually challenging.

 
Not used here, but a very interesting demonstration of using erosion on a Unity terrain ... if you want to try out dynamic erosion.

Yeah, since posting I did some reading on it. And I can see why it would be slow. Even still I'm going to give it a shot.

 
My daughter downloaded your map generator last night, and we played a multiplayer game for a few hours. Thanks for sharing this - it's so much nicer to start a map knowing it's not going to end up being over half burned and wasteland. It did take a while for me to download the map once she'd started it, but it worked just fine.The ground outside the settled areas is quite... rugged. Some high hills/mountains, yes, but also just a lot of bumpy ground. Not necessarily a bad thing, mind you, but it made running across the wild areas visually challenging.
Good to hear that you both had a good time.

That what I make those tools for.

You could generate a random map without the rough terrain (only mountains, flat land and forests). Thats the advantage of having configuration options in an RWG.

And also place more or less POIs, depending on how much you want to spend on walking through the terrain.

Wasteland and buring forest biomes are not generated. I just dont think they are making the game any better, and basically just annoyed me, every time I was in them.

i could add maybe a few small patches of burned forest here and there...

 
Last edited by a moderator:
Updated to v0.12 - same download link

-new country roads (gravel) between towns (more roads overall now)

-more efficient road generation

-additional setting for landscapes with a more balanced default (more flat land, less rough terrain)

 
Status
Not open for further replies.
Back
Top