This is the testing Godot forums! All forum posts unique to this forum will be deleted! Please use the main forums here for any posts you want to keep. All forum rules still apply.

Generating 3D shooter maps

ErtainErtain Posts: 8Member

I'm making a multiplayer game and want to procedurally generate the maps. I am wondering what would be a good approach to generating these maps. I am using Gridmaps to piece together the map, but am trying to figure out which algorithm'/method to use. Here are some guidelines I have for generating the map:

  1. Must be large enough to accommodate up to four players.
  2. The map must utilize Gridmaps.
  3. Any hallways/corridors must be connected to other corridors or rooms (i.e. no dead ends).
  4. Spawn points for the players will be set at an equal distance from the center of the map.
  5. There will be spot on the map with large, open areas.
  6. The players will be able to easily move vertically, be it ramps or jump pads. I may even put in teleporters.

I have thought of using some kind of dungeon generator and adjusting it to make larger rooms. Though I don't know how I'll adapt that for 3D. Also I don't entirely know how I'll make the hallways/corridors without dead ends.


Tags :

Answers

  • sent44sent44 Posts: 27Member
    edited May 2020

    Check out Sebastian Lague's cave generation videos
    3- Do you mean you don't want isolate room that do nothing/ accident trap players? His videos cover this issue
    6- If you don't interest to have multiply floors (I mean 2 or more players able to stand in same x/z but difference y), you may need to use height map to identify if it is ramp, low level, mid level, high level or such. Something like teleporters or jump pads, I think you should store data separate from height map. I rest is generate mesh, I know you can do it.
    4- My idea is defined center point -> defined player spawn points -> A* from spawn points to center point -> Move all non-lowest cost spawn points toward to center point by = cost - lowest-cost (or such)
    1- Cellular Automata is bad algorithm but it is do good job in this type of generation, in my experience it is better than Perlin noise/OpenSimplex, so too large may take minutes. Well something like 256x120 is large enough to take many minutes to walk from corner to another corner straight, yet it take very short time to generate (possible to generate in < 5 sec, yet still get decent result)
    2 - Never hear before, is it good? Sorry for ask off topic question in answer

    Here is small potion of my 256x120 map generate, take about 14 sec

    Good luck

  • DschoonmakerDschoonmaker Posts: 216Member
    edited May 2020

    Dead ends aren't always a bad thing, they can be good if there's loot or a powerful enemy or something else interesting.
    Edit: why lol? I did mean that.

  • ErtainErtain Posts: 8Member

    I could use a cellular automata algorithm, @sent44. But I don't know how it will accommodate Gridmaps. I could have it first create one in an Array and then map that to the 3D world. But I would have to look out for a lot of bends and stuff.

    This will have multiple levels to it, too. So the players will go up and down ramps. I would like it to have that verticality so that players have to not only look left to right, but also up and down, when they're fighting other players. It adds to strategy and variety of play.

  • MegalomaniakMegalomaniak Posts: 2,580Admin
    edited May 2020

    @Dschoonmaker said:
    Dead ends aren't always a bad thing, they can be good if there's loot or a powerful enemy or something else interesting.

    The simple solution to "dead ends" is to instantiate another room to where ever you have a "dead end" tunnel. Harder part might be to actually detect them, need specific criteria. But MUDs should have figured this out ages ago, probably worth googling some tutorials.

    If you want to not have rooms with less than 2 openings, you should create a function to detect that and then set a nearish room as a target to generate another tunnel between the two.

  • ErtainErtain Posts: 8Member

    I would like the hallways/corridors to connect to other hallways/corridors because, if one player is in a fire fight against another player, they won't be backed into a corner.

  • DschoonmakerDschoonmaker Posts: 216Member

    I think the main problem is how to detect a dead end, how could you check if a passage never connected to the entrance/start point? Maybe pathfinding would work, but there might be a simpler way.

    Perhaps you could start with a gridmap completely filled with walls, then take a start point and "dig" a tunnel from there. This would be simple and eliminate dead ends.

  • ErtainErtain Posts: 8Member

    Ah, the "digging" method. I've heard of that, but I've never implemented something like it. I could do something like that, but I would also like to have parts of the arena that are open sky.

  • ErtainErtain Posts: 8Member

    I came across this article on creating a 3D dungeon with instanced scenes. I would like to try making an arena with this method. The only problem I'm facing is aligning the entrances/exits of the instanced scenes.

  • sent44sent44 Posts: 27Member

    @Ertain Oh, so this is what you mean. After generate, there are too many open end that make it dead end room.
    Here are my suggestion(again):
    1. Just remove/revert dead end rooms and its only hallway
    2. Connect(Dig) dead end rooms with nearest other rooms/hallways or other dead end rooms, you might need to generate mesh to these connector hallway
    3. You 'DO' have teleporter/jump pad right? Use it at dead end rooms. Both of these things are already indirect hallway for players to escape

  • ErtainErtain Posts: 8Member

    I'll try to connect the dead ends with the current method I'm using (it's the one mentioned in that article I linked to). As for dead ends, I can use teleporter/jump pads. Though I'll try not to put in too many, because that could make the courses look too similar.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.