WIP: SpringCombat

I have started to work with my physics-based space combat game again.

http://www.springworldgames.com/springcombat/gameimages/screenshot_1.jpg

http://www.springworldgames.com/springcombat/gameimages/screenshot_2.jpg

http://www.springworldgames.com/springcombat/gameimages/screenshot_3.jpg

Blog post

Here are some videos (most recent first):

Cool battle
Ship configuration and battle
Ship hull textures
Ramming test
Procedural ship hull tester

Planned features:

  • Evolve you own ship (and friendly bot) by buying new segments, weapons etc.
  • Generative/reactive music
  • Procedural levels and ships

It is currently rendered using Java2D. My plan is to keep the renderer/sound/music separate so I can simply make LWJGL, GWT (webGL and pure canvas), Android variants as well. I will however make the first game an Applet/Java application with Java2D.

Looks nifty! Hard to tell exactly what is going on but that youtube reminds me a lot of what gish prototypes looked like (which is a good thing).

Thanks! If this week’s work turns out like planned, I’ll have a much better video soon :slight_smile:

Here is a new video with some added visual effects and player control:

Now the real question is: how are you going to draw all that so it doesn’t look crappy? :slight_smile:

The Java2D renderer will probably always look crappy with its flat shaded, vector graphics stuff :). It might look a bit better when I add backgrounds and make the obstacles more visually varied.
For the OpenGL renderer (LWJGL or WebGL), the plan is to use textures with normal maps for everything which will spice it up. I have a lot of particle effects/animations as well that I want to use for explosions, smoke etc.

Do you have any anti-crap hints for me when it comes to Java2D (and JS canvas) rendering?

There isn’t much you can do with Java2D, I’m afraid. You can make gradient fills perhaps, and anti-alias lines, but textures are mostly out of the question as far as I know.

You can have an image wrapped around a shape.
Look into http://ra4king.is-a-geek.net/javadocs/java/awt/TexturePaint.html

It’s not much, but it’s the closest thing there is to textures.

If by textures you mean images, Java2D is actually quite good. It can paint heaps of transformed images pretty quickly, so long as java2D lets the video card hardware accelerate, which it doesn’t for many intel cards :frowning:

There’s radial and linear gradient paints and they’re also fast with hardware accel.

A tip: One problem with java2D is that you can’t do soft-clipping or anti-aliasing of images, so if you paint a rotated image it will always have jaggies on the edges. One way to make it look better is to draw a rectangle around the edge of the image in feint grey or some other translucent color to make it look less jaggy.

[quote]One problem with java2D is that you can’t do soft-clipping or anti-aliasing of images, so if you paint a rotated image it will always have jaggies on the edges.
[/quote]
Well can do this but will be a performance hit of course.
http://weblogs.java.net/blog/campbell/archive/2007/03/java_2d_tricker.html

This is good back reading on scaling images:
http://today.java.net/pub/a/today/2007/04/03/perils-of-image-getscaledinstance.html

Thanks for all the info!

I remember now that I tried some texture paint a couple of years ago but it was extremely slow on my machine so I forgot about it :slight_smile:

Well that was a couple years ago. Computers are now much more powerful. The demo on those websites ran instantly on my relatively crappy laptop. ;D

Nice, I didn’t know you could do all that in Java2D. Cool.

Added a video with some sound effects, procedural level generation, automatic path planning graph and a not so smart bot:

The sound effects are played with the Gervill Midi player with some key-based tuning messages for doppler effects (currently not really working well).

Holy crap how many classes do you have?!?

Far to many! :slight_smile:

I would differentiate the smoke from damage from ejector thrust. Grey circles for the first and lines for the second.

Upon first glance, I thought I was seeing a top-down of Archie’s jalopy as he was driving over to pickup Veronica. :slight_smile:

Damage from ejector thrust? I had to google two times since I didn’t know what Archie’s jalopy was either :slight_smile:

OpenGL will solve all the visual stuff for me eventually. In my vision I have a lot of nice looking cool explosions, weapons, backgrounds etc. that will hide the fact that it is extremely stupid to make a mass-spring based shmup :wink:

Heh, minus points to me for vague cultural references.

What I meant to say (and you figured out by now) is that the grey circle special effects for thrust looks more like billowing smoke and makes me think that the ship is heavily damaged (possibly on fire) and about to fall apart–like Archie’s clunker.

Exactly my first impressions! It took me a while to realize that the grey circles are just special effects when you’re moving :stuck_out_tongue: