WormGame

Last weekend I had a friend stay the night and we decided to both write a game that night. We had done this before only we were making the same game as a competition and only had 4 hours ( mine is at: http://cyntaks.com/spikeattack/ takes a horribly long time to load and is an applet ack!). Well this one we had the whole night and I spent the better part of this week adding features and enhancing graphics.
This was supposed to be a quick project so I could actualy complete something since it will be a long time before my bigger project is done :), and since it was taking too long I sorta wrapped it up quickly. This resulted in:
-Half ( or less ) working multiplayer version
-Not tested on any platform besides windows xp
-A bug in windowed mode (described below)

Fortunately there is also good stuff:
-Wonderfully fun!
-Pretty cool graphics ( graphics programming, not the lame: google image search, graphics themselves)
-Online high scores for the competitive types

Should have mentioned this earlier: The concept for this game is not mine, it is based on an applet I played called SFCave ( which I was told was based on another game… ).

Bug in windowed mode: each time you restart it (without restarting the app), it runs progressively slower on start up. I’m at a complete loss for any idea of what could cause this.

somehow I pressed a couple keys and it posted my message before i was done :(, I just had a couple more quick things to say. Let me know how it runs on all your computers (as I’m sure you already would), and please let me know what you think of it!

I just finished being a high school student ( yay ) and have only been programming in java for about 1.5 years so the number of games I have made could still be counted on one hand (maybe 2), so if this is horribly crappy to you, thats part of the reason :). Here it is:

http://www.cyntaks.com/projects/wormgame/webstart/wormgame.php

Edit: typos, same with the other post.
Edit: omg, I forgot to give the link.

Look cool!, very slow and stuttery on my machine tho (Radeon 9000). Shame cause it looks like it could be lots and lots of fun.

Kev

slow, uh oh. What are you fps? (says in the top left), I tested this on my sisters 266mhz (I think thats what it is) and got 25-35 fps.

Forgot to say how it ran on my pc (1.8 ghz, GeforceFX 5200): I have it limited to 85 fps, but I have run it at over 120, and when running at 85 it was using under 20% cpu.

jesus christ, the FPS was 120ish, but the game speed just kept jumping all over, it start fine then it went into warp speed! by warp speed I mean the worm is down at the bottom of the floor from the middle of the air in 0.1 of a second!

Thats my only concern, other than that ( with the 3 second experience I had of the game ), its good.

PC Specs:
2.26Ghz P4
512 Ram
ATI Radeon 9200 256Mb VRAM

DP

Works like a charm here :slight_smile:
Fun game!

If you want want to give it another try dark prophet I would suggest running in fullscreen, then it should be vsynced, also there is a bug in windowed mode and I think that may be what you are experiencing.

If I select windowed mode I get a blank black window.

The application is unusable in Fullscreen mode (as with all LWJGL webstart apps under Mac OS X - this is a known bug, and a number of people are hopefully working on a Cocoa based version which will solve these bugs).

Due to the above bug, I can only see the initial menu screen, but it does display the menu.

Sys: Mac OS X 10.3.4, Java 1.4.2_04, ATI Mobility Radeon 9600 128MB.

Well, theres my first mac user… I wish there was somthing I could do about that but I have no access to a mac and really have no idea whats going on. Btw, its a java2D game not lwjgl.

Hey ribot, any chance you could tell me what gets printed to the console when you get that blank black screen? no problem if you don’t want to.
I found someone with a mac to test my game and he said it worked fine other than it being slow ( his computer is ancient ), that tells me the problem your having isn’t just because its a mac, so I’m curious…

I tried it on my Mac in fullscreen mode and it appeared to work fine. I find it difficult though… if anything it starts too fast.

I shouldn’t play my games so much while making them, then I get too good at them and don’t have something to base the difficulty on ;D my high score is 18,000 some points lol. Starting out too fast is an issue though I can see that, lemme see if theres something I can do to fix it.

Windows: fullscreen mode just goes black and crashes.

windowed mode the menu works wonderfully, but the game displays “you’re dead” 0.5 seconds after starting.

Ahem. I think you need to read about “frame-rate independent game-speed”. Irrespective of vsync’ing etc you should never make an FPS-dependent game :frowning:

I agree with 3 * blah… I have v sync off as default and I die almost instantly.

Ok, uploaded a new version that should make starting out considerably easier. Starting on fast mode could still be difficult. Also, on windowed mode there is a stutter when the game starts (still no idea why) so that also could make it difficult for some.

about my not frame-rate independent game-speed (dern, thought no one would notice.) This is bad, very bad I know. I usualy have any change that takes place based on a time delta, but since my main goal was to have this done by morning… I did something bad. Cave generation + smooth scrolling + syncing worm to cave speed, ended up being dependant on iterations through my main loop. I realized this would be a problem and created a bit of a work around.

First part was to limit the framerate. I am using the GAGE timer along with a class I found by kev glass called PrecisionTimer, when I sleep at the bottom of my main loop it looks like this:


PrecisionTimer.sleep((lastLoopTime + PAUSE_TIME) - PrecisionTimer.getTime());

I thought this would limit the framerate to 1000/PAUSE_TIME, but apparantly not if dark prophet was going at 120fps.

Second part was to have the game speed catch up if their fps was lower than desired. To do this I made extra iterations through my main loop without doing the rendering ( about 90% of my cpu usage ). The number of iterations was equal to delta/DESIRED_DELTA and I had another variable called timePassed that got += delta%DESIRED_DELTA each time through and I made an extra iteration once this was >= DESIRED_DELTA. This worked fine for keeping the game speed equal on three different computers: my laptop 60fps, my sister’s computer 30fps, and my computer 85fps (desired fps). Game speed was the same but animation was not as smooth with lower frame rates (obviously).

Anyway, it was a mistake, won’t happen again.

The fullscreen problem concerns me because I am using a class I wrote for a game framework I am working on and I though I had everything perfect… Blah^3 (or any of you) would you mind taking a look at it? its well commented:

http://www.cyntaks.com/projects/DisplayManager.java

thanks!

OK fullscreen worked this time. Perhaps it was just being very slow at the black screen bit last time (Why does it go black for so long with nothing happening?). This time it came to life after only 20 seconds or so.

Windowed still dies horribly. There is also no death animation on fullscreen, although windowed looks liek there’s meanty to be one?

I like the game, although I would suggest trying modifying it so that instead of being an arcadey twitch game it['s a bit more skilful by removing/weakening the gravity and making the up/down alter the acceleration up/down - so you have to plan ahead (because it takes you a long time to “abort” a curve) but at the same time placing more emphasis on the skilful art of doing curves that will “snatch” a powerup from in between two obstacles.

what jvm are you using blah^3, the only thing I can think of that would cause a delay going into fullscreen is if my fullscreen code doesn’t work the same in java 5.0 or something. I’ll download the new beta and test it out on my computer tonight, there is no delay with my 1.4.2_05 install. What fps are you getting? does it run slow other than when starting up? Death animation: once you die it is supposed to clip everything out of the scene except a circle around where you collided and it will display the text: Game Over. This has never appeared differently in fullscreen/windowed for me.

About using up/down for acceleration, you think it should continue to accelerate for as long as you hold down up/down and then stay at that velocity once you release , or press up/down once and it continues accelerating ( even after key release ) until you change direction.

Fullscreen issues are scaring me right now, someone please tell me my code is ok ;D (link is in my previous post)

1.4.2_04 windows XP

OK, I thought in windowed mode it was (trying to) zoom the circle in - i.e. animate smoothly from game down to just the smll circle left visible.

I was thinking hold = change accel. NB: when you let go, velocity will CONTINUE to change, since you were controlling the accelleration. I only suggested it that way since (I think) that retains similarity with the current design, whereby you do not have direct positional control?

Zoom in on the circle, wow thats a great idea. I think I may add that. Ok so your using 1.4.2_04, guess its not the jvm then… That means it could only be: I have no idea. I see what you mean by adjusting the acceleration with key presses, this could lead to better control for doing risky powerup grabbing and making other slight adjustments to do more fun maneuvers. I will try this out.

Edit: I now realize you meant something else by zooming down to the circle from fullscreen (thats probably better) throught you meant something else.