• Creating a Random Generating Map
    15 replies, posted
I know that making a completely random generated map would be very hard in source, but I need some help with one thing. How can I make it to where buildings, props and entities would be randomly spawned in the map. Would I make the building brush into a specific entity or what? I need help... I'm trying to make a map that will have varied gameplay for every playthrough. Please post a helpful response!
This require a ridiculous amount of programming, you'd need something similar to the AI Director in L4D2.
Best way you can do this without actually modifying the source code is to make it pseudo random like in L4D2. Set up possible spots and use a lot of logic.
[url]http://facepunch.com/threads/935406?highlight=[/url] Try modifying that system to your needs.
You could make a number of modular sections. 128 x 128 x 128 blocks. Then have a different block for every possible path through said block (ie straight corridor, 90degree left turn, 90 degree right turn, 4 way junction) Then you would need to have a script (probably lua or coding in the mod itself) to draw paths then go thru each block on the path to change them directly. I got no idea how to do the coding for this though. A simpler version would be to have the same blocks cept this time just have 2 variations. 128 high and 4 units high. Define a path then convert all blocks along that path to be the model for the 4 units high one. You could then have an array of models and a corresponding array of cooridinates (with respect to the centre of that 128^3 block) Then for each block conversion you do along the path place another 1-3 props using a random number put into both arrays. So the result would be an axe placed on the wall, a barrel put offset from the middle on another wall and a metal grill on the floor. Again I can't help with the coding since the path bit has made me hit a stop. IF you want a map which changes as you play look at that post above with the dancing floor. You could also look at cs_havana since that had some kind of random paths (i think)
you could make it with hammer entities. but that'll take a lot of time and effort to make it work smoothly. or alternatively: make a whole big bunch of different areas make some kind of doorway or two in each area randomly teleport to another area each time
Sounds Good, thanks for the help guys! I'll try each of the suggestions, and see what works best. Again, Thanks!
A long time ago I did something similar to thIs when I first started mapping. It's a terrible way to do it but it was insanely fun to make. I had some buildings that I made full of func_physboxes in a large room. I then added a point push and the buildings fly about the room into random little teleporters with designated spots on he map. Ofcourse it killed the framerate overtime and I quit making it.
[QUOTE=mdeceiver79;35396068]You could make a number of modular sections. 128 x 128 x 128 blocks. Then have a different block for every possible path through said block (ie straight corridor, 90degree left turn, 90 degree right turn, 4 way junction) Then you would need to have a script (probably lua or coding in the mod itself) to draw paths then go thru each block on the path to change them directly. I got no idea how to do the coding for this though. A simpler version would be to have the same blocks cept this time just have 2 variations. 128 high and 4 units high. Define a path then convert all blocks along that path to be the model for the 4 units high one. You could then have an array of models and a corresponding array of cooridinates (with respect to the centre of that 128^3 block) Then for each block conversion you do along the path place another 1-3 props using a random number put into both arrays. So the result would be an axe placed on the wall, a barrel put offset from the middle on another wall and a metal grill on the floor. Again I can't help with the coding since the path bit has made me hit a stop. IF you want a map which changes as you play look at that post above with the dancing floor. You could also look at cs_havana since that had some kind of random paths (i think)[/QUOTE] The simplest version of this would be to make 128 sections that have doors on all sides, and open the door corresponding to the path.
[QUOTE=BioShnog;35397748]Sounds Good, thanks for the help guys! I'll try each of the suggestions, and see what works best. Again, Thanks![/QUOTE] If you do use my method and you get stuck, feel free to ask me about it on steam.
Alright, sounds good man.
Someone made a random map generator for GoldSrc [url]http://www.gamebanana.com/hl/tools/3180[/url] Dunno if you want to take a look at it and see if it whatever this does can help you for what you are trying to do.
[QUOTE=HoodedSniper;35471971]Someone made a random map generator for GoldSrc [url]http://www.gamebanana.com/hl/tools/3180[/url] Dunno if you want to take a look at it and see if it whatever this does can help you for what you are trying to do.[/QUOTE] HOLY CRAP! IT WORKS! and quite nicely too! (Yes, I just so happened to have the original half-life on a CD) pics [IMG]http://oi40.tinypic.com/290udjl.jpg[/IMG] [IMG]http://i42.tinypic.com/2wnwb44.jpg[/IMG] W00t
Yeah when I first used it, it blew my mind how well it works for what it does. It only makes really simple maps but still incredible that it can make them and have them work correctly.
Holy shit, that's awesome! This needs a source version.
[QUOTE=Matt2468rv;35500115]Holy shit, that's awesome! This needs a source version.[/QUOTE] hmm tried loading it in Hammer, but it crashed. hammer... 1.3? 1.5? I forget, loads it just fine though
Sorry, you need to Log In to post a reply to this thread.