r00k wrote:Completely random or random set of interconnecting pieces? IIrc, that mapgen uses blocks? could you maybe create bsp models that have tagged link positions that could be interconnected? Like this side always faces down or this side always faces the camera (side scroller), then the ends left and right are static bu the middle obsticles are dynamic.
$0.02.
That's what my never-finished mapgen utility was supposed to do, there's source for it on the twilight svn, basically it was designed to load all the .map files it found in a subdirectory and randomly pick one and see what connectors it had, and see if it can attach that to any of the existing pieces' connectors, and iterate until it runs out of connectors (and the map size would be fairly random as a result, since deadend pieces would kill off the paths sooner or later).
It was supposed to test if brushes overlap eachother and reject a piece if so, so that there would not be collisions (overlapping rooms)...
Now the fun part was that I realized it would be possible to have a few very big room pieces containing many more connectors, so you could have catwalks and other randomized stuff inside a room.
All connectors would have a type name and thus would only match up with compatible connecting pieces (so sewer1, sewer2, basedoor1, basehall1, wizardhall1, etc).
Then I realized the next step - monsters and other things would be random pieces too, so you could have a group of 2 grunts and a dog for example as one piece, and an enforcer as another piece, and they might have the same connector name, so wherever a map piece had "basemonsters_medium" it would randomly choose between the 2 grunts+1 dog, or 1 enforcer piece to put there...
This goes a step further - you can have things like burned out torches and working torches as pieces with the same connector name, so sometimes a torch would be burnt out on a wall because it chose different torch pieces from time to time.
It's all extremely flexible in concept, but I lost motivation to finish it, I also lost motivation to make all the pieces
P.S.
The entity name was info_connector and it would have "message" key values like "sewerhall1" to select what shape it represents, the meaning of each message name would be up to the designer, but essentially represents a compatibility codename between pieces (if someone makes a badly mismatched piece that misuses the same name, it would probably make a leaky map).
The utility is standalone and makes .map files to compile, so you still get all the nice lightmapping and good framerate, it was not developed as a mod because of performance and lighting quality being much higher as a .map file generator.
The part I did not finish is the collision checks between map pieces (detecting overlap and rejecting the piece), this might be possible to do with just bounding box comparisons on the brushes, it doesn't have to be exact, as its main purpose is to prevent two rooms from overlapping, I lost motivation when I started thinking about "colliding" two brushes (now I know how to do that, though...).
Another consideration in map generation is pacing - the old Doom map generator known as SLIGE would actually do some balancing considerations and ensure there was ammo placed before monsters, key/door relationships were created as a quest system (and the value of the rewards were considered in placing monsters later on the same path)... I never really tackled this in the design of mapgen, but it is possible to give it some consideration (albeit in a different way - if it places ammo/armor/health, it could then boost the danger rating for later pieces to allow monsters to be placed to consume those resources).
I also never really tackled the idea of placing an exit, or any sort of directed flow in the layout.
I noticed that in the game Torchlight, there is basically just one wandering path through the level, with some branching side areas but of very limited length, this is in contrast to the sprawling levels of Diablo1 which were more or less just filling a preset map size with rooms.