Lethal Company

Lethal Company

Aeronark Jan 28, 2024 @ 6:56am
Algorithm used to generate the facility?
Hello,
I'm writing my bachelors thesis on procedural generation, focusing on dungeons. In the analysis part I would like to mention games and describe the algorithms used to generate their dungeons.

The dungeon generator in Lethal company seems simple enough. From the layout, how rooms are connected, where loot spawns to where turrets and mines spawn. But I can't really describe an algorithm or take inspiration from one just from some feeling I get while exploring whatever it generated. Also who knows, there might be more to it than meets the eye at first glance.

While searching online I couldn't find a link to anyone asking or answering a question like this. I know it might be a long shot asking here but who knows, maybe one of you has seen some old dev notes or something. Besides, I don't really know if there is a way one could contact the dev and ask directly, so this is likely the best bet I have at finding answers.

Thank you very much for any info!
< >
Showing 1-10 of 10 comments
RaindropperinG Jan 28, 2024 @ 7:44am 
You could try checking the official Lethal Company discord server, to see if such a topic has been discussed there.

I can't recall seeing any such info about random generation on Steam, though.
Last edited by RaindropperinG; Jan 28, 2024 @ 7:44am
Hugo the Dwarf Jan 28, 2024 @ 10:15am 
I hope LC isn't going to be the only research material for procgen. As it seems from your OP you're targeting specifically "Dungeon" or "Interior" procgen, and I'd say again, I hope this isn't your own target for research, Warframe has a dungeon generation as well, and could point to many others like older roguelites (Dark Cloud 1+2, Diablo, Azure Dreams, Fatal Labyrinth)

And each of these all have different takes on the generation, Like LC, Warframe, Dark Cloud all work off of a tile system, including if said tile has baked in (or not) features. Warframe has enemy spawners (doors, etc) that's inside each tile. But WF, LC, and DC all use snappoints, and door connectors. For the former 2 they will use a SEED so that levels can be generated per client to save on bandwidth (less data to send, if everyone just uses the same basis for their generation alg) Dark Cloud the latter as it's a single player game, and rather basic for it's generation (just connect tiles and endcaps)

And with that most procgen that is semi-decent is when rules are included and multiple passes are done. 1st pass would be placing the tiles, a simple rule might be.. A fireexit should be place at a % of the generation, LC for example some moons have more than 1 fire exit. So there are anywhere from min 2 to max of 4 means of access into the dungeon. so if there was 3 fire exits, every 33% generation try to place a fireexit on a door slot in that tile, as long as it doesn't disconnect it from the rest of the tiles (steals a valid connection)

After that would be the next pass of placing loot, perhaps based on distance from an entrance (more rules) on generation it figures I need 17 pieces of loot, and there is 1 fireexit, so I want to place a few near each, and as I get deeper into the dungeon I'll place maybe 2, and if I haven't placed all 17 go backwards adding 1 by 1 until all done.

Next pass may be the hazards (turrets, mines) which some rules could still be applied like. You can't place these in the 1st few rooms connected to an entrance.

After that you may have spawners cooked into a tile, or each tile has it's own mini RNG (for LC this could be steam pipes, vent for monster spawning, perhaps a security door and said door has a 20% chance to be closed).

Now idk how LC really does this, but I understand enough of it, and there is tons of articles, and papers written on it that you can review on procgen, only you may have to transform what's written to be used for a dungeon/interior generation.

Like take for example a new one with some of the older, Deep Rock Galactic starts with a solid block of terrain, and instead cuts out or carves the cave layout, much as Azure Dreams will generate some free floating "rooms" and then connect them with paths, this is also how Fatal Labyrinth did it as well (other than some floors that were designed by the devs) most floors were generated by just making some random sized rectangles, and once done, would make sure they're all connected. And then sprinkle loot and POIs around where it can.

And how basic or ruleless these algorithms are can lead to the entrance, and next floor exit being right next to each other (LC runs into this where you can have all the fire exits, and main entrance be a few meters away from each other) or you can get a bit more logical and have rules like Warframe that at least somewhere after 50% or more the exit should be placed, and it should never be placed before the objective of the mission
RaindropperinG Jan 28, 2024 @ 10:39am 
Deep Rock Galactic cave generation is also a noteworthy example, in my book.
Aeronark Jan 28, 2024 @ 12:14pm 
Originally posted by RaindropperinG:
Deep Rock Galactic cave generation is also a noteworthy example, in my book.
Thank you for the recommendation, I joined the discord in hopes the dev was active in it but I don't think they are. Ended up finding no info regarding the topic but I might dig a bit deeper or just find a different game to use.

Deep Rock is a fantastic example, one I was originally going to try to implement, but in the end decided against it due to the fact I'm working with rooms rather than caves. Other than that, generating rooms, placing them and only then creating hallways between them is definitely a way to do it, just not something I'll likely end up using.
RaindropperinG Jan 28, 2024 @ 1:24pm 
Originally posted by Aeronark:
Originally posted by RaindropperinG:
Deep Rock Galactic cave generation is also a noteworthy example, in my book.
Thank you for the recommendation, I joined the discord in hopes the dev was active in it but I don't think they are. Ended up finding no info regarding the topic but I might dig a bit deeper or just find a different game to use.

Deep Rock is a fantastic example, one I was originally going to try to implement, but in the end decided against it due to the fact I'm working with rooms rather than caves. Other than that, generating rooms, placing them and only then creating hallways between them is definitely a way to do it, just not something I'll likely end up using.
You're welcome!
Fair enough if that's not the Rng model that you're looking for; I do agree that it's still a great example regarding this subject : )
Aeronark Jan 29, 2024 @ 3:51am 
Originally posted by Hugo the Dwarf:
...
And how basic or ruleless these algorithms are can lead to the entrance, and next floor exit being right next to each other (LC runs into this where you can have all the fire exits, and main entrance be a few meters away from each other) or you can get a bit more logical and have rules like Warframe that at least somewhere after 50% or more the exit should be placed, and it should never be placed before the objective of the mission
Hi, and thank you for such an expansive response.

First thing's first, no, LC is not the only example I'll be describing and exploring. I'll be creating 3 different dungeon generators:
1) something simple that does bare minimum to create a playable dungeon
2) one that is heavily inspired by Enter the Gungeon's dungeon generator
3) something more natural, like a forest location, using a cellular automaton

There will be plenty of games listed and described either for their take on proceduraly generating content or simply because they generate dungeons in some interesting way.

I am familiar with the methods you mentioned, just that in order to describe the LC generation i need a solid description of how exactly it works. These are just general ideas for how dungeon generating works. Still, thank you for going into such detail, appreciate it.

I didn't even think about Warframe, so I'm glad you brought that up, I'll definitely look into it and see if the algorithm they use is any interesting. Dark Cloud also looks interesting. I've actually considered making a cave based dungeon (off of Deep Rock Galactic), as the game I'm making it for is based underground, but in the end I decided against it. But yeah, it's an interesting take on generating maps.
Hugo the Dwarf Jan 29, 2024 @ 7:42am 
Yeah generally dungeon generation goes the route of tiles or prefabs (more or less the same thing) Dark Cloud, LC, Warframe, Diablo, I think even Enter the Gungeon you mentioned is tiles as well. So for your 3 types:

1) Warframe, Dark Cloud, Diablo 1, and even LC would be the best bet for a bare min dungeon, because you just need to setup enough lego pieces, can even give them some generation rules. Like a big room, can't connect (or generate off of a attach point) another big room (exclusion rule) and a staircase has to connect to a room and not a hall and not another staircase (requirement rules)

2) Basic 2d dungeons are still tiles/prefabs so Binding of Issac, Enter the Gungeon, Replicator (I think is the name) since you only have to worry about 2 axis (top-down or side-scroller) placement checks are a bit easier.

3) These generations are more work, this would be something like Dwarf Fortress (even if it's sprites now, previously is was ASCII, land mass generation is complex af, including years of simulated erosion, etc), another one that might be good to check would be 7 days to die. Since not only do they include landmass generation, they also assemble towns/cities based on POIs (prefabs) which these also have smaller embedded POIs zones so even the same Gas Station, could also be unique simply because it used different prefabs nested inside itself, but the prefabs don't match to a "Generate sheet of terrain, place "paths" which could be man made, or just ease of use by animals making a natural path, then placing foliage and statics based on what free space"

But altho as I stated before, the core of these are generally multi passing. Like I think the most basic example I gave was Dark Cloud, It probably only has two or three passes. First is obviously Generate the layout, then do a pass for placing chests and "orbs", and then another pass for placing monsters, however loot/orb/mob could just be 1 pass.

You can look at other algorithms for sure, but without a solid idea or theory or understanding of what goes on, you won't be able to make your own, because someone elses algorithm might not even do what you need it to.

I wish you luck, I know I've dabbled with my own attempts but dropped the project for another before getting anywhere too advanced.
Menaced Jan 30, 2024 @ 1:55am 
Last edited by Menaced; Jan 30, 2024 @ 1:56am
mitzapper2 Sep 9, 2024 @ 4:26pm 
kinda resurrecting a thread here, so this is probably a little too late to help now, but this showed up when I was trying to look into LC's level generation for my own purposes (Im trying to get into modding)

LC uses a unity asset called "DunGen" to generate the level, the below document explained it pretty well for me. Now I'm just trying to look through assemblies to find out where LC's tilesets are actually defined :P

https://www.aegongames.com/blog/wp-content/uploads/DunGen_Readme.pdf
Originally posted by Aeronark:
Hello,
I'm writing my bachelors thesis on procedural generation, focusing on dungeons. In the analysis part I would like to mention games and describe the algorithms used to generate their dungeons.

The dungeon generator in Lethal company seems simple enough. From the layout, how rooms are connected, where loot spawns to where turrets and mines spawn. But I can't really describe an algorithm or take inspiration from one just from some feeling I get while exploring whatever it generated. Also who knows, there might be more to it than meets the eye at first glance.

While searching online I couldn't find a link to anyone asking or answering a question like this. I know it might be a long shot asking here but who knows, maybe one of you has seen some old dev notes or something. Besides, I don't really know if there is a way one could contact the dev and ask directly, so this is likely the best bet I have at finding answers.

Thank you very much for any info!
Yeah. Its like it knows that the loot is there, so then they would put a turret to block it, and a thumper and a snare flea combo with no prediction.

I think Lc should add hint notes that would predict the future of what WILL happen. Like you would see a note on like a rock that shows an eyeless dog with an earth worm, or a forest keeper.
< >
Showing 1-10 of 10 comments
Per page: 1530 50

Date Posted: Jan 28, 2024 @ 6:56am
Posts: 10