Deformation: Screenies!

Posted by TDOT on Nov. 6, 2008, 5:05 p.m.

Hey guys. In my last blog I wrote about how I was gonna focus on programming. My project at the top of the list was simple 2D terrain deformation. I've been working on this for a while now and FINALLY fixed the stupid glitch in my code. After that, things just started rolling and I've gotten a pretty good amount done.

So far I've programmed a simple terrain creator, which I plan on working on as I go. I can make any terrain I want with the mouse, and then export the terrain to an array which is easily read in GM. Right now, it's really only fit for me and testing purposes, but eventually it will be a decent tool to use with the engine.

The basic idea behind my engine is that the character doesn't really interact with the terrain itself. Position and collisions (that's right, the character collisions are pretty much fully functional) are calculated through a series of points (vertex points for the polygon which is the terrain) and character location. This works very well with the engine. Since the position is updated at all times, and calculated through the points, when the terrain deforms, the character moves with it.

Currently, I have a simple polygon with various points which can be deformed upward at the click of a mouse. The character moves over the terrain relatively smoothly. Jumping (and more importantly landing) work fine (except jumping doesn't work when walking down a slope, only when not moving, or going up).

Here's a quick list of immediate things to do:

[x]Implement "deformerator" instead of mouse manipulation.

[x]Code collision for the "deformerator" projectile.

[ ]Fix jumping glitch.

[x]Add downward deformation (beyond easy).

Next blog, expect screens and possibly a tech demo.

Shot down 5260 n00bs at time of blog

Ok, so I thought about posting another blog with the screens, but considering this one's only about 4th from the top or so, I'm just gonna edit.

I've got about 8 screens, so I'm gonna post 2 or 3, then just link to the rest.

So here we've got a….relatively….flat terrain.

Now, here's what happens after I fire the deformerator once.

Of course, we've also gotta have craters. Not just mountains.

See that little dot there? For now that's what the deformerator fires. Red means crater, blue means mountain. Right now it's firing a crater shot at the mountain I made earlier.

Screen 4

And the after effect.

Screen 5

So we've got a big crater. Now I'm firing a blue shot (which will make a mountain).

Screen 6

And now the after.

Screen 7

So I think that pretty much showcases it. Here's an extra one after I just played around and made a couple mountains.

Final

FAR from the flat terrain it started with.

As far as the tech demo goes, I may post it in the WIPs section in the next couple of days so keep an eye out.

Shot down 5355 n00bs at time of edit

Comments

Juju 16 years ago

Mmm… Also, just getting polygons to deform around other polygons is difficult. I've got a triangulator if you're interested.

noshenim 16 years ago

you should loose some file size and convert the images to .gif :<