Destructible Terrain
#41
Posted 13 July 2009 - 06:42 PM
#42
Posted 20 July 2009 - 10:17 PM
Terrain drawing could be optimized with surfaces.
Download
Edited by TeBe, 17 November 2009 - 09:11 AM.
#43
Posted 20 July 2009 - 10:46 PM
This is incredible mate, incredible. I'm still looking at the source, but good lord you've done a good job here.
#44
Posted 20 July 2009 - 10:56 PM
TeBe, this is your first post?!
This is incredible mate, incredible. I'm still looking at the source, but good lord you've done a good job here.
Thanks.
I've also done a 3D version with the Marching Cubes using c++ and opengl but since this is the Game Maker forum I'll only share the 2D version here
#45
Posted 20 July 2009 - 11:04 PM
#46
Posted 21 July 2009 - 02:20 AM
I've managed to come up with a pretty simple implementation of a destructible polygonal terrain. It uses a 2D array and the Marching Squares algorithm to polygonise the terrain, but instead of boolean values it uses real values to represent the terrain density at each point. This allows us to interpolate vertex positions between adjacent points, so we can make the terrain much smoother. Also there's no need to have a density value for each pixel, so the terrain can be linearly scaled.
Terrain drawing could be optimized with surfaces.
Download
Wow I was trying to make something like this but I gave up when I couldn't figure out a polygon fill method plus I didnt actually get to the part where you make craters and stuff. Any way excellent job Tebe. Its really cool. you should make this a tutorial.
Also another nice touch you could add might be dust and rocks which are created during the explosion which land and add to the terrain
Edited by ydawg314, 21 July 2009 - 02:20 AM.
#47
Posted 21 July 2009 - 06:52 AM
#48
Posted 21 July 2009 - 02:04 PM
it's nice and instantaneous, but it's still slow when you get heaps of triangles on screen. For me, 700 triangles gives me about 35-40 fps.
Yeah, this can be improved by drawing the triangles on surfaces and only draw them when they need updating. This makes the framerates not depend on triangle counts.
I've already implemented a surface method and got 500+ fps but it's still quite buggy.
#52
Posted 22 July 2009 - 04:58 PM
didn't bother to write a platform example for it, shouldn't be too hard, you can just read from a list if a place is free from collision with the terrain...Can you show me a platform engine for that please?that was already possible without the slowdown when drawing, go back a couple off pages and have a look at my surface 'n grid method...
linky
#53
Posted 22 July 2009 - 05:36 PM
Calculating the entire collision thing of several nonsquare shaped objects using grids is going to kill all your perfomance. (since even for square with good collisions you'll have to check your grid like 4*vspeed times per step, and you are normally going to have something else then player with collisions, I suppose
)
#54
Posted 23 July 2009 - 10:28 AM
true, but you don't need pixel perfect collision checking, just checking all the corners is good enough...I'm not talking about hardness, i'm talking about perfomance.
Calculating the entire collision thing of several nonsquare shaped objects using grids is going to kill all your perfomance. (since even for square with good collisions you'll have to check your grid like 4*vspeed times per step, and you are normally going to have something else then player with collisions, I suppose)
EDIT:and you can use the ds_grid_get_disk_max function to check for circles, and the ds_grid_get_max function to check for squares, and most shapes are a composite off those...
Edited by ditdingiscool, 23 July 2009 - 10:30 AM.
#55
Posted 28 July 2009 - 02:23 AM
drawing water is difficult yes. splashing water is even more difficult.
first difficult step: terrain destruction in the shape of hand (or water destruction)
second difficult step: random but not random splashes water bubble sizes
third difficult step: water refilling the destructed parts of water
fourth difficult step: water bubbles conjoining with the water
fifth difficult step: water making waves due to splash
i couldn't do anything about this problem so i just set limits to what the hand can do, how deep the hand can go. and i just made an animation of the splash out of flash and sony vegas, so it's a sprite into a video file, but i converted the video to animated image of course.
any suggestions??? sigh...
should this be a new topic?
#56
Posted 28 July 2009 - 04:24 PM
yes it should, what you're currently doing is hijacking this topic, although the question is related-ish it isn't the same as the topic...<snip>
should this be a new topic?
#57
Posted 12 August 2009 - 02:35 AM
I have a landscape sprite, and when a bomb hits it, it creates a hole sprite at that position, when you drop another bomb in the collision with the land it checks if there is already a hole, if so it continues until there isn't.
This is fast(For me) and im able to destroy the whole terrain without dropping one frame.
#58
Posted 12 August 2009 - 09:36 AM
that's not the problem anymore, enough solutions for that already(just browse this topic), now were mainly thinking off ways to make the terrain fall if there are holes in it...I know this isn't the most er.. expert suggestion, but it worked for me.
I have a landscape sprite, and when a bomb hits it, it creates a hole sprite at that position, when you drop another bomb in the collision with the land it checks if there is already a hole, if so it continues until there isn't.
This is fast(For me) and im able to destroy the whole terrain without dropping one frame.
#59
Posted 15 August 2009 - 05:41 PM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users












