Sign in with
Sign up | Sign in
Your question

RL Developement question (Java UI)

Last response: in Video Games
Share
Anonymous
May 19, 2005 1:55:47 AM

Archived from groups: rec.games.roguelike.development (More info?)

Hey Everyone,

I've long been a fan of rl games and have been playing adom and angband
variants for the past five years. Recently I decided to start creating
my own game and decided to use java(like JADE ;)  ). - (with Jbuilder).

I'm pretty familiar with java, but haven't done much with UI stuff and
am stuck on finding the best way (or even a way that works) to display
my "tiles" to the screen (Right now I just want to use ascii).

I'm trying to use swing... What do I use for the components? Can
I can use a single JTextArea? Or somehow hundreds of little jpanels?

It looked like Thomas B. created his own class deriving from
swing.JPanel. Although I'm not sure the how many he used, etc.

I've been googling it but can't seem to find anything. After spending
a couple days reading this newsgroup, I decided to ask here. Let me
know if you can help, or have open source code that does it, or have
found a webpage that tells me.

Thanks,
Nedasa
Anonymous
May 19, 2005 2:11:22 AM

Archived from groups: rec.games.roguelike.development (More info?)

Wow, fast response. (thanks)
Most of what you said confirmed what I was afraid of...

A normal Tile engine? Can you (or anyone else) suggest a good one?
Is there anything in particular I should know about them? It is
possible that's exactly what I need.

I think I downloaded Jcurses a few days back, but haven't looked much
at it yet.

Again, thanks for your help.
Nedasa
Anonymous
May 19, 2005 5:17:28 AM

Archived from groups: rec.games.roguelike.development (More info?)

ryan.mcdaniel@gmail.com wrote:
> Hey Everyone,
>
> I've long been a fan of rl games and have been playing adom and
angband
> variants for the past five years. Recently I decided to start
creating
> my own game and decided to use java(like JADE ;)  ). - (with
Jbuilder).
>
> I'm pretty familiar with java, but haven't done much with UI stuff
and
> am stuck on finding the best way (or even a way that works) to
display
> my "tiles" to the screen (Right now I just want to use ascii).
> I'm trying to use swing... What do I use for the components?
Can
> I can use a single JTextArea? Or somehow hundreds of little jpanels?

JTextArea can be, with difficulty and possibly with performance
degradation, be coerced to display an array of coloured characters
(monospaced font, red only, thousands of ranges and attributes) but
it's unlikely to be a good solution because it's not its job.

An array of hundreds of panels or a borderless JTable are also
inappropriate and probably too heavy.

>
> It looked like Thomas B. created his own class deriving from
> swing.JPanel. Although I'm not sure the how many he used, etc.

I've not read Biskup's code, but I suppose he used the standard
approach of custom widget drawing: a specialized "playfield" panel in
which appropriate high level calls drew letters, highlights and so on.
Swing offers comprehensive drawing primitives. Each letter can be drawn
at pixel precise locations, you can leave room for borders around
letters, you can mix letters drawn on the fly and bitmaps (maybe
pre-rendered letters), and performance is good.

> I've been googling it but can't seem to find anything. After
spending
> a couple days reading this newsgroup, I decided to ask here. Let me
> know if you can help, or have open source code that does it, or have
> found a webpage that tells me.
>
> Thanks,
> Nedasa

You shouldn't need anything more specialized than standard Swing
documentation like the API docs, the official Java Tutorial
(http://java.sun.com/docs/books/tutorial/ ;
http://java.sun.com/docs/books/tutorial/uiswing/ ) and other examples
and tutorials you can find on the web.
The main relevant technicalities are easy ones: installing and
referencing fonts in Java and double buffering.

Lorenzo Gatti
Related resources
Anonymous
May 19, 2005 5:29:12 AM

Archived from groups: rec.games.roguelike.development (More info?)

Thanks for your help! Your comments definately are helpful, now I
have a more clearly defined path to pursue in trying to figure it out.

Nedasa
Anonymous
May 19, 2005 5:32:00 AM

Archived from groups: rec.games.roguelike.development (More info?)

If I were to make a tile engine, writing my own would be my first
choice. I haven't done much inter-language stuff yet in high level
languages. I assume the easiest way would be to program the tile
engine in C++ or some other language?
Anonymous
May 19, 2005 5:38:11 AM

Archived from groups: rec.games.roguelike.development (More info?)

As of now I'd like to pursue a purely ASCII based game. I've
never gotten into playing RL games with 2D graphical tiles - always had
too much trouble telling things apart.

There is a simplicity in ASCII that appeals to me (however, the
isographic stuff looked really intresting, hadn't seen much of that
before)

H-World also looked interesting, and if i fail miserably creating a
game from scratch I may take another look at it ;) .

Thanks,
Nedasa
Anonymous
May 19, 2005 7:49:18 AM

Archived from groups: rec.games.roguelike.development (More info?)

gatti@dsdata.it wrote:

> Each letter can be drawn at pixel precise locations, you can leave
> room for borders around letters, you can mix letters drawn on the fly
and
> bitmaps (maybe pre-rendered letters), and performance is good.

...

> You shouldn't need anything more specialized than standard Swing
> documentation like the API docs, the official Java Tutorial
> http://java.sun.com/docs/books/tutorial/ ;
> http://java.sun.com/docs/books/tutorial/uiswing/ ) and other examples
> and tutorials you can find on the web.

I second all these. You could try searching for the drawFromPoint(...)
method description. I personally dont think amassing objects like
JTextField/Area, JPanel is a good idea with Java because:
+ it makes things damn slow
+ using drawFromPoint(...) is more than suffice ;) 
Anonymous
May 19, 2005 10:14:16 AM

Archived from groups: rec.games.roguelike.development (More info?)

ryan.mcdaniel@gmail.com ha escrito:
> Hey Everyone,
>
> I've long been a fan of rl games and have been playing adom and
angband
> variants for the past five years. Recently I decided to start
creating
> my own game and decided to use java(like JADE ;)  ). - (with
Jbuilder).

Nice! what JDK will you be using???

>
> I'm pretty familiar with java, but haven't done much with UI stuff
and
> am stuck on finding the best way (or even a way that works) to
display
> my "tiles" to the screen (Right now I just want to use ascii).
>
> I'm trying to use swing... What do I use for the components?
Can
> I can use a single JTextArea?


No...
> Or somehow hundreds of little jpanels?

NOOOOOO!!!! ;) 

>
> It looked like Thomas B. created his own class deriving from
> swing.JPanel. Although I'm not sure the how many he used, etc.

I haven't properly seen Mr. Biskup ideas, but the best thing you can do
to make console output in java is to create a specialized component
which can plot characters at specific positions of the screen.

You can do this by creating a JPanel that stores arrays of arrays of
characters, colors and screen update flags, and paints itself using
this data with standard drawString or more advanced text plotting
methods; and providing printAt(x,y,String) as well as cls(),
setColor(), etc. methods.

I am using this up to now with good results, see
http://peltkore.net/~szdev/crl and http://peltkore.net/~szdev/ga

>
> I've been googling it but can't seem to find anything. After
spending
> a couple days reading this newsgroup, I decided to ask here. Let me
> know if you can help, or have open source code that does it, or have
> found a webpage that tells me.
>
> Thanks,
> Nedasa

--
Slash
Anonymous
May 19, 2005 11:00:45 AM

Archived from groups: rec.games.roguelike.development (More info?)

ryan.mcdaniel@gmail.com wrote:
> Hey Everyone,
>
> I've long been a fan of rl games and have been playing adom and angband
> variants for the past five years. Recently I decided to start creating
> my own game and decided to use java(like JADE ;)  ). - (with Jbuilder).
>
> I'm pretty familiar with java, but haven't done much with UI stuff and
> am stuck on finding the best way (or even a way that works) to display
> my "tiles" to the screen (Right now I just want to use ascii).

Unfortunately Java is a realy bad choice for ASCII graphics. There is no
decent curses implementation for that platform.

> I'm trying to use swing... What do I use for the components? Can
> I can use a single JTextArea?

Oh no! This thingie wasn't designed to handle a direct access,
multicolor character table.

> Or somehow hundreds of little jpanels?

Arggghh!! This one would be realy bad :-(.

You may try searching for JCurses (someone will post a link probably)
but they're incomplete. The only reasonable way (and the way Biskup did
it I guess) is doing a normal Tile engine, with ASCII characters instead
of tiles.

> I've been googling it but can't seem to find anything. After spending
> a couple days reading this newsgroup, I decided to ask here. Let me
> know if you can help, or have open source code that does it, or have
> found a webpage that tells me.

Maybe someone will provide some more useful info.
--
At your service,
Kornel Kisielewicz (charonATmagma-net.pl) [http://chaos.magma-net.pl]
"From what I've read, a lot of people believe that GenRogue
exists and will be released some day" -- Arxenia Xentrophore
Anonymous
May 19, 2005 12:16:34 PM

Archived from groups: rec.games.roguelike.development (More info?)

Nedasa wrote:
> Wow, fast response. (thanks)
> Most of what you said confirmed what I was afraid of...
>
> A normal Tile engine? Can you (or anyone else) suggest a good one?

The best one is your own ;-).

> Is there anything in particular I should know about them? It is
> possible that's exactly what I need.

But you have to make it yourself. I dont remember what Java has for
drawing Bitmaps (a canvas?) but maybe you'd be better of in looking for
a true 2D library. Slash? ABCGi? Anyone?
--
At your service,
Kornel Kisielewicz (charonATmagma-net.pl) [http://chaos.magma-net.pl]
"Due to Pascal's original purpose as a teaching language it forces one
to learn good habits - and those good habits stay with you, even when
you later migrate to a much more forgiving language." - Sherm Pendley
Anonymous
May 19, 2005 2:35:49 PM

Archived from groups: rec.games.roguelike.development (More info?)

Nedasa wrote:
> If I were to make a tile engine, writing my own would be my first
> choice.

Exactly :-).

> I haven't done much inter-language stuff yet in high level
> languages.

You mean programming something in C++ to use in Java? No need for such
heavy artillery....

> I assume the easiest way would be to program the tile
> engine in C++ or some other language?

The easiest is FreePascal ;-D.
But if you make a game in Java -- stick to Java.
--
At your service,
Kornel Kisielewicz (charonATmagma-net.pl) [http://chaos.magma-net.pl]
"It's much easier to make an army of dumb good people than to
make one single smart good guy..." -- DarkGod
Anonymous
May 19, 2005 3:13:09 PM

Archived from groups: rec.games.roguelike.development (More info?)

Dnia Thu, 19 May 2005 07:00:45 +0200, Kornel Kisielewicz napisa³(a):
> Unfortunately Java is a realy bad choice for ASCII graphics. There is no
> decent curses implementation for that platform.

What for? Java is portable enough without curses library :) 

There is something called Charva
http://www.pitman.co.za/projects/charva/
I haven't try it.

read also:
http://www.javaworld.com/javaworld/javaqa/2002-12/02-qa...

regards,
Jakub
--
"We're just toys in the hands of Xom"
xenocide.e-plan.pl - SF roguelike in development
www.graveyard.uni.cc - visit Roguelike Graveyard
www.alamak0ta.republika.pl - my other projects
Anonymous
May 19, 2005 8:44:44 PM

Archived from groups: rec.games.roguelike.development (More info?)

Kornel Kisielewicz wrote:
> Nedasa wrote:
>
>> Wow, fast response. (thanks)
>> Most of what you said confirmed what I was afraid of...
>>
>> A normal Tile engine? Can you (or anyone else) suggest a good one?
>
> The best one is your own ;-).

Instead use H-World to write your whole game - it has
a "tile engine" built in :) 
http://h-world.simugraph.com/
https://sourceforge.net/projects/h-world/

>> Is there anything in particular I should know about them? It is
>> possible that's exactly what I need.
>
> But you have to make it yourself. I dont remember what Java has for
> drawing Bitmaps (a canvas?) but maybe you'd be better of in looking for
> a true 2D library. Slash? ABCGi? Anyone?
*---------------------------^^^^^
|
There is an excellent tileset set (2D and iso-psuedo3D)
available from the excellent Itakura!
http://rltiles.sourceforge.net/

--
ABCGi ---- (abcgi@yahoo.com) ---- http://codemonkey.sunsite.dk
Fun RLs in rgrd that I have tested recently!
DoomRL - DwellerMobile - HWorld - AburaTan - DiabloRL
Heroic Adventure - Powder - Shuruppak - TheTombs
Anonymous
May 19, 2005 8:44:45 PM

Archived from groups: rec.games.roguelike.development (More info?)

ABCGi wrote:
>>> Is there anything in particular I should know about them? It is
>>> possible that's exactly what I need.
>>
>> But you have to make it yourself. I dont remember what Java has for
>> drawing Bitmaps (a canvas?) but maybe you'd be better of in looking
>> for a true 2D library. Slash? ABCGi? Anyone?
>
> *---------------------------^^^^^
> |
> There is an excellent tileset set (2D and iso-psuedo3D)
> available from the excellent Itakura!
> http://rltiles.sourceforge.net/

I meant a Java 2D programming library :-P
--
At your service,
Kornel Kisielewicz (charonATmagma-net.pl) [http://chaos.magma-net.pl]
"The development cycle for roguelikes never ends..." -- Joseph
Hewitt
Anonymous
May 19, 2005 9:39:25 PM

Archived from groups: rec.games.roguelike.development (More info?)

Kornel Kisielewicz wrote:
> ABCGi wrote:
>
>>>> Is there anything in particular I should know about them? It is
>>>> possible that's exactly what I need.
>>>
>>> But you have to make it yourself. I dont remember what Java has for
>>> drawing Bitmaps (a canvas?) but maybe you'd be better of in looking
>>> for a true 2D library. Slash? ABCGi? Anyone?
>>
>> There is an excellent tileset set (2D and iso-psuedo3D)
>> available from the excellent Itakura!
>> http://rltiles.sourceforge.net/
>
> I meant a Java 2D programming library :-P

Yeah - but once you start using H-World instead
you just need this tileset or one like it :D 

--
ABCGi ---- (abcgi@yahoo.com) ---- http://codemonkey.sunsite.dk
Fun RLs in rgrd that I have tested recently!
DoomRL - DwellerMobile - HWorld - AburaTan - DiabloRL
Heroic Adventure - Powder - Shuruppak - TheTombs
Anonymous
May 20, 2005 2:34:08 AM

Archived from groups: rec.games.roguelike.development (More info?)

> Nice! what JDK will you be using???

Working with Jbuilder right now.

> You can do this by creating a JPanel that stores arrays of arrays of
> characters, colors and screen update flags, and paints itself using
> this data with standard drawString or more advanced text plotting
> methods; and providing printAt(x,y,String) as well as cls(),
> setColor(), etc. methods.

Looking into figuring out the "Graphics", "Graphics2d", and "ImageIcon"
classes (sound familiar at all?). They seem to have some of the needed
methods. Haven't got it working quite yet, but haven't had the time
to.

When you're talking about with creating a JPanel... ( lets say that
the map info is stored in a 2d array ). Do you mean creating a class
derived from JPanel and having the array as a data member?
Anonymous
May 20, 2005 2:39:16 AM

Archived from groups: rec.games.roguelike.development (More info?)

FreePascal eh? hmm, okay.

Sticking to java was the original plan. It seems like it will work,
although not 100% sure until the UI stuff is sorted out.
Anonymous
May 20, 2005 2:42:45 AM

Archived from groups: rec.games.roguelike.development (More info?)

Thanks, the sun.com sites are quite informative although a lot of
info. Hopefully in a day or two I'll either have the basics UI
working or have another more specific question I can ask.

Nedasa
Anonymous
May 20, 2005 6:52:30 AM

Archived from groups: rec.games.roguelike.development (More info?)

Nedasa wrote:

> When you're talking about with creating a JPanel... ( lets say that
> the map info is stored in a 2d array ). Do you mean creating a
> class derived from JPanel and having the array as a data member?

I think he means drawing stuff inside one JPanel only.
Anonymous
May 20, 2005 7:01:47 AM

Archived from groups: rec.games.roguelike.development (More info?)

Kornel Kisielewicz wrote:
> I meant a Java 2D programming library :-P

I'm using SDLJava for the moment, which is a really nice way to use SDL without having to mess around with JNI.

http://sdljava.sourceforge.net/

I suspect I'll eventually use it anyway (for compilation with gcj) but one step at a time. Anyway, the important thing is not to have too many dependencies on one graphics library; ideally you'd only have to implement some interfaces to switch Java2D to jcurses, for example.

-Aaron
Anonymous
May 20, 2005 9:56:43 AM

Archived from groups: rec.games.roguelike.development (More info?)

Nedasa ha escrito:
> > Nice! what JDK will you be using???
>
> Working with Jbuilder right now.

Yeah, but what JDK? :) 

>
> > You can do this by creating a JPanel that stores arrays of arrays
of
> > characters, colors and screen update flags, and paints itself using
> > this data with standard drawString or more advanced text plotting
> > methods; and providing printAt(x,y,String) as well as cls(),
> > setColor(), etc. methods.
>
> Looking into figuring out the "Graphics", "Graphics2d", and
"ImageIcon"
> classes (sound familiar at all?). They seem to have some of the
needed
> methods. Haven't got it working quite yet, but haven't had the
time
> to.

Well, but you must be the one to provide the methods using your custom
JPanel.

>
> When you're talking about with creating a JPanel... ( lets say that
> the map info is stored in a 2d array ). Do you mean creating a
class
> derived from JPanel and having the array as a data member?

Yes, that's what I mean... however have in mind not to store game
objects (like mapcells or so) as attributes of the JPanel if you want
to provide generic functionality with it... (store characters and
colors instead)

Perhaps I should clean up and provide this small console emulation
panel here???
Anonymous
May 20, 2005 11:29:48 AM

Archived from groups: rec.games.roguelike.development (More info?)

> Yeah, but what JDK? :) 
>

Lol, JDK... version 1.4.2

>
> Well, but you must be the one to provide the methods using your
custom
> JPanel.
>

right.

>
> Yes, that's what I mean... however have in mind not to store game
> objects (like mapcells or so) as attributes of the JPanel if you want
> to provide generic functionality with it... (store characters and
> colors instead)
>

Okay, that is what I was originally thinking (as far as not storing
game objects in the user interface). There are a few details
about storing the characters and colors that I'm not sure about yet.
I work a double today, but should have a couple hours to work on
it when I get home tonight.

> Perhaps I should clean up and provide this small console emulation
> panel here???

Sure :)  I'll eventually figure it out, but an example would
certainly speed up the process.

Thanks for your help,
Nedasa
Anonymous
May 21, 2005 12:24:05 AM

Archived from groups: rec.games.roguelike.development (More info?)

ryan.mcdaniel@gmail.com <ryan.mcdaniel@gmail.com>
wrote on 18 May 2005 21:55:47 -0700:
> Hey Everyone,
> I've long been a fan of rl games and have been playing adom and angband
> variants for the past five years. Recently I decided to start creating
> my own game and decided to use java(like JADE ;)  ). - (with Jbuilder).
> I'm pretty familiar with java, but haven't done much with UI stuff and
> am stuck on finding the best way (or even a way that works) to display
> my "tiles" to the screen (Right now I just want to use ascii).
> I'm trying to use swing... What do I use for the components? Can
> I can use a single JTextArea? Or somehow hundreds of little jpanels?
> It looked like Thomas B. created his own class deriving from
> swing.JPanel. Although I'm not sure the how many he used, etc.
> I've been googling it but can't seem to find anything. After spending
> a couple days reading this newsgroup, I decided to ask here. Let me
> know if you can help, or have open source code that does it, or have
> found a webpage that tells me.

I would highly recommend not using Swing for this. Swing is extremely
bloated and slow, and will typically run at half to 1/10th the speed of
an equivalent AWT solution. If you do use Swing, you'll want to use a
single component, extending JComponent. Using many components will be
unbelievably slow.

For making a terminal screen, you need to make a custom component and
draw each character (or tile) into a grid. While double-buffering and
only redrawing the dirty rectangle can make the display even faster,
it's not really essential in a turn-based game.

I have a simple terminal class I've used for some little apps, I'll
pull that out and publish it on my Java page today or tomorrow, as
"Terminal"
<http://kuoi.asui.uidaho.edu/~kamikaze/Java/&gt;

--
<a href="http://kuoi.asui.uidaho.edu/~kamikaze/"> Mark Hughes </a>
"Gibson and I dueled among blazing stacks of books for a while. [...] The
streets were crowded with his black-suited minions and I had to turn into a
swarm of locusts and fly back to Seattle." -Neal Stephenson, /. interview
Anonymous
May 21, 2005 4:56:30 AM

Archived from groups: rec.games.roguelike.development (More info?)

> I would highly recommend not using Swing for this. Swing is
extremely
> bloated and slow, and will typically run at half to 1/10th the speed
of
> an equivalent AWT solution. If you do use Swing, you'll want to use
a
> single component, extending JComponent. Using many components will
be
> unbelievably slow.

Okay, for some reason I was still equating AWT and Swing in my mind.

>
> For making a terminal screen, you need to make a custom component
and
> draw each character (or tile) into a grid. While double-buffering
and
> only redrawing the dirty rectangle can make the display even faster,
> it's not really essential in a turn-based game.
>
Okay, I'll keep that in mind. I read an article about
double-buffering so sort of understand it.

> I have a simple terminal class I've used for some little apps, I'll
> pull that out and publish it on my Java page today or tomorrow, as
> "Terminal"

Thanks for posting it. I've download it and glanced at it tonight. It
compiled and ran and produced a lot of the output I'm now working to
produce :) .

It is based on Canvas which is more heavyweight than Component... What
kind of adv. / disadvantages are there to using the two different
classes?




> <http://kuoi.asui.uidaho.edu/~kamikaze/Java/&gt;
>
> --
> <a href="http://kuoi.asui.uidaho.edu/~kamikaze/"> Mark Hughes </a>
> "Gibson and I dueled among blazing stacks of books for a while. [...]
The
> streets were crowded with his black-suited minions and I had to turn
into a
> swarm of locusts and fly back to Seattle." -Neal Stephenson, /.
interview
Anonymous
May 21, 2005 8:51:03 PM

Archived from groups: rec.games.roguelike.development (More info?)

Nedasa wrote:
> FreePascal eh? hmm, okay.

No! Don't take that *seriously*! He meant it as a *joke*!

:) 

--
http://www.gnu.org/philosophy/right-to-read.html
Palladium? Trusted Computing? DRM? Microsoft? Sauron.
"One ring to rule them all, one ring to find them
One ring to bring them all, and in the darkness bind them."
Anonymous
May 21, 2005 8:53:07 PM

Archived from groups: rec.games.roguelike.development (More info?)

gatti@dsdata.it wrote:
> I've not read Biskup's code, but I suppose he used the standard
> approach of custom widget drawing: a specialized "playfield" panel in
> which appropriate high level calls drew letters, highlights and so on.
> Swing offers comprehensive drawing primitives. Each letter can be drawn
> at pixel precise locations, you can leave room for borders around
> letters, you can mix letters drawn on the fly and bitmaps (maybe
> pre-rendered letters), and performance is good.

What is this phrase doing here, associated as it is with Java and even
with Swing! ("Performance is good")

--
http://www.gnu.org/philosophy/right-to-read.html
Palladium? Trusted Computing? DRM? Microsoft? Sauron.
"One ring to rule them all, one ring to find them
One ring to bring them all, and in the darkness bind them."
Anonymous
May 22, 2005 10:53:07 PM

Archived from groups: rec.games.roguelike.development (More info?)

Twisted One wrote:
> Nedasa wrote:
>
>> FreePascal eh? hmm, okay.
>
>
> No! Don't take that *seriously*! He meant it as a *joke*!

No I didn't :-P

--
At your service,
Kornel Kisielewicz (charonATmagma-net.pl) [http://chaos.magma-net.pl]
"Shadows universe is non-heroic, unfair, cruel and designed to
start playing on your nerves and sanity." -- Anubis
Anonymous
May 23, 2005 2:33:03 AM

Archived from groups: rec.games.roguelike.development (More info?)

Kornel Kisielewicz wrote:
> Twisted One wrote:
>> Nedasa wrote:
>>> FreePascal eh? hmm, okay.
>>
>> No! Don't take that *seriously*! He meant it as a *joke*!
>
> No I didn't :-P

Pascal *is* a joke, somewhat in the same vein as perl and INTERCAL, I
suspect. The more so because it (along with perl) are actually in
production use -- the joke's on hundreds of Webmasters, and even some
Microsoft employees!

--
http://www.gnu.org/philosophy/right-to-read.html
Palladium? Trusted Computing? DRM? Microsoft? Sauron.
"One ring to rule them all, one ring to find them
One ring to bring them all, and in the darkness bind them."
Anonymous
May 23, 2005 5:55:59 PM

Archived from groups: rec.games.roguelike.development (More info?)

My project uses a similar approach, but supports both text and image
graphics by rendering characters into BufferedImage objects...java's
excellent image/graphics libraries make this very easy, and the
performance is excellent. That way, nearly all display code can be
written independently of which graphics mode you're in.

http://roguelike-eng.sourceforge.net/

The classes of interest are rle.core.ui.CameraBase, TileCamera, and
TextCamera...

Drawing text to an image looks like this:

Image image = new BufferedImage(height,width,type);
image.getGraphics().drawString("a",x,baseline);

Good luck!

-Tom
Anonymous
May 23, 2005 8:00:36 PM

Archived from groups: rec.games.roguelike.development (More info?)

Twisted One wrote:
>> No I didn't :-P
>
> Pascal *is* a joke, somewhat in the same vein as perl and INTERCAL, I
> suspect. The more so because it (along with perl) are actually in
> production use -- the joke's on hundreds of Webmasters, and even some
> Microsoft employees!

Well, DoomRL is no joke (at least in that sense) so who cares what I
use? Anyway, you'll never fully understand the power of the DarkSide
unless you try... ;-D
--
At your service,
Kornel Kisielewicz (charonATmagma-net.pl) [http://chaos.magma-net.pl]
"11 years and no binary. And it's not vapourware" -- Igor Savin
Anonymous
May 23, 2005 8:00:37 PM

Archived from groups: rec.games.roguelike.development (More info?)

Kornel Kisielewicz wrote:
> Twisted One wrote:
>
>>> No I didn't :-P
>>
>>
>> Pascal *is* a joke, somewhat in the same vein as perl and INTERCAL, I
>> suspect. The more so because it (along with perl) are actually in
>> production use -- the joke's on hundreds of Webmasters, and even some
>> Microsoft employees!
>
>
> Well, DoomRL is no joke (at least in that sense) so who cares what I
> use? Anyway, you'll never fully understand the power of the DarkSide
> unless you try... ;-D

You just proved one of the points I've stated all along. Who cares
what language is used? As long as the end-user can't tell, it doesn't
matter. As long as it runs, is not buggy, and is capable of
cross-platform support, it doesn't matter. The end-user doesn't care
about the language, he just cares whether or not it works.


--
Read more about my three projects, SoulEaterRL,
Necropolis, and a little toy RL.

http://www.freewebs.com/timsrl/index.htm

--
Anonymous
May 23, 2005 10:12:40 PM

Archived from groups: rec.games.roguelike.development (More info?)

Tom Seufert wrote:
> My project uses a similar approach, but supports both text and image
> graphics by rendering characters into BufferedImage objects...java's
> excellent image/graphics libraries make this very easy, and the
> performance is excellent.

The performance is what? I thought you said this was implemented in
Java? ... *hopelessly confused*

--
http://www.gnu.org/philosophy/right-to-read.html
Palladium? Trusted Computing? DRM? Microsoft? Sauron.
"One ring to rule them all, one ring to find them
One ring to bring them all, and in the darkness bind them."
Anonymous
May 23, 2005 10:24:25 PM

Archived from groups: rec.games.roguelike.development (More info?)

In my experience, the approach of subclassing a single JComponent
(using Swing) does not constitute a performance hurdle. AWT is
probably faster, but for my game, the performance profiler reports only
5% or so CPU usage in drawing tasks while the player is running.

The benefit you get with Swing is that for non-speed sensitive parts of
your UI you can use JTable, etc; the Swing components are easily
configurable via renderers to show up however you want them to look...I
use JTable's for my inventory/equipment lists and it saved a lot of
hassle. AWT could probably do most of the same stuff, although I don't
believe there is an AWT table...

BTW, thanks for posting the Terminal class, Mark.

-Tom
http://roguelike-eng.sourceforge.net/
Anonymous
May 24, 2005 1:51:08 AM

Archived from groups: rec.games.roguelike.development (More info?)

Tom,

I've downloaded your code and am going to look through it over the next
couple days (thanks for posting it).

What is your CPU speed out of curiousity?
Anonymous
May 24, 2005 11:29:05 AM

Archived from groups: rec.games.roguelike.development (More info?)

I test on 2 PIII's, 500 and 700 MHz, and a Pentium M 1.6GHz.

All three test systems are laptops with 128, 320, and 512 MB RAM
respectively, and nothing special in terms of graphics cards.

SimpleGame runs very fast (ie, when the player runs, he moves too
quickly to really see) on the PIII's, and ridiculously fast on the
Pentium M.

Of note with respect to Java's performance in 2D is that recent JVM's
enable the use of hardware acceleration for images, so even in Swing
you can focus on simplicity rather than performance and still be ok, at
least if your system was made in the last 5 yrs or so...

-Tom
http://roguelike-eng.sourceforge.net
!