Page 1 of 24 12311 ... LastLast
Results 1 to 15 of 350

Thread: [Tool] NITROGEN , a random world generator for 7DtD

  1. #1
    Reconstructionist Damocles's Avatar
    Join Date
    May 2018
    Posts
    571
    Rep Power
    1

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

    NitroGen, [current version 0.27: new mountains, more cars, sunken world scenario]
    This is a random world generator. It will create customizable random worlds for 7DtD. Configure your own personal world..

    You can select:
    -type of landscape (currently included are Forests, Alpine Mountains, Canyon Desert, Rocky Hills)
    -the number and size of cities and towns
    -the general number of POIs and smaller settlements (Farms, trailerparks, old western towns, etc)
    -4k, 8k, 16k (experimental) or custom dimension maps
    -the player start positions (far away, close to towns or random)
    -the number and position of traders (close to cities and towns, or far in the countryside)
    -even import your selfmade hightmap (play on a realworld terrain or a cat picture)
    -spawn together in Multiplayer, and spawn near a town if you want
    -the number of traders (or no traders if you like a challenge)
    -[dedicated server, Ravenhearst, Darkness Falls (see bottom of the post)]

    DOWNLOAD: (v 0.24 alpha)
    NitroGen (900kb)

    It will require you to have JAVA installed. (like old Minecraft...), you can get JAVA here https://www.java.com/en/download/
    The world-generation will take around 4 to 5 minutes for an 8K map in v0.1 ... still not optimized

    This is a playble 4k example map, if you want to see the generated output:
    Example 4k Map


    (unregular updates):
    https://twitter.com/TheDamocles






    [Quick Guide]

    Hit 'GENERATE WORLD' to create a default 8K map.
    The world data will be saved to a folder (map name) inside the output folder.

    You will have to copy the created world-files folder to your 'GeneratedWorlds' Directory for 7 DaysToDie
    It should be somewhat like this: C:\Users\--MyUserName--\AppData\Roaming\7DaysToDie\GeneratedWorlds

    Then you can start a new world from within the game (the generated world-name will show up in the selection when starting a new world)

    I suggest to first start it with cheat-mode on, and fly around a bit to see if you like the default setup.
    You could choose in the settings to spawn closer to town if you want a faster start for example...

    Try around a few setting to see what type of world you would like to have.





    This is Version 0.21, please test if there are any problem when running a multiplayer game (only tested in singleplayer at this time)


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

    [HOW TO RUN NITROGEN]

    JAVA:

    You would need to first install JAVA on your machine. Its a Java App.
    You can check if you have Java installed and configured by typing java in the console .. something should pop up then
    The java Runtime can be easily obtained from https://www.java.com/en/download/

    INSTALL:

    -just copy the NitroGen folder anywhere you like.
    All required files are included in its sub-folders.

    RUN:

    -doubleclick the nitrogen.jar file (if JAVA was configured to run it)
    -OR use the bat file, wich basically just runs:
    -OR type:

    java -jar nitrogen.jar

    into the console
    (Nitrogen should work basically on Linux too)

    Try using extended heap memory when generating 16k map...
    java -Xmx6g -jar nitrogen.jar


    COPY FILES:

    copy the generated map folder to your 7DTD GeneratedWorlds folder.
    If you select preview map you can have a look at the generated gamemap PNG file.

    -best is to delete a previous folder of the same map name, (especially the dtm_processed.raw file, wich would be loaded instead of dtm.raw)


    START NEW IN GAME:

    Go to NEW GAME and browse thoug the gameworlds, the generated map should appear then.
    (go to the main menu first to refresh the list)

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

    Troubleshooting:

    #1 there where several issues discussed in this thread, you might find you solution when searching though the posts

    #2 Can not get it to run, how does that work?
    -The generator needs Java to be installed, preferably a 64bit version
    -you can check if Java is installed AND configured by opening a console (cmd in Windows) and entering:
    java -version
    this prints out details about Java (it should state 64-bit Server somewhere, so you know it is pointing to a 64 bit installation)
    -if Java is configured correctly, you could either just doubleclick the nitrogen.jar file, OR use one of the included .bat files to start it

    #3 Out of memory error:
    -if you see a out of memory error, you either run a 32 bit Java version, or did not reserve high enough heap memory. You can edit the .bat files to start the generator with more memory (4 Gigabytes should be enough for a normal sized map, defined with the -Xmx4G parameter, increase it as needed)

    #4 It does not start generating:
    -check if you extracted everything from the .zip to a folder (can be started, but cannot operate out of the zip)
    -check if you already have an output folder with generated files, use the option "check folder" to allow overwriting

    #5 my world is flooded!
    -when overwriting a previous world in the generatedWorld folder, make sure to delete the dtm_processed.raw file (generated by the game when loading the world the first time), it would mix the old terrain with the new water spawnpoints, leading to leaking lakes...

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

    Post by zootal regarding dedicated servers:

    Quote Originally Posted by zootal View Post
    It is surprisingly easy to get this to work.

    Step 1 should start like this:


    1) I recommend you specify the save game folder for your server, this is what I put in serverconfig.xml:

    <property name="SaveGameFolder" value="/home1/sd/saved_games" />
    <property name="UserDataFolder" value="/home1/sd/saved_games" />


    Create the directory, and under it create the directory GeneratedWorlds. If your server root is /home1/sd like mine is, you should have:

    /home1/sd/saved_games/GeneratedWorlds

    2) Make these changes to your serverconfig.xml, these are what I use but you can use whatever you want. In this case my server name is "Vomiting Spleens", and the game world and seed is NitroGenMap_4096_flat_snow. I'm not sure what would happen if GameWorld and WorldGenSeed were different, I didn't try to find out as I was a bit short on time. I kept them the same and it worked great.

    <property name="ServerName" value="Vomiting Spleens"/>
    <property name="ServerDescription" value="Vomiting Spleens"/>
    <property name="GameWorld" value="NitroGenMap_4096_flat_snow"/>
    <property name="WorldGenSeed" value="NitroGenMap_4096_flat_snow"/>
    <property name="WorldGenSize" value="4096"/>
    <property name="GameName" value="Vomiting Spleens"/>

    3) Use NitroGen to generate your world, give it the same name you use for GameWorld above. I used NitroGenMap_4096_flat_snow because it was a 4K flat snow world.

    4) Copy the directory NitroGenMap_4096_flat_snow from the NitroGen output directory to the GeneratedWorlds directory. You should have:

    /home1/sd/saved_games/GeneratedWorlds/NitroGenMap_4096_flat_snow

    5) Cross your fingers, pray to the diety of your choice, and start the server. It will take this template and generate the world:

    /home1/sd/saved_games/NitroGenMap_4096_flat_snow

    When the server finishes generating the world, join the server and enjoy!

    This works for me, YMMV. The above creates a 4096 world, I kept it small for testing. After I saw that it worked, I then created a 16K world, which likewise worked great.

    Try it and let us know what happens.
    A hint for hosting very large server maps: NitroGen creates several intermediary outputs during generation:

    -genHM.png
    -poiHM.png
    -previewMap.png

    They could be deleted before hosting the game, so the clients dont download those images (takes more time than necessary, and looking at the preview might spoil the exploration aspect.)

    ---------------
    Modding:

    Prefablists (Ravenhearst, Darkness Falls) by other users (MelT, Xylvier):
    All prefab lists in a single file (latest versions)
    https://github.com/NickPhaedra/7-Day...refablists.zip
    -> you need to manually replace / rename it to prefablist.txt in the resources folder

    Prefablist-Generator by Xylvier
    https://drive.google.com/file/d/1Wfp...hFInbvTuC/view

    links:
    https://7daystodie.com/forums/showth...l=1#post972744
    https://github.com/NickPhaedra/7-Day...ee/Prefablists
    Last edited by Damocles; 3 Days Ago at 05:21 PM.

  2. #2
    Hunter
    Join Date
    Nov 2013
    Posts
    104
    Rep Power
    0
    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.

  3. #3
    Guppycurian Forum Whore Guppycur's Avatar
    Join Date
    Apr 2014
    Location
    Enemy for life
    Posts
    20,767
    Rep Power
    1
    What's it using for prefab placement? Curious what it's using to know what to place where.

  4. #4
    Reconstructionist Damocles's Avatar
    Join Date
    May 2018
    Posts
    571
    Rep Power
    1
    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)



    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.




    Last edited by Damocles; 04-04-2019 at 03:58 AM.

  5. #5
    Guppycurian Forum Whore Guppycur's Avatar
    Join Date
    Apr 2014
    Location
    Enemy for life
    Posts
    20,767
    Rep Power
    1
    Do you find your roads smoother than vanilla?

  6. #6
    Colony Founder n2n1's Avatar
    Join Date
    Oct 2015
    Location
    MotherRussia
    Posts
    1,884
    Rep Power
    1
    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 n2n1; 04-04-2019 at 08:27 AM.

  7. #7
    Guppycurian Forum Whore Guppycur's Avatar
    Join Date
    Apr 2014
    Location
    Enemy for life
    Posts
    20,767
    Rep Power
    1
    Any thoughts? Seems it does not like doing 4k worlds.


  8. #8
    Reconstructionist Damocles's Avatar
    Join Date
    May 2018
    Posts
    571
    Rep Power
    1
    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.

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


    Quote Originally Posted by n2n1 View Post
    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 Damocles; 04-04-2019 at 04:56 PM.

  9. #9
    Guppycurian Forum Whore Guppycur's Avatar
    Join Date
    Apr 2014
    Location
    Enemy for life
    Posts
    20,767
    Rep Power
    1
    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. =)

  10. #10
    Refugee
    Join Date
    Apr 2019
    Posts
    1
    Rep Power
    0
    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

  11. #11
    Reconstructionist Damocles's Avatar
    Join Date
    May 2018
    Posts
    571
    Rep Power
    1
    Quote Originally Posted by Guppycur View Post
    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 - - -

    Quote Originally Posted by Alexr82 View Post
    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.

  12. #12
    Colony Founder n2n1's Avatar
    Join Date
    Oct 2015
    Location
    MotherRussia
    Posts
    1,884
    Rep Power
    1
    Quote Originally Posted by Damocles View Post
    //// 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 n2n1; 04-04-2019 at 06:45 PM.

  13. #13
    Reconstructionist Damocles's Avatar
    Join Date
    May 2018
    Posts
    571
    Rep Power
    1
    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 - - -

    Quote Originally Posted by n2n1 View Post
    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 Damocles; 04-04-2019 at 06:53 PM.

  14. #14
    Reconstructionist Damocles's Avatar
    Join Date
    May 2018
    Posts
    571
    Rep Power
    1
    Quote Originally Posted by Guppycur View Post
    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 Damocles; 04-04-2019 at 07:56 PM.

  15. #15
    Hunter
    Join Date
    Nov 2013
    Posts
    104
    Rep Power
    0
    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 mrsquish; 04-04-2019 at 08:52 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •