Could I get some feedback on my destroyable terrain physics?

Here’s the demo: http://www.filedropper.com/terraintest_2 (executable jar file)

The lack of character animation and incorrect hitbox are temporary, but does the movement feel natural? The only game I’ve played with this kind of terrain was Worms, and that was a long time ago.

Edit: You can drag the mouse to dig, though this won’t be in the final game.

Hehe I got sucked into that, destroying the ground and making tunnels is fun! :stuck_out_tongue:

The collision detection works very nicely, and I really wonder how you did it? Did you use java.awt.geom.Area?

Also, it is best to “erase” from the old mouse location to the new mouse location because moving the mouse too fast causes this trail of circles effect :stuck_out_tongue:

Looking through the data image files, what is the point of the light gray areas in your collision map?

You might want to provide a bat (or even better, applet) to start it up. I downloaded it, it didn’t seem to be a runnable jar so stopped and removed it. :wink:

Screenshots also always help.

Mike

It is a runnable jar, did you extract everything? :stuck_out_tongue:

Not everybody can run a runnable jar…

Yay, Liero/Worms physics! I’ve always thought that it’s annoying to get stuck on small bumps in the terrain though, and your game has the same “problem”. It can also be annoying with barely visible pixel sized terrain fragments that block your bazooka when you fire, so it might be good to add some kind of outline to the terrain to better empathize obstacles.

yeah like one speck stops you. was annoying in worms, depeding on gameplay, it can be annoying here too

edit: program doesn’t close properly.

I like it, seems to work very well. You may consider adding some sort of system so that it gets rid of really small bits that are hard to see but still disrupt the movement.

My java really refused to run it so I did it through the command prompt and then it worked right away.

All in all, the engine seems to work, no issues at all except for what Bearded Cow said.

Mike

This used to be one of my favorite “dog” techniques! Get your worm to be standing on one of these specs and watch the bazooka shells fly past!

The terrain demolition is great! I know the sprite is a temp one but I would narrow his collision detection box. I was able to get him to suspend in mid air numerous times (based on his gun i believe).

Didn’t mean it as a joke. Jars often dont work by just double clicking obviously.

java -jar then. that’s why some people include bat file on their distribution.

I’ve been wondering for some time how they did this, never figured it was just a bitmap with bits cut out :slight_smile:

Anyway, I tried to make my own worms (or scorched earth if you prefer :)) style destructible terrain and I was wondering what you use to draw the gaps?

I use this:


g.setComposite(AlphaComposite.getInstance(AlphaComposite.CLEAR, 0.0f));
g.fillOval(xpos - radius, ypos - radius, radius * 2, radius * 2);

Which works fine, but tends to get a bit slow on large levels.

If I were you I’d make a bitmap and update it (for example with draw oval if it is that kind of explosions) when needed. Not draw each explosion that ever occured on each frame :slight_smile:

If you are doing that and it still is slow, how large is large? If large is huge and you need a world that big, split up the bitmaps into smaller and only draw the ones in the viewport.

Mike

Yeah, I’m doing that :slight_smile: It’s only slow when you get a lot of explosions in a short period of time. I also use that method to draw a border as well (like in the later worms games) so I guess it’s not really that odd that it slows down.

I tried it on 6000*1000, so I guess it’s huge :slight_smile: It was just an experiment to see how it would work, but I guess splitting it up is the best way to go.

6000*1000? Split it up :stuck_out_tongue:

Mike

I´d love to give it a try but the link doesn´t work anymore :frowning: