Rogue 4k

Update: The game is now published out on the Java4k site.

With an uninspired title, I bring you my first 2013 Java4k contest entry: Rogue 4k (now in HD)

On Java4k.com (final version)

The Story:

You crossed a vast wasteland to reach the fabled Dungeons of McGuffin, where the Mad Mage lived for centuries, collecting monsters and creating items of immense power. Hungry, you descend its ancient stairs with your trusty lantern in hand. The journey was hard, but it was only beginning. Now you must fight off long-unknown creatures to gain treasure and fame, and return home a hero.

I played around with it a bit, it’s nice. A few things (not sure how this impacts the 4k limit).

  1. Is it possible to make the fonts/window a bit bigger? The small letters strained my eyes.
  2. You are using up little enough of the screen, can you put the key instructions in abbreviated form right in the applet?
  3. When I hit a monster the second time, it wasn’t clear what had happened because the text description is the same so nothing changes. Is it possible to cycle between a few options “You hit the monster”, “You clobbered the monster”, etc. to make it more obvious that something happened again?

Having never played Rouge, this reminds me of Castle Adventure which is nice and nostalgic :slight_smile:

Had a squiz at your code, there is quite a bit of logic under the hood, very deceptive given the simple ASCII display.

Good work

Nice game! I had a cuirass of filling and a dagger of filling (+10 too, that’s one tasty dagger), is this a bug?

  1. I agree with the font size. It was what I could do to keep the messages on a single line and not lose too much information. I’ll see what I can do about possibly stretching the screen size to make the text a bit more readable. However, I’m really pinched for space as it stands (4061), and I’m looking to keep the changes minimal.

  2. For the official submission, the applet will be by itself. I’ll look at rearranging the page so that the instructions are more easily read.

  3. That’s a really good point. I’m going to look into alternating the text color, so that there will be some kind of indication that another turn passed.

Nope. Both of them have the same enchantment - it’s the dungeon of a Mad Mage!

Any item being able to get any enchantment definitely adds fun to the game, I tried to kill an enemy with a pizza of harming at one point ;D

Optimization tip:
I see you use a lot of switch case instructions.

Try out a chain of "if"s
This saves somes bytes.

I uploaded a new version. This includes:

  • fixes to the map generation (no more long strings of doors)
  • text messages alternate colors, so you can more easily tell if a new message appears with the same text
  • a few balance issues regarding monster strength and frequency of appearance

Most of the case statements take advantage of the fall-through feature to reduce code duplication, but there were some that I removed. It seems to have helped to reduce the code size. Thanks for the suggestion.

Hello Groboclown,

I’m very interested in your game, but I would appreciate very much to play it on a bigger screen !

I gave a short look at your code, and noticed you mixed &, &&, | and || logical operators. Is it mandatory for your program ? If it wasn’t, I wonder if you wouldn’t save a few bytes by using only the & and | ones.

Due to popular demand, Rogue4k is now in HD!

Hmm, I just got a white screen and an AOOBE :frowning:

Edit : I reloaded the applet 4 or 5 times and it worked… something with the random level generation? Anyway, it looks good :slight_smile: I look forward to a more balanced version.

Bah. I thought I had eliminated that, but I just saw it, too. It’s related to the generation of the map. I’ll look into this. Thanks for the heads up.

Cool Roguelike game. A few comments about it :

  • I was not able to cancel the “use item” action when the game asked me to “pick a direction” or to hit “any other key to cancel” ;
  • I regret the dungeon level is not indicated ;
  • when the player reaches 0% food, starvation should not lead to immediate death, but to reduce health slowly instead.

Thanks everyone for the feedback. I’ve incorporated all the notes you’ve given, as well as improved the game balance.

The game is now official on the java4k site. Thanks Appel!

Hey Groboclown, trying to compile the source code provided in java4k but it giving me errors below:

R.java:1740: unclosed character literal
private static final int DISPLAY_CHAR_PATH = ‘u2592’;
^
R.java:1740: illegal start of type
private static final int DISPLAY_CHAR_PATH = ‘u2592’;
^
R.java:1740: unclosed character literal
private static final int DISPLAY_CHAR_PATH = ‘u2592’;
^
R.java:1740: ‘;’ expected
private static final int DISPLAY_CHAR_PATH = ‘u2592’;
^
R.java:1744: unclosed character literal
private static final int DISPLAY_CHAR_BOX_DOUBLE_HORIZ = ‘u2550’;
^
R.java:1744: illegal start of type
private static final int DISPLAY_CHAR_BOX_DOUBLE_HORIZ = ‘u2550’;
^
R.java:1744: unclosed character literal
private static final int DISPLAY_CHAR_BOX_DOUBLE_HORIZ = ‘u2550’;
^
R.java:1744: ‘;’ expected
private static final int DISPLAY_CHAR_BOX_DOUBLE_HORIZ = ‘u2550’;
^
R.java:1745: unclosed character literal
private static final int DISPLAY_CHAR_BOX_DOUBLE_VERT = ‘u2551’;
^
R.java:1745: illegal start of type
private static final int DISPLAY_CHAR_BOX_DOUBLE_VERT = ‘u2551’;
^
R.java:1745: unclosed character literal
private static final int DISPLAY_CHAR_BOX_DOUBLE_VERT = ‘u2551’;
^
R.java:1745: ‘;’ expected
private static final int DISPLAY_CHAR_BOX_DOUBLE_VERT = ‘u2551’;
^
R.java:1746: unclosed character literal
private static final int DISPLAY_CHAR_BOX_DOUBLE_NW = ‘u2554’;
^
R.java:1746: illegal start of type
private static final int DISPLAY_CHAR_BOX_DOUBLE_NW = ‘u2554’;
^
R.java:1746: unclosed character literal
private static final int DISPLAY_CHAR_BOX_DOUBLE_NW = ‘u2554’;
^
R.java:1746: ‘;’ expected
private static final int DISPLAY_CHAR_BOX_DOUBLE_NW = ‘u2554’;
^
R.java:1747: unclosed character literal
private static final int DISPLAY_CHAR_BOX_DOUBLE_NE = ‘u2557’;
^
R.java:1747: illegal start of type
private static final int DISPLAY_CHAR_BOX_DOUBLE_NE = ‘u2557’;
^
R.java:1747: unclosed character literal
private static final int DISPLAY_CHAR_BOX_DOUBLE_NE = ‘u2557’;
^
R.java:1747: ‘;’ expected
private static final int DISPLAY_CHAR_BOX_DOUBLE_NE = ‘u2557’;
^
R.java:1748: unclosed character literal
private static final int DISPLAY_CHAR_BOX_DOUBLE_SW = ‘u255a’;
^
R.java:1748: illegal start of type
private static final int DISPLAY_CHAR_BOX_DOUBLE_SW = ‘u255a’;
^
R.java:1748: unclosed character literal
private static final int DISPLAY_CHAR_BOX_DOUBLE_SW = ‘u255a’;
^
R.java:1749: unclosed character literal
private static final int DISPLAY_CHAR_BOX_DOUBLE_SE = ‘u255d’;
^
R.java:1749: illegal start of type
private static final int DISPLAY_CHAR_BOX_DOUBLE_SE = ‘u255d’;
^
R.java:1749: unclosed character literal
private static final int DISPLAY_CHAR_BOX_DOUBLE_SE = ‘u255d’;
^
R.java:1749: ‘;’ expected
private static final int DISPLAY_CHAR_BOX_DOUBLE_SE = ‘u255d’;
^
27 errors

It looks like some issue with the escaping - there should be a backslash (’’) before each u. If you want to see the source control version, it’s available here:

http://groboutils.cvs.sourceforge.net/viewvc/groboutils/projects/grobo-games/4kgames/rogue/src/R.java?revision=1.22&content-type=text%2Fplain