View unanswered posts | View active topics It is currently Thu Jan 16, 2025 11:31 am



Reply to topic  [ 81 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next
 Procedural Generation 
Author Message
User avatar

Joined: Sun Dec 27, 2009 9:31 am
Posts: 170
Reply with quote
Post Re: Procedural Generation
Someone said generated terrain?

Image

Who says it has to be made in Lua? (The topic inspired me. Needs work, obviously.)


Tue May 11, 2010 9:04 am
Profile
User avatar

Joined: Wed Jan 07, 2009 10:26 am
Posts: 4074
Location: That quaint little British colony down south
Reply with quote
Post Re: Procedural Generation
Interesting. Perhaps add something to also make the scene from it automatically?


Tue May 11, 2010 9:07 am
Profile WWW
User avatar

Joined: Sun Dec 27, 2009 9:31 am
Posts: 170
Reply with quote
Post 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
Profile
User avatar

Joined: Wed Jan 07, 2009 10:26 am
Posts: 4074
Location: That quaint little British colony down south
Reply with quote
Post 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
Profile WWW
User avatar

Joined: Sun Jul 13, 2008 9:57 am
Posts: 4886
Location: some compy
Reply with quote
Post 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
Profile WWW
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post 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
Profile
User avatar

Joined: Mon Jun 04, 2007 5:55 am
Posts: 1627
Location: Ohio
Reply with quote
Post Re: Procedural Generation
uh... random terrain generation... is anyone else thinking worms?


Wed May 12, 2010 3:14 am
Profile YIM WWW
User avatar

Joined: Mon Mar 16, 2009 10:50 pm
Posts: 2175
Location: Neverwhere
Reply with quote
Post 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
Profile
User avatar

Joined: Sat Jun 16, 2007 2:31 am
Posts: 2982
Location: Texas
Reply with quote
Post 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
Profile
REAL AMERICAN HERO
User avatar

Joined: Sat Jan 27, 2007 10:25 pm
Posts: 5655
Reply with quote
Post 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
Profile
User avatar

Joined: Mon Mar 16, 2009 10:50 pm
Posts: 2175
Location: Neverwhere
Reply with quote
Post 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
Profile
User avatar

Joined: Sun Jul 13, 2008 9:57 am
Posts: 4886
Location: some compy
Reply with quote
Post 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
Profile WWW
User avatar

Joined: Fri May 11, 2007 4:30 pm
Posts: 1040
Location: England
Reply with quote
Post 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 :P I could fix this by going in reverse through the points until the difference between two of the points is within a threshold limit.
Image


Thu May 13, 2010 5:08 pm
Profile
DRL Developer
DRL Developer
User avatar

Joined: Wed Dec 13, 2006 5:27 am
Posts: 3138
Location: A little south and a lot west of Moscow
Reply with quote
Post 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
Profile WWW
User avatar

Joined: Sun Dec 27, 2009 9:31 am
Posts: 170
Reply with quote
Post 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
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 81 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next

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

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.
[ Time : 0.055s | 14 Queries | GZIP : Off ]