Roguelike News

From time to time, the original post,
email or web pages news provides more
information that can be added to the
news sections.

Main | News | Development | Archives | Articles
Links | FAQs | Contact : rogue@skoardy.demon.co.uk
Herve Lefebvre's plans for JavaRogue.
I had a lot of messages asking me why starting this project, and
why in Java ...

I'm actually starting this project _because_ it's in Java, and
this language provides some possibilities unknown in others
languages.

1] Portability.

A lot of peoble said C and C++ are easy to port, because GCC is
available in almost all platforms. That's true, but I'm not sure
that a player is pleased to learn how to use GCC and compile the game
for his computer/operating system.

2] Same version available at the same time.

Furthermore, when versions are upgrading, you're not sure you'll
find this new version on your platform. It's difficult for the player
to find it, and also it's difficult for the developper to inform
others developpers that they can compile the new version on others
platforms.

3] Modular game

The greatest improvement provided by Java is the possibility to
add to the software new components (Java objects) wich may be have
been developped separatly.

In fact, the "base game" will provide some ancestor objects: one
for intelligent monsters, one for animals, one for spells, one for
races, one for classes, one for weapons, for dungeons etc...

If you want to create a new monster, you'll have to inherit a class
from the monster ancestor. You may also, if you want just create a
slightly different monster that an existing one, inherit directly
from this monster.
Then, you'll have to write (in Java), new methods that will override
ancestors methods wich are not matching with the new definition of
the monster.

For example, if you want to create a "black dwarf" wich will have
STRength rolled with 5d6 rather than 4d6 for the "normal dwarf",
you'll just have to create a new Java class named blackDwarf 
inherited from the normalDwarf class, and then override the method
for monter creation, calling in this creation() method roll(5d6) for
STRength characteristic, and then calling ancestor methods for all
others characteristics.

When this is done, you'll compile your new class, and then the Java
compiler will generate a file named "blackDwarf.class". As soon as
you put this file in your game directory, the game will be able to
handle this new monster.
This new file is only what you need to distribute to give others
players the opportunity to smash some new "black dwarves" in their
adventures.

And if another one has created a new spell named "invoqueDragon",
then all the players who has dowloaded these 2 files 
(blackDwarf.class and invoqueDragon.class) and put them into their
game directory, will be able to both smash some black dwarves while
invoquing some dragons.... and if after playing they do not want to
meet the black dwarf anymore, they will just have to delete the file
blackDwarf.class, and the next adventure they'll run will be
black dwarf free. :-)

Some people said me we can use in C some ASCII files wich contains
the monster definition and then load these files when the program
start. They're right, but an ascii file contains only DATA and 
DEFINITIONS. With a .class java file you've also METHODS. So you may
code in these methods some new comportements for the monsters. You
may choose it will simply run to you and fight, or you may also
create a very smart monster wich will be always with one of it's
friends, and when fighting communicate each other to agree how they
will fight. (for example one running to you with a melee weapon while
the other will cast some spells to heal his friend and hurt you).

4] Object Programming

Well, I won't explain here all benefits of OOP, i'll just say that
it will provide an easy and fast way to write new monsters, items 
etc..


Herve Lefebvre
aegir@hol.fr
Java Rogue : http://www.mygale.org/10/aegir/moria/rogue.htm
© Copyright 1999 Darren Hebden.