Author Topic: Realtime Ruby WASD  (Read 10375 times)

quixotic

  • Newcomer
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Realtime Ruby WASD
« on: August 25, 2014, 08:45:31 PM »
Hello world. Interested in making a roguelike in Ruby. Learning project :)

At stage 0; what are some good libraries to play with? So far, checking out gosu, chingu, tcod, rubygame, etc....

Trying to compare UI; any input would be appreciated.

Objectives:
*Realtime
*Sprites(For communicating direction-relative stuff; Field-of-View, blocking, backstab, etc.... asis I'm just modifying fonts in TCOD)
*WASD+Mouse(TCOD.mouse_get_status(lbutton_pressed? x:y)  sort of dealy; WASD+mouse feels visceral)
*Some sort of code for transitioning between dungeon tiles smoother; not a priority yet, but it'd be nice down the line
*More "Triangle Wizard" or "Pyromancer" than "Nethack"

Cfyz

  • Rogueliker
  • ***
  • Posts: 194
  • Karma: +0/-0
    • View Profile
    • Email
Re: Realtime Ruby WASD
« Reply #1 on: August 26, 2014, 10:14:34 AM »
Can't help but recommend to look at my BearLibTerminal library (http://foo.wyrd.name/en:bearlibterminal), it matches pretty much everything you mentioned. Download the archive and skim over the simple demonstrations in SampleOmni app, that should give a good idea of what it capable of.

quixotic

  • Newcomer
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Realtime Ruby WASD
« Reply #2 on: August 26, 2014, 09:49:08 PM »
@cfyz- Heh. Have already been skimming bearlibterminal, Rubygame, libgosu, OpenGL, SDL, etc... Was already using libtcod. I'm at the step where it seems browsing others' code and libraries is more useful for learning than coding :-) Logic/systems is fun, but the "other stuff" I need to figure out.

I'd rather my roguelike not be "The first roguelike written with nokogiri*", finding intuitive libraries that work is part of the !!fun!!. Deleted(well, there are backups) my TCOD code today in a ragequit to start writing some things in Gosu.

*actually. using scraped databases to procedurally generate would be interesting; if you're using BLS data, an economic downturn could mean the death of your character ;) Scraping and PDF manipulation is basically all the apps I've coded so far.

CaptainKraft

  • 7DRL Reviewer
  • Rogueliker
  • *
  • Posts: 60
  • Karma: +0/-0
    • View Profile
Re: Realtime Ruby WASD
« Reply #3 on: September 11, 2014, 01:26:16 PM »
Since this is a learning project, you might want to try implementing some basic roguelike libraries yourself. Use libtcod as a reference and see if you can get some dungeon generation, fov, etc. up and running. You'll learn a lot this way.
Build a man a fire, and he'll be warm for a day.
Set a man on fire, and he'll be warm for the rest of his life.

quixotic

  • Newcomer
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Realtime Ruby WASD
« Reply #4 on: September 24, 2014, 02:58:07 AM »
@CaptainKraft-
Dungeon generation/etc. have always been intended in Ruby :-) They're actually not that bad, logical operations are easy/fast/expressive. I can't speak any other language out loud and have other people understand what I said :P

The problem was drawing(I don't want to learn openGL/other languages for his project). As a realtime game, sprites/layers/moveable fonts were kind of a necessity... drawn not necessarily fast or pretty, but not ridiculously slow either.  BearLibTerminal pretty much enabled me to move forward.

(AKA "thanks again Cfyz")

Dungeon generation is leaning toward Caves/Fortress/Swamp kind of settings. Caves being some flavor of random walkish behavior, fortress levels being more cartesian with premade "rooms" to plunk down near eachother and connect, swamps being... I dunno... some kind of gaussian nightmare? :P Tile types(E.g. "slow tiles" or "poison" for swamps) won't really be implemented for a long while, so swamps will be pretty straightforward. Although if you somehow magically find a chokepoint in a swamp, treasure it.

mcouk

  • Newcomer
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: Realtime Ruby WASD
« Reply #5 on: September 27, 2014, 09:22:20 AM »
Like yourself I'm wanting to use Ruby to write games and from what I can see, the best place to start would either be directly in the terminal (pure ASCII) or to use Gosu.

I recently picked up the book "Developing Games With Ruby" (https://leanpub.com/developing-games-with-ruby). It's still WIP (80% complete) but there's enough in there to get you going. I found it very useful and at $10, that has to be a bargain!

Some days back I updated the Ruby page on Roguebasin and included some useful resources which may be worth checking out (http://www.roguebasin.com/index.php?title=Ruby), but I'll go over them again here for completeness.

The RubyQuiz website (http://rubyquiz.com) has some really cool code* which I think can be used as examples for RL development. See the Sokaban entry (http://rubyquiz.com/quiz5.html), it's a full game with examples that use Gosu, Curses, OpenGL and plain old terminal. James's 'unix' entry could be useful for a pure ASCII RL jump off point. There's also an AD&D Dice Roller (Dennis Ranke's full_parser_roll.rb is very interesting), Dungeon Generation examples and some for Maze Generation.

I hope some of that is useful.


* much of which is quite old now, but of those examples I tired the only thing I had to do was update how the files are included. Basically change 'require' to 'require_relative' and you'll be good to go.

quixotic

  • Newcomer
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Realtime Ruby WASD
« Reply #6 on: October 20, 2014, 04:54:36 AM »
@mcouk-
Thanks! Reading now. A storm knocked me for a loop, learned to make backup -.- The RubyQuiz site is actually what convinced me it might be a fun project :-)

Updated game name:
"Treasure Bro"
AKA
"The prequel to 'Treasure Bros', although the chance of netcode is effectively 0"

Because loot is really what makes my chest thump, as a player.