Random map generation

Discussion in 'Spigot Plugin Development' started by TheCreeperCow, Apr 16, 2018.

  1. Hi there i have a kind of complex question i got several map segments and i would like to generate them randomly on a map but some have some conditions for example if you place a elevator on the 1st floor the room on the 2nd floor would also need to contain a elevator how would i do this?
     
  2. Code (Text):
    public void world(){
            WorldCreator wc = new WorldCreator("World_Name");
            wc.environment(World.Environment.NORMAL);
            long mapSeed = new Random().nextLong();
            wc.seed(mapSeed);
            wc.createWorld();
        }
     
    • Funny Funny x 1
    • Optimistic Optimistic x 1
  3. Random world, random seed! :=)
     
    • Optimistic Optimistic x 1
  4. Did you read my question
     
  5. I'm not sure what you are asking. What do you mean by "map segments?" What are they, what do they contain, what are your conditions and how do they relate to the map segments?
     
  6. I'm guessing this is something like a dungeon generator, where you need a way to link the upper and lower floors together. Simply generate the floors in order. When you generate the top floor, mark a room as an "elevator room". Then, when you generate the next room under it, add the position of the "elevator room" as a requirement so it is guaranteed to connect the 2 floors. I assume you know how to link together the map segments and whatnot.
     

Share This Page