Download

Paper2d Paper Grouped Sprites and Procedural Generation!

Hello everyone!

I’m currently working on trying to create a decent procedural generation system utilizing a 100 by 100 tilemap. The size of each tile is 208 by 208. I want to achieve something found in this gamasutra article.

http://www.gamasutra.com/view/feature/130071/random_scattering_creating_.php?page=2

Now I’ve never done PCG before so this thing is blowing my mind in every single level ever. (Also I’m a newb, be gentle please!) but some of the issues I’ve ran into trying to recreate the algorithm shown here is that for every single tile, it places something down so it doesn’t achieve the same look. Now I think it’s probably because the example uses a small tilemap size and I’d love to get a similar outcome with any size tilemap. like there being 7 trees distributed on whatever size tilemap or 30 trees in whatever size tile map, and it would choose just a random tile in the tilemap.

I have attempted a few things, I made something for the grass that is really basic but it’s two loops that take the height and width of the tile map, and visits each tile and drops a piece of grass once. then I have another loop that makes this happen 10 times. I’m sure there’s a better way for that tooooo.

I dunno…

I’m super lost…

help?

Thank you,
Alex Batista

I don’t have UE4 in front of me unfortunately but I think you can fill the tilemap with a tile even through nodes(I THINK). If you are going to be using generation there will be loops, that’s not really avoidable. You may want to avoid Grouped Sprites as well, the collision on them is a mess at the moment.

It’s not so bad for what I want. I’m mostly procedural generating things that will have no collision, so ground decoration. Like grass and some patterns. Maybe a few little extra decorative flowers here and there. Mostly to lessen the work of hand placed assets for the artist. We have huge tile maps that will be explore-able and we’ve blocked them out but they’re still pretty big. we might scale back accordingly but for now we’re trying it out.

I am creating loops for sure. I was wondering if I could maybe get a hand in creating something akin to the article I linked where you can get random placement of trees but that kinda look like that. Right now my loops mimic the example code that they show but what it does is place a “tree” in every single tile, making it look hectic as hell lol.