Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Making A Roguelike  (Read 1309 times)

ArizonaGM

  • Escaped Lunatic
    • View Profile
Making A Roguelike
« on: March 04, 2010, 10:49:24 pm »

Hey all, I've been inspired to make a roguelike because the gaming world just doesn't cater to my specific needs in games. What languages are good to use to program roguelikes?
Logged

qwertyuiopas

  • Bay Watcher
  • Photoshop is for elves who cannot use MSPaint.
    • View Profile
    • uristqwerty.ca, my current (barren) site.
Re: Making A Roguelike
« Reply #1 on: March 05, 2010, 07:49:19 pm »

Almost anything works, so it is best to work with what you know.

Often, though, low-level languages like C and C++ will be somewhat worse simply because you need to understand more concepts to work with them(and mannage your own memory), while some high-level languages might not be fast enough to add neat features later.

Generally, though, anything works, so use what you understand best.
Logged
Eh?
Eh!

winner

  • Bay Watcher
    • View Profile
Re: Making A Roguelike
« Reply #2 on: March 06, 2010, 02:24:02 am »

the seven day rogue like competition is starting about now.  So you chose a good time to ask.
As Qwerty said the best language is the one you already know.  If you show what you have then we can probably help you wherever you get stuck.
Logged
The great game of Warlocks!

UristMcGunsmith

  • Bay Watcher
  • "Shhh! My common sense is tingling!"
    • View Profile
Re: Making A Roguelike
« Reply #3 on: March 08, 2010, 12:35:11 pm »

EDIT: Nevermind
« Last Edit: March 08, 2010, 02:44:57 pm by UristMcGunsmith »
Logged

Grendus

  • Bay Watcher
    • View Profile
Re: Making A Roguelike
« Reply #4 on: March 09, 2010, 09:28:24 am »

A lot depends on what you're familiar with. An object oriented language would probably be best, objects and inheritance would make enemy classes easier to work with. I tried something similar to this in basic, and keeping track of the player and enemies with array indexes is harder than a single list of them.

Personally, I'd recommend Java, but I'm fairly familiar with it (better with C++, but it's harder to work with). Ultimately, so long as the language you know is viable for this (I wouldn't recommend trying to do this with QBasic, for example) you can probably do a roguelike in it.
Logged
A quick guide to surviving your first few days in CataclysmDDA:
http://www.bay12forums.com/smf/index.php?topic=121194.msg4796325;topicseen#msg4796325

qwertyuiopas

  • Bay Watcher
  • Photoshop is for elves who cannot use MSPaint.
    • View Profile
    • uristqwerty.ca, my current (barren) site.
Re: Making A Roguelike
« Reply #5 on: March 09, 2010, 06:12:51 pm »

Technically, enemy classes can be done nearly was well though a single function that has the sole purpose of being a massive swtich block to send the AI where it needs to go, but in low level languages such as C, you can do the same thing with a function pointer. It wouldn't work as well for saving, but you could swap out one AI for another at runtime with no speed penalty at all.

Still, one nifty feature often has consequences. If you CAN use function pointers, you most certainly would have to deal with regular pointers, and all of the potential crashes, bugs, and memory leaks.

Some languages have something similar to a function pointer but diffrent. I know that Actionscript's "onDragOver=function(){..." sort of system would be practically the same thing, only as a high-level solution. Probably many other high-level languages would have a feature like that, and an actual function pointer, though same functionality, would only be found at low levels where storing the numeric memory address of a function is a good tradeoff(efficiency and crashes if the programmer messes up, compared to a slower system that likely uses a string or internal ID as a refrence. Actually, an internal ID would be very similar to the whole massive switch block, except that the programmer wouldn't need to bother knowing that it even exists...)
Logged
Eh?
Eh!

eerr

  • Bay Watcher
    • View Profile
Re: Making A Roguelike
« Reply #6 on: March 11, 2010, 09:14:51 pm »

ASCII Lab has code necessary to draw in C #.

Which is both amazing, and object oriented.


Java is extremely explicit(Mucho extra typing), but is most perfectly reliable compared to other languages.

Basically, the only common errors are null pointer, divide by zero, or parser error. Everything else is very specific.
Very verbose
« Last Edit: March 13, 2010, 05:54:43 pm by eerr »
Logged