Request

71 views
Skip to first unread message

Björn Bergström

unread,
Aug 12, 2003, 12:33:10 PM8/12/03
to
Hi,

I've been away from RL coding way to long now so I decided to start a really
simple project just for fun. Since I've been doing games for cellphones
lately I decided to try if I could fit a simple RL into a Java (J2ME MIDP
1.0) based cellphone. I just recently started the project so I haven't done
much coding yet, but I have a simple prototype (dungeon, fov ...).
Sourcecode will be released soon if anyone is interested. The biggest
problem is to fit everything into the memorylimitations of the phone...

Up until now I've only tested the prototype in the emulator that comes with
the WTK and the game runs perfectly. I tried to move the game to my phone
today and the results were terrible to say the least... after browsing some
dev forums I found that the early versions of my phone (SE T610) had poor
Java performance which has been fixed in newer versions. The game was
extremely slow, didn't respond to keys, and had distorted fonts... I would
really appreciate if anyone with a Java phone would download and try the
game and let me know how it runs and how it looks.

A version without items can be found here:

http://student.hyperisland.se/~bjobe888/mobility/dwellersmall/Dweller.jad
and
http://student.hyperisland.se/~bjobe888/mobility/dwellersmall/Dweller.jar

A version with items can be found here:
http://student.hyperisland.se/~bjobe888/mobility/dwellerbig/Dweller.jad and
http://student.hyperisland.se/~bjobe888/mobility/dwellerbig/Dweller.jar

Or from here:
http://student.hyperisland.se/~bjobe888/mobility/


instructions:
movement - left, right, up, down (keys 4,6,2,8)
pickup - fire (key 5)
inventory - game_a (key 7)

inventory:
exit - left (key 4)
commands - right (key 6), fire (key 5) activates command (currently only
drop)

--
Björn Bergström
L:C++ E+ T- R+ P+ D-- G+ F:V RL-- RLA++
W:F Q+++ AI++ GFX+ !SFX RN+++ PO+ Hp- Re+ S++
Dungeondweller (http://roguelikedevelopment.org/dungeondweller/)
Roguelike Development (http://roguelikedevelopment.org)


Jeff Lait

unread,
Aug 12, 2003, 6:14:22 PM8/12/03
to
"Björn Bergström" <bjorn.b...@hyperisland.se> wrote in message news:<bhb4pj$105nna$1...@ID-134817.news.uni-berlin.de>...

>
> I've been away from RL coding way to long now so I decided to start a really
> simple project just for fun. Since I've been doing games for cellphones
> lately I decided to try if I could fit a simple RL into a Java (J2ME MIDP
> 1.0) based cellphone.

Now here is a subject near my heart: Roguelikes for handhelds!

I'm working on a GameBoy Advance roguelike right now, so am rather
interested in how you address the UI problems...

> Sourcecode will be released soon if anyone is interested. The biggest
> problem is to fit everything into the memorylimitations of the phone...

How much memory do you have on those phones? Is there a difference
between static in and dynamic ram? IIRC, PDAs have their scratch
space + the 8mb or so of static storage. Similarly, on the GBA I've
got some depressing 256 of working RAM to deal with, but I can fatten
up my ROM with megabytes of sprites without problems.

How would you differentiate static from dynamic in JAVA anyways?

> Up until now I've only tested the prototype in the emulator that comes with
> the WTK and the game runs perfectly. I tried to move the game to my phone
> today and the results were terrible to say the least... after browsing some
> dev forums I found that the early versions of my phone (SE T610) had poor
> Java performance which has been fixed in newer versions.

True, hardware is always the limit :> At least you have the hope of
faster phones in the future :>

> instructions:
> movement - left, right, up, down (keys 4,6,2,8)

Cool, so only 4 way movement? Makes sense. That leaves you 5 free
keys for extra options... (I'm also restricting to four way movement,
but for different reasons :>)

> pickup - fire (key 5)
> inventory - game_a (key 7)
>
> inventory:
> exit - left (key 4)
> commands - right (key 6), fire (key 5) activates command (currently only
> drop)

I presume up/down scroll through the inventory, and then left exits &
right selects, and then you get a context sensitive menu, which you
use up/down on and hit 5 again to select?

Questions and Comments:

1) What res do you get? How many pixels? What font size are you
using in pixels? And thus, what tile size :>

For comparison, I'm running 240x160 and using 16x16 tiles. This gives
me a 15x10 viewable area which scrolls with each step of the avatar.
I can also fit only 30 char of text per line with my 8x8 font. (For
technical reasons, proportional fonts would be hard)

2) Any ideas how to write "blessed broken rusty +5 bastard sword" with
fewer characters? :>
I've got as far as using "holy" rather than "blessed", but haven't
added breakage or rust...

3) Have you thought about how to handle all the different commands a
user might want (cast spell, use skill, climb, pickup, search, look,
etc...)? I've got my own answer to this, but would like to hear yours
first :>

4) What size map are you planning on using? Arbitrary? Fixed size?
Any overviews?
What I've found nice as a mechanic is a quick key which brings up the
overview map for orientation. This might be harder on a phone which I
suspect doesn't work as well for volatile keypresses, on the GBA I can
just use one of the shoulder buttons ([R] in my case)

5) On a nitpicky UI side of things, I don't understand the use of 6 to
bring up the context sensitive menu for an item, and the 5 to activate
it. I would think that either 6 should be the key in both cases, or 5
should be. Which one I guess would depend on the shape of your phone
:>

- Jeff Lait
(POWDER: http://www.zincland.com/powder)

Pekka Nurminen

unread,
Aug 13, 2003, 11:32:33 AM8/13/03
to
Björn Bergström wrote:

> Up until now I've only tested the prototype in the emulator that
> comes with the WTK and the game runs perfectly. I tried to move the
> game to my phone today and the results were terrible to say the
> least... after browsing some dev forums I found that the early
> versions of my phone (SE T610) had poor Java performance which has
> been fixed in newer versions. The game was extremely slow, didn't
> respond to keys, and had distorted fonts... I would really appreciate
> if anyone with a Java phone would download and try the game and let
> me know how it runs and how it looks.

I tried quickly with Nokia 3650 (that version with items). Well, it starts,
but does not work completely ok. E.g. sometimes character jumps to another
place (even if moving just one step), like either screen refresh,
LOS or character movement does not work.

Try with different emulators, e.g. there should be available Java SDKs for
Symbian OS phones (i.e. Nokia 7650, Nokia 3650, N-gage, P800).

- Pekka


Pekka Nurminen

unread,
Aug 13, 2003, 11:32:44 AM8/13/03
to
Jeff Lait wrote:
> "Björn Bergström" <bjorn.b...@hyperisland.se> wrote in message
> news:<bhb4pj$105nna$1...@ID-134817.news.uni-berlin.de>...
>> instructions:
>> movement - left, right, up, down (keys 4,6,2,8)
>
> Cool, so only 4 way movement? Makes sense. That leaves you 5 free
> keys for extra options... (I'm also restricting to four way movement,
> but for different reasons :>)

You could also use following:
4 - turn 45 degrees left,
6 - turn 45 degrees right,
2 - go forward,
8 - go backwards (keep same facing)

> Questions and Comments:
>
> 1) What res do you get? How many pixels? What font size are you
> using in pixels? And thus, what tile size :>
>

Resolution varies as it depends on phone model. Nokia 3650 gives
something like 174 * ~120, but you can also get full screen control
(if you use Nokia specific class) and then resolution is 176 * 208.

> 2) Any ideas how to write "blessed broken rusty +5 bastard sword" with
> fewer characters? :>
> I've got as far as using "holy" rather than "blessed", but haven't
> added breakage or rust...

I do not have any solution for writing that with fewer characters, but
you could use icons instead of text. Another approach would be to
simplify items, i.e. do you really need rusty items in your game.

> 3) Have you thought about how to handle all the different commands a
> user might want (cast spell, use skill, climb, pickup, search, look,
> etc...)? I've got my own answer to this, but would like to hear yours
> first :>

Some solutions:
- Provide a key to get a menu of commands
- Provide shortcuts (e.g. press asterisk followed by a digit)


R. Alan Monroe

unread,
Aug 13, 2003, 6:45:19 PM8/13/03
to
In article <774acfb8.03081...@posting.google.com>, torespon...@hotmail.com (Jeff Lait) wrote:
>I can also fit only 30 char of text per line with my 8x8 font. (For
>technical reasons, proportional fonts would be hard)
>2) Any ideas how to write "blessed broken rusty +5 bastard sword" with
>fewer characters? :>

Is it at all feasible to squeeze two letters into an 8x8 block, and
have all combinations of aa, ab, ac, ad, ...zy, zz stored in your
graphics rom? Hmm, that's 676 combinations, maybe not. I wonder if you
could overlay single letters on 4 pixel boundaries...

Alan

J.Vuori

unread,
Aug 14, 2003, 2:50:42 AM8/14/03
to
"Björn Bergström" <bjorn.b...@hyperisland.se> wrote in message news:<bhb4pj$105nna$1...@ID-134817.news.uni-berlin.de>...
> Up until now I've only tested the prototype in the emulator that comes with
> the WTK and the game runs perfectly. I tried to move the game to my phone
> today and the results were terrible to say the least... after browsing some
> dev forums I found that the early versions of my phone (SE T610) had poor
> Java performance which has been fixed in newer versions. The game was
> extremely slow, didn't respond to keys, and had distorted fonts... I would
> really appreciate if anyone with a Java phone would download and try the
> game and let me know how it runs and how it looks.

I tried the game(version with items) with Nokia 3650. There were some
apparent problems: keymap is different from what you mentioned,
keypresses were processed too quickly(it is hard to move only one
space) and, the biggest problem of all: font is not fixed-width, which
distorts the map and makes it quite impossible to play. Oh, and menu
choice 'help' doesn't work.

On the other hand, performance was no problem. The game was not slow
at all.

I would really love to have a good roguelike for phones, so please,
keep on developing!

Jussi

Jeff Lait

unread,
Aug 14, 2003, 12:12:24 PM8/14/03
to
amon...@yahoo.com (R. Alan Monroe) wrote in message news:<3cz_a.56803$hc.4...@fe3.columbus.rr.com>...

> In article <774acfb8.03081...@posting.google.com>, torespon...@hotmail.com (Jeff Lait) wrote:
> >I can also fit only 30 char of text per line with my 8x8 font. (For
> >technical reasons, proportional fonts would be hard)
> >2) Any ideas how to write "blessed broken rusty +5 bastard sword" with
> >fewer characters? :>
>
> Is it at all feasible to squeeze two letters into an 8x8 block, and
> have all combinations of aa, ab, ac, ad, ...zy, zz stored in your
> graphics rom? Hmm, that's 676 combinations, maybe not.

It is worse than that. There are upper case and numbers and space,
giving 62, say 64 for evenness. That then 2^12 or 4096 different
combinations.

I have infinite space in ROM, so the number of combinations is not a
problem. The problem is in VRAM. However, I've had to already give
up loading all my tiles simultaneously and have a VRAM memory manager
to allocate them on demand, so the limit is the number of
simultaneously displayed tiles.

> I wonder if you
> could overlay single letters on 4 pixel boundaries...

I considered that. However, the real limitation is that 4 pixels
isn't enough to write "W". If I were to go this route, I'd likely go
to a proportional font and render the tiles on demand. (I already do
on demand rendering for the avatar tile, for example, as I build up
his appearance from the different clothing & weapon tiles).

What's stopping me from this?
1) Want to spend my efforts somewhere other than graphics, as graphics
have already sucked a lot of my time.
2) Have assumptions about character level addressing. The status
line, for example, is carefully managed to exactly 30 characters in
length so I know it is the full width. Proportional fonts would make
this rather more difficult.
3) My undying hatred for proportional fonts :>

That all said, I likely will break down at some point.

Jeff Lait

unread,
Aug 14, 2003, 12:23:16 PM8/14/03
to
"Pekka Nurminen" <pekka.n...@pp8.inet.fi> wrote in message news:<wSs_a.271$IR....@read3.inet.fi>...

> Jeff Lait wrote:
> > "Björn Bergström" <bjorn.b...@hyperisland.se> wrote in message
> > news:<bhb4pj$105nna$1...@ID-134817.news.uni-berlin.de>...
> >> instructions:
> >> movement - left, right, up, down (keys 4,6,2,8)
>
> You could also use following:
> 4 - turn 45 degrees left,
> 6 - turn 45 degrees right,
> 2 - go forward,
> 8 - go backwards (keep same facing)

I'm unconvinced. It would seem that you'd need a lot more key presses
to navigate around a dungeon. Maybe with the appropriate auto-turn
when you go forward into a wall it would work?

Then you have the whole can of worms that is introducing facing :>

> Resolution varies as it depends on phone model. Nokia 3650 gives
> something like 174 * ~120, but you can also get full screen control
> (if you use Nokia specific class) and then resolution is 176 * 208.

Wow, that's pretty good for such a small screen.

> > 2) Any ideas how to write "blessed broken rusty +5 bastard sword" with
> > fewer characters? :>
> > I've got as far as using "holy" rather than "blessed", but haven't
> > added breakage or rust...
>
> I do not have any solution for writing that with fewer characters, but
> you could use icons instead of text.

I considered that - having a broken version of the weapon & rusty
version so the user can tell immediately. However, my artwork lags
behind my text, so I'd like to be able to list all the properties.

> Another approach would be to
> simplify items, i.e. do you really need rusty items in your game.

That's my current approach. Still,
"evil ring of the missing finger"
exceeds my 30 char limit.

> > 3) Have you thought about how to handle all the different commands a
> > user might want (cast spell, use skill, climb, pickup, search, look,
> > etc...)? I've got my own answer to this, but would like to hear yours
> > first :>
>
> Some solutions:
> - Provide a key to get a menu of commands
> - Provide shortcuts (e.g. press asterisk followed by a digit)

My solution is to provide a key for a menu of commands, and then allow
you to define top-level short cuts by pressing the appropriate key.

Ie:
* - Get menu. When menu is listed, select a command and hit 1,3,5,7,
or 9. That key will then be bound to that menu option.

Björn Bergström

unread,
Aug 18, 2003, 3:10:15 AM8/18/03
to
"Jeff Lait" <torespon...@hotmail.com> skrev i meddelandet
news:774acfb8.03081...@posting.google.com...

> "Björn Bergström" <bjorn.b...@hyperisland.se> wrote in message
news:<bhb4pj$105nna$1...@ID-134817.news.uni-berlin.de>...
> >
> > I've been away from RL coding way to long now so I decided to start a
really
> > simple project just for fun. Since I've been doing games for cellphones
> > lately I decided to try if I could fit a simple RL into a Java (J2ME
MIDP
> > 1.0) based cellphone.
>
> Now here is a subject near my heart: Roguelikes for handhelds!
>
> I'm working on a GameBoy Advance roguelike right now, so am rather
> interested in how you address the UI problems...
>
> > Sourcecode will be released soon if anyone is interested. The biggest
> > problem is to fit everything into the memorylimitations of the phone...
>
> How much memory do you have on those phones? Is there a difference
> between static in and dynamic ram? IIRC, PDAs have their scratch
> space + the 8mb or so of static storage. Similarly, on the GBA I've
> got some depressing 256 of working RAM to deal with, but I can fatten
> up my ROM with megabytes of sprites without problems.

The amount of memory varies greatly between different phones. I have no
exact figures, but I think that on the Sony Ericsson phones static and
dynamic memory may not exceed somewehere around 100kb. This makes it a bit
of a challenge!

> How would you differentiate static from dynamic in JAVA anyways?

Dunno actually. I'm more used to C++...

> > Up until now I've only tested the prototype in the emulator that comes
with
> > the WTK and the game runs perfectly. I tried to move the game to my
phone
> > today and the results were terrible to say the least... after browsing
some
> > dev forums I found that the early versions of my phone (SE T610) had
poor
> > Java performance which has been fixed in newer versions.
>
> True, hardware is always the limit :> At least you have the hope of
> faster phones in the future :>
>
> > instructions:
> > movement - left, right, up, down (keys 4,6,2,8)
>
> Cool, so only 4 way movement? Makes sense. That leaves you 5 free
> keys for extra options... (I'm also restricting to four way movement,
> but for different reasons :>)

I'm not sure about four or eight way movement. I've been thinking of using
the center key (ie, 5) for everything except movement. A long press on 5
could perhaps show a menu with all commands available (ie, inventory, rest
100 turns, use magic etc) while a quick press would perform an appropriate
action, say pickup if standing on an object, ascend/descend stairs if on
stairs and so on... dunno if this will work though...

>
> > pickup - fire (key 5)
> > inventory - game_a (key 7)
> >
> > inventory:
> > exit - left (key 4)
> > commands - right (key 6), fire (key 5) activates command (currently only
> > drop)
>
> I presume up/down scroll through the inventory, and then left exits &
> right selects, and then you get a context sensitive menu, which you
> use up/down on and hit 5 again to select?

Correct. Don't know if this is the best way to handle the inventory but I'll
use this until I come up with something better.

> Questions and Comments:
>
> 1) What res do you get? How many pixels? What font size are you
> using in pixels? And thus, what tile size :>

Depends entirely on the phone. ATM I use the phones built in fixed width
font, that can be set to three different size, small, medium and large.
Using a SE T610 I have a resolution of 128x160 pixels and a small font size
of about 6x10. I use the entire screen, except for the bottom line, to
display the dungeon. The bottom line is used as a statusline showing stats
and hp. Messages are displayed at the top, on top of the map.

> For comparison, I'm running 240x160 and using 16x16 tiles. This gives
> me a 15x10 viewable area which scrolls with each step of the avatar.
> I can also fit only 30 char of text per line with my 8x8 font. (For
> technical reasons, proportional fonts would be hard)
>
> 2) Any ideas how to write "blessed broken rusty +5 bastard sword" with
> fewer characters? :>
> I've got as far as using "holy" rather than "blessed", but haven't
> added breakage or rust...

This is an even bigger problem on a cellphone display. Perhaps wrap the text
over several lines?

> 3) Have you thought about how to handle all the different commands a
> user might want (cast spell, use skill, climb, pickup, search, look,
> etc...)? I've got my own answer to this, but would like to hear yours
> first :>

I will try to keep the number of commands to a minimum and automate as much
as possible. Doors will automatically open when moved into for instance.
Look at my answer above for more about handling commands.

> 4) What size map are you planning on using? Arbitrary? Fixed size?

ATM 80x40 but this might change if I run out of memory :-)

> Any overviews?
> What I've found nice as a mechanic is a quick key which brings up the
> overview map for orientation. This might be harder on a phone which I
> suspect doesn't work as well for volatile keypresses, on the GBA I can
> just use one of the shoulder buttons ([R] in my case)

No overview yet, but I think I'll implement it if I have memory enough.

>
> 5) On a nitpicky UI side of things, I don't understand the use of 6 to
> bring up the context sensitive menu for an item, and the 5 to activate
> it. I would think that either 6 should be the key in both cases, or 5
> should be. Which one I guess would depend on the shape of your phone
> :>

Correct. I'll change that.

>
> - Jeff Lait
> (POWDER: http://www.zincland.com/powder)

--

Björn Bergström

unread,
Aug 18, 2003, 5:13:35 AM8/18/03
to
"J.Vuori" <con...@luukku.com> skrev i meddelandet
news:5b9125a5.03081...@posting.google.com...

> "Björn Bergström" <bjorn.b...@hyperisland.se> wrote in message
news:<bhb4pj$105nna$1...@ID-134817.news.uni-berlin.de>...
> > Up until now I've only tested the prototype in the emulator that comes
with
> > the WTK and the game runs perfectly. I tried to move the game to my
phone
> > today and the results were terrible to say the least... after browsing
some
> > dev forums I found that the early versions of my phone (SE T610) had
poor
> > Java performance which has been fixed in newer versions. The game was
> > extremely slow, didn't respond to keys, and had distorted fonts... I
would
> > really appreciate if anyone with a Java phone would download and try the
> > game and let me know how it runs and how it looks.
>
> I tried the game(version with items) with Nokia 3650. There were some
> apparent problems: keymap is different from what you mentioned,

The movementkeys were the same though, weren't they? I guess it was the
game_a (key 7) and fire (key 5) that were mapped differently?

> keypresses were processed too quickly(it is hard to move only one
> space)

Ok, there seems to be quite a bit of difference in executionspeed between
different phones. I have to find a nice way of setting the delay between
turns based on the phones executionspeed.

> and, the biggest problem of all: font is not fixed-width, which
> distorts the map and makes it quite impossible to play.

Hmm.. then the 3650 doesn't have a built in fixed-width font. I have to
create my own font then...

> Oh, and menu choice 'help' doesn't work.

I thought I removed the 'help' choice. It isn't implemented yet...

> On the other hand, performance was no problem. The game was not slow
> at all.

Great!

> I would really love to have a good roguelike for phones, so please,
> keep on developing!

I added monsters, weapons and armour yesterday. I'll post here when I have a
new version ready that has fixed the problems mentioned above. Thank you for
your help!!!

> Jussi

Jeff Lait

unread,
Aug 18, 2003, 1:12:32 PM8/18/03
to
"Björn Bergström" <bjorn.b...@hyperisland.se> wrote in message news:<bhpu50$1sovf$1...@ID-134817.news.uni-berlin.de>...

> "Jeff Lait" <torespon...@hotmail.com> skrev i meddelandet
> news:774acfb8.03081...@posting.google.com...
>
> The amount of memory varies greatly between different phones. I have no
> exact figures, but I think that on the Sony Ericsson phones static and
> dynamic memory may not exceed somewehere around 100kb. This makes it a bit
> of a challenge!

Indeed!

> > How would you differentiate static from dynamic in JAVA anyways?
>
> Dunno actually. I'm more used to C++...

I guess the question is, do you have seperate resource files that can
sit in static memory? If you made your own font, how do you ensure it
uses static memory?

With the GBA, everything is converted to source and const structures
end up in the static area (along with the code).

> > > instructions:
> > > movement - left, right, up, down (keys 4,6,2,8)
> >
> > Cool, so only 4 way movement? Makes sense. That leaves you 5 free
> > keys for extra options... (I'm also restricting to four way movement,
> > but for different reasons :>)
>
> I'm not sure about four or eight way movement. I've been thinking of using
> the center key (ie, 5) for everything except movement. A long press on 5
> could perhaps show a menu with all commands available (ie, inventory, rest
> 100 turns, use magic etc) while a quick press would perform an appropriate
> action, say pickup if standing on an object, ascend/descend stairs if on
> stairs and so on... dunno if this will work though...

From personal experience, I don't like delay keys. It's a very
painful semantic when you know what you want to do (as you will after
the first time you play the game).

I like the idea of "do the right thing" keys.

> > Questions and Comments:
> >
> > 1) What res do you get? How many pixels? What font size are you
> > using in pixels? And thus, what tile size :>
>
> Depends entirely on the phone. ATM I use the phones built in fixed width
> font, that can be set to three different size, small, medium and large.
> Using a SE T610 I have a resolution of 128x160 pixels and a small font size
> of about 6x10. I use the entire screen, except for the bottom line, to
> display the dungeon. The bottom line is used as a statusline showing stats
> and hp. Messages are displayed at the top, on top of the map.

So you have 21x15 viewable area? That's very good - more than enough
for a roguelike, IMO.

> > 2) Any ideas how to write "blessed broken rusty +5 bastard sword" with
> > fewer characters? :>
> > I've got as far as using "holy" rather than "blessed", but haven't
> > added breakage or rust...
>
> This is an even bigger problem on a cellphone display. Perhaps wrap the text
> over several lines?

It might be easier on cellphones to use text colour to represent the
status of the item, thus handling some of the dimmensions of this
issue.

> > 3) Have you thought about how to handle all the different commands a
> > user might want (cast spell, use skill, climb, pickup, search, look,
> > etc...)? I've got my own answer to this, but would like to hear yours
> > first :>
>
> I will try to keep the number of commands to a minimum and automate as much
> as possible. Doors will automatically open when moved into for instance.
> Look at my answer above for more about handling commands.

I agree whole heartedly with this. I actually drive the action on
bumping off the mobs ai, so monsters that wander around will open
doors if they are smart enough.

> > 4) What size map are you planning on using? Arbitrary? Fixed size?
>
> ATM 80x40 but this might change if I run out of memory :-)

True :> I use only 32x32 and it is playable, so don't worry about
scaling back.

Reply all
Reply to author
Forward
0 new messages