Jump to content
Damocles

[A19] NITROGEN , a random world generator for 7DtD

Recommended Posts

Is there a mask for forcing generation of pois along roads? If not, is it planned? :)

 

Currently the roads are created after the POIs where placed. (thus avoiding them)

The vanilla RWG seems to first create roads and city blocks, then POIs, NitroGen is doing it the other way around.

 

But I can see how it looks to create more paths, also toward smaller settlements (farms, rednecks, oldwest-towns).

 

Or test creating smaller random "road-side" POIs like gas stations, grocery markets and gun shops near a road.

Share this post


Link to post
Share on other sites

Just thinking that I'd really like to be able to paint (mask) places that would for sure spawn pois if it's smooth enough, then that roads would find a way to.

Share this post


Link to post
Share on other sites

Can POIs be biome-specific? Is that what "zone" does because you can put biomeonly there but unsure what it does.

Share this post


Link to post
Share on other sites
Just thinking that I'd really like to be able to paint (mask) places that would for sure spawn pois if it's smooth enough, then that roads would find a way to.

 

Sure I could read out more information from the mask, like a city-center point.

That could be like reading a single red pixel as spawn point for a city-center, that gets added to a preferred list.

 

BTW: currently all towns and cities have a road to each of their 3-closest other cities/towns.

Share this post


Link to post
Share on other sites

Lots of changes, very nice. I'm still a bit stumped on how to edit roads after generation *g*

 

I'm making a map, painting in my general features.

I'm editing the biome file and the heightmap

I'm now adding a no spawn mask to my rivers and lakes

I'm rendering those until i find a nice spread of cities and towns that i like

 

So far this is working great (apart from having to flip the heightmap every time *g*)

 

Now i'd like to undo all the damage the poi and road generation has done, like a road going through a river for example, which it will do if the river is very long it seems. I have no idea on how to accomplish that.

 

Feels like i should use the generated POI heightmap, edit out the filled up river-parts, edit the splatmap and delete the road. But how to render that thing now while keeping all the pois and stuff? Is there a way and i'm not seeing it?

 

Or can we perhaps leave out road generation completely, apart from within a city? and then i could draw my own highways on the splatmap??

 

Since I'm modelling the entire map myself, flattening and adjusting would not be required ^^ But i can't be arsed to manually create twenty cities, that's why i need the random poi generation and heightmap adjustments :)

Edited by ecv (see edit history)

Share this post


Link to post
Share on other sites
Lots of changes, very nice. I'm still a bit stumped on how to edit roads after generation *g*

 

I'm making a map, painting in my general features.

I'm editing the biome file and the heightmap

I'm now adding a no spawn mask to my rivers and lakes

I'm rendering those until i find a nice spread of cities and towns that i like

 

So far this is working great (apart from having to flip the heightmap every time *g*)

 

Now i'd like to undo all the damage the poi and road generation has done, like a road going through a river for example, which it will do if the river is very long it seems. I have no idea on how to accomplish that.

 

Feels like i should use the generated POI heightmap, edit out the filled up river-parts, edit the splatmap and delete the road. But how to render that thing now while keeping all the pois and stuff? Is there a way and i'm not seeing it?

 

Or can we perhaps leave out road generation completely, apart from within a city? and then i could draw my own highways on the splatmap??

 

Since I'm modelling the entire map myself, flattening and adjusting would not be required ^^ But i can't be arsed to manually create twenty cities, that's why i need the random poi generation and heightmap adjustments :)

 

It would be superb if a road would build a bridge when encountering rivers.

Share this post


Link to post
Share on other sites
Lots of changes, very nice. I'm still a bit stumped on how to edit roads after generation *g*

 

I'm making a map, painting in my general features.

I'm editing the biome file and the heightmap

I'm now adding a no spawn mask to my rivers and lakes

I'm rendering those until i find a nice spread of cities and towns that i like

 

So far this is working great (apart from having to flip the heightmap every time *g*)

 

Now i'd like to undo all the damage the poi and road generation has done, like a road going through a river for example, which it will do if the river is very long it seems. I have no idea on how to accomplish that.

 

Feels like i should use the generated POI heightmap, edit out the filled up river-parts, edit the splatmap and delete the road. But how to render that thing now while keeping all the pois and stuff? Is there a way and i'm not seeing it?

 

Or can we perhaps leave out road generation completely, apart from within a city? and then i could draw my own highways on the splatmap??

 

Since I'm modelling the entire map myself, flattening and adjusting would not be required ^^ But i can't be arsed to manually create twenty cities, that's why i need the random poi generation and heightmap adjustments :)

 

Roads will eventually find a way (the mask is just increasing the cost of the path-seach, like mountains do). I can increase the costs of the mask-pixels, that should allow for longer detours around blocked of areas.

 

If you need full control of roads: you could render the map with roads turned off. (the city roads are still present then, the option is just regarding the long distance roads).

You can then edit the splat map manually (drawing the roads), and also smooth out the terrain map beforehand where the roads should go.

 

Of course the cities locations will not be known 100% at that point, unless the mask is very restrictive. But you could prepare mountain-passes beforehand for example, and later draw the road onto that.

 

But overall I would suggest to make the mask at the rivers thicker than the river, and already plan in land-bridges when painting very long rivers. (better preparing it by hand, than letting the generator mess around automatically when crossing a river)

The most effort but best result would be to manually place a bridge there (adding it and its position to the prefabs.xml) where your manually drawn road cross a large river.

Edited by Damocles (see edit history)

Share this post


Link to post
Share on other sites
It would be superb if a road would build a bridge when encountering rivers.

 

I can add them at one point. They need a bit more complex logic, as the bridge POIs are not very long , and only go East-West or North-South, the generator would have to prepare a land-bridge at its end for wider rivers/lakes.

Share this post


Link to post
Share on other sites
I can add them at one point. They need a bit more complex logic, as the bridge POIs are not very long , and only go East-West or North-South, the generator would have to prepare a land-bridge at its end for wider rivers/lakes.

 

Could the road generation then perhaps honor the mask and simply stop the roads and terrain altering there? I can insert the bridges on my own. I don't even mind the road, the filled river is the biggest issue as that takes like an hour to edit out in the game ^^

 

Landbridges are not really an option as i'd like a river going through the entire map, starting on a mountain on one edge.

 

I really don't understand enough of the process, but this would be the best for me (i think):

 

Part 1

 

generate a new map, or provide a premade heightmap and biome mask

generate the cities and pois, respecting the dont build here mask

--> let me repeat this step until I have found a suitable city/poi distribution

 

 

Part 2

 

generate a splatmap, before altering the terrain for road usage.

--> let me edit the splatmap to get rivers and deep cracks or whatever region free of roads, perhaps to add a few of my own, or to lay down a road system for a player village perhaps or a road from the spawnpoint to somewhere whereever.

 

now generate the smoothed out heightmap and place the roads

 

generate the spawnpoints in non-masked areas and non-radiation zones or at a predefined coordinate.

 

load the map in the game and enjoy :)

Share this post


Link to post
Share on other sites

For a quick "fix", I have increased the mask costs, so roads are less likely to pass though marked areas.

 

Also: roads now will keep a minimum level of 35, so they will no draw "under" the large-lake surface level, but create a raised ramp.

Please check if this looks ok, or the hight needs to be lower.

 

EDIT: also the roads will not alter the terrain in masked off area (but their smoothing can "bleed" like 12 pixels into the masked area, so the mask should be wide enough when blocking off certain areas)

 

(v0.251 same download link)

 

The way the path calculation works, it will always find a path, with the lowest cost. So It cant be completely blocked off. You need to have some passable landbridge between the two sides of the map, if there are cities/towns on both sides.

 

The only time roads will not connect is when the 3 closest towns are already nearby. So when the distance is large enough, and both side have at least 3 towns/cities, there should be no road drawn.

Edited by Damocles (see edit history)

Share this post


Link to post
Share on other sites

I tried using a mask with a prepared heightmap and am rather happy with the results, especially the single spawnpoint option is great.

 

Sure I could read out more information from the mask, like a city-center point.

That could be like reading a single red pixel as spawn point for a city-center, that gets added to a preferred list.

 

I had an idea, tho it kinda goes away from what you said your generation procedure follows.

 

I would be interested in drawing roads, at least like a "main road", along which red pixels could be arranged to generate a city/town, while a city would obviously use different prefabs and amounts and towns would use their materials to create a drive towards/in and essentially through experience. I know you build the POIs before the roads, that makes it though impossible to have a main road, to drive straight through the city.

 

At the moment, i believe (excuse me if i am wrong) your generation bundles prefabs surrounded with a street frame to separate the buildings as city or town and then joins them with roads.

Would it be possible to switch those 2 procedures, that way the roads would be (if so chosen) in the users hand to draw or adjust and could very well allow some nice planing along terrain-features (leaving gaps for tunnel-prefabs perhaps as well).

 

Also, something a bit simpler i believe, if possible, could we get a number along with the trader amount? I always try to find all traders to keep me/us busy, but it seems on a 4k map the max amount is always 5. (could be influenced by the extra prefabs from DF, dunno)

Never the less i bet some others may be interested in having more quests available, especially playing DF dedicated, as there the traders are also possible zombie food, not invincible anymore ;)

Share this post


Link to post
Share on other sites

Also, be aware that my script only reads out what is in the prefabs tts and xml files. You will need to do some manual editing, as that can't all be done by a non sentient script XD

 

Hope it will be of use for some/one... ;)

 

https://drive.google.com/open?id=12cVrKInSBjNuxA68eH85DWyMeY-iH7H3

 

 

Hey Damocles and all map builders here,

thanks to Xylvier script I generated the CompoPack38 prefablist and spend some time editing it :p

I had to place the deepest poi (Sphinx3 and NSite) on mountains cos' their heights makes bugs if placed too low.

Lots of huge poi are placed alone and i edited the placement as I believe it would be best.

But it's my interpretation I haven't played in all of those POI atm so maybe a better placement for some may occur.

It may cause bugs especially if you try to maximize spawns of everything since those prefabs are huge for lot of them.

I uncomment some on my own for generation feel free to do the same.

He are 234 prefabs to add to the nitrogen prefablist at the end if you want to use CompoPack easily.

original prefablist finish with

water_tower_03,RESIDENTIALOLD;RESIDENTIALNEW;INDUSTRIAL,2,-1,10,15,13,farm;smalltown

you just copy paste after (using notepad++ or such) all the xcostum

Hope it will help some and thanks again Xylvier :)

prefablistCPonly.txt

Edited by Hell_Vice (see edit history)

Share this post


Link to post
Share on other sites

^happy to help

 

but be careful with the Zonenames, guess the "INDUS TRIAL" was just a typo, but i don't know what NITROGEN does when it can't sort the Zonename in? Would be interesting to know ... catch or fall through?

Edited by Xylvier (see edit history)

Share this post


Link to post
Share on other sites
^happy to help

 

but be careful with the Zonenames, guess the "INDUS TRIAL" was just a typo, but i don't know what NITROGEN does when it can't sort the Zonename in? Would be interesting to know ... catch or fall through?

 

When NitroGen places POIs it will look for the zone name by a simple text search. (last list with zone-names seperated by ; )

If the zonetype is not in this list (due to a typo) it will just ignore this prefab.

The first zone-list in a prefab-entry is just the original 7DtD zone type, but not used by the code.

 

 

In the beginning it checks if there is at least 1 POI of each zone type, else it prints a warning "Warning: prefab list does not contain POIs of type". There should be at least one prefeab of each type, else it can run into a deadlock!

 

 

Here are all zone names as a reference (the case does not matter, it always converted to lower case)

 

checkPOIZoneTypeExists("citycenter");

checkPOIZoneTypeExists("downtown");

checkPOIZoneTypeExists("houses");

checkPOIZoneTypeExists("smalltown");

checkPOIZoneTypeExists("industrial");

checkPOIZoneTypeExists("trader");

checkPOIZoneTypeExists("alone");

checkPOIZoneTypeExists("mountain");

checkPOIZoneTypeExists("farm");

checkPOIZoneTypeExists("hillbillytrailer");

checkPOIZoneTypeExists("hillbillyjunk");

checkPOIZoneTypeExists("oldwest");

Share this post


Link to post
Share on other sites
Hey Damocles and all map builders here,

thanks to Xylvier script I generated the CompoPack38 prefablist and spend some time editing it :p

I had to place the deepest poi (Sphinx3 and NSite) on mountains cos' their heights makes bugs if placed too low.

Lots of huge poi are placed alone and i edited the placement as I believe it would be best.

But it's my interpretation I haven't played in all of those POI atm so maybe a better placement for some may occur.

It may cause bugs especially if you try to maximize spawns of everything since those prefabs are huge for lot of them.

I uncomment some on my own for generation feel free to do the same.

He are 234 prefabs to add to the nitrogen prefablist at the end if you want to use CompoPack easily.

original prefablist finish with

water_tower_03,RESIDENTIALOLD;RESIDENTIALNEW;INDUSTRIAL,2,-1,10,15,13,farm;smalltown

you just copy paste after (using notepad++ or such) all the xcostum

Hope it will help some and thanks again Xylvier :)

 

The base hight (normal hight the flat-land will be created) is at 35 meters.

However, the bedrock is somewhere between 3 to 4 meters high. Leaving only 32 to 31 meters of underground on low land (above the water level).

 

If several of your POIs are going down deeper than that, its probably better to use a custom hight-map, and import it, where the "flat land" is higher than 35 (but not higher than 65, else cities dont spawn).

Or just spawning them on a mountain.

Share this post


Link to post
Share on other sites
The base hight (normal hight the flat-land will be created) is at 35 meters.

However, the bedrock is somewhere between 3 to 4 meters high. Leaving only 32 to 31 meters of underground on low land (above the water level).

 

If several of your POIs are going down deeper than that, its probably better to use a custom hight-map, and import it, where the "flat land" is higher than 35 (but not higher than 65, else cities dont spawn).

Or just spawning them on a mountain.

 

Very good to know about the heights, especially the 35 and even more so the not higher then 65 for cities for obvious reasons.

 

May i ask what grey value represents the 65 height, or would that be RGB(166,166,166) roughly ?

 

And thanks for clearing up the Zone handling ;)

Share this post


Link to post
Share on other sites

gray value 65 should be represented by (65, 65, 65) or #414141 :)

Share this post


Link to post
Share on other sites
^happy to help

 

but be careful with the Zonenames, guess the "INDUS TRIAL" was just a typo, but i don't know what NITROGEN does when it can't sort the Zonename in? Would be interesting to know ... catch or fall through?

 

Yeah the typo is a ctrl c on original prefablist; conversion most likely but everything works fine since it's not the zoning part here but at the end

If several of your POIs are going down deeper than that, its probably better to use a custom hight-map, and import it, where the "flat land" is higher than 35 (but not higher than 65, else cities dont spawn).

Or just spawning them on a mountain.

Yeah just 2 POIS are deep enough Sphinx3 which is 40 below ground and xcostum_NSiteMissileSilo which is 34 so they are on mountain list (i obviously tested it the hard way).

Just one question, will it be possible to add a maxcount on some prefabs on the prefablist?

Thank you for this amazing Tool.

Share this post


Link to post
Share on other sites
gray value 65 should be represented by (65, 65, 65) or #414141 :)

 

well .. i thought more about the 100% white represented as (255,255,255) which then 65% of would be (166,166,166).

 

But then again i don't know how Damocles uses it, that's why i asked.

Share this post


Link to post
Share on other sites
well .. i thought more about the 100% white represented as (255,255,255) which then 65% of would be (166,166,166).

 

But then again i don't know how Damocles uses it, that's why i asked.

 

It's not percent. It's 256 shades of gray.

0, 0, 0 = black (lowest level, 0m)

x1, x1, x1 = any shade of gray in between (1m-254m)

255, 255, 255 = white (highest level 255m)

Edited by ecv (see edit history)

Share this post


Link to post
Share on other sites

i'm still having massive troubles with the roads :( Perhaps what I want isn't possible at all, i don't know. I've made this testmap with that river I so love. Made my mask. I've uploaded the resulting preview. specially the center is troublesome to me. I really need to get rid of any roads going through masked zones :) And there's a whole city sitting on my river as well :)

 

Unbenannt.jpg.dbfa3ebd5f8da37d53d53643c81c3906.jpg

 

I'd really hate to paint all roads by hand :) :)

 

Oh wow, the upload quality is abysmal. river goes from NE to SW, snaking it's way down.

Share this post


Link to post
Share on other sites

Yes, the RGB value goes from 0 to 255 representing 0 to 255 meters ingame. So a 100,100,100 rgb will create terrain at 100 meters high.

 

You can have a look at the generated grey HM as reference

Share this post


Link to post
Share on other sites
i'm still having massive troubles with the roads :( Perhaps what I want isn't possible at all, i don't know. I've made this testmap with that river I so love. Made my mask. I've uploaded the resulting preview. specially the center is troublesome to me. I really need to get rid of any roads going through masked zones :) And there's a whole city sitting on my river as well :)

 

[ATTACH=CONFIG]28293[/ATTACH]

 

I'd really hate to paint all roads by hand :) :)

 

Oh wow, the upload quality is abysmal. river goes from NE to SW, snaking it's way down.

 

Looks like your mask is flipped upside down. There should be no Pois spawning in masked off areas.

The imported mask must be the same orientation as the imported hightmap image.

 

Also, the pathfindig will find a path, so when an area is completely surrounded by blocked area, the road will go though the mask. You need some gap (where a bridge would be naturally)

Edited by Damocles (see edit history)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...