Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Making an RPG in Clojure (briancarper.net)
87 points by uggedal on Feb 21, 2010 | hide | past | favorite | 12 comments



Great stuff. I'd just like to add that working with Clojure+OpenGL has gotten a lot simpler with Zach Tellman's Penumbra, http://wiki.github.com/ztellman/penumbra/. Penumbra is well integrated with Leiningen so getting an OpenGL app up and running now takes a matter of minutes if not seconds.

I've been porting the Nehe tutorials to Penumbra and it's been ridiculously straightforward. Being able to update OpenGL on the fly via REPL is also really great fun, especially if you're used to the slow and tedious nature of OpenGL programming with pretty much everything else, http://github.com/swannodette/clj-nehe.


I've just posted an example of using Penumbra to create a simple game: http://news.ycombinator.com/item?id=1141556


This is one of the best articles I've read for a while. Really interesting insights into the writers thought process while coding.


I've played around with making a strategy game in Java/Scala. It was surprisingly easy to work with. I didn't take it too far but performance was adequate (for a 2D, turned based game).

Anyone with experience making a "real" game in Java. I know http://www.freecol.org/ is built in Java.

Just wonder why it's not more popular for indie/casual games. Does performance degrade that much?

I'm do mostly C# but I wanted to try the JVM for cross platform deployment.


I'm writing a Java-based game ( plug: http://www.metalbeetle.com/spaceexploration/ ). Performance can be very tricky if you want a good screen resolution, and there's lots of gotchas, like having to make sure that you force your sprites into the right colour space for your screen.

On the plus side you get a reasonably fast, garbage-collected language to write your game in.


Looks great! I'll definitely be giving this a try.


Back when I was looking at trying to write a game in java(pre 05 or so). Java was horribly broken for games. Sound support was so so. On the graphics side Java 3d had been abandoned with vague promises of Opengl support. None of the third party Opengl bindings were mature. So I went back to C++.


I really think it's just stigma. The joke goes:

Knock knock!

Who's there?

...

...

Java!

Of course today the performance of Java is fine, even comparable to C/C++ in some cases. Java2D is accelerated, the JDK comes with OpenGL/OpenAL, and there are all sorts of other libs like LWJGL and Slick. It might even be up there with XNA for desktop game development now, but I haven't done anything in-depth.


Perhaps it isn't the most popular example, but isn't Runescape done in Java?


Good point - it is. Though they have a somewhat strange approach of implementing everything - up to & including basic data structures - from scratch.


Also useful is 'line of sight' algorithm so the character can 'see'. Basically, you cast out rays of light (in 8 directions or 360 if you want to be really accurate), and when the light beam hits a solid object (a wall, for instance), you stop casting the ray.

All the non-solid objects encountered (eg, grass, tiles) are noted as 'visible'.

What you get is that the character (NPC or human) can see through windows and open spaces, but not through walls. Re-scan every time they move.


I like how he said that when the code didn't suck he would release the source, so really we'll never get that code. Wish he'd put it on a git so others could just commit to it.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: