Not logged inGosu Forums
Forum back to libgosu.org Help Search Register Login
Up Topic Gosu / Gosu Showcase / "QuickRPG" remake
- By DivineDominion Date 2009-03-24 15:25 Edited 2009-08-01 12:55


Back in 2001 it took me a week to create an RPG walkaround-demo in Blitz Basic. I never finished anything comparable after that.

It took me 2 days with Ruby and gosu to re-create the engine. I had no original source left, so it took me a while to figure out how I saved the maps, how the scripts worked and such. Still I'm not sure how NPC walking cycles used to be configured.

You can grab the current source from my github.com project where I put the old Win32 binary -- which shouldn't run on your PC since it attempts 320x240 in fullscreen mode (!!! what a stupid idea that was ...). 640x480 was supported as well but I lost the binary. The OSX .app is obviously new and works fine.

If you like you could as well modify the contents of this walkaround demo by taking a look at the scripts. Without a map editor it's not possible to create new maps. Take a look at the project Wiki on github.com where I might explain the .map format in the future.

As of today, 2009-03-24, the code was a lot of "hacking". Blitz Basic, the game's initial language, didn't support OOP so there's a huge gain of readability and structure. Yet, I just wanted to re-implement every feature possible. Refactoring will be the next item on my to do list right after "figure out how NPC-initialization scripts work" and "time animations (i.e. slow down)". :)

Comments appreciated, though I doubt you'll be able to make it through that code just yet.

D O W N L O A D

From github.com project (cutting edge!)
Packed qrpg.tar.gz (updated regularily but not as often as the github repository)
Patch (NEW): FPS.rb missing, 2x movement speed: patch_v1_speed-and-fps.zip

Later modifications to this post

(2009-03-24)
Okay, download on github.com doesn't work or so it seems. Added a TAR.GZ archive.

(2009-03-25)
Added two small screenshots of the current app. You can trigger FPS count by hitting "F" and the on-map-debugging-stuff by hitting "D".
The archive only contains the deployed Mac OS X .app file. To get the sources, please use the link to GitHub.com and download everything from there, seems
to work again.

(2009-03-27)
Translated game content and added NPC movement. They don't collide, though. I'll OOP-ify the game further to implement this.

(2009-08-01)
Added a patch for faster char movement and fixed that 'fps.rb' was missing in the archive.
- By banister Date 2009-03-24 19:19
hey buddy, put up some screenshots or video link too :)
- By DivineDominion Date 2009-03-26 00:42
Good point :)




Please keep in mind that I didn't translate the texts to English yet (picture #2). They don't mean anything, though, so don't worry.

I didn't point out that the game's native resolution was 320x240 and I didn't bother to implement 2x (or more) zoom after rendering just yet. If it's not playable for you at all (no speed limit might be an issue as well *sigh*) just drop me a line with the reason and I'll try to fix it soon :)
- By Shinobi Chef Date 2009-05-11 03:55
How do I run the game/demo so I can test it
when  trying to run the main.rb I get the following error

>ruby main.rb


C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require': no such file to load -- ./fps (LoadError)
  from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require'
  from main.rb:34

>Exit code: 1

- By AmIMeYet Date 2009-05-12 15:39
Yeah, I had that aswell..
It's been a while but I think this is the only stuff I changed, to make it work:

1) Open main.rb
2) Go to line 45 and comment out (#) '   require './fps'   '
3) Go to line 88 and comment out (#) '    FPS::tick milliseconds()    '
4) Go to line 101 and comment out (#) '   FPS::draw if $show_fps   '
- By Shinobi Chef Date 2009-05-13 01:12
Thanks ,Ill give that a try :)
- By Shinobi Chef Date 2009-05-13 02:09
Thanks that worked great,I got the game running now!

any idea on how you would speed the game up??as it is running a little slow
- By AmIMeYet Date 2009-05-13 12:43
No, not a clue... because I can run it fast enough...
Do you see it lagging or something? Or do you just not like the player's speed?
- By Shinobi Chef Date 2009-05-14 13:53
No it dont lag,it would good though if the players speed was a little faster ,say 33% faster
- By AmIMeYet Date 2009-05-14 16:51
Ah,
Well, I tried it for you, but it failed.. XD
- By Shinobi Chef Date 2009-05-16 06:44
You tryed to speed the game up ,though it didnt work is that what u mean?
- By AmIMeYet Date 2009-05-16 09:55
Yeah.. it would make a lot of bugs, and when walking you would only walk half a tile at a time
- By Shinobi Chef Date 2009-05-16 11:00
Thanks for trying

yeh it does have a couple of bugs
- By Shinobi Chef Date 2009-05-18 23:58
it may have a few small bugs at the moment,though with a little work it could be a very nice base for a great 2D RPG

you gotta expect a few bugs when it only took 2 days,well done DivineDominion!

any chance DivineDominion you can make it run a bit faster and get rid of the main chr dissappearing when other people walk near him?
- By DivineDominion Date 2009-08-01 12:53 Edited 2009-08-01 12:56
Sorry mates, vacation was over but now I've got time again.  Of course that's a lame excuse for not supporting you, I'm really sorry for that!

I wonder why I didn't include the 'fps.rb' file in the repository ... that's really stupid.  I changed the source a lot since then, like implementing event dispatching and sending messages between the various parts of the game logic.  Since then, my 'fps.rb' is way too much altered to work with the old GitHub source. 

The new bundle is just not finished yet.  I'll work on it soon after I finish my last essay for university.

You can download a 2x-movement-speed patch with fixed main.rb included (same file as further down in this post).

---

Well, speeding up the character really won't be that easy.  The old code relies on the tiles being 16 pixels in each direction.  Animation takes 16 steps, the character moves 16 pixels during each cycle, the camera scrolls 16 pixels as well when triggered (there's no direct link between char movement and map scrolling, they just behave the same :)).

When I finish my current setup, it should by far be easier to modify movement speed.

For now, download the modified files and overwrite the old ones.  The FPS-fix is already included.  The char moves twice as fast then.  I think the real problem is the graphics' sizes and the huge map.  On no console would you find that big a map, it just takes too long to travel and there's too much space between stuff.  I'll fix contents when the engine is ready.

---

Here's the changes to apply manually:

REPLACE 'player.rb'
class Player < Char
  def initialize(image)
    super(0, 0, image)
  end
 
  def update
    animate! if animating?

    walk! if walking?
   
    if @step >= 16
      @step = 0
    else
      @step += 2
    end
   
    return [@x, @y]
  end
 
protected
  def walk!
    raise "not walking" unless walking?
   
    if @step >= 16
      @walking = false
      return :finished
    end
   
    # Move on screen
    case @direction
    when :up
      @y_off -= 2
    when :down
      @y_off += 2
    when :left
      @x_off -= 2
    when :right
      @x_off += 2
    end
   
    if @y_off < 0
      @y_off += 16
      @y -= 1
    elsif @y_off > 15
      @y_off -= 16
      @y += 1
    end
   
    if @x_off < 0
      @x_off += 16
      @x -= 1
    elsif @x_off > 15
      @x_off -= 16
      @x += 1
    end
  end
end


map.rb : ll. 391 -- 409, replace 'Map::animate_scrolling'
  def animate_scrolling
    if @steps >= TILE_SIZE
      @scrolling = false
      return :finished
    end
   
    case @direction
    when :up
      @scrolled_y -= 2
    when :down
      @scrolled_y += 2
    when :left
      @scrolled_x -= 2
    when :right
      @scrolled_x += 2
    end
   
    @steps += 2
  end
- By Shinobi Chef Date 2009-08-01 12:57
Thanks heaps :) I will have a look
Up Topic Gosu / Gosu Showcase / "QuickRPG" remake

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill