Games Galore : Raiden 4K

Hi there…

Another Java 4K entry… A tribute to an old classic :slight_smile:

http://www.ahristov.com/raiden4k/screenshot-big.png

Full instructions here : http://www.ahristov.com/raiden4k

Comments,ideas and bugs are appreciated :-). I’ve tested it under Linux (Fedora Core) and Windows and seems to work fine. No way to test it under Mac, though.

The “End-Boss” is too fast, u can’t get around without being hit, cause his fire rotates to fast.

And a “Bug”: The Ship get’s nearly out of the screen at the bottom.

Win2K, Java 1.5, AMD 3000+

That’s not a bug. When you don’t run a WebStart app signed, it puts a status bar at the bottom of the window. Unfortunately they didn’t do it smartly, so it overlays your display. Anybody running an unsigned webstart app needs to take that into account when making their games.

I’m impressed! Brilliant for 4k.

Too fast, too hard in the beginning, not enough power ups, the boss is too hard. When I died it didnt’ decrement my ship count. Otherwise, nice game.

Thanks

What kind of computer do you have?

As for the powerups, do you mean “not enough variety” or “they don’t drop frequently enough”?

Regarding lives, it’s definitely impossible :slight_smile: Lives are decreased the very moment you die, and this is reflected immediately in the lower status bar. Since when you start again nothing changes in the status (because lives have already been decremented), it may create the illusion that they were not. This, or maybe you picked an additional life.

Wow, I’m impressed!

I’ve never played a Java game before manages to cause a machine crash/overload!!!
Twice now, while playing this game (no other app. running), my work PC has instantly powered down - and refused to boot back up again until the power cable was removed for ~10 seconds.

Athlon 64 3000+ cpu, MSI mobo, Geforce 6200LE gfx.

Good old Geforce drivers I bet :wink:

[edit]
Just caused another crash! :S
I’d got quite far too :frowning: I had max firepower, max fire speed, hadn’t died(obviously), and had 10 orbiters :smiley:
[/edit]

?!?!?! ??? Anything I can do about it? :’(
I have no idea why this might be happening. I swear my game yields for 25 ms every game loop and I use nothing extraordinary inside…
My computer is a P4 3GHz HT With a GeForce FX 5200…

Nah, doubt very much its anything you are doing.

As soon as Java started using hardware acceleration, it became susceptible to the whims of the driver authors :-
I’m not overly suprised tbh, MSI are a crappy mobo. mfg, and 6200LE’s are the crappiest card that Geforce do.
This is the third MSI motherboard that i’ve had in this machine, the other 2 were faulty in some way or other…

Ok, I’ve fixed the frame-rate and game speed to about 32-33 FPS, so now it should be reasonable on faster computers …

I knew that the ship could go to the lowest end of the screen but I didn’t consider this as a problem. Anyway, now it can’t go below the score line.

If you want, give it a new try here : http://www.ahristov.com/raiden4k/raiden4k-2.jnlp

Very impressive stuff.

But I agree, a bit too fast at start.

Even the recent, slowed-down version?

Sorry, only clicked on the link in the original post. The newest version seems to be good.

Completely awesome. Definitely not too easy, but then it’s not too difficult either. Very impressive amount of features in a 4k game, and graphical scrolling background along with it. Very good work.

Only one real complaint, detailed in screenshot below:

http://img176.imageshack.us/img176/6317/whycrashbs7.png

Note I am not hitting any bullets. Why did I die? =(

Thanks a lot for your opinion… You died because there was not enough space in the game to do a proper collision detection other than a “bounding box” calculation. So basically the game thinks you ran into the boss. The image below shows the bounding boxes for both ships

http://www.ahristov.com/raiden4k/boss-crash.gif

Now I’ll see what I can do about this. Probably it’s not much, because I’ve used every single optimization stuff I could think of but maybe I can think of something…

To help squeeze out the last few bytes from your game I suggest trying to remove as many intermediate variables as possible and simply use the full statements in their stead.

i.e. from your game (i decompiled it to see what i could suggest to help) there is a block of code similar to this:


                        int l4 = ai1[0] - ai1[j1];
                        int l6 = ai2[0] - ai2[j1];
                        ai3[j1] = (int)(10D * Math.cos(Math.atan2(l6, l4)));
                        ai4[j1] = (int)(10D * Math.sin(Math.atan2(l6, l4)));

I would recommend changing it to:


                        ai3[j1] = (int)(10D * Math.cos(Math.atan2(l6, ai1[0] - ai1[j1])));
                        ai4[j1] = (int)(10D * Math.sin(Math.atan2(l6, ai2[0] - ai2[j1])));

This is a little counter intuitve but in most cases it will reduce the number of bytes after compression.

I also ran your “raiden.jar” through the 4KJO tool and it reduced the jar by one byte… Not much i know but i do not have access to your original class before being run though obsfucators, I would imagine some more gain if the original class file was used in the tool.

I’d suggest using a better bytecode optimiser, rather than mangling the source-code…

heh, isnt source code mangling what j4k is all about ? :wink:

Thanks moogie, I used your wonderful 4KJO metaoptimizer while developing the game, but the code became so so complex that most optimizers were simply crashing when trying to analyze the code. I had to run both ProGuard and 4KJO with the -Xint switch so that they wouldn’t throw StackOverflowException or other strange errors at me :frowning: … And using -Xint means that each game iteration took about 5 minutes to test - much more that I’m capable of bearing…

I’ve used so many optimizations and code-mangling sutff that I doubt the amount of code that a proper collision detection requires can be compensated through further optimizations. As an extreme example, I have variables that are reused more than 6 times throughout the code for completely different purposes - just to increase repetition in stack frame references.

So I guess I’m going to let it stay as is… Actually, I’d rather add more gameplay if I had the space…