Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for IDE-like debugging of RGSS / ruby scripts #198

Open
Poityu opened this issue Apr 28, 2018 · 8 comments
Open

Support for IDE-like debugging of RGSS / ruby scripts #198

Poityu opened this issue Apr 28, 2018 · 8 comments

Comments

@Poityu
Copy link

Poityu commented Apr 28, 2018

The idea is that it would be much easier to debug scripts, with step through/step into...etc functions provided by the IDE.

I saw some people mentioning using IDEs instead of the engine editor with MV, which shouldn't be too difficult because MV is backed by Javascript.

For engines with RGSS, I am under the impression that this would require quite some hacking, correct? (Likely involves RubyInline/Rice/FFI)
This is because both the official and the mkxp binary are exe first, Ruby second (Binary runtime that calls into Ruby script), where as MV is Javascript first. (Javascript that calls into JS Runtime)

Appreciate clarifications or confirmations.

@Ancurio
Copy link
Owner

Ancurio commented Apr 29, 2018

Last time I checked (a long time ago), there was no simple way to step through a running ruby script, look at (local) variables etc., has this changed meanwhile?
I don't like the idea of people using mkxp to create new games (because the engine architecture of RPG Maker is flawed, see #103), but I would still appreciate an effort like this, simply for the fact that it's a nightmare to debug existing games right now with the current infrastructure (which is barely more than printf-debugging).

This is because both the official and the mkxp binary are exe first, Ruby second (Binary runtime that calls into Ruby script), where as MV is Javascript first. (Javascript that calls into JS Runtime)

This is correct. I don't know what's involved in making MRI "traceable", and I don't really have time or resources to devote to this, but I would support such an effort.

@Poityu
Copy link
Author

Poityu commented Apr 29, 2018

Oh, I see..

Last time I checked (a long time ago), there was no simple way to step through a running ruby script, look at (local) variables etc., has this changed meanwhile?

Hmm, RubyMine seems to be able to? I'm approaching this from a similar perspective where ActionScript under Flash has no breakpoint at all, but with Flex you get those things...But in fact, I am not familiar with Ruby development at all, sorry if this turned out to be a silly question.

it's a nightmare to debug existing games right now with the current infrastructure (which is barely more than printf-debugging).

Can't agree more.

This is correct. I don't know what's involved in making MRI "traceable", and I don't really have time or resources to devote to this, but I would support such an effort.

Thanks for the answer. I don't think I can do it even if I have all the time I want. One can only dream...

@Poityu
Copy link
Author

Poityu commented Feb 7, 2019

Well...I don't know why I missed them, but there were certainly some attempts at porting the engine that can be used for the purpose. None seem to be finished.

I have managed a frankenstein that can be boot up and debugged from VSCode (breakpoints/step into/step over/inspect variables...etc), it can show the title screen (in a quite poor way, because it is spliced together), but that's about it...
VXonGosu.zip

I have no idea what is happening beyond title screen, either in a infinite loop or takes too much time drawing. Monkey patching can only get one so far...

@Ancurio Ancurio changed the title Can you use mkxp to develop games under Ruby IDEs? Support for IDE-like debugging of RGSS / ruby scripts Aug 10, 2020
@gbbnfhb
Copy link

gbbnfhb commented Oct 22, 2021

ruby2.6 + ruby_jard 
use rubygems install ruby_jard 

debug

@Ancurio
Copy link
Owner

Ancurio commented Oct 24, 2021

ruby2.6 + ruby_jard  use rubygems install ruby_jard 

:O 超かっこいいじゃないすか、まるでIDEのdebuggerみたいです。 スクショ ありがとうございます。

@Speak2Erase
Copy link

You can actually get rdebug_ide and debase working inside mkxp, with some trickery. It's kinda meh, but it works.
Ruby does come bundled with an official debugger too, so you could try to upgrade to 3.1.0 and use that instead.

@gbbnfhb
Copy link

gbbnfhb commented Jan 13, 2022

Currently, mkxp doesn't work on ruby 3.1, but I'm investigating.
https://aur.archlinux.org/packages/mkxp-git/
Again, it's 2.7, and since ruby_jard>2.5 or higher, I've adopted the stable 2.6.

@Speak2Erase
Copy link

You can try using binding-util.h from mkxp-z, it supports 3.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants