Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (534)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Sokoban4k  (Read 3513 times)
0 Members and 1 Guest are viewing this topic.
Offline DonaldEKnuth

Junior Member





« Posted 2005-12-11 08:20:04 »

My (first) entry will be a Sokoban clone implemented as an applet at http://thisistheurl.com/file/Sokoban4k/Sokoban4k.html . I like the game genre and thought that it could be fun.

Now it's a webstart application: [size=40pt]Play Sokoban4k[/size]


Blog entry (where you can get the source code): http://thisistheurl.com/2005/12/13/sokoban4k/

Some facts about the game:
  • Contains 78 95 levels.
  • Size of jar is 4087 4093 4031 bytes. Optimized using 7zip and ProGuard.
  • Game area is 672*480 704*509.
  • I tried to fit in some basic effects.
  • I went for the colorful look.
  • Level designs are created by David W. Skinner, who gave me permission to use them.
  • Only tested under Windows using JDK 1.5.

Check it out and give me your opinion! After that I'll submit it to the contest, and perhaps create another one if I get enough time. Thanks for your time!

Best regards, Kent

My 4k 2006 Entry: Sokoban4k
Offline Morre

JGO Knight


Medals: 2
Projects: 10


I'm Dragonene on IRC.


« Reply #1 - Posted 2005-12-11 11:31:42 »

78 levels? Wow Smiley
A classic. Good work!

Oh, and first level's much harder than lvl 2, by the way.

Offline oNyx

JGO Coder


Medals: 1


pixels! :x


« Reply #2 - Posted 2005-12-11 15:31:29 »

Flickers alot when using the appletviewer... other than that it looks and works fine.

弾幕 ☆ @mahonnaiseblog
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Morre

JGO Knight


Medals: 2
Projects: 10


I'm Dragonene on IRC.


« Reply #3 - Posted 2005-12-11 15:57:25 »

My friend told me the game froze upon clearing lvl 39, and that he started in the wall on lvl 40.

Offline nonnus29

Senior Member




Giving Java a second chance after ludumdare fiasco


« Reply #4 - Posted 2005-12-11 16:57:55 »

I solved 39, it flashed, then froze:

Quote
Exception in thread "Thread-6" java.security.AccessControlException: access denied (java.lang.RuntimePermission exitVM)
   at java.security.AccessControlContext.checkPermission(Unknown Source)
   at java.security.AccessController.checkPermission(Unknown Source)
   at java.lang.SecurityManager.checkPermission(Unknown Source)
   at java.lang.SecurityManager.checkExit(Unknown Source)
   at java.lang.Runtime.exit(Unknown Source)
   at java.lang.System.exit(Unknown Source)
   at G.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)
Exception in thread "Thread-11" java.lang.StringIndexOutOfBoundsException: String index out of range: 7
   at java.lang.String.charAt(Unknown Source)
   at G.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)

I got some flickering too, like it's tearing a little.  Are you drawing straight to the Graphics or drawing to a back buffer first?  Nice sokoban game though, good job!
Offline f.l.x

Senior Member


Projects: 3


there is no place like 127.0.0.1


« Reply #5 - Posted 2005-12-11 18:14:07 »

nice game, i got one of these for my phone and it had me addicted for days, i have'n reached that far, but it looked good to me (no flickering nor tearing)

Litterarum radices amaras, fructus dulces
http://flx.proyectoanonimo.com
figth spam!
Offline DonaldEKnuth

Junior Member





« Reply #6 - Posted 2005-12-11 21:35:26 »

Quote
78 levels? Wow
Thanks! I stored the levels in a way I found to be some what clever. They are all in a long string, while it bloats the class file it's still excellent to compress. My class file in uncompressed form is a whopping 10456 bytes, while the compressed jar is 4087 bytes [and it could probably be compressed a bit further using KZip]. Smiley

Quote
Oh, and first level's much harder than lvl 2, by the way.
Yes it's hard to set the order correctly. From playing with friends I noticed that what was seen as easy for one person could be very hard for another, then on another level it was the other way around. I guess improvements still could be made in the level order, I'll save it for last.

Quote
Flickers alot when using the appletviewer... other than that it looks and works fine.
Quote
I got some flickering too, like it's tearing a little.  Are you drawing straight to the Graphics or drawing to a back buffer first?  Nice sokoban game though, good job!

[edit]: Got help with it from nonnus. No need to clutter the thread with the source code any more.

Quote
I solved 39, it flashed, then froze:
Quote
My friend told me the game froze upon clearing lvl 39, and that he started in the wall on lvl 40.
Ouch, bug! Smiley Thanks for mentioning it. I have a feeling about what it is, I'll solve it tonight.

My 4k 2006 Entry: Sokoban4k
Offline nonnus29

Senior Member




Giving Java a second chance after ludumdare fiasco


« Reply #7 - Posted 2005-12-11 22:33:10 »

What I do is overload paint() with the drawing code and then overload update() to call paint(). I never see any flickering this way.

Quote
Thanks! I stored the levels in a way I found to be some what clever. They are all in a long string, while it bloats the class file it's still excellent to compress. My class file in uncompressed form is a whopping 10456 bytes

Nice, so you just pull off a char/byte at a time?  I'll have to experiment with that....

 Grin
Offline jbanes

JGO Coder


Projects: 1


"Java Games? Incredible! Mr. Incredible, that is!"


« Reply #8 - Posted 2005-12-12 00:27:20 »

Quote
I stored the levels in a way I found to be some what clever. They are all in a long string, while it bloats the class file it's still excellent to compress.

*cough* Sounds familiar...   Wink Grin

Java Game Console Project
Last Journal Entry: 12/17/04
Offline DonaldEKnuth

Junior Member





« Reply #9 - Posted 2005-12-12 01:22:53 »

Quote
What I do is overload paint() with the drawing code and then overload update() to call paint(). I never see any flickering this way.
I changed my method of updating into yours, it seems like it doesn't flicker any more. I haven't seen any yet anyway. The applet link above points to the newly generated applet which has this fix in it. I hope some of you can try it out.
Quote
Nice, so you just pull off a char/byte at a time?  I'll have to experiment with that....
Well this is ripped from my code (but shortended, you get the idea though):
String[] levelArray = "####N# .#N#  ###N#*@  #N#  $ #N#  ###N####NN######N#    #N# #@ #N# $* #N# .* #N#    #N######NNGG####N###  ####N#     $ #N# #  #$ #N# . .#@ #N#########NN########N#      #N# .**$@#N#      #N#####  #NGGGG####".split("NN");
So I have all my levels in levelArray easily accessible. As you see there are not many different letters in the string, which makes up for the ability to compress it well (together with the fact that some combinations, like #### occur frequently, but such combinations can be found in almost any non-random data).
Quote
*cough* Sounds familiar...
Oh gosh!  Wink Grin Actually it doesn't seem very similar (I read about your method) at all. Your method seems far more elaborate than mine. I just store the tile data using a string (see above). No graphics are stored or anything complicated really. My first idea was to develop a vector format stored in a string, and use interpolation between keyframes to get the animation. But then I thought: "No! You should get som school work done as well you fool!", and I might just do. Smiley

I have a new applet now, see first post for link!
  • Changed double buffering method to nonnus suggestion.
  • Fixed my level loader a bit
  • Size went up to 4093 bytes.

My 4k 2006 Entry: Sokoban4k
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline woogley
« Reply #10 - Posted 2005-12-12 06:25:11 »

excellent, it has me hooked for the next couple of hours at least Cheesy
Offline DonaldEKnuth

Junior Member





« Reply #11 - Posted 2005-12-12 07:34:51 »

Quote
excellent, it has me hooked for the next couple of hours at least Cheesy
Thank you! (And thanks to everyone else who have given me feedback as well!) It feels great that some of you liked it!

n00b question
I got to earn my title (if I haven't already). My jar file is just the class-file compressed using 7-zip and renamed to Sokoban4k.jar . Is this wrong in any way? It seems to work nicely without the manifest file. And as it is an applet I couldn't get it to work by double clicking on it anyway (but it might be my lack of knowledge) when using jar cf Sokoban4k.jar G.class to produce the jar-file.

My 4k 2006 Entry: Sokoban4k
Offline jbanes

JGO Coder


Projects: 1


"Java Games? Incredible! Mr. Incredible, that is!"


« Reply #12 - Posted 2005-12-12 15:51:45 »

I got to earn my title (if I haven't already). My jar file is just the class-file compressed using 7-zip and renamed to Sokoban4k.jar . Is this wrong in any way? It seems to work nicely without the manifest file. And as it is an applet I couldn't get it to work by double clicking on it anyway (but it might be my lack of knowledge) when using jar cf Sokoban4k.jar G.class to produce the jar-file.

Applets don't need manifests. In fact, you can rename it to "ZIP" and it will work just fine. JARs were an outgrowth of the use of ZIP files to store applets back in the Java 1.1 days.

So in short, you're doing fine. Good work! Smiley

Java Game Console Project
Last Journal Entry: 12/17/04
Offline DonaldEKnuth

Junior Member





« Reply #13 - Posted 2005-12-13 05:17:10 »

Good, it's time to enlist my entry as the bugs seem to have been solved. I also go the permisson of David W. Skinner to use part of his levelset Microban in the game. Thanks for your feedback.

I converted it to an application and distribute it through webstart now. First post updated!

My 4k 2006 Entry: Sokoban4k
Offline DonaldEKnuth

Junior Member





« Reply #14 - Posted 2006-01-08 02:20:35 »

I have now added the source code! Check it out if you like to, link is in the first post.

My 4k 2006 Entry: Sokoban4k
Offline DonaldEKnuth

Junior Member





« Reply #15 - Posted 2006-01-28 19:19:37 »

[size=40pt]Play Sokoban4k[/size]

Blog entry (where you can get the source code): http://thisistheurl.com/2005/12/13/sokoban4k/

Now that the game has been stable for a while (no reported bugs and quite a lot of downloads) I'm asking:
  • Should I add more visual effects to the game? In which case I will have to lower the number of levels.
  • Are the graphics all right? I went for sun's insted of boxes as is most common, should I change something? And if yes, what?
  • Does it work well on other operative systems than Windows? Under Linux? And MacOS?
  • What's good with this game?
  • What's bad with this game?
  • Did I do something "strange" in my source code which you want to point out?
[move][size=20pt]All feedback will be greatly appreciated![/size] [/move]

My 4k 2006 Entry: Sokoban4k
Pages: [1]
  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 (35 views)
2014-07-24 01:59:36

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

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

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

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

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

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

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

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

Riven (56 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!