Not logged inGosu Forums
Forum www.libgosu.org Help Search Register Login
Up Topic Gosu / Gosu Showcase / RPG Paper Maker (a 3D game editor)
- - By Wano Date 2015-10-10 14:58
Hi ! I'm coming here to show you my project, and I'm using that awesome Gosu Library with openGL. Maybe you already know bestguigui, he is the one who taught me how to combine ruby and openGL. :)

You can directly see more informations on RM.net here : http://rpgmaker.net/games/8053/







For GUI, I'm using wxruby library (awful). It's a really big project that will be commercialized ! I trully want to thanks the Gosu developer for his work and to support him as much as I can. I hope this project will encourage him to update Gosu more and more !
Parent - - By jlnr (dev) Date 2015-10-10 15:57
Wow, the indoor screenshot looks awesome, and the transition to battle even more so!

Also liked this rotation demo in the forum thread: http://img107.xooimage.com/files/6/9/8/maison-45ee599.gif

Let me know if you encounter any problems in Gosu! Great work. (And I'm a little jealous at how busy the RPG Maker forums are :P)
Parent - - By Wano Date 2015-10-11 15:36
Thank you very much, and yep I'd tell you if I got any problem. The only thing I think is missing on your library is a multi-window support. For example, I'd like to create a laucher before running the game and I have to fiddle with killing process. Even for displaying errors, I have to run a wxruby frame.
Parent - - By jlnr (dev) Date 2015-10-11 15:37
Which version of Gosu do you use? Closing and opening windows should work fine in the current version, the only limitation being that you can only .show one window at a time.
Parent - - By Wano Date 2015-10-11 17:03
Oh yeah I'm using the last version. When I show this class :

class Launcher < Gosu::Window
  def initialize
    super(200, 500, false)
    self.caption = "test"
  end

  def button_down(id)
    if id == Gosu::KbF12
      Window.new.show
      exit
    end
  end
end


And for 1 second, I can see a kind of 2 windows fusion while the second window is created :



Exept this, all is working good. But maybe I'm doing that bad ?
Parent - - By lol_o2 Date 2015-10-11 17:18
Use close instead of exit and show the second window only after the first one closes. Exit closes whole program.

if id == Gosu::KbF12
    close
    Window.new.show
end
Parent - By Wano Date 2015-10-11 17:31
It's not working, I have the same result but the new Window created is only a black screen...
Parent - - By jlnr (dev) Date 2015-10-11 21:14
button_down is called in the main loop that Launcher#show starts. So basically the launcher window will be stuck forever in its loop, waiting for the whole main Window#show loop to finish. The call stack will be (among others) main > Launcher#show > Launcher#button_down > Window.show.
You'll have to store the launcher settings into some sort of global variables, then let the launcher close itself, and then create the new window. Something like:

Launcher.new.show # stores settings in global $settings_from_launcher
# .show returns at some point because .close was called
Window.new($settings_from_launcher).show


(Assuming that the point of the launcher is to decide on settings)

Hope that helps (and works-haven't tested it)!
Parent - - By Wano Date 2015-10-14 17:57
Why should I let the launcher close itself instead of close it manually ? I don't understand why you are using global variables too, what is the link between my window-fusion ?
Parent - - By jlnr (dev) Date 2015-10-18 09:59 Edited 2015-10-18 10:05
Imagine that the implementation of Window#show looks like this (pseudocode):

def show
  show_OS_window_on_screen()
  while not self.closed?
    self.button_down(x) for each x that the OS reports
    self.update()
    self.draw()
    sleep(16ms)
  end
  hide_OS_window()
end


When you create a second window and call .show on it from within button_down, you will have two nested while loops, one for each window, and the outer loop will be stuck until the inner while loop completes. So the first window never has a chance to clean up and hide itself.
The only way around this is to wait for the first call to Window#show to return (doesn't matter if you've manually called close or if the user clicks the X), and only then show the second window. So, more like:

Launcher.new.show
puts "the first window has been closed now"
GameWindow.new.show


The global variable was just an example for you could pass data between both windows. I don't know what your launcher actually does, so please ignore that bit.
Parent - By Wano Date 2015-10-25 19:30
Oh thanks that's perfectly clear now ! I did this one and this is nice working, and I'm now sure that there is not a behind window looping. I now understand why you were talking about global variables, don't worry. :)
Parent - By bestguigui Date 2015-10-19 17:49
(Don't be too jealous. There is a lot of garbage out there).
Parent - - By jahmaican Date 2015-10-12 08:47
I see the screenshots and think "bestguigui" immediately. I was always quite, erm, affectionate with this "2.5D" gfx style - good job!
Parent - By Wano Date 2015-10-14 17:58
Ahah yep I love his work so much too. :)
Parent - By bestguigui Date 2015-10-19 17:47
Thanks ! But Wano creates all the graphics, so she's doing a really better job there ! :)
Parent - - By shawn42 Date 2015-10-13 14:19
Wano,
This looks incredible! Amazing project! Are you going to open source it or sell it? I'd love to see how you wrangled openGL and Gosu. :)

Keep posting updates! (Is there a demo I can play with?)
Parent - By Wano Date 2015-10-14 18:22
Thank you !

First, this will be a commercial product. However, such as RPG Maker (in recent versions), there will be a script part with the main code to display your game. So you will be able to see exactly how I did.

Secondly, there will be a demo ! But you have to wait a moment for it.
Up Topic Gosu / Gosu Showcase / RPG Paper Maker (a 3D game editor)

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill