Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / [DBP]Destructable Terrain (matrix)

Author
Message
MikeS
Retired Moderator
21
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 19th Feb 2007 05:30 Edited at: 19th Feb 2007 05:30
I posted this in a thread overhere . I figure it'll be easier to find here, and maybe some of you other guru's can expand on it.

Press space to drop the bombs and use the arrowkeys to move around. The size of the craters is currently dependent on the sphere size which is randomized.

You can also click with your mouse to get information and manually lower the tiles. This can demonstrate how to make a mini matrix editor for those interested.



[Screen shot]




A book? I hate book. Book is stupid.
(Formerly Yellow)
aluseus GOD
17
Years of Service
User Offline
Joined: 19th Mar 2007
Location: I\'m here. Now I\'m there. I keep moving
Posted: 28th Mar 2007 08:27
woah
Zombie 20
17
Years of Service
User Offline
Joined: 26th Nov 2006
Location: Etters, PA
Posted: 28th Mar 2007 09:34
that is asweome

Inverted
18
Years of Service
User Offline
Joined: 19th Nov 2006
Location: Oregon
Posted: 31st Mar 2007 03:15
Thats cool mike, thanks for the snippet


Lawl
Chris Franklin_
17
Years of Service
User Offline
Joined: 21st Dec 2006
Location: Home
Posted: 2nd Apr 2007 11:29
Cheers Mike , I'll be using that soon

TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 2nd Apr 2007 14:59
Well this is a slightly better version of the smooth matrix function. It stores the values in array at the start. That means that the smoothing won't end up making decisions based upon the already altered matrix.


MikeS
Retired Moderator
21
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 15th Apr 2007 18:51
Cool smoothing TEH_CODERER. Thanks for the comments guys.



A book? I hate book. Book is stupid.
(Formerly Yellow)
Aralox
17
Years of Service
User Offline
Joined: 16th Jan 2007
Location: Melbourne
Posted: 7th Jul 2007 13:36 Edited at: 12th Aug 2007 15:48
its got some 'could not determine parameter type of
'pick object(mousex(),mousey(),1,Objects) at line whatever.

Am i doing something wrong?

MikeS
Retired Moderator
21
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 10th Jul 2007 07:29
This snippet will only work in dbp sorry. Otherwise just make sure the objects variable is not zero.



A book? I hate book. Book is stupid.
(Formerly Yellow)
Niels Henriksen
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 12th Aug 2007 09:14
Very nice

I added this



And now I can raise terrain by using right mouseclick.

Now I will put this in my game in Dark GDK

Niels Henriksen
Working on a (MMO)RPG right now in DarkEngine
http://www.tigernet.dk - Send SMS to mobile online (will come in english soon)
wickedly kick it
18
Years of Service
User Offline
Joined: 13th Jul 2006
Location: Fort-worth Texas
Posted: 12th Aug 2007 09:31
you are my god...

MikeS
Retired Moderator
21
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 28th Aug 2007 10:06
Thanks guys. Keep on adding to it if you'd like. I think it's reaching the maximum as far as the DBP matrices systems go. The only thing left to do is create the matrix from a heightmap. I have some code to do just that if anyone is interested, or I'll just add it when I get to it.



A book? I hate book. Book is stupid.
(Formerly Yellow)
Yian
21
Years of Service
User Offline
Joined: 16th Jun 2003
Location: Nicosia, Cyprus(the Greek half)
Posted: 28th Aug 2007 17:24
I know this is a stupid question, but is there any chance of a destructible object version? I'm not even sure dbp's vert commands are bug free for that though...

What is happening to them[the children] is the only thing they've known. The whole system of values is turned upside down: a child is appreciated and loved if it earns money by stealing
MikeS
Retired Moderator
21
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 30th Aug 2007 05:53
Kevil made a destructable terrain system using objects long before I had. I believe I am the first to use matrices for any kind of realtime deformation(that I know of).

Converting this object into a memblock matrix is definitly possible, and then offsetting the tiles that way(up, down, or even sideways, which a matrix can't do!) would then be possible. The memblock command set is fairly stable, so we wouldn't need to use the vertex commands.

Go check out kevil's destructable terrain in the codebase, it's really 10x better than this. How it works is a bit beyond me though.



A book? I hate book. Book is stupid.
(Formerly Yellow)
TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 30th Aug 2007 11:41
Quote: "I believe I am the first to use matrices for any kind of realtime deformation(that I know of). "

I don't think so! I'm pretty sure I've seen it somewhere else and when I first learnt DB I made a 3d worms style game using it.

Quote: "Converting this object into a memblock matrix is definitly possible, and then offsetting the tiles that way(up, down, or even sideways, which a matrix can't do!) would then be possible. The memblock command set is fairly stable, so we wouldn't need to use the vertex commands."

Memblock terrains are good and considerably faster and more versatile than the standard DB matrices. However, as far as I am aware, the vertex commands are faster otherwise, I'm assuming they would have no reason to exist. As far as I know again, they are stable enough. I have used them for cloth and water effects as well as a polygon based level editor.

Pyramid Games Ltd
17
Years of Service
User Offline
Joined: 23rd Aug 2007
Location: Line 21, DBP
Posted: 30th Aug 2007 14:45
I love you Mike! This can come in handy......
DarthVader 335
17
Years of Service
User Offline
Joined: 18th May 2007
Location: Cyberspace
Posted: 1st Sep 2007 05:31
Is there a way to make this work with a .dbo file exported from 3DWS??

STAR WARS ROCKS!!!
MikeS
Retired Moderator
21
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 2nd Sep 2007 08:00
Okay cool TEH_CODERER. I'd like to see how that was done then. Cause I originally made this for a worms game.

@Pyramid Games Ltd
Thanks. There's a lot of other helpful guys around here too.

@DarthVader 335
Read a few posts up. We discussed the possibility of converting a matrix into memblocks to use like an object(.dbo or .x).



A book? I hate book. Book is stupid.
(Formerly Yellow)
TEH_CODERER
21
Years of Service
User Offline
Joined: 12th Nov 2003
Location: Right behind you!
Posted: 2nd Sep 2007 14:59
Well having lost everything on my hard drive a couple of times I don't have the original any more but I can certainly put together another example. Of course the main problem with using a matrix is the inability to move verts on the x and z axis. My more recent attempts have used object and then moved verts using the vertexdata commands till they are outside of the blast radius. Also using memblocks on images for a 2D version or a 3D version but with textured plains.

Login to post a reply

Server time is: 2024-11-22 18:42:40
Your offset time is: 2024-11-22 18:42:40