[RGD] DirectX implementation of RGSS3

Discussion in 'Useful Development Tools' started by invwindy, May 13, 2018.

  1. invwindy

    invwindy Ice Fairy Veteran

    Messages:
    64
    Likes Received:
    58
    First Language:
    Chinese
    Primarily Uses:
    RMVXA
    [​IMG]

    Hi everyone. I'm not sure if it is all right to post on this forum. This project is not a ruby script but a replacement of Game.exe. Because the source code is in a mess, we are not ready to publish the code until we have no time maintaining and updating RGD project. I am not a native English speaker so please tell me if there is any mistake.

    RGDirect (RGD) is a partial re-implementation and functional extension of the script system of RPG Maker VX Ace (RMVA), RGSS3. The main purpose of this project is to enhance the rendering efficiency, expansibility and to fix some bugs on original RGSS3.

    RGD re-implements graphical classes and modules in RGSS3, Bitmap, Graphics, Viewport, Sprite, Tilemap and Plane, using DirectX9 technique. The performance for drawing maps, images of large size and scaling, rotating sprites of large number with GPU is greatly higher compared to the lag in RGSS3. RGD has a built-in shader interface in Sprites and Viewports which is used for real-time custom effect code. On bitmap operations, besides the operators in RGSS3, RGD implements built-in pixel font option without using external DLLs. In addition, RGD implements mouse input. You may use module Mouse to get mouse position and button status easily. RGD 1.02 added Geometry class to draw triangles on screen, as well as fast drawing layers in Viewport for batch sprites.

    This work is completed by Fux2 and me(invwindy). Fux2 completed all the communications between C++ and ruby, and functions on drawing texts. I completed the functions related to D3D rendering. Many thanks to Mayaru for drawing the character and icons of RGD.

    If you have any questions or advice, please reply to this post.

    More information & download link: http://invwindy.mist.so/archives/290

    [​IMG]
    Map effect

    [​IMG]
    Normal mapping

    [​IMG]
    Vision effect using Geometry class

    [​IMG]
    Particle effect (~1000 particles)

    [​IMG]
    1920x1080 map in 60fps
     
    Last edited: May 18, 2018
    #1
  2. Kes

    Kes Global Moderators Global Mod

    Messages:
    20,180
    Likes Received:
    10,329
    First Language:
    English
    Primarily Uses:
    RMVXA
    @invwindy Before approving this for public viewing, I wonder if you could clarify something for me.
    It sounds as if you have overwritten some of the core parts of the engine, not just the default scripts that you can see in the Script Editor. Is that correct?

    You might like to remove your email from the post. That is because this site, like many others, is deep trawled by bots looking for email addresses, and you will be inundated with spam/phishing/malware.
     
    #2
  3. invwindy

    invwindy Ice Fairy Veteran

    Messages:
    64
    Likes Received:
    58
    First Language:
    Chinese
    Primarily Uses:
    RMVXA
    It's correct. We replaced some part of the engine. But RGSS30X.dll is not modified.
    You may think of this as an extension, because default behaviors of RGSS is not changed, at least from our test on dozens of games and third party scripts (some scripts using address on ruby objects may cause error).
    Thank you for reminding me. I have removed may email.
     
    Last edited: May 14, 2018
    #3
  4. mlogan

    mlogan Global Moderators Global Mod

    Messages:
    13,612
    Likes Received:
    7,520
    Location:
    Texas
    First Language:
    English
    Primarily Uses:
    RMMV
    @invwindy Can you explain how you replace parts of the engine but not modify the dll? Sorry to seem ignorant but those on staff who really understand this stuff are going to be unavailable to look over this for a while, so the rest of us are trying to determine whether this is okay to approve or not. Thanks for helping us out. :)
     
    #4
  5. invwindy

    invwindy Ice Fairy Veteran

    Messages:
    64
    Likes Received:
    58
    First Language:
    Chinese
    Primarily Uses:
    RMVXA
    We redefined Ruby methods in C++, like we do that in Ruby. The methods are defined in runtime.
    We used functions from the RGSS dll, some of which are not in the export table. My partner Fux2 found them one by one manually.
     
    #5
  6. Archeia

    Archeia Level 99 Demi-fiend Staff Member Developer

    Messages:
    14,522
    Likes Received:
    14,158
    Location:
    Game Dev Salt Mines
    First Language:
    Filipino
    Primarily Uses:
    VNM
    Hi @invwindy, can you clarify something for me? Did you modify the game.exe or created an entirely new game.exe?
     
    #6
  7. invwindy

    invwindy Ice Fairy Veteran

    Messages:
    64
    Likes Received:
    58
    First Language:
    Chinese
    Primarily Uses:
    RMVXA
    Hi @Archeia . We created a entirely new game.exe. Please ask me if you need any other detailed information.
     
    Last edited: May 18, 2018
    #7
  8. Archeia

    Archeia Level 99 Demi-fiend Staff Member Developer

    Messages:
    14,522
    Likes Received:
    14,158
    Location:
    Game Dev Salt Mines
    First Language:
    Filipino
    Primarily Uses:
    VNM
    Thanks for the clarification! I'll approve this then :)
     
    #8
    invwindy likes this.
  9. kovak

    kovak Silverguard Veteran

    Messages:
    1,244
    Likes Received:
    1,547
    Location:
    I'm from the Hu3
    First Language:
    PT - EN
    Primarily Uses:
    RMMV
    This is amazing, normal mappin is something that i still miss in RM engines.
    And congrats on cleaning up your code, no everybody is that careful.
     
    #9
  10. fux2

    fux2 monokuma Member

    Messages:
    3
    Likes Received:
    2
    First Language:
    Chinese
    Primarily Uses:
    RMVXA
    Hope this can helps people in need:uswt:
     
    Last edited: May 19, 2018
    #10
  11. Kvothe

    Kvothe The Bloodness Veteran

    Messages:
    108
    Likes Received:
    437
    First Language:
    Brazil
    Primarily Uses:
    N/A
    Oh! Great work, dude! I hope that this can be finished haha sounds so amazing and wondeful. Are you using the vanilla Win32API to call some functions from your dll?
     
    #11
  12. invwindy

    invwindy Ice Fairy Veteran

    Messages:
    64
    Likes Received:
    58
    First Language:
    Chinese
    Primarily Uses:
    RMVXA
    In our implementation we called some functions in the RGSS3 dll.
    If you are going to use RGD, just download the exe file (I have just edited "Instructions" to "Instructions and Download Link") and replace the original Game.exe. All the additional functions are listed in the document.
     
    #12
    fux2 and Kvothe like this.
  13. dsiver144

    dsiver144 Peaceful Days Dev Veteran

    Messages:
    239
    Likes Received:
    721
    Location:
    Vietnam
    First Language:
    Vietnamese
    Primarily Uses:
    RMVXA
    Finally, this is what I was waiting for. Tested with my project, have some visual bug. But the performance is perfect. Looking for more update from you guys. :D
     
    #13
  14. TheoAllen

    TheoAllen Self-proclaimed jack of all trades Veteran

    Messages:
    4,154
    Likes Received:
    4,591
    Location:
    Riftverse
    First Language:
    Indonesian
    Primarily Uses:
    RMVXA
    Honestly, with improved rendering on RGSS3 engine, I could've done more than what RGSS3 currently capable. Thanks for this!

    Also, this is kinda unrelated with DX, but is it possible to implement sound cache? Apparently one that contribute lag / frameskip is when u load a sound effect. The effect is barely noticeable, but when you're doing it real-time (like if you are making SHUMP game), everytime SE is loaded, it skips frame a bit.

    Now I'm not sure if modifying exe is legal hmm....
     
    #14
  15. Archeia

    Archeia Level 99 Demi-fiend Staff Member Developer

    Messages:
    14,522
    Likes Received:
    14,158
    Location:
    Game Dev Salt Mines
    First Language:
    Filipino
    Primarily Uses:
    VNM
    It's not a modified game.exe they remade it from scratch.
     
    #15
    TheoAllen likes this.
  16. invwindy

    invwindy Ice Fairy Veteran

    Messages:
    64
    Likes Received:
    58
    First Language:
    Chinese
    Primarily Uses:
    RMVXA
    @dsiver144 If your visual bug is out of the list in "compatibility" section, please describe it to me. It would be very helpful if you create a new project and reproduce it using the minimum third-party scripts and game data.
    @TheoAllen Sorry we don't have the plan to enhance Audio module at present. I'm not sure if you need this but you may take a look: https://rpg.blue/thread-256937-1-1.html (document: https://www.rubydoc.info/gems/seal; github: https://github.com/zhangsu/seal). This is an audio library in RGSS using OpenAL. I hope it helps your project. And thanks for @Archeia 's explanation. We made a entirely new game.exe.
     
    #16
    Kvothe and TheoAllen like this.
  17. BCj

    BCj Veteran Veteran

    Messages:
    1,395
    Likes Received:
    655
    Location:
    NL
    First Language:
    Dutch
    Primarily Uses:
    N/A
    Tried to use it for my game but sadly a) it messes up the fonts completely. I don't know where to change it, since it seems to come from the game.exe only.
    And b) seems to be uncompatible with parts of Luna Engine. Parts of my UI suddenly turned extremely yellow..
     
    #17
  18. invwindy

    invwindy Ice Fairy Veteran

    Messages:
    64
    Likes Received:
    58
    First Language:
    Chinese
    Primarily Uses:
    RMVXA
    It's hard to find the exact point of different behavior in RGSS and RGD for a complicated project. If you focus on finishing the game first, I recommend you use the original RGSS at present.
    Could you tell me what font you are using, and what happened in your game?
    Sorry I don't know about Luna Engine. Is the engine using external dll files to handle bitmap operation or creating sprites in different viewports with different blend type? If not. please tell me what happened in your game exactly.
     
    #18
  19. BCj

    BCj Veteran Veteran

    Messages:
    1,395
    Likes Received:
    655
    Location:
    NL
    First Language:
    Dutch
    Primarily Uses:
    N/A
    My font is Calibri. It's supposed to look like this:
    [​IMG]
    but with your game.exe it looks like:

    [​IMG]
    It doesn't happen everywhere, there are scripts that override it. BUT it happens a lot, e.g. in battle my hp nubers are suddenly in this font, while the skill descriptions are not. My item descriptions are fine but my equip screen is a mess. Etcetra.



    This is also happening..

    [​IMG]

    I know Luna Engine requires a seperate .dll to run, but I don't know how they handle graphics and such. BUT it only happens on the Status/Equip screen, which both use the same command to copry settings from the main screen. Maybe the issue is there? The rest seems to work fine. I can send you the .dll so you can check. I don't know how to see what's "in" it. My notepad++ won't open it.


    Noticed another problem, calculation. But this might be my own fault.

    [​IMG]
     
    #19
  20. invwindy

    invwindy Ice Fairy Veteran

    Messages:
    64
    Likes Received:
    58
    First Language:
    Chinese
    Primarily Uses:
    RMVXA
    @BCj I tried Calibri on my own project. Everything works fine. I believe both of your problems have something to do with Lunar Engine, or the incompatibility between RGD and Lunar Engine somewhere.
    Please send me the dll file then I'll ask Fux2 to handle it, which may take a couple of days.
    Thank you for the feedback and screenshots!
     
    #20

Share This Page