Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (476)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (532)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1] 2
  ignore  |  Print  
  Tilt 4k  (Read 10208 times)
0 Members and 1 Guest are viewing this topic.
Online kevglass

JGO Kernel


Medals: 120
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Posted 2005-01-01 14:51:12 »

Its been a busy day, dragged myself out of bed this morning at 10.30 and started coding.. here's my first attempt at the 4k games contest.

http://www.cokeandcode.com/4k/tilt/

Webstart is here: http://www.cokeandcode.com/4k/tilt/tilt4k-mouse.jnlp

Jar is here:
http://www.cokeandcode.com/4k/tilt/
tilt4k-mouse.jar

Which you'll have to run with:

java -cp tilt4k-mouse.jar G

I've not quite brought it in under the 4k limit yet but I'm still working on it. As far as I'm aware it should happily work on all platforms.

Controls are:

Space - Start Game
Escape - Quit Game
Cursors - Tilt Board

5 levels in the 4k entry.

Feedback would be appreciated as always (especially to do with platform issues). Smiley

Finally, it doesn't use a hires timer as yet (though I think I'll make the final entry use the 1.5 one) so if you're running on windows and get a bit of time related stuttering you know why Smiley

** UPDATE ** - Source is now available on the website.

Kev

PS. Gravity Battle new version is also up at: http://www.cokeandcode.com/grav2/grav2.jnlp (which should also work on all plaformts now, DrA!)

PPS: I could really do with some tips on how to shrink this sucker down the final 500 bytes.

Offline woogley
« Reply #1 - Posted 2005-01-01 15:08:05 »

great game! runs perfect for me.

as far as shrinkning it, I don't know if you read my reply to you in the Site Polls, but there's some tips there.

Also, in your jar, I notice you have stuff like:

1.dat
2.dat
...
Game.class

Use one-letter files. You don't need an extension for the files. The only file that needs an extension is Game.class, and you can even save that as G.class.

Other than that, I'd have to peek at your code to help you shrink it some more. Are you using one-letter variables? Are you using a static intializer or a main method? etc..

edit:
another strategy: after I removed all your .dat extensions, I zipped up all your level files and called the file 'g' (left off the .zip extension). When I jared this, the size reduced to 4390bytes (your jar is 4662 bytes). The only snag with this is, in your code you're gonna hafta open the zip to read your files. If you're not sure how to do this I can write up a quick example for you Tongue
Offline tom
« Reply #2 - Posted 2005-01-01 15:18:01 »

Great game Smiley

Quote
PPS: I could really do with some tips on how to shrink this sucker down the final 500 bytes.


-Use a obfuscator. Will rename functions and vars to save space. Some may have a size option you could try.
-Manually inline functions that is only called from one place.
-Don't use jar. Instead compress it with 7zip or other zip util.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline woogley
« Reply #3 - Posted 2005-01-01 15:23:02 »

Quote

-Don't use jar. Instead compress it with 7zip or other zip util.


this is a good idea, but I'm pretty sure it's against the rules (because the user would have to install 7zip to open 7zip files). By the way the 7zip extension would be the only compression that is better than jar becuase jar uses the standard zip compression (if I'm wrong please prove me wrong, I'd love to hear about better compression Cheesy)
Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #4 - Posted 2005-01-01 15:30:50 »

What a cool game.

Although, in traditional KG style-ee, one small mistake on a high level forces you to re-do all the others. Oh, the pain of traditional arcade games, no save-points, no level-codes, nothing!

Still kicks ass though. Best 4k game I've ever played...

EDIT: um, best as in "most fun". I've seen some much more impressive visually etc, but they were quite dull, usually just simple space-invaders in 3D.

malloc will be first against the wall when the revolution comes...
Offline tom
« Reply #5 - Posted 2005-01-01 15:44:18 »

Quote


this is a good idea, but I'm pretty sure it's against the rules (because the user would have to install 7zip to open 7zip files). By the way the 7zip extension would be the only compression that is better than jar becuase jar uses the standard zip compression (if I'm wrong please prove me wrong, I'd love to hear about better compression Cheesy)


I did not mean to use 7zips proprietary format, but to use it to create a standard zip file. Wich is what a jar really is. There are different ways to implement a zip compressor, and different utilities will result in different sizes. 7zip is regarded to be one of the best last time I checked.

Found two threads about reducing jar size in the j2me section:
Shaving
Midlet size

Offline Malohkan

Senior Member




while (true) System.out.println("WOO!!!!");


« Reply #6 - Posted 2005-01-01 15:55:51 »

Awesome game!  I'm very very impressed Smiley  Good work!  Now anti-alias the lines... Smiley

Admin and Game Developer at
GameLizard.com
Play Rimscape!    |    Play Conquer!
Offline tom
« Reply #7 - Posted 2005-01-01 15:59:12 »

Had a closer look at your jar file. You have to get rid of those dat files. I appended all the dat files to the class and 7ziped it. The result was 4009 bytes. I suggest you embed the content of the files in one or more arrays in the code. You'll be under the 4k limit with room to spare.

Offline woogley
« Reply #8 - Posted 2005-01-01 16:39:14 »

Quote


I did not mean to use 7zips proprietary format, but to use it to create a standard zip file.

My mistake, I was assuming you meant the .7z or whatever it is.
Online kevglass

JGO Kernel


Medals: 120
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #9 - Posted 2005-01-01 16:54:04 »

You guys rock! Smiley Thanks for the all the lovely positive feedback. I can now actually say I'm going to be entering the 4k contest since I've managed to bring the entry jar down to.. dum dum dum:

4086 bytes Smiley (10 to spare.. what to use them for?)

I also had room to add an extra feature just for B^3, type "e" to toggle into "Easy Mode" (not that it tells you anywhere since I couldn't fit that in (yet?) Smiley). This means you don't restart at level 1 when you die, carry on from the current level Smiley

I can honestly say after my busy day I'd recommend everyone have a go at this 4k lark, really changes the way you code Smiley

Kev

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline oNyx

JGO Coder


Medals: 1


pixels! :x


« Reply #10 - Posted 2005-01-01 17:10:21 »

Oooooh nice game Grin

Btw the jar I just downloaded is 4086 bytes. Those two files are just 3999 bytes if you zip it with 7zip (zip/ultra). And it's only 3988 bytes if you zip it with kzip Wink

98 bytes smaller, leaving a total of 108 bytes for some additions (maybe one level more?).

弾幕 ☆ @mahonnaiseblog
Online kevglass

JGO Kernel


Medals: 120
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #11 - Posted 2005-01-01 17:36:22 »

Thank-you!!! Smiley

1 more level... or maybe 3 Smiley New version uploaded with 3 additional levels. I'm now 50bytes or so in the black. Got a little indicator to show when easy mode is on too.

Oh, also the X on the window will work now.

50 bytes?

a) More levels?
b) Try and get an icon in there?
c) Something else?

Thanks again Onyx, KZIP, what a find!

Kev

Offline woogley
« Reply #12 - Posted 2005-01-01 17:57:49 »

how about random level generation? Grin

actually, now that I think about it.. the rules say the game itself has to be <=4096, but didn't say there was a size limit to what runs it (e.g. the jnlp file)

if that's the case, you could make an applet version and have all the level data in some <param> tags, then you could make tons of levels! Cheesy
Offline oNyx

JGO Coder


Medals: 1


pixels! :x


« Reply #13 - Posted 2005-01-01 18:15:58 »

> actually, now that I think about it.. the rules say the game
>itself has to be <=4096, but didn't say there was a size limit
>to what runs it (e.g. the jnlp file)
>if that's the case, you could make an applet version and
>have all the level data in some <param> tags, then you
>could make tons of levels!

Nop. The game and it's data needs to be <=4096 bytes. All cheats like requiring a huge commandline switch (eg containing the images) or anything like that is forbidden (the original rules were a bit more specific there).

You can - however - save some bytes by only zipping the class and leaving the data external. So, no zip directory entry overhead, but you lose (of course) some coolness points (like I did) heh Wink

弾幕 ☆ @mahonnaiseblog
Offline the2bears

Senior Member


Projects: 2


Little Bear: Code Fu!


« Reply #14 - Posted 2005-01-01 23:21:18 »

Kev,

Great little game, seriously!  I'm thinking your advice to try out the 4k stuff is good.  I just might:)

I'm glad there's the 'e' secret code.  I was frustrated as well having to start at the beginning.  I consider it 'e' for experienced, rather than easy.

Cheers,

Bill

the2bears - the indie shmup blog
Online kevglass

JGO Kernel


Medals: 120
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #15 - Posted 2005-01-02 20:24:37 »

Hola,

Thanks all for the feedback thus far, brilliant!

I've just uploaded the new version bringing the jar size to exactly.... 4096 bytes! For the extra 300 odd bytes you lucky people get:

* A total of 10 levels (some of the very easy ones have been redesigned)
* An icon replacing the little java mug
* A website address in the title bar (woo!)
* Some instructions on how to play
* The best time per level is now recorded and shown (only per session I'm afraid, no saving)
* 3, yes count them, 3 lives. (Note easy mode still works but I might take it out now to save space)
* Gameplay update - you now need to collect the coins (yellow circles) before the exit will appear. At which point you need to use it.

Not bad I reakon. I'm going to try and make some cosmetic updates now (speed up rendering) without breaking the limit.

For info, my current work flow is:  Code carefully => Design levels (I've a level designer tool) => Pack levels into one file => KZIP into a jar => ProGuard the jar.

Any additional feedback or tips much appreciated but I'm starting to think I'm reaching the edge of what I can do with this code base. Soko4k or Kart4k next? Smiley

Kev

Offline Matzon

JGO Knight


Medals: 19
Projects: 1


I'm gonna wring your pants!


« Reply #16 - Posted 2005-01-02 21:35:35 »

god damn it!
Quote
java.lang.ArrayIndexOutOfBoundsException: 10
     at G.draw(Unknown Source)
     at G.<init>(Unknown Source)
     at G.main(Unknown Source)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
     at java.lang.reflect.Method.invoke(Unknown Source)
     at com.sun.javaws.Launcher.executeApplication(Unknown Source)
     at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
     at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
     at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
     at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
     at com.sun.javaws.Launcher.run(Unknown Source)
     at java.lang.Thread.run(Unknown Source)

when completing last level *grumble* - oh well no fame for me :/
Very nice! - this screams for a 3d version, like the old wooden board thingy

Online kevglass

JGO Kernel


Medals: 120
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #17 - Posted 2005-01-02 21:52:15 »

Thanks for that, fixed! Hadn't actually got round to completing the game since the 10 levels went in.

You mean you don't like my 3D! Wink

I've just uploaded a version with a system property set which (noddraw) which massively improves performance locally. Also manage to save 5 bytes somewhere Smiley

Let me know if performance is suddenly a problem.

Cheers,

Kev

Offline Malohkan

Senior Member




while (true) System.out.println("WOO!!!!");


« Reply #18 - Posted 2005-01-03 00:58:16 »

I beat it WOOO!!! Smiley

Anti-alias and add mouse control! Smiley

Admin and Game Developer at
GameLizard.com
Play Rimscape!    |    Play Conquer!
Online kevglass

JGO Kernel


Medals: 120
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #19 - Posted 2005-01-03 10:48:53 »

You wish is my command oh master Wink, well half of it.

New version uploaded, and with my spare 30 bytes there is now:

a) Antialiasing toggled via the "a" key. (board only)
b) A bonus (tricky!) level 11.
c) Bug fix for the collision, you should now be able to the end of walls happily.

Kev

Offline oNyx

JGO Coder


Medals: 1


pixels! :x


« Reply #20 - Posted 2005-01-03 12:16:04 »

*phew* finished it Grin

That was pretty tough Smiley

Level 6 was also quite hard (at the end only 1 second left).

弾幕 ☆ @mahonnaiseblog
Offline Malohkan

Senior Member




while (true) System.out.println("WOO!!!!");


« Reply #21 - Posted 2005-01-03 18:35:11 »

Great I like the new level!  However I didn't notice antialiasing on the board or on the text or on the ball/coins Smiley

I think mouse support would make it more like the original wooden/plastic versions of this kinda game because the steadiness of your hand would come back into play Smiley

Do that, add 40 more levels, crazy graphics and a GameLizard loader there and you're ready to go Wink

Admin and Game Developer at
GameLizard.com
Play Rimscape!    |    Play Conquer!
Online kevglass

JGO Kernel


Medals: 120
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #22 - Posted 2005-01-03 19:00:11 »

Honest, toggle it on with 'a' and tilt the board, the lines look way smoother.. the coins and ball also get smoothed only its very subtle..

Mouse is only out cause the game is for the 4k contest. Although I suppose I could remove keyboard support and just have mouse.

I think this one stops at the 4k contest tho.. Wink

Kev

Offline Malohkan

Senior Member




while (true) System.out.println("WOO!!!!");


« Reply #23 - Posted 2005-01-03 20:18:04 »

ahh I forgot it was a toggle Wink

Admin and Game Developer at
GameLizard.com
Play Rimscape!    |    Play Conquer!
Offline dranonymous

Junior Member




Hoping to become a Java Titan someday!


« Reply #24 - Posted 2005-01-04 01:46:11 »

Great stuff!  I wish I could code out something fun and useful regardless how large it is.  Wink

I'm not sure I like the anti-aliasing, the way I thought I would.  The black ball looks much nicer as do the circles.  The lines look a little worse to me for some reason.  I think its because the antialising makes them look fatter, since the colors are so high contrast maybe?  Any way of AA'ing the balls, but leaving the lines undone?

How about a shadow for the ball?  I'd go for more 'glitz' at this point, rather than levels.  You can just improove the difficulty of the levels, since the app you have already prooves its point by being so good.  Now just put more polish on it to keep the other 4k demos in check.  Wink

Dr. A>

PS - You have different jnlp links for GB.  The website one doesn't match the one you posted at the top of this thread.  GB also didn't run on the mac.  Sad  It complained about not finding an 800x600 mode.  I tried to manually switch my resolution, but it didn't help.  Sad
Offline tom
« Reply #25 - Posted 2005-01-04 02:19:28 »

I'd like to see a mouse only version. The analog mouse controls is much more challenging.

I'd also like to see the game continue after the last level.  Continue with level 1, but make it more difficult. Less time to finish, make the ball go faster, or flip/rotate the level. You could also repeat all the previous levels before you get to the next. Like this (numbers represent level): 12123123412345123456 etc. The player will be motivated to see the next level, and you'll increase the time it takes to finish the game.

I don't see the need to toggle between antialising or easy mode. Decide on one or the other and use the extra space to add levels or gameplay. And I rather see gameplay added than nicer gfx.

I really love the game, btw  Smiley

Online kevglass

JGO Kernel


Medals: 120
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #26 - Posted 2005-01-04 06:19:29 »

Ok, I'll take a look tonight. I agree that anti-alias and easy mode shouldn't be toggled.. I take them out.

Mouse only - probably the best control system? Remove keyboard all together. Move mouse to start.. Could even make the controls analogue!

I really like the idea of flipping the board over to get a new level.. I'll see what I can do with that. You might see a 33 level version soon with flipped boards Smiley

Damn, I thought I'd finished. Smiley

Kev

Offline KONI

Junior Member




Java games rock!


« Reply #27 - Posted 2005-01-04 11:10:27 »

As for the control system (Mouse), I suggest you have a look at Neverball: http://icculus.org/neverball/ damn funny game and great MOUSE & Keyboard Control.
Online kevglass

JGO Kernel


Medals: 120
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


« Reply #28 - Posted 2005-01-04 20:30:28 »

Thanks for the tip Smiley

The mouse control version is now available although I've put it at a different location since its a very different game and I'm not sure which is best..

Webstart: http://www.cokeandcode.com/4k/tilt/tilt4k-mouse.jnlp

Jar: http://www.cokeandcode.com/4k/tilt/tilt4k-mouse.jar
Run with:

java -cp tilt4k-mouse.jar G

I can only get as far as level 4 now! I dare someone to complete it! Easy mode has gone, antialiasing is now default (text, pieces, ball and board).

I'm not sure its valid making a game harder by changing the control system.. let me know what you think and if its how you'd expected...

I'd also be interested on how well java.awt.Robot works on different platforms.

Thanks all!

Kev

Offline blahblahblahh

JGO Coder


Medals: 1


http://t-machine.org


« Reply #29 - Posted 2005-01-04 20:42:09 »

Quote
I can only get as far as level 4 now! I dare someone to complete it! Easy mode has gone, antialiasing is now default (text, pieces, ball and board).



Haven't tried the new version yet, but the previous ones anti-aliased mode caused the framerate to drop from (something smooth) to (just jerky enough to annoy you but still playable) on a 1ghz machine (linux) - and it looked damned ugly on a high res monitor.

malloc will be first against the wall when the revolution comes...
Pages: [1] 2
  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.

pw (15 views)
2014-07-24 01:59:36

Riven (14 views)
2014-07-23 21:16:32

Riven (13 views)
2014-07-23 21:07:15

Riven (15 views)
2014-07-23 20:56:16

ctomni231 (43 views)
2014-07-18 06:55:21

Zero Volt (40 views)
2014-07-17 23:47:54

danieldean (32 views)
2014-07-17 23:41:23

MustardPeter (36 views)
2014-07-16 23:30:00

Cero (51 views)
2014-07-16 00:42:17

Riven (50 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!