[RGD] DirectX implementation of RGSS3

Updated to v1.5
  • Enabled input for debug console.
  • Enhanced performance for Tilemap.
  • Fixed a bug that some tiles are accidentally above the shadow.
  • Fixed a bug on Bitmap#clear_rect.
Method for executing the input script from console:
Code:
class Scene_Base
  alias cirno_20200130_update update
 
  def update
    cirno_20200130_update
    if $RGD && ($TEST || $BTEST)
      code = RGD.console_input
      if code.length > 0
        begin
          eval(code)
          p "Script execution succeeded!"
        rescue Exception => e
          p "Error: #{e}"
          p "Call stack:"
          p e.backtrace
        end
      end
    end
  end
end
A quick fix (1.5.1)
Fixed a tilemap bug crashing the game.
Reporting a minor bug here - with RGD the screen tint change command is locked to a maximum of 120 frames - meaning for example if I set them to apply with 300 frames the tint still finishes applying in 120 frames.
@KK20
No, I didn't realize xD. Didn't take into consideration that the bitmap would change its structure, or in this case, from a bitmap struct (which I didn't know was a DDraw texture then?) to a DX texture.
I'll try later with F0's.

@invwindy
There are some changes, yeah. From what I can gather, it's due to aliasing maybe? but I wasn't able to get why it happened since it's not the first time I alias a method with a variable argument size. The table I'm using is always 3D.

I tried accessing the table with 0, 1, 2 and 3 indices. And every time, no matter the table dimensions, it gave me an error asking for one parameter less. It even asked me -1 parameters when I gave it zero, which is impossible.

I'll keep testing stuff.
@KK20
No, I didn't realize xD. Didn't take into consideration that the bitmap would change its structure, or in this case, from a bitmap struct (which I didn't know was a DDraw texture then?) to a DX texture.
I'll try later with F0's.

@invwindy
There are some changes, yeah. From what I can gather, it's due to aliasing maybe? but I wasn't able to get why it happened since it's not the first time I alias a method with a variable argument size. The table I'm using is always 3D.

I tried accessing the table with 0, 1, 2 and 3 indices. And every time, no matter the table dimensions, it gave me an error asking for one parameter less. It even asked me -1 parameters when I gave it zero, which is impossible.

I'll keep testing stuff.

I think the size of parameters must be same as table dimension in RGD. In default RGSS behavior, the parameters work differently. Is this causing your problem?
Given how everything's been rewritten from the ground up, would it be possible to, say, change how tiles are drawn with the tilemap class? For example, could they be displayed closer to each other if someone wanted smaller tiles (Like 16x16 as opposed to the default 32x32)?
Found another glitch. I could deal with this myself though.

Screenshot_14.jpg

Screenshot_15.jpg

There are two problems here
1. The arrow window shouldn't even be there.
2. If the window openness is 0, the arrow is still being displayed.

EDIT:
Is input.trigger?(:ALT) no longer works?

Please ignore the crappy UI I made
Updated to 1.5.2
  • Fixed in_focus and out_focus when background_exec.
  • Fixed counter layering bug in Tilemap.
  • Fixed blur implementation in Bitmap.
  • Fixed incorrect copy of color in Font, Viewport and Plane.


@TheoAllen I found the alt key is always unavailable in RGD. This is caused by windows not sending Alt key as a key message and RGD does not handle this key from a version (maybe 1.2).

@cardcafe This would not be an easy work because the tile would be different from the editor and many convensions are going to be made, including the way of drawing auto tiles. I suggest parallax map systems if you need custom map settings. I personally recommend ULDS system https://rpg.blue/thread-367901-1-1.html .
Updated to 1.5.2
  • Fixed in_focus and out_focus when background_exec.
  • Fixed counter layering bug in Tilemap.
  • Fixed blur implementation in Bitmap.
  • Fixed incorrect copy of color in Font, Viewport and Plane.


@TheoAllen I found the alt key is always unavailable in RGD. This is caused by windows not sending Alt key as a key message and RGD does not handle this key from a version (maybe 1.2).

@cardcafe This would not be an easy work because the tile would be different from the editor and many convensions are going to be made, including the way of drawing auto tiles. I suggest parallax map systems if you need custom map settings. I personally recommend ULDS system https://rpg.blue/thread-367901-1-1.html .
Thanks for your work, he is amazing. I use your work since the first version in my VXA-OS project.

background_exec is what I had suggested once so that the client would not pause when minimized, what would be very useful in online games?
A quick update (1.5.3): fixed crashing on Font.clone and Font.dup
1) Do you have any plans to release the source code?

2) Is there a way to not pause the executable when I click the minimize button? Because, even with background_exec enabled, the executable pauses when minimized.
Any news on text compression problem? Some of my dialogues and menus are cutting off because of this. Especially on the bottom and the right side.

Temporary fix for now: I was using 24 font size, now using 23... kinda works for now...

Also, is there a way to prioritize text boxes I want it on the front 🙁?

Game_6Q7fYLUv1K.png


Spoiler: Difficulty box script I'm using
Code:
class Window_BattleDifficulty < Window_Command

  def make_command_list
    KGC::BattleDifficulty::param_revs.each { |d|
      add_command(d[:name], d[:name].to_sym)
    }
  end

  def select_last
    select($game_variables[KGC::BattleDifficulty::DIFFICULTY_VARIABLE])
  end
end

class Window_MenuCommand

  alias :th_kgc_battle_difficulty_add_main_commands :add_main_commands
  def add_main_commands
    th_kgc_battle_difficulty_add_main_commands
    if KGC::BattleDifficulty::USE_MENU_DIFFICULTY_COMMAND
      add_command("Difficulty", :difficulty, main_commands_enabled)
    end
  end
end

class Scene_Menu

  # add new menu to the scene

  alias :th_kgc_battle_difficulty_start :start
  def start
    th_kgc_battle_difficulty_start
    create_difficulty_window
  end

  alias :th_kgc_battle_difficulty_cmd_window :create_command_window
  def create_command_window
    th_kgc_battle_difficulty_cmd_window
    @command_window.set_handler(:difficulty,      method(:command_difficulty))
  end

  def create_difficulty_window
    @difficulty_window = Window_BattleDifficulty.new(80, 100)
    @difficulty_window.set_handler(:ok, method(:on_difficulty_ok))
    @difficulty_window.set_handler(:cancel, method(:on_difficulty_cancel))
    @difficulty_window.hide.deactivate
  end

  def command_difficulty
    @difficulty_window.select_last
    @difficulty_window.show.open.activate
  end

  def on_difficulty_ok
    KGC::BattleDifficulty.set(@difficulty_window.index)
    end_difficulty_selection
  end

  def on_difficulty_cancel
    end_difficulty_selection
  end

  def end_difficulty_selection
    @difficulty_window.close
    @command_window.activate
  end
end
Any news on text compression problem? Some of my dialogues and menus are cutting off because of this. Especially on the bottom and the right side.

Temporary fix for now: I was using 24 font size, now using 23... kinda works for now...

Also, is there a way to prioritize text boxes I want it on the front 🙁?

View attachment 143566

Spoiler: Difficulty box script I'm using
Code:
class Window_BattleDifficulty < Window_Command

  def make_command_list
    KGC::BattleDifficulty::param_revs.each { |d|
      add_command(d[:name], d[:name].to_sym)
    }
  end

  def select_last
    select($game_variables[KGC::BattleDifficulty::DIFFICULTY_VARIABLE])
  end
end

class Window_MenuCommand

  alias :th_kgc_battle_difficulty_add_main_commands :add_main_commands
  def add_main_commands
    th_kgc_battle_difficulty_add_main_commands
    if KGC::BattleDifficulty::USE_MENU_DIFFICULTY_COMMAND
      add_command("Difficulty", :difficulty, main_commands_enabled)
    end
  end
end

class Scene_Menu

  # add new menu to the scene

  alias :th_kgc_battle_difficulty_start :start
  def start
    th_kgc_battle_difficulty_start
    create_difficulty_window
  end

  alias :th_kgc_battle_difficulty_cmd_window :create_command_window
  def create_command_window
    th_kgc_battle_difficulty_cmd_window
    @command_window.set_handler(:difficulty,      method(:command_difficulty))
  end

  def create_difficulty_window
    @difficulty_window = Window_BattleDifficulty.new(80, 100)
    @difficulty_window.set_handler(:ok, method(:on_difficulty_ok))
    @difficulty_window.set_handler(:cancel, method(:on_difficulty_cancel))
    @difficulty_window.hide.deactivate
  end

  def command_difficulty
    @difficulty_window.select_last
    @difficulty_window.show.open.activate
  end

  def on_difficulty_ok
    KGC::BattleDifficulty.set(@difficulty_window.index)
    end_difficulty_selection
  end

  def on_difficulty_cancel
    end_difficulty_selection
  end

  def end_difficulty_selection
    @difficulty_window.close
    @command_window.activate
  end
end

GetGlyphOutline always fails in some special scales, and measuring text size sometimes returns incorrect values. I am not sure how default RGSS implements the drawing function. Maybe it will take more time to solve this.

But for your problem, I guess RGD doest not work well with KGC bitmap extension.

1) Do you have any plans to release the source code?

2) Is there a way to not pause the executable when I click the minimize button? Because, even with background_exec enabled, the executable pauses when minimized.

1) Currently no but I think I should release the source code after the project is stable enough.

2) Thank you for the reply. I'm going to have a look at this.
EDIT: I tested the case of background_exec + windows minimize button. The game is actually background executing and not paused. You may see the window frozen in the preview when you put the mouse on the toolbar icon. But the game is not stopped and the preview is saved before by windows system I think.
2) Thank you for the reply. I'm going to have a look at this.
EDIT: I tested the case of background_exec + windows minimize button. The game is actually background executing and not paused. You may see the window frozen in the preview when you put the mouse on the toolbar icon. But the game is not stopped and the preview is saved before by windows system I think.
Really, sorry for the mistake.

Any news on text compression problem? Some of my dialogues and menus are cutting off because of this. Especially on the bottom and the right side.

Temporary fix for now: I was using 24 font size, now using 23... kinda works for now...
I solve this in my project by increasing the width of the texts.
Is it possible to make the screen 16:9 stretched? I can't seem to ALT + ENTER. Fullscreen ++ script not working either.
Is it possible to make the screen 16:9 stretched? I can't seem to ALT + ENTER. Fullscreen ++ script not working either.
You can create a menu that activates the full screen, as I did in my project:
1.jpg

There are some unnecessary things in the original Game.exe, one of which is the shortcut Alt + Enter, F12, text compression etc.

The RGD must be better than the original Game.exe and not repeat the same "errors" as this one.
You can create a menu that activates the full screen, as I did in my project:
1.jpg

There are some unnecessary things in the original Game.exe, one of which is the shortcut Alt + Enter, F12, text compression etc.

The RGD must be better than the original Game.exe and not repeat the same "errors" as this one.

How did you make that menu? I've been unable to get fullscreen working with RGD.
You can create a menu that activates the full screen, as I did in my project:
1.jpg

There are some unnecessary things in the original Game.exe, one of which is the shortcut Alt + Enter, F12, text compression etc.

The RGD must be better than the original Game.exe and not repeat the same "errors" as this one.
Well, RGD's F1 menu script has Full Screen, but it only allows 4:3 resolutions. Is there a way to apply Alt + Enter (stretched) style resolution into that?

Nice settings menu though ^.^
quick update on the shadow bug: it still happens.
I'll post some screenshots later, but I was able to tie it to Group-2 Autotiles, specifically Block A, sections 3 & 4

from my testing, sections 3 & 4 always render without shadows.

I came to this conclusion also by accident, so further testing is required.

@sawworm , @BCj , I can render fullscreen with alt-enter just fine, and I heavily modified it.
I'm using a partial plugin for a submenu on the title screen, and part of that code runs the fullscreen change, so it might be my doing making that happen..... but alt-enter, widescreen AND, various resolutions, can definitely happen.

EDIT: uploaded pic.
I accidentally modified the tileset for another map and it screwed up this one, but fortunately that evidenced the tiles that were overlapped.
you can see how this screenshot compares to the video, and where the shadows appear or not.
these tiles are a vanilla Outside_A2, so you can use that as reference.

nuevo-1.jpg


nuevo-3.jpg


@sawworm , @BCj
that game window is 640x512, so you can see widescreen is possible, as well as full screen.

EDIT2:
@sawworm @BCj
I did a quick check and the results are inconclusive. I disabled the plugin I'm running and it switches fine to fullscreen AND widescreen. RGD should run just fine on it's own.
I left the plugin running until now, for this very reason. I was unsure RGD would render resolutions above 800x600 but I guess it does.
The download link doesn't work to me.
Can someone share me that via PM, or give me link? I want to give a look on it too.

Edit: Got it, don't need link anymore.

Original thread: https://forums.rpgmakerweb.com/threads/rgd-directx-implementation-of-rgss3.95228/