[RGD] DirectX implementation of RGSS3

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,176
Reaction score
831
First Language
Hungarian
Primarily Uses
RMVXA
Smooth! How did I miss this until now? o.o

Just tested this and it really boosts performance by A LOT (60 FPS on 1920x1080 resolution O_O), plus the unlocked resolution is a godsend for this engine!
I can finally design menus and GUIs for higher resolutions, the 640x480 limit was too painful to manage for some menus.

For laptop users:
Remember to set up the exe file to use your proper GPU (Nvidia / AMD) for maximum performance!

I wonder how will this work with my more complicated scripts, I tend to use a lot of visual stuffs. Gonna test it tomorrow, bedtime now. *.*
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,004
First Language
Tagalog
Primarily Uses
RMVXA
Time to test this later, just downloaded the file right now.

I have a question, since its said on the site that this replaced the F1 config menu with an About menu, how will the users be able to change controls? Do we need to add a new way to do it? Also on the base game.exe, if a player changes config in one game.exe, it actually changes the config for all game.exe in his/her computer, so I'd like to know if those changes to the base game.exe would also affect the RGD game.exe.

PS: How did you make the effects on the samples in the OP? Are those included in the default features of RGD or are combination of RGD + other scripts?

EDIT: Tested it just now, works nice though it changed my font somehow. Does it use a different font or font size than the default? The test project doesnt have anything that changes font in any way

Also tested it with my light script, with so much lights added it still gets an FPS drop in the FPS counter (F2) but in-game it still looks wayyyyyyy better than the default. Does the FPS counter doesnt work correctly or is the DX implementation really just made the graphic update better? Coz on default game.exe, when I go like 55 FPS in the counter, the difference is already noticeable.
 
Last edited:

JakenBear

Villager
Member
Joined
Mar 25, 2013
Messages
9
Reaction score
1
First Language
English
Primarily Uses
This works really well with our current project. A few questions others have asked.
Is there a recommended way to change the font now? The current default font also adds a space after each apostrophe I've noticed.
Other than that this is really amazing work, thank you for creating it.
 

Archeia

Level 99 Demi-fiend
Staff member
Developer
Joined
Mar 1, 2012
Messages
15,169
Reaction score
15,509
First Language
Filipino
Primarily Uses
RMMZ
Do you think it's possible to make fullscreen go much faster?
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,176
Reaction score
831
First Language
Hungarian
Primarily Uses
RMVXA
So, I tested it in one of my more complicated projects, and I noticed a few issues.

Bug 1:
The wave effect of sprites refuses to work unless the wave_length property of the sprite is set explicitly.
Seems like the default value of wave_length property is not setup correctly in RGD?
In case you wonder, if that property is not set and the wave_amp property is set to something higher than 0, the sprite will disappear completely, or will end up being a big pile of lines with RGD. In the default engine, it would simply load 180 for wave_length if it's not set.
I could specify wave_length everywhere if I need to, but given that I would need to edit an animation configuration section of 5000+ lines in more than one project, I would rather you add that default wave_length value back if possible. *.*

On the bright side, the wave effect seems to be much smoother with RGD, or at least I think so.

Bug 2:
The eql? method is messed up for Color objects.
The method itself works if called on any other object type, but when called on a Color object, it triggers an error IF the other object is NOT a Color object.
For example, I can do this:
Code:
sprite.eql?(color)
But I can't do this:
Code:
color.eql?(sprite)
It seems like it misses the part where it should return false if the other object is not the same (Color) object, because it wants to convert the other object to a Color object (and compare it after, I guess), and that obviously won't work.

Bug 3:
There seems to be an issue with moved viewports and how the sprites on that viewport are displayed.
I use a lot of viewports in my more complicated menus. I don't use them because of their Z value, that is irrelevant to me (in most cases), I use them to make a specific area on the screen display a specific group of sprites, and I need these sprites to disappear when they get out of the boundaries of their viewport (or get cut down if some parts are still in the boundaries).
With RGD installed, viewports just refuse to work like this. Stationary viewports are fine, but when I move them around, problems start to occur.
I move these viewports around using their rect property.
I also move the sprites on these viewports outside of the viewport's rect to hide them. This works so far, so the sprites are hidden, as they should be, since they are outside of the viewport's rect.
Here comes the issue... When I move the viewport now (changing the rect's x property), the viewport moves fine, but the sprites it holds will appear the moment the viewport's rect doesn't cover them anymore. Ahh, kinda hard to explain without proper visuals, so I tried to demonstrate this in the images below.

When the animation starts for that filter display, the sprites on it will move to the left and right and they will get out of the viewport's rect, so they will get hidden.Like this:

During halfway, the viewport itself will start to move to the left as well, and will get out of the screen completely too.
This results in a pretty cool animation... Until it reaches the end, that is, because this happens:

See those leftover sprites at the left? They should not be shown at all, yet when their viewport moves enough to the left, they will appear for some reason.
It is the same with all viewports and their assigned sprites, and it happens only when I move the viewport to the left, and only the sprites on the right will show up.
I hope this issue gets fixed soon, because moving viewports around is kinda necessary for many of the menus I made.

Bug 4:
There happens to be some color issues with the sprite's color property.
The issue occurs in the same menu I have shown above, but just for clarification, this is how it should look like:
When at least 1 card from a type is equipped, their command background should turn to green, and when no card is equipped from a type, their background should revert to normal color (gray in this case).
If it matters, the green value of the color is always set to 255, I only change the alpha value of them after equipping/unequipping a card.
Now, with RGD installed, this happens:

And if I unequip all cards from a type, this happens:
So, whatever color I set the last, ALL of them will get the same color, regardless if they are equipped or not.
I don't even know how to debug this, since I have no idea how can this even happen.
If it matters, those background sprites are using the same bitmap, but each of them is a clone of the original, so they should be handled separately.
No idea if the sprite's bitmap is connected to the sprite's color property or not, but just in case it matters, they are all cloned bitmaps using the same image.

Bug 5:
Well, just look at the font on the above images...
The first image shown in Bug 4 is using the correct display for the font, that one is taken without RGD installed.
The rest of them are all screenshots made with the RGD. The difference in the font is kinda obvious.
If it matters, here are the font settings I use for those:
Code:
        :font => {
          :type => "Matrix Bold", :size => 16,
          :bold => false, :italic => false, :shadow => true, :outline => true,
          :font_col => Color.new(255,255,255,255),
          :outline_col => Color.new(0, 0, 0, 128),
        },

Also, there are some symbols which won't load with RGD installed, such as the arrows like: ↑ and ↓, for example. These load without any issue normally (so long as the font type supports them), but with RGD installed, they will show up as big squares instead.

I don't plan to use the default font drawing method for my next menu engine (using my own which uses images instead with many extra options), but it still comes in handy for quick testing the text space during early designs, so a fix would be highly appreciated.

These are the bugs I found so far. I made the project I tested in for a commission, so I can't share it, but if you need a video of how it should work properly, here is one I uploaded when I finished the project:
Yes, I slowed down the music, annoying, I know! :D

Anyway, hope you can fix these bugs, because as it stands now, I can't make many visual effects I want to make. *.*

I will test the RGD in some other projects later if I find some free time. Who knows what else will I find, right? :D

Edit:

Okay, so I fixed bug #2 and bug #4.

Bug 2 fix:
Code:
class Color

  alias fix_eql9917 eql?
  def eql?(other)
    return false unless self.class == other.class
    return fix_eql9917(other)
  end
 
end
This will take care of the crash issue on Color objects when comparing them with objects with different classes.
Adding it in RGD is preferred still, but until that happens, this fix works.

Bug 4 fix:
Code:
class Sprite
 
  def color=(val)
    self.color.red = val.red
    self.color.green = val.green
    self.color.blue = val.blue
    self.color.alpha = val.alpha
  end
 
end
I figured it thinks that all Color objects are the same on all those sprites, so I started debugging there. And sure enough, they really were the same objects.
It seems like the default engine doesn't replace the color property's value (which is a Color object) in the Sprite class. Instead it either clones the new Color object and sets that for the value, or it sets the color's individual... color values (red, green, blue, alpha). Both would result in unique Color objects, so no sprite would have the same Color object.
While RGD is installed, it directly sets the Color object for sprites. This resulted in the bug in the menu I have shown above. That color is made in a setting area (a constant in a module), and it assigned that same Color object to all of my sprites, so once I changed the RGBA value of the color, on one sprite, all of my sprites got the change as well, since it's the same Color object.
To prevent this from happening, I simply overwrote the default color= set method in the Sprite class. Now it sets the RGBA values instead of changing the Color object completely. This restored the default behaviour.
I assume that this issue is present in the Plane and Viewport classes as well, but I didn't test those. Applying the same fix should work on those classes too.

This leaves the viewport and font issues only.

Ohh, and I also noticed another bug...

Bug 6:
The sprite's wave effect makes the edges of the image/bitmap get cut down.
The default engine didn't do this, it displayed every single pixel from the image/bitmap.
With RGD installed, if the image/bitmap gets out of the default image/bitmap's area, it gets cut down on the sides.
To test this, set the wave_length to a very high amount, and set the wave_amp and wave_speed to low values. This will create a slow wave effect, so you can clearly see the visual bug.

I actually prefer it this way in some cases, but in other cases, I need the whole image/bitmap shown even when a wave effect is active.
 
Last edited:

Valentine90

Veteran
Veteran
Joined
Oct 5, 2017
Messages
56
Reaction score
19
First Language
Português
Primarily Uses
RMVXA
This works really well with our current project. A few questions others have asked.
Is there a recommended way to change the font now? The current default font also adds a space after each apostrophe I've noticed.
Other than that this is really amazing work, thank you for creating it.
All characters + spacing of the standard VL Gothic font have the same width, which includes the apostrophe. You can resolve this by changing the default font, but this is not a font problem. In fact, this makes it easy to create text boxes in my project, when you need to have the new characters "eat" the old characters if the text size has exceeded the width of the text box.
 
Last edited:

JakenBear

Villager
Member
Joined
Mar 25, 2013
Messages
9
Reaction score
1
First Language
English
Primarily Uses
All characters + spacing of the standard VL Gothic font have the same width, which includes the apostrophe. You can resolve this by changing the default font, but this is not a font problem. In fact, this makes it easy to create text boxes in my project, when you need to have the new characters "eat" the old characters if the text size has exceeded the width of the text box.
Yup, we figured it out. We are just setting our font via scripting and including the font file in the fonts folder in openfont type format.
Thank you for the reply. Really impressed with this so far.
 

invwindy

Ice Fairy
Veteran
Joined
Apr 9, 2016
Messages
91
Reaction score
101
First Language
Chinese
Primarily Uses
RMVXA
Hi everyone.
I am now developing a lighting and shadow system on RGD, which may take some time. After this script I am going to fix all bugs you have reported.
Many thanks to your feedback and efforts on testing!


 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,822
Reaction score
6,794
First Language
Indonesian
Primarily Uses
RMVXA
These kind of light effect will be neat in my current project that requires such kind of effect because of the story setting. Thanks for your hardwork, and good luck!
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,004
First Language
Tagalog
Primarily Uses
RMVXA
I just noticed something after a few more tests, it somehow "pixelates" the windowskin I'm using. Back on the normal game.exe its just a bit blurred but on RGD you can see "pixels". Is there any way to change that?

PS: I'll try to upload images later, just cant do it rn

PS2: Woah, an in-built lighting like that would be really cool
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,822
Reaction score
6,794
First Language
Indonesian
Primarily Uses
RMVXA
I just noticed something after a few more tests, it somehow "pixelates" the windowskin I'm using
If you go back at previous page, I already reported that. Welp, it might be unnoticable if you're using default windowskin though
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,004
First Language
Tagalog
Primarily Uses
RMVXA
Probably, I only noticed it in my other project since it uses a custom windowskin.
 

Valentine90

Veteran
Veteran
Joined
Oct 5, 2017
Messages
56
Reaction score
19
First Language
Português
Primarily Uses
RMVXA
Hi everyone.
I am now developing a lighting and shadow system on RGD, which may take some time. After this script I am going to fix all bugs you have reported.
Many thanks to your feedback and efforts on testing!


Very good.

This is not really a problem, but I am reporting here if nobody noticed:
When Game.exe is minimized a change in CPU usage happens. Here's an image of my Task Manager:
Default:

RGD:

While the standard Game.exe reduces CPU usage from 10 to 1%, the RGD increases from 7% to 50%
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,176
Reaction score
831
First Language
Hungarian
Primarily Uses
RMVXA
@Valentine90
Interesting find...
It happens for me too, from 5-10% it jumps to 25% when minimized or simply switching windows, but oddly enough, there is an exception...
If I click on the game's taskbar item to minimize, it won't happen, CPU usage drops to 1-2% than.
If I use the minimize button of the game's window or simply click down from the window to another window, CPU usage goes up to 25%.

@invwindy
I wanted to ask about these 2 methods:
onWindowBlur
onWindowFocus


Well, these aren't really there. I suppose you wanted to add them, but forgot it?
I noticed that there is a method named __blur in RDG, and that actually works how it should, but it's kinda useless without it's __focus counterpart.
Will these be added in the next update? Or are they already added but somewhere else with other method names? I only checked the RGD module, since your instructions say that these should be there.
 

Valentine90

Veteran
Veteran
Joined
Oct 5, 2017
Messages
56
Reaction score
19
First Language
Português
Primarily Uses
RMVXA
Some users of my project are reporting the following issues while running Game.exe:

Error 1:
"Game.exe has stopped working"


Error 2:
How should it appear:


As it appears:


They have already installed the latest June update for DirectX 9.
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,822
Reaction score
6,794
First Language
Indonesian
Primarily Uses
RMVXA
@Valentine90 are you sure the first error is not because of the usual RGSS Player Stopped Working error? even the default game.exe could crash like that if you have undisposed sprites.
 

invwindy

Ice Fairy
Veteran
Joined
Apr 9, 2016
Messages
91
Reaction score
101
First Language
Chinese
Primarily Uses
RMVXA
@Valentine90
Interesting find...
It happens for me too, from 5-10% it jumps to 25% when minimized or simply switching windows, but oddly enough, there is an exception...
If I click on the game's taskbar item to minimize, it won't happen, CPU usage drops to 1-2% than.
If I use the minimize button of the game's window or simply click down from the window to another window, CPU usage goes up to 25%.

@invwindy
I wanted to ask about these 2 methods:
onWindowBlur
onWindowFocus


Well, these aren't really there. I suppose you wanted to add them, but forgot it?
I noticed that there is a method named __blur in RDG, and that actually works how it should, but it's kinda useless without it's __focus counterpart.
Will these be added in the next update? Or are they already added but somewhere else with other method names? I only checked the RGD module, since your instructions say that these should be there.

The methods are designed for implementing game exit and focus changing events. You can implement the methods in module RGD by your self. We have just found they are not stable in some cases and plan to temporary hide them in next version.
I am also going to solve CPU problem. The next update may take some but I do not have a schedule. Sorry!
---
update: cpu usage bug solved
 
Last edited:

invwindy

Ice Fairy
Veteran
Joined
Apr 9, 2016
Messages
91
Reaction score
101
First Language
Chinese
Primarily Uses
RMVXA
Some users of my project are reporting the following issues while running Game.exe:

Error 1:
"Game.exe has stopped working"


Error 2:
How should it appear:


As it appears:


They have already installed the latest June update for DirectX 9.

Sadly some old graphic cards or virtual machines may have problem supporting shaders. This problem is reproduced in some users but we cannot solve it at present.
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,176
Reaction score
831
First Language
Hungarian
Primarily Uses
RMVXA
The methods are designed for implementing game exit and focus changing events. You can implement the methods in module RGD by your self.
That was my point, I can't implement them because those methods aren't even there and they are not called when game loses/gets focus (the onWindowBlur and onWindowFocus methods).
I tried to overwrite these methods to see if they would do anything, but they didn't. Than I tried to alias them, and it says that there are no methods named like that. And that's when I went and printed all method names and found the __blur method in there, and that one works as it should.
But what can I do with that alone? If there isn't a way to undo what I did in that method when the game gets focus again, it's kinda useless, at least for me.

Well, it's not a high priority on my list to use these methods, just wanted to let you know that the documentation on your site shows incorrect information about these methods.

I also tried to clip the mouse with the clip method, but that doesn't seem to work for some reason. All other mouse functions work, but that one just doesn't want to. >.>

And sometimes the game throws an error ("not responding") when I close it with the big red X button on the top right, especially when I toggled full-screen mode on and off. Considering that I already wanted to close it anyway, it's not a big issue, but it is certainly annoying.
Ohh, and the window border's top seems to lose the "Aero" effect after toggling full-screen once (on Windows 7). It loads the default blue-ish, non transparent window border instead of my windows settings.
 

Latest Threads

Latest Profile Posts

oh looks like the forums updated while I wasn't looking and we can put a banner now. Neat!
Treating this as a devlog
Finally feel well enough to sketch. Took twenty minutes to find the tablet. Another ten for the cable. Only to discover that my Clip Studio Pro license has expired. Yup. Gonna be one of those days.
Is there a way to add pictures to profile posts?

Forum statistics

Threads
107,656
Messages
1,031,194
Members
139,782
Latest member
Masterbrge
Top