Jump to content

Damocles

Members
  • Posts

    1,507
  • Joined

  • Last visited

  • Days Won

    10

Everything posted by Damocles

  1. Did you try the very newest version? v0.25 It should create a ramp through the large water area where the road goes (unless you edited it manually) Water should not be cut then. Small lakes are avoided also. Bridges are not implemented yet, its a bit tricky to make them work properly.
  2. this is basically the code: the raw hightmap has the value range of a 2-byte short: The second byte is the same as the original rgb hightmap values, and the first byte the detail values. (little Endian) Very simple format actually: byte[] out = new byte[wide*wide*2]; //map dimensions int i=0; for(int y=0;y<wide;y++) { for(int x=0;x<wide;x++) { int valShortRage = getByteTo2ByteOutputRange(floatImage[x][y]); //convert to short range (0 .. 65535) equals (0 .. 255 meters) int a = valShortRage & 0xFF; int b = valShortRage >>8 & 0xFF; out = (byte)a; out[i+1] = (byte)b; i+=2; } } Internally I use a float-value map to make smoothing the terrain simpler.
  3. In the very latest uploaded version, roads will not alter terrain on masked areas. You can then just delete that section that crosses the forbidden area in the splat map.
  4. 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)
  5. 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
  6. 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.
  7. 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");
  8. 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.
  9. 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.
  10. 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.
  11. 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.
  12. Had a few beers (May Day), will respond tomorrow
  13. 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.
  14. New version 0.25 online (same download link) -option to only have single playerspawn (same starting location in MP) -generation mode: * automatic: normal generation * use import_HM.png: loads import_HM.png from the resources folder, then generates map * import + mask: loads import_HM.png and a mask.png from the resource folder (mask will block POIs from spawning, and discourages roads), only the alpha channel is considered, alpha below 20 is free, everything else blocked * only generate HM: stops after generating the procedural map * only map POIs: loads the genHM.png from the indicated folder, and continue generation usecases: -> you first use "only generate the HM", edit the hightmap, then use "only map POIs" to continue -> you can repeat "only map POIs" to try out different POI distributions on the same hightmap -> you can create a custom hightmap, place it in the resource folder, add a mask, then generate a custom world In the provided example (quickly drawn), I used the mask to block the mountains and river areas / river deltas from spawning POIs. The mask can have any size, as long as its square. Larger masks will of course have a better resolution. The logic ist just testing for the center of the POI for a mask-pixel. So to really avoid an area, it should have a large enough margin in the mask. The mask consideres any pixel with an ALPHA value smaller than 20 (eg fully transparent) as passable, anything else as blocked. The color does not matter, so you can paint all blocked areas pink if you like. The easiest way to create a mask would be to paint an separate layer in photoshop ontop of the terrain, and then export that layer as mask.png
  15. Added separate generation steps, to redo POI mapping to the same terrain. Also added a mask image import that blocks POIs and roads to use a masked off area. This way the user has more manual control over the POI and road distribution. Also an option to only have a single spawnpoint, so in MP everyone should start together at the same spot. Will be included when the next version is uploaded.
  16. Thanks for all the feedback. I will note down the suggestions, lets see when I have time to add some more features.
  17. Maybe I will add some options to trigger map generation and POI placement separately, as they are functionally different modules. Something like: -generate map and pois -only generate map -import map, generate pois (where you can edit the hight-map beforehand) -import POI placement mask - - - Updated - - - The player spawn points are red, traders purple, city centers cyan, industrial buildings blue. (..in Xylviers map, there also seem to be some custom added POIs, using the citycenter color)
  18. The results are completely random every time you start / restart the generation. At the start of the program, the random Object is initialized with a seed calculated from the current nanosecond counter. A classic pseudo-random function. So there will be no observable repeating patterns (that could be fixed be manually setting the seed), outside of the existing limitations of the generation. (Any time a very small change is done to the generation, the output is completely different) The approach I took here is theoretically less random than the noise-map based approach in the vanilla RWG, but it also gives me more control over the outcome. And one of my main goals is, that any generated default map is fun to play for a normal vanilla user (who would likely not try out several maps, but just wants one to play on). It should not just be a few good maps with a lucky draw on the distribution of features and POIs. For anyone who likes to experiment, there should also be lots of custom options. All the way to allowing to import a selfauthored hightmap.
  19. About the seed: while it would be possible to insert a seed, it would only give the same results on other clients if ALL options are set to the same value. That could be an idea when I dont plan any further changes, as any change would also completely change the results. (All generation steps draw from the same random pool) The vanilla RWG does not have manual configuration options in the UI, so sharing a seed works better here. ---- With the mountains I tried to have a scenic "Alpine" look. They are pretty hight, also as to use the full range of the possible hight. I can think about a parameter to set the impact of the peaks. But the best results would come from custom hightmap brushes here, if you want a specific look. (Should be enough to just smooth and reduce the white value on the mountain tops, and maybe remove the snow biome color values in the mask, if you want high green hills).
  20. New version: 0.242 (same download link) -added option to have wasteland (craters) and burned forest patches, unter the biomes selection -roads can be set a bit (2 meters) wider ---- I dont want to make the roads too wide, as this can cause problems with the smoothing of the terrain, and dangling POIs. I dont really like the wasteland biome (mostly for its visual environment effect and as its nonsensical), so its optionally spawned as a huge crater (imagine the landscape was bombed to eradicate the outbreak) ---- About the POI biome restrictions: most POIs work fine in all biomes, there are a few that dont work well (namely the snow POIs) But adding extra logic for those few would make it unnecessarily complex. The prefab list excluded several POIs, I tried to keep as many in as possible but some are -very specific handplaced decorations for Navezgane -have snow (looks weired when spawned somewhere else) -would require special logic to place correctly (the docks, the bridges and canyon POIs) -are work in progress, some elements in them would break immersion
  21. The ore clusters and detail vegetation/stones etc cant be defined by the world files. Its generated by the game after importing the world-files and generating the actual chunks. So the only way for caves I see is creating cave-POIs currently. (NitroGen loads 4 caves from the prefabs, so technically there are some) Once there are new cave-prefabs, they could be easily added to the NitroGen list of prefabs. Procedural caves would be something they have to define in code, when generating the chunk voxels. Or have additional imports for the world files. (like a voxel "overwrite patch")
  22. Thats really weird. I had no problems of this type yet. Maybe you can open one of the (not working) biomes.png in a graphics editor (GIMP, Photoshop), and check the colors. They should be: (Hex, RGB) 004000 or 0,64,0 -> forest ffe477 or 255,228,119 -> desert ffffff or 255,255,255 -> snow ba00ff or 186,0,255 -> burned forest ffa800 or 255,168,0 -> wasteland If they are not, there seems to be some differing behavior with the png export on your system/java version combination. You could as a workaround replace the colors in the biomes.png with the above mentioned values, (everything fully opaque, alpha = 255, so no transparent pixel) (In Gimp you can just select a color, change to the target color and overpaint the selection) If the colors are correct however, there must be some issue in 7DtD when importing the png, and decoding it. Also check if the biomes.png has the exact same dimensions as the map pngs. Maybe the image got stretched, thus altering the color values.
  23. those are the colors used, in ARGB format, (starting with the alpha) -the game is pretty picky about loading the correct values- public static final int BIOME_COL_FOREST=0xFF004000; public static final int BIOME_COL_SNOW=0xFFFFFFFF; public static final int BIOME_COL_DESERT=0xFFFFE477; public static final int BIOME_COL_BURNED_FOREST=0xffba00ff; public static final int BIOME_COL_WASTELAND=0xffffa800; RGBA(225, 161, 0, 225) looks like that the image was saved with the alpha and other channels "lowered" by the same amount. This color looks like the wasteland color. Did you manually edit the biomes.png, having transparency set to a certain smaller level? (The newest version is 0.241) Else I have to see if there is some bug somewhere. Can you tell me all the parameters you set when generating the map?
  24. When I have time I could make a mask-image to import, that can mark nospawn and preferred spawn areas. (easily drawn in Photoshop as a separate layer over the custom terrain) This should give the user all the options to define the rough layout of the POIs in the map, without having to place them by themself.
×
×
  • Create New...