Author |
Message |
SneakyMax
Joined: Sun Dec 27, 2009 9:31 am Posts: 170
|
Re: Procedural Generation
Someone said generated terrain? Who says it has to be made in Lua? (The topic inspired me. Needs work, obviously.)
|
Tue May 11, 2010 9:04 am |
|
|
411570N3
Joined: Wed Jan 07, 2009 10:26 am Posts: 4074 Location: That quaint little British colony down south
|
Re: Procedural Generation
Interesting. Perhaps add something to also make the scene from it automatically?
|
Tue May 11, 2010 9:07 am |
|
|
SneakyMax
Joined: Sun Dec 27, 2009 9:31 am Posts: 170
|
Re: Procedural Generation
That would be fairly easy, I assume. Grasslands.ini is only about 20 lines long. Could copy that. Could be generated from the mod manager, such as when the game is started. The terrain is still a little to jagged for my liking. I'll have to work on that. Also need to generate the layers for the terrain, and actually export a valid bitmap. You guys can mess around with it if you want. The generated terrain is actually seamless.
|
Tue May 11, 2010 9:22 am |
|
|
411570N3
Joined: Wed Jan 07, 2009 10:26 am Posts: 4074 Location: That quaint little British colony down south
|
Re: Procedural Generation
So how does it work exactly? Would you be able to make extra caves and stuff?
|
Tue May 11, 2010 9:26 am |
|
|
Geti
Joined: Sun Jul 13, 2008 9:57 am Posts: 4886 Location: some compy
|
Re: Procedural Generation
Midpoint displacement? If so it'd take work afterwards to do caves, but regardless, speed isn't of the essence as it's done outside of the game anyway.
|
Tue May 11, 2010 11:51 am |
|
|
Grif
REAL AMERICAN HERO
Joined: Sat Jan 27, 2007 10:25 pm Posts: 5655
|
Re: Procedural Generation
yeah but ingame generation would be so much cooler
because you could have a scene menu that generates new terrain files for you to play on without even having to exit the main game window
|
Wed May 12, 2010 3:10 am |
|
|
Miles_T3hR4t
Joined: Mon Jun 04, 2007 5:55 am Posts: 1627 Location: Ohio
|
Re: Procedural Generation
uh... random terrain generation... is anyone else thinking worms?
|
Wed May 12, 2010 3:14 am |
|
|
Contrary
Joined: Mon Mar 16, 2009 10:50 pm Posts: 2175 Location: Neverwhere
|
Re: Procedural Generation
Uhh, there has to be a random function in Lua, right? Can't you just have an emitter that shits dirt in all direction will randomly moving around the top of the scene?
|
Wed May 12, 2010 3:20 am |
|
|
whitty
Joined: Sat Jun 16, 2007 2:31 am Posts: 2982 Location: Texas
|
Re: Procedural Generation
Contrary wrote: Uhh, there has to be a random function in Lua, right? Can't you just have an emitter that shits dirt in all direction will randomly moving around the top of the scene? Don't forget about IsScrap.
|
Wed May 12, 2010 3:48 am |
|
|
Grif
REAL AMERICAN HERO
Joined: Sat Jan 27, 2007 10:25 pm Posts: 5655
|
Re: Procedural Generation
sure, contrary, if you want to end up with, uh, a mostly flat entirely featureless bit of terrain
If you want a competent in-game terrain generation function, it's not really all that hard. Give the game a static background, part of a bunker background module that's automatically placed.
Across a horizontal level ground line, randomly add displacement at increments of your base tile size (probably 24 for ease of use). For extra credit, add some rules to, say, lower the chance of continuing on a downward slope each time the randomizer comes up with a downward slope. Then have a function to splice in terrain chunks from a prebuilt list, then fill in the terrain below the overall tiles. Then, just for extra credit, add in some terrain features and splices that roughen up the terrain and make it less machine-created.
It really wouldn't be hard, in particular, just time consuming and require a pretty good grasp of Lua.
|
Wed May 12, 2010 4:05 am |
|
|
Contrary
Joined: Mon Mar 16, 2009 10:50 pm Posts: 2175 Location: Neverwhere
|
Re: Procedural Generation
Ehh. Just proposing a quick, easy solution to the request. I suspect everyone fully trusts you when you say that it would be time consuming- and with you showing no inclination to do it, who will? If people really want PG, a "mostly flat entirely featureless" scene would do. If you really want it to look nice you can add in a gold sprayer, and when the first two are done, a hard soil sprayer, and finally that grass thing someone made. Hell, I could probably program something like this myself with tiles in Game Maker. I could probably make a rough example in LittleBigPlanet (If they have a random logic blocks, I can't remember).
I don't really know how this could be done before bunker building, but then dropping a brainbot with a pistol after that would make for an easy, functional, procedurally generated survival mode.
But I'm definitely not going to do this easier, so it's all just pointless speculation/discussion.
|
Wed May 12, 2010 4:24 am |
|
|
Geti
Joined: Sun Jul 13, 2008 9:57 am Posts: 4886 Location: some compy
|
Re: Procedural Generation
It wouldn't be hard. If someone makes me a template with a selection of earth tile MOSRotatings (of various strength earth materials) and a scene as wide as grasslands but a bit shorter full of background, I'll make a seamless terrain generator that uses those pieces. Probably no bells or whistles cause I'm pressed for time and motivation, but If it's all set up and just needs the Lua I'll do it.
|
Wed May 12, 2010 4:56 am |
|
|
robolee
Joined: Fri May 11, 2007 4:30 pm Posts: 1040 Location: England
|
Re: Procedural Generation
PG terrain is quite easy actually, you could even select map sizes to make, number of rock layers and whether to add sand or not, it wouldn't take too long, it might not look very good and would be featureless, but it might be good for skirmish, I think it should be implemented by Data though by actually making the bitmap using the allegro functions rather than with a Lua mod which would be really inefficient and any external thing would be kinda rubbish (not in terms of quality, but just having to quit to generate a new map), but I guess if someone made a good enough procedural map generator dan might be willing to hack it in. edit: just tried to make my own, I could add in a step to smooth the terrain, but I CBA at the moment, you can specify the size to make the terrain as well, also it loops but only because I made the last point at the edge have the same y location as the first point, so it sometimes makes a huge jump at the end I could fix this by going in reverse through the points until the difference between two of the points is within a threshold limit.
|
Thu May 13, 2010 5:08 pm |
|
|
TheLastBanana
DRL Developer
Joined: Wed Dec 13, 2006 5:27 am Posts: 3138 Location: A little south and a lot west of Moscow
|
Re: Procedural Generation
SneakyMax already did this at the top of the page. The issue we were discussing was mostly caves and other features that can't be dealt with using midpoint displacements.
|
Fri May 14, 2010 12:12 am |
|
|
SneakyMax
Joined: Sun Dec 27, 2009 9:31 am Posts: 170
|
Re: Procedural Generation
I actually didn't use midpoint displacement (doesn't look like robolee did either, since by its nature midpoint displacement has the first and last points at the same height)...but it's essentially the same thing. I was thinking that a cave could be applied by generating a random polygon somewhere on the final border between the air and ground, then roughly following the edge of this with a set of points.
|
Mon May 17, 2010 3:59 am |
|
|
|
Who is online |
Users browsing this forum: No registered users |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|