Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Any tutorials for creating a Roguelike in Java?

2,208 views
Skip to first unread message

goomb...@gmail.com

unread,
Jul 27, 2012, 12:40:21 AM7/27/12
to
I saw the excellent tutorials for creating a Roguelike in C and C++, and they looked great and easy to follow - but I'm hoping to improve my abilities with Java, my main language. So far I've found that Java isn't natively good for the Roguelike because it doesn't natively allow console access. I've found the PDCurses libraries but have no clue what to do with those and fumbling around by myself isn't working.

Does anyone know of a concise beginners Roguelike tutorial using a Java approach/implementation? Would greatly appreciate any help.

goomb...@gmail.com

unread,
Jul 27, 2012, 1:40:11 AM7/27/12
to
I don't know if it's possible to edit the original post but, I've decided to use the LWJGL in order to do this. I was able to get it set up and running fairly easily. Any tutorials for this would be especially appreciated.

TychoDev

unread,
Jul 27, 2012, 5:49:02 AM7/27/12
to
Op vrijdag 27 juli 2012 06:40:21 UTC+2 schreef goomb...@gmail.com het volgende:
> I saw the excellent tutorials for creating a Roguelike in C and C++, and they looked great and easy to follow - but I'm hoping to improve my abilities with Java, my main language. So far I've found that Java isn't natively good for the Roguelike because it doesn't natively allow console access. I've found the PDCurses libraries but have no clue what to do with those and fumbling around by myself isn't working.
>
> Does anyone know of a concise beginners Roguelike tutorial using a Java approach/implementation? Would greatly appreciate any help.

Hi there,

At the moment I'm working on a roguelike using LWJGL in java. I'm willing to make tutorials for a LWJGL-roguelike. Unfortunately I'm going for four weeks on vacation tomorrow, so I can only begin in early September.

Do you prefer tutorials in text or in a video (like youtube) tutorial series,

Cheers,

TychoDev

goomb...@gmail.com

unread,
Jul 27, 2012, 4:38:23 PM7/27/12
to
That would be amazing. I personally prefer text tutorials for coding because you can go at any pace. I find this helps me make sure I really understand every line as I type.

Thanks so much for offering a tutorial!

Michał Bieliński

unread,
Jul 27, 2012, 4:47:40 PM7/27/12
to
Once upon a time, goomb...@gmail.com wrote thus:
> Does anyone know of a concise beginners Roguelike tutorial using a Java
> approach/implementation? Would greatly appreciate any help.

Trystan Spangler has one over there. Not sure if it matches your criteria:

http://trystans.blogspot.com/2011/08/roguelike-tutorial-01-java-eclipse.html

--
Michał Bieliński

Jürgen Lerch

unread,
Jul 27, 2012, 8:55:20 PM7/27/12
to
Saluton!

Am Freitag, den 27.07.2012, 02:49 -0700 schrieb TychoDev:
> Op vrijdag 27 juli 2012 06:40:21 UTC+2 schreef goomb...@gmail.com het volgende:
> > I saw the excellent tutorials for creating a Roguelike in C and C++, and they looked great and easy to follow - but I'm hoping to improve my abilities with Java, my main language. So far I've found that Java isn't natively good for the Roguelike because it doesn't natively allow console access. I've found the PDCurses libraries but have no clue what to do with those and fumbling around by myself isn't working.
> > Does anyone know of a concise beginners Roguelike tutorial using a Java approach/implementation? Would greatly appreciate any help.

Actually, there is at least the start of a java roguelike tutorial
on Roguebasin:
http://roguebasin.roguelikedevelopment.org/index.php/Java_Roguelike_Tutorial

Ad ASCII!
JuL

--
jur...@gmx.net / Übrigens: Elfen tragen keine Rollis.
Jürgen ,,JuL'' Lerch /

Gerry Quinn

unread,
Jul 28, 2012, 9:06:08 AM7/28/12
to
In article <653be305-65cb-4f37...@googlegroups.com>,
goomb...@gmail.com says...
> I saw the excellent tutorials for creating a Roguelike in C and C++, and
> they looked great and easy to follow - but I'm hoping to improve my
> abilities with Java, my main language. So far I've found that Java
> isn't natively good for the Roguelike because it doesn't natively allow
> console access. I've found the PDCurses libraries but have no clue what
> to do with those and fumbling around by myself isn't working.

Why bother with console access? You have windows and controls at your
fingertips that do everything a console does, only better.

- Gerry Quinn

goomb...@gmail.com

unread,
Jul 29, 2012, 2:54:57 AM7/29/12
to
On Saturday, July 28, 2012 8:06:08 AM UTC-5, Gerry Quinn wrote:
> In article <653be305-65cb-4f37...@googlegroups.com>,
>
> g says...
>
> > I saw the excellent tutorials for creating a Roguelike in C and C++, and
>
> > they looked great and easy to follow - but I'm hoping to improve my
>
> > abilities with Java, my main language. So far I've found that Java
>
> > isn't natively good for the Roguelike because it doesn't natively allow
>
> > console access. I've found the PDCurses libraries but have no clue what
>
> > to do with those and fumbling around by myself isn't working.
>
>
>
> Why bother with console access? You have windows and controls at your
>
> fingertips that do everything a console does, only better.
>
>
>
> - Gerry Quinn

Hmm, I guess I just wanted to maintain the original roguelike feel. I'll be making more adventure/RPGs once I get the hang of something basic down though, so I'll use the built in stuff in the future when I go for Sprites.

goomb...@gmail.com

unread,
Jul 29, 2012, 2:53:42 AM7/29/12
to
On Friday, July 27, 2012 3:47:40 PM UTC-5, Michał Bieliński wrote:
> Once upon a time, goomba wrote thus:
I actually discovered this yesterday and am now halfway through it. EXCELLENT tutorial. Still trying to absorb all their is. It's a bit higher level programming than I had to do through college, which is great though. Lots of learning.

goomb...@gmail.com

unread,
Aug 1, 2012, 2:40:09 PM8/1/12
to
On Sunday, July 29, 2012 10:48:31 AM UTC-5, XLambda wrote:
> On 28 Jul., 02:55, Jürgen Lerch <jyn...@gmx.de> wrote:
>
> > Saluton!
>
> >
>
> > Am Freitag, den 27.07.2012, 02:49 -0700 schrieb TychoDev:
>
> >
>
> > > Op vrijdag 27 juli 2012 06:40:21 UTC+2 schreef goomb...@gmail.com het volgende:
>
> > > > I saw the excellent tutorials for creating a Roguelike in C and C++, and they looked great and easy to follow - but I&#39;m hoping to improve my abilities with Java, my main language. So far I&#39;ve found that Java isn&#39;t natively good for the Roguelike because it doesn&#39;t natively allow console access. I&#39;ve found the PDCurses libraries but have no clue what to do with those and fumbling around by myself isn&#39;t working.
>
> > > > Does anyone know of a concise beginners Roguelike tutorial using a Java approach/implementation? Would greatly appreciate any help.
>
> >
>
> > Actually, there is at least the start of a java roguelike tutorial
>
> > on Roguebasin:http://roguebasin.roguelikedevelopment.org/index.php/Java_Roguelike_T...
>
> >
>
> >         Ad ASCII!
>
> >         JuL
>
> >
>
> > --
>
> > jur...@gmx.net       / Übrigens: Elfen tragen keine Rollis.
>
> > Jürgen ,,JuL'' Lerch /
>
>
>
> Yeah, I was the one who started that. I never got really far, a)
>
> because I had a ton of other work to do and b) because many people,
>
> especially over at roguetemple, kind of looked down on the language.
>
> "Real programmers" use C++, you know. That was very discouraging.
>
>
>
> I can really recommend Trystan's tutorial, I myself copied some
>
> patterns from there.
>
>
>
> Also, if you run into any coding problems, consider posting at the
>
> roguetemple. At least some people over there know their java-fu. :)

I've been using Trystan's tutorial and have a pretty sick basic roguelike now. I feel bad copying code, but I'm getting to the point where I can make lots of unique changes. I added criticals and misses, as well as critical failure (drop weapon if you roll a 0 to hit) and once I learn how to implement save/load I've got some big plans.

XLambda

unread,
Aug 3, 2012, 6:22:44 AM8/3/12
to
Save/load is super easy. Just let all your classes implement
Serializable (make sure that they *are* serializable, though) and code
a simple function to write them into a file and bam, you're done.
Takes only a few minutes.

yam655

unread,
Aug 4, 2012, 10:03:00 AM8/4/12
to
On Friday, July 27, 2012 12:40:21 AM UTC-4, goomb...@gmail.com wrote:
> Does anyone know of a concise beginners Roguelike tutorial using a Java
> approach/implementation? Would greatly appreciate any help.

I'm the author of the Blacken roguelike library for Java:

https://code.google.com/p/blacken/

(Right now, 1.0 is stable -- but has some major issues. Blacken 1.1 will be released next month in time for the ARRP.)

I'm planning on writing a comprehensive tutorial for writing Roguelikes with Blacken. Comprehensive as in start with Hello World, and end with a coffee-break roguelike. (And available in all standard ebook formats.)

My goal is to be done with it in December so that folks can read it and try out the examples while they're researching material for the 7DRL.

Cheers,
Steven Black

Eben Howard

unread,
Aug 12, 2012, 4:26:30 PM8/12/12
to
I'm the author of SquidLib, which uses Swing for the display elements.

https://github.com/SquidPony

SquidLib vs. Blacken (Both Java RL Libs):

Blacken is oriented towards implementing rules of a roguelike, with some display elements. It uses curses-style functions.

SquidLib is primarily oriented towards displaying monospaced text in a JComponent, allowing easy integration into Swing GUIs. For example, I used two different "consoles" in my game EmoSquid within the same GUI JFrame.

Both libraries include future feature sets that largely mimic libtcod (the best RL library currently, but not in Java), but do so in different ways. Both are also under active development with the developers willing to listen to feature requests.

You can see the games I've been making with SquidLib here: http://squidpony.com

The library comes with come brief examples (it's really easy to use), and the source of my games are generally available upon request.

One feature SquidLib has in the next release which I believe is not part of the plan for Blacken is animations for tiles. For example you can call bump(x, y, Direction.NORTH) to make the character at x,y do a bump move upwards.

For a comprehensive feature list for SquidLib, go here: http://roguebasin.roguelikedevelopment.org/index.php/SquidLib

Check them both out and see what you like.
Message has been deleted

Ido Yehieli

unread,
Aug 23, 2012, 1:59:50 PM8/23/12
to
On Sunday, August 12, 2012 10:26:30 PM UTC+2, Eben Howard wrote:
> I'm the author of SquidLib, which uses Swing for the display elements.

A bit off-topic, but what would you use for saving games or settings in an applet? local file-system access requires the user to give you permission via a scary looking pop-up window. In flash I just use a Local Shared Object, which is pretty easy to use and gives me enough room for everything I need to save. With js you can use cookies or (with html5) LocalStorage (which is much better).

What do you use with java applets?

-Ido.

yam655

unread,
Aug 26, 2012, 2:06:17 AM8/26/12
to
On Thursday, August 23, 2012 1:59:50 PM UTC-4, Ido Yehieli wrote:
> A bit off-topic, but what would you use for saving games or settings in
>an applet? local file-system access requires the user to give you permission
>via a scary looking pop-up window. In flash I just use a Local Shared Object,
>which is pretty easy to use and gives me enough room for everything I need to
>save. With js you can use cookies or (with html5) LocalStorage (which is much
>better).
>
> What do you use with java applets?

For Blacken I don't currently have direct applet support. I'm currently recommending JNLP instead. JNLP can be hosted from within your normal source repository, so it doesn't require anything fancy at all. (I've heard of them being hosted directly on Google Sites, too, but I've not yet tried that.)

There are similar security issues with JNLP, of course.

The pop-up window for local file storage requires the JARs be signed. You only even get a "scary looking" pop-up if it is self-signed. There's literally no option to use the "all-permissions" JNLP applications without some sort of code-signing.

My personal recommendation is that coffee-break Blacken games not bother saving anything. If it's a ~15 minute game then the cost vs. benefit of having a saved game versus just starting over is pretty small.

I suspect the pop-up window you're seeing for applets is also about code-signing. There's only one way to avoid code-signing: Uploading the saved game to the same server the JNLP/applet was hosted on. That's an option that totally doesn't scale, though.

The best option is to just get a cert and sign your code or make people download and install it.

Cheers,
Steven Black

Eben Howard

unread,
Aug 26, 2012, 3:05:18 AM8/26/12
to
Steven summed it up. If you want applet style things you should choose between not having saves or not having Java, unless you want to do server-side saving.

Scary security certificate pop-ups are a real problem :(

SquidLib does support both Applets and JNLP since it's a JComponnet based thing, and I've done both with a puzzle game I built as a demo, but Flash or HTML5 or pretty much anything is better than Java for interactive web deployment.

-Eben
Message has been deleted
0 new messages