Terraria Procedural Generation

Show us your works in progress and request feedback

Post » Mon Jan 30, 2017 10:51 pm

So this has been a long standing work in progress for me. Not just procedurally generating an underground cave system like Terraria, but also setting the correct blocks. So it knows if it's a corner piece, middle piece, side piece, disconnect completely, etc. Right now it is based on a giant array filled with numbers. So it starts off with the entire array being filled in with a single number. Then through iteration it cuts out cave systems. After that it checks each block to figure out what it is, top left corner, top middle, top right corner, etc and gives it a number value in the array. Then of course we generate a tilemap based off the numbers. For me it takes about 20 seconds to load in the game. The entire map is 8400x2400, the player is 16x24 and the blocks are 8x8. I'm still working on finding a way to only render what is on screen to help with performance. Anyways without further adieu.

CONTROLS
ARROW KEY MOVES
MOUSE WHEEL ZOOM IN/OUT
LEFT CLICK PLACE BLOCK
RIGHT CLICK REMOVE BLOCK

LINK
http://florist-contraband-18753.bitballoon.com/
Image
B
45
S
17
G
2
Posts: 201
Reputation: 4,501

Post » Wed Feb 01, 2017 6:31 pm

Oh that's nice! I'm looking forward to what comes out of it in future. I hope you will keep developing it. :)
B
29
S
16
G
2
Posts: 109
Reputation: 3,380

Post » Mon Feb 13, 2017 10:41 am

Some progress made. Below you can find the updated game link, link to the current commented .CAPX, and links to sources I cobbled together to make this happen. The last major feature I need to tackle is only rendering what is on screen with like a 10-20 tile buffer off screen so I can really make this a HUGE world without hitting performance issues. My current tiles are not seamless due to my lack of bravado within Photoshop, but hopefully I can make or find better ones in the future, probably find.

UPDATES
Smaller Map, Larger Tiles for testing purposes.
Performance fixes
Placing new blocks updates neighbor blocks
Controls Changed

CONTROLS
WSAD- Move Camera
Middle Mouse - Zoom
Left Click/Hold - Place Block
Right Click/Hold - Remove Block

GAME
http://hairdresser-bird-28631.bitballoon.com/

.CAPX
https://drive.google.com/open?id=0BzhJb ... k85dE9QU0U

SOURCES
https://www.youtube.com/watch?v=1kqYdSKVtE4&t=42s
https://www.scirra.com/tutorials/746/au ... ise-method
http://www.saltgames.com/article/awareTiles/
https://forums.tigsource.com/index.php?topic=14166.0
Last edited by VictoryX on Thu Jun 15, 2017 10:18 am, edited 1 time in total.
Image
B
45
S
17
G
2
Posts: 201
Reputation: 4,501

Post » Tue Feb 14, 2017 5:33 am

So I decided to try out some water simulations this is a work in progress and it hits the FPS pretty hard so the current way I am doing it is not sustainable. I do however like the outcome, it's pretty fun filling these caves with water and creating these little air pockets.

UPDATE
Water Simulation
Hold Shift and Left Click/Hold to add water.


GAME
http://personnel-officer-governor-86515.bitballoon.com/
Image
B
45
S
17
G
2
Posts: 201
Reputation: 4,501

Post » Tue Feb 14, 2017 2:38 pm

looks great so far :)
I like giving game advice more than I actually like making games ;)

Image
B
40
S
15
G
3
Posts: 129
Reputation: 4,651

Post » Tue Feb 14, 2017 7:21 pm

Thanks, I'm having trouble with cellular automata for the fluid simulations. I understand the concept/idea of it, but I can't seem to get it working. At least not without having a constant check of the entire array, which is what is causing the slowdowns.
Image
B
45
S
17
G
2
Posts: 201
Reputation: 4,501

Post » Tue Feb 14, 2017 10:59 pm

Very nice!
B
54
S
16
G
6
Posts: 719
Reputation: 9,207


Return to Works in Progress/Feedback Requests

Who is online

Users browsing this forum: No registered users and 3 guests