Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (521)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (589)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Could I get some feedback on my destroyable terrain physics?  (Read 5815 times)
0 Members and 1 Guest are viewing this topic.
Offline Jacob_

Junior Devvie


Projects: 3



« Posted 2012-02-12 00:16:06 »

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.
Offline ra4king

JGO Kernel


Medals: 355
Projects: 3
Exp: 5 years


I'm the King!


« Reply #1 - Posted 2012-02-12 02:34:28 »

Hehe I got sucked into that, destroying the ground and making tunnels is fun! 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 Tongue

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

Offline Mike

« JGO Spiffy Duke »


Medals: 86
Projects: 1
Exp: 6 years


Java guru wanabee


« Reply #2 - Posted 2012-02-12 16:26:11 »

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

My current game, Minecraft meets Farmville and goes online Smiley
State of Fortune | Discussion thread @ JGO
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline ra4king

JGO Kernel


Medals: 355
Projects: 3
Exp: 5 years


I'm the King!


« Reply #3 - Posted 2012-02-12 16:29:37 »

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
It is a runnable jar, did you extract everything? Tongue

Offline Cero
« Reply #4 - Posted 2012-02-12 16:46:42 »

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
It is a runnable jar, did you extract everything? Tongue

Not everybody can run a runnable jar...

Offline theagentd

« JGO Bitwise Duke »


Medals: 361
Projects: 2
Exp: 8 years



« Reply #5 - Posted 2012-02-12 16:52:59 »

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.

Myomyomyo.
Offline Cero
« Reply #6 - Posted 2012-02-12 16:59:28 »

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.

Offline Bearded Cow

Senior Devvie


Medals: 2
Projects: 1
Exp: 1 year


¬..¬


« Reply #7 - Posted 2012-02-12 22:46:25 »

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.
Offline Mike

« JGO Spiffy Duke »


Medals: 86
Projects: 1
Exp: 6 years


Java guru wanabee


« Reply #8 - Posted 2012-02-12 22:52:24 »

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
It is a runnable jar, did you extract everything? Tongue

Not everybody can run a runnable jar...

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

My current game, Minecraft meets Farmville and goes online Smiley
State of Fortune | Discussion thread @ JGO
Offline Christopher

Senior Devvie


Medals: 2
Projects: 1



« Reply #9 - Posted 2012-02-12 23:59:06 »

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.

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).

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Cero
« Reply #10 - Posted 2012-02-13 01:42:05 »

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
It is a runnable jar, did you extract everything? Tongue

Not everybody can run a runnable jar...

My java really refused to run it ...

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

Offline ReBirth
« Reply #11 - Posted 2012-02-13 04:27:10 »

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

Offline Aeroren

Senior Newbie


Medals: 1



« Reply #12 - Posted 2012-02-15 12:53:40 »

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

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

I use this:
1  
2  
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.
Offline Mike

« JGO Spiffy Duke »


Medals: 86
Projects: 1
Exp: 6 years


Java guru wanabee


« Reply #13 - Posted 2012-02-15 13:16:16 »

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 Smiley

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

My current game, Minecraft meets Farmville and goes online Smiley
State of Fortune | Discussion thread @ JGO
Offline Aeroren

Senior Newbie


Medals: 1



« Reply #14 - Posted 2012-02-15 14:16:16 »

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 Smiley

Yeah, I'm doing that Smiley 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.

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

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

« JGO Spiffy Duke »


Medals: 86
Projects: 1
Exp: 6 years


Java guru wanabee


« Reply #15 - Posted 2012-02-15 15:44:09 »

6000*1000? Split it up Tongue

Mike

My current game, Minecraft meets Farmville and goes online Smiley
State of Fortune | Discussion thread @ JGO
Offline _Al3x

Senior Devvie


Medals: 7


Indie Games FTW!


« Reply #16 - Posted 2012-03-06 19:10:41 »

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

Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xFryIx (58 views)
2014-11-13 12:34:49

digdugdiggy (37 views)
2014-11-12 21:11:50

digdugdiggy (30 views)
2014-11-12 21:10:15

digdugdiggy (24 views)
2014-11-12 21:09:33

kovacsa (48 views)
2014-11-07 19:57:14

TehJavaDev (51 views)
2014-11-03 22:04:50

BurntPizza (51 views)
2014-11-03 18:54:52

moogie (66 views)
2014-11-03 06:22:04

CopyableCougar4 (65 views)
2014-11-01 23:36:41

DarkCart (150 views)
2014-11-01 14:51:03
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!