Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (754)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (842)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Games Center / 4K Game Competition - 2009 / Re: Ice Fighters on: 2009-03-29 12:46:59
If rather than encoding the end co-ord you encode the length then the data should compress a lot better (especially if you're clever in the way you order it) and you'll probably only need a few extra bytes for decoding.
I must confess I didn't think of encoding by length rather than endpoint. But I'm curious why you think it would compress better -- most of the rooms are different sizes and unless the rooms were square I don't see why one scheme would offer a better compression ratio than the other. A lot of points are re-used in a maze (eg point 127 is used in all mazes) so compression should be reasonable from the points currently.

Also, storing the lengths would mean that you'd need to cater for positive and negative numbers, thus halving the distance you could move in a single byte. For example a wall from 0,0 to 0, 127 could not be represented in a single byte unless I was to sacrifice the diagonal walls and the halving of the sample space that goes along with reserving the high bit of a byte for the "hey, I'm a perpindicular wall" indicator
2  Games Center / 4K Game Competition - 2009 / Re: Ice Fighters on: 2009-03-26 11:21:07
I like it without a mini-map cause then it adds a maze effect to the game.

Hmmm, good point. It would sort of give the game away particularly on the second level. I did toy with just showing what the user had seen, but again I ran out of bytes.

Yes, it's complex, but it was the only way I could find to compress the wall data down enough to fit! I'm definitely open to better ideas.

Thanks for the compliment!  Cheesy I might extended it. There's a lot of really cool things I wanted to do like bosses, different weapons, transparent walls and so on, and most of them actually won't require much work (or bytes!)
3  Games Center / 4K Game Competition - 2009 / Re: Next 4K contest should be Applet only? on: 2009-03-25 09:23:35
Learn Jasmin. I switched to disassembly of my class file and manual tweaks in Jasmin at the very end of development because I couldn't get the last 5 bytes any other way, and ended up saving something like 60 bytes.

I think I might. I was optimising my symbol table and code as much as I could by hand (my walls are pi unit high because I couldn't afford an extra double to store my desired height of 3!) and I kept bumping up against the way the various optimisers would do things.

Plus, writing games in bytecode takes me back to the first games I ever wrote... 4C 00 03 6D 89 57... Those were the days...  Cool
4  Games Center / 4K Game Competition - 2009 / Re: Next 4K contest should be Applet only? on: 2009-03-25 03:28:20
My experience is exactly the opposite of this. Every time I've converted a game from my 4k template (which is available in one of the threads, uses a JFrame, and gives a reasonably small size) to an applet, the program has gotten considerably smaller. Which means that I ended up converting most of my games to applets this year.

Very interesting to hear these sizing opinions from people who have actually used applets, and I will definitely revise my opinions in deference to their greater experience. I am curious why the size would drop though -- did you ever have a look into this?

I must admit I thought there would be more of an overhead using applets than what both Morre and Ranger are saying. However, even a few bytes can make all the difference when it comes to the crunch! (I felt really bad about commenting out my "setResizable(false);" line in my application, but I couldn't get the last few bytes I needed any other way!  Shocked)

If we're requiring an applet version, perhaps it would be a good idea to provide a template or guide for minimal applets?

I agree. It would be great to see an applet template, preferably with some comments about why methods like isActive() need to be called and when.
5  Games Center / 4K Game Competition - 2009 / Re: Ice Fighters on: 2009-03-25 00:52:18
Sorry for the slow reply, been out of the loop for a little bit... (I hate it when work interferes with my hobbies!!)

The maze is hard coded in an octal-encoded string, so for example the simple level is:

String sMapData = "\001\001\055\260" + "\010\001\060\265\377\201\201\236\372\255\201";

The first number is the number of walls in each "wall chain", then the x and the y coordinate of the wall starting point. After that, there's either pairs of x,y coordinates (one byte each) or if the high bit is set then the wall is perpindicular to the last wall (or vertical, if it's the first wall)

So the first few walls on the second chain here ("\010\001\060\265\377\201\201\236\372\255\201") are:
- there are \010 (ie Cool walls in this chain
- the first wall starts at (\001, \060) ie (1, 48)
- the next number (\265) has it's high bit set on the first wall so it's a vertical wall, and we'll ignore the high bit, so the wall ends at \065 ie 53. Thus the first wall goes from (1, 48) to (1,53)
- the next number (\377) again has the high bit set, so it's perpendicular to the last wall (ie horizontal) and ends at (177) ie 127. Thus the second wall goes from (1,53) to (127,53)

And so on. This constrains my walls to be in the range (1, 1) to (127,127) but it means I get to effectively use one byte per wall, unless I want a diagonal wall in which case I need to give both x and y coordinates.

Aren't you glad you asked?  Cool

I'm happy to release the source code if anyone's interested, but it's rather a mess due to the optimisations...

Thanks for the comments though, it's much appreciated. I wanted to see what kind of cool graphics I could stuff into 4k, and I'm aware that it does tax the CPU a little, particularly at some of the harder levels when there are a bunch more monsters and sprites. I think even moderately high spec'd machines would grind a bit on level 4, but without many more bytes, the only way I could have sped it up would be by reducing the screen size, and that would have been a shame...  Smiley

I really wanted to put in a gun image on the screen which would have helped with the aiming, but I had exactly 1 byte to spare after my best optimisation attempts, so it went by the wayside. As did the mini-map...  Cry
6  Games Center / 4K Game Competition - 2009 / Re: Next 4K contest should be Applet only? on: 2009-03-25 00:21:57
Whilst I think that there's some drawbacks to JNLP as others have mentioned, adding the requirement to be applet does seem to increase the size of the application for no good reason.

Isn't this competition about the games that can be written in 4k and not how we should show them to the user?

To make an application via JNLP, all you need to do is override the paint(), processKeyEvent() and call setVisible(true) in your application somewhere. Sure, you can override or call a lot more system functions, but for the most basic game this is all you need to do. (Ok, so you probably want to call getGraphics() and drawXXXX also)

I've never written a game as an applet, so please correct me if I'm wrong, but don't you also need to:
- override init()
- use the interface java.lang.Runnable
- override run()
- call JApplet.enableEvents(AWTEvent.KEY_EVENT_MASK)

plus probably some other stuff that I'm not aware of, like cleaning up the applet?

These appear to be an unnecessary overhead on the game and for those of us who have fought tooth and nail to squeeze every byte into our 4k, may mean the difference between a good game and a great game.

And isn't this competition all about making great games, like many of the entries are this year, in 4k, and not making good games as applets in 4k? Smiley

7  Games Center / 4K Game Competition - 2009 / Re: Ice Fighters on: 2009-02-27 13:35:11
Thanks for the really helpful feed back, everyone.

I've changed the turning similar to what Jason suggested, having an accelerated turn (but no decelerated turn, I ran out of bytes!) and you can pretty much turn to anywhere if you tap the turn key quickly.

The first level is now expanded. Not much, but hopefully enough to qualify as a level in it's own right.  Roll Eyes

There are walls in the third level for you and the monsters to hide behind. Not too many, just enough to make it interesting. This seems to reduce the lag a little.

I've also beefed up the difficulty a fraction. Hopefully not too much so that the extra monsters on level 3 more than compensate for the speedup I get from the extra walls, but hopefully enough to make level 4 a fair challenge.

Haven't done the keyboard remapping yet, but it's on the list. I do find I'm using turn more often, now I can turn to pretty much anywhere I want to.
8  Games Center / 4K Game Competition - 2009 / Re: Ice Fighters on: 2009-02-26 20:16:28
Pah! Of course I'm counting it as a level!!  Smiley

I wanted something to "warm up" people as they entered the game and not have them have to fight too many monsters originally. I might try to put a couple of extra walls in if you think it would help, or I could add more monsters. Or both. (Maybe. It depends on finding those rather elusive spare bytes!)
9  Games Center / 4K Game Competition - 2009 / Re: Ice Fighters on: 2009-02-26 04:31:44
Jason, I've got to agree with you. I thought it was just me...  Angry I tried having it turn slower so you could fire more accurately, but then it turned too slowly. I think the solution might be accelerating into a turn. (ie turn 1 degree the first frame, 2 degrees the next frame, 4 the next and so on up to the maximum turn rate) Is this what you mean by "progressive"?

Oh, for more bytes to play with...  Cry

Thanks for the feedback to all...
10  Games Center / 4K Game Competition - 2009 / Re: Ice Fighters on: 2009-02-26 04:27:51
zammbi, can I ask which difficulty level you were playing on? I know that level 4 has some issues with speed if you're facing towards a large group of monsters on the last level and they're all firing as it does a painter's algorithm based render. Maybe I'll put a couple of walls in on the last level so there aren't so many shots on screen at the same time or something...
11  Games Center / 4K Game Competition - 2009 / Re: Ice Fighters on: 2009-02-26 04:23:28
Thanks for the suggestions, cylab. I like your suggestions and they make a lot of sense, but I'm pretty sure I don't have the bytes available to be able to support multiple different key strokes for the same action. I'll give it a try though, but I've already had to do a lot of horrible things to get it under 4k

I will put out different version for different keyboards though, and thanks for the reminder about the French keyboard.

One question: I notice that you've put the strafe next to the "backwards" key, and turn next to the "forwards" key, whereas from memory games like HalfLife start off with the turn next to the "backwards" key. I'm assuming you put it this way because you find it easier to play with keys set up like this?
12  Games Center / 4K Game Competition - 2009 / Re: Ice Fighters on: 2009-02-25 12:06:18
Ok, I've cut the levels of difficulty down to 4, but level 4 is much harder than level 1. The graphics are also a bit cooler now, with some nice reflections coming off the floor.  Cool

I'd be very interested to hear any feedback. Are the levels too hard or too easy? (Yes, it's possible to win on level 4!) Are there any changes you'd like to see to improve the game play?
13  Games Center / 4K Game Competition - 2009 / Re: Run Over Zombies on: 2009-02-24 11:42:50
Cool game with a nice 3d engine. But would it be possible to slide along the walls you run into instead of stopping dead? And I agree with the other post about the near plane -- I kept finding walls were disappearing on me as I got too close!
14  Games Center / 4K Game Competition - 2009 / Re: Ice Fighters on: 2009-01-23 06:32:44
Thanks for the suggestions. I've released a new version incorporating these.

Now there are 7 levels of difficulty (1-7) with 1 being very easy and 7 being, well, not very easy.

The keys have changed to WSAD + QE for strafe and Enter to fire. At the moment I've only got a version for QWERTY keyboards, but I'll do a DVORAK one soon.

If you die, just hit enter to restart.
15  Games Center / 4K Game Competition - 2009 / Ice Fighters on: 2009-01-16 11:23:37
Feeling bloody thirsty? (Well, without the blood). A nice, mindless shoot 'em up game in which you get to kill lots of evil fire-breathing aliens. Just the thing for a bit of stress relief. All you need to do is escape with your life to win.

There are 3 levels to escape from, but to escape from the last level you need to clear it of monsters...

Visit the website here or play via webstart.

Use the arrow keys to move / turn, ctrl + left / right arrow to strafe and shift to fire.

Any feedback greatly appreciated. I'm not a huge fan of the keys myself, and would be very happy to listen to suggestions. (I didn't want to use Alt to fire because if you press it and don't press anything else before you release it, you get a system menu which makes your player pretty unresponsive for a while...  Cry)

Pages: [1]
DesertCoockie (20 views)
2018-05-13 18:23:11

nelsongames (68 views)
2018-04-24 18:15:36

nelsongames (65 views)
2018-04-24 18:14:32

ivj94 (748 views)
2018-03-24 14:47:39

ivj94 (79 views)
2018-03-24 14:46:31

ivj94 (555 views)
2018-03-24 14:43:53

Solater (94 views)
2018-03-17 05:04:08

nelsongames (168 views)
2018-03-05 17:56:34

Gornova (338 views)
2018-03-02 22:15:33

buddyBro (998 views)
2018-02-28 16:59:18
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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‑
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!