[RGD] DirectX implementation of RGSS3

invwindy

Ice Fairy
Veteran
Joined
Apr 9, 2016
Messages
91
Reaction score
101
First Language
Chinese
Primarily Uses
RMVXA
1- the map loops when the option is disabled, in the editor. I get a weird camera offset when using screen-fit maps. Check the validation for it, while moving near the edges.
2- no, although I was planning to. That's GubiD's work (check the demo if you still have it, Sprite_Range class)


I was just coming to correct myself: I fixed the font problem, it must be forced manually, but the game seems to load the correct font as long as it's installed.
@Valentine90, check your font names.


EDIT:
@invwindy check the event priority (above, below, same) against the tile draw order, I just corrected a character being drawn below the grass, it being set to below characters.
Fixed priority issue on range and characters. But I still cannot find a proper way to test the map looping problem. In my empty object the map looping is fine, but I do not know how to test in your project.
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,315
Reaction score
1,330
First Language
Spanish
Primarily Uses
RMVXA
Training Grounds, first hall, walk up against the upper wall, then down towards the bottom hallway.

put the player start point in whatever map you want, and use the blank menu option, above Training Grounds.
use the maps at the bottom of the list, under "utils"
 

invwindy

Ice Fairy
Veteran
Joined
Apr 9, 2016
Messages
91
Reaction score
101
First Language
Chinese
Primarily Uses
RMVXA
Training Grounds, first hall, walk up against the upper wall, then down towards the bottom hallway.

put the player start point in whatever map you want, and use the blank menu option, above Training Grounds.
use the maps at the bottom of the list, under "utils"
I know what have caused incorrect scrolling. From RGD I got Graphics.height 720 while in RGSS I got 480. It seems that your screen resolution script do not fit RGD exe.
RGD provides Graphics.resize_window to adjust window size without changing game resolution. See if you need this function.
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,315
Reaction score
1,330
First Language
Spanish
Primarily Uses
RMVXA
already resized, no change.
it's only when scrolling down, going up or either side doesn't seem to cause it.
 

BCj

Veteran
Veteran
Joined
Jun 19, 2014
Messages
1,749
Reaction score
935
First Language
Dutch
Primarily Uses
N/A
Your advice is awesome. I'll include it in the script then.
Great :D

Out of curiosity, would RGD also allow reflecting?
E.g.
wJraq2j.png
 

invwindy

Ice Fairy
Veteran
Joined
Apr 9, 2016
Messages
91
Reaction score
101
First Language
Chinese
Primarily Uses
RMVXA
already resized, no change.
it's only when scrolling down, going up or either side doesn't seem to cause it.
Maybe we need to modify the resolution script and make it compatible with RGD.

Great :D

Out of curiosity, would RGD also allow reflecting?
E.g.
wJraq2j.png
If the reflecting effect is made using sprites, then it is fine with RGD.
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,315
Reaction score
1,330
First Language
Spanish
Primarily Uses
RMVXA
*just* found something that might help: a piece of Yanfly code was interfering with the scrolling.
find the Viewport/Map Fix, which I believe was included with GTBS, and you'll see a chunk of it is commented out.
*I* disabled it for some reason, but I can't remember why.
re-enabling it solved the issue, but now I have to find where it caused errors with the original game.exe to see why I disabled it XD

EDIT:
isolated the problem when using resolutions above 640x480 with both the original exe and RGD.
aparently that Yanfly code was there to help correct the camera somehow.
the problem doesn't appear with resolutions of 544x416 or 640x480 using the default code.
the map *scrolls* up or down (as it was intended originally) rather than *jumping* or splitting the screen
 
Last edited:

invwindy

Ice Fairy
Veteran
Joined
Apr 9, 2016
Messages
91
Reaction score
101
First Language
Chinese
Primarily Uses
RMVXA
*just* found something that might help: a piece of Yanfly code was interfering with the scrolling.
find the Viewport/Map Fix, which I believe was included with GTBS, and you'll see a chunk of it is commented out.
*I* disabled it for some reason, but I can't remember why.
re-enabling it solved the issue, but now I have to find where it caused errors with the original game.exe to see why I disabled it XD
From what I have known, the game map would immediately translate to a new position when it is scrolling and its size is smaller than game resolution. This can already be found in RGSS. The difference between RGSS and RGD is the translation distance.
Since you already have the fixing script, this difference is not so importance then.
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,315
Reaction score
1,330
First Language
Spanish
Primarily Uses
RMVXA
exactly.
I'll see if I can work around removing that code entirely, and just rely on RGD
 

BCj

Veteran
Veteran
Joined
Jun 19, 2014
Messages
1,749
Reaction score
935
First Language
Dutch
Primarily Uses
N/A
Maybe we need to modify the resolution script and make it compatible with RGD.


If the reflecting effect is made using sprites, then it is fine with RGD.

I mean, is there a command or code for it already implemented in RGD?
 

invwindy

Ice Fairy
Veteran
Joined
Apr 9, 2016
Messages
91
Reaction score
101
First Language
Chinese
Primarily Uses
RMVXA
I mean, is there a command or code for it already implemented in RGD?
I'm afraid this would not be included in RGD commands. This effect relies on extra information from tilesets or regions, which is more suitable for ruby scripts, instead of built-in functions.
 

Archeia

Level 99 Demi-fiend
Staff member
Developer
Joined
Mar 1, 2012
Messages
15,217
Reaction score
15,629
First Language
Filipino
Primarily Uses
RMMZ
I tried the latest download but I keep getting this error even in a new project.
And I also use RGSS301.dll
upload_2018-9-8_8-59-42.png
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,181
Reaction score
836
First Language
Hungarian
Primarily Uses
RMVXA
I'm not sure of this problem. Have you tried a new DLL copied from an empty VXA project?
Whenever the project is saved, the DLL gets replaced by the one from your VX Ace installation folder, so new project or not, it will be the same DLL.
Unless, of course, it is replaced manually.

Tried the mouse clip method with the correct arguments now, works like a charm!

I noticed that you handled the flash color differently somehow, because the sprite's color property won't interfere with it anymore, which is one less annoyance fixed for me, so thanks for that!

And I also noticed that no matter what I do, any text I draw with the default draw_text method is positioned slightly off to the left. It's around 2 pixels too much to the left when the alignment is set to 2 (right), and around 4 pixels too much to the left when the alignment is set to 1 (center). If the alignment is set to 0 (left), it seems to behave the same way like the default engine does (some font types get 1 pixel cut down from the first letter if the text starts from 0 x position on the bitmap, but that's how it always worked, so it's not a big deal).
It doesn't matter what font type or size I use, or what other font settings I use.
I don't know if this is how the default engine works too or not, never paid much attention to it before, but it started to annoy me now because I'm in the process of fine-tuning the text positions in a menu I work on. I can always just set the positions accordingly to work-around this issue, but than I wouldn't know why I set all positions off a few pixels if I ever need to check them again some time later.
 

invwindy

Ice Fairy
Veteran
Joined
Apr 9, 2016
Messages
91
Reaction score
101
First Language
Chinese
Primarily Uses
RMVXA
Whenever the project is saved, the DLL gets replaced by the one from your VX Ace installation folder, so new project or not, it will be the same DLL.
Unless, of course, it is replaced manually.

Tried the mouse clip method with the correct arguments now, works like a charm!

I noticed that you handled the flash color differently somehow, because the sprite's color property won't interfere with it anymore, which is one less annoyance fixed for me, so thanks for that!

And I also noticed that no matter what I do, any text I draw with the default draw_text method is positioned slightly off to the left. It's around 2 pixels too much to the left when the alignment is set to 2 (right), and around 4 pixels too much to the left when the alignment is set to 1 (center). If the alignment is set to 0 (left), it seems to behave the same way like the default engine does (some font types get 1 pixel cut down from the first letter if the text starts from 0 x position on the bitmap, but that's how it always worked, so it's not a big deal).
It doesn't matter what font type or size I use, or what other font settings I use.
I don't know if this is how the default engine works too or not, never paid much attention to it before, but it started to annoy me now because I'm in the process of fine-tuning the text positions in a menu I work on. I can always just set the positions accordingly to work-around this issue, but than I wouldn't know why I set all positions off a few pixels if I ever need to check them again some time later.
Thank you!
The flashing color issue is going to be fixed in the next update.
I did not know much about the exact position of draw_text before. I'm going to do some test work later.
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,181
Reaction score
836
First Language
Hungarian
Primarily Uses
RMVXA
Wait, I think you misunderstood me. :D
Actually, the way how you handled the flash color of sprites is much better than how the default engine did it.

This is how the default engine handles it:
  1. Set the sprite's color property to a color with an alpha value of higher than 0, preferably to something high so you can see the visual issue clearly.
  2. Start a flash effect on that same sprite, any kind with a proper color setting (meaning the color is not set to nil).
  3. You will see that the flash color will not show up properly, because for some unknown reason, only the color with the highest alpha value will show up between these 2 color effects. This leads to a pretty bad looking flash effect on any sprites that have their color changed, especially if the color's alpha value is set to something high.
But with RGD installed, it displays the effect of the flash color regardless of the sprite's color property. I prefer it this way, and I'm sure anyone who worked with these color effects together would agree with me.
Only tested this with black and white combinations, so no idea if the blending is any good in the more... colorful situations, but it sure looks better this way with black and white combo.

If you want a quick testing scene for that draw_text issue, you can try this:
Code:
# Font property settings. Self-explanatory.
fnt = {
  :size => 16,
  :bold => false, :italic => false, :shadow => true, :outline => true,
  :color => Color.new(255,255,255,255),
  :out_color => Color.new(0, 0, 0, 128),
}

# Add any font type you want to test here.
# Cycle through them with the LEFT and RIGHT keys during testing.
fonts = [
  "Tw Cen MT Condensed","Bell MT","Candara","Adobe Caslon Pro","Corbel",
  "Estrangelo Edessa","Franklin Gothic Book","Gill Sans MT","Iskoola Pota",
  "Matrix","Aclonica","VL Gothic","Verdana", "Arial",
]

al = 1   # Alignment value.
ww = 400 # Width reserved for the text
hh = 200 # Height reserved for the text
txt = "01234567899876543210" # Sample text for testing.

fnt[:name] = fonts[0]
mtds = [:name, :size, :bold, :italic, :shadow, :outline, :pixel, :color, :out_color]

sp1 = Sprite.new
sp1.bitmap = Bitmap.new(ww,hh)
sp1.x = (Graphics.width - ww)/2
sp1.y = (Graphics.height - hh)/2

sp2 = Sprite.new
sp2.bitmap = Bitmap.new(ww,hh)
sp2.x = (Graphics.width - ww)/2
sp2.y = (Graphics.height - hh)/2

sp1.bitmap.fill_rect(0,0,ww,hh,Color.new(255,255,55,255))

mtds.each do |mtd|
  sp2.bitmap.font.send(mtd.to_s+"=",fnt[mtd])
end
sp2.bitmap.draw_text(0,0,ww,hh,txt,al)

# Just a debug print to see the font properties
mtds.each do |mtd|
  p "#{mtd}: #{sp1.bitmap.font.send(mtd)}" if sp1.bitmap.font.respond_to?(mtd)
end

# Yeah... laziness at it's best! :P
# Didn't want to bother with sound effects much...
DataManager.load_normal_database

loop do
  Input.update 
  Graphics.update
  sp1.update
  sp2.update
  SmoothAnim.update
 
  if Input.trigger?(:LEFT)
    Sound.play_cursor
    id = fonts.index(sp2.bitmap.font.name)
    id -= 1
    id = fonts.size - 1 if id < 0
    sp2.bitmap.clear
    sp2.bitmap.font.name = fonts[id]
    p "font name: #{sp2.bitmap.font.name}"
    sp2.bitmap.draw_text(0,0,ww,hh,txt,al)
  elsif Input.trigger?(:RIGHT)
    Sound.play_cursor
    id = fonts.index(sp2.bitmap.font.name)
    id += 1
    id = 0 if id > fonts.size - 1
    sp2.bitmap.clear
    sp2.bitmap.font.name = fonts[id]
    p "font name: #{sp2.bitmap.font.name}"
    sp2.bitmap.draw_text(0,0,ww,hh,txt,al)
  end
 
end
This is what I used to test it.
Just run it, make a screenshot, use any image editing program to magnify the image, and check the text positions.
The yellow area is supposed to be the area reserved for the text.
 

invwindy

Ice Fairy
Veteran
Joined
Apr 9, 2016
Messages
91
Reaction score
101
First Language
Chinese
Primarily Uses
RMVXA
Wait, I think you misunderstood me. :D
Actually, the way how you handled the flash color of sprites is much better than how the default engine did it.

This is how the default engine handles it:
  1. Set the sprite's color property to a color with an alpha value of higher than 0, preferably to something high so you can see the visual issue clearly.
  2. Start a flash effect on that same sprite, any kind with a proper color setting (meaning the color is not set to nil).
  3. You will see that the flash color will not show up properly, because for some unknown reason, only the color with the highest alpha value will show up between these 2 color effects. This leads to a pretty bad looking flash effect on any sprites that have their color changed, especially if the color's alpha value is set to something high.
But with RGD installed, it displays the effect of the flash color regardless of the sprite's color property. I prefer it this way, and I'm sure anyone who worked with these color effects together would agree with me.
Only tested this with black and white combinations, so no idea if the blending is any good in the more... colorful situations, but it sure looks better this way with black and white combo.

If you want a quick testing scene for that draw_text issue, you can try this:
Code:
# Font property settings. Self-explanatory.
fnt = {
  :size => 16,
  :bold => false, :italic => false, :shadow => true, :outline => true,
  :color => Color.new(255,255,255,255),
  :out_color => Color.new(0, 0, 0, 128),
}

# Add any font type you want to test here.
# Cycle through them with the LEFT and RIGHT keys during testing.
fonts = [
  "Tw Cen MT Condensed","Bell MT","Candara","Adobe Caslon Pro","Corbel",
  "Estrangelo Edessa","Franklin Gothic Book","Gill Sans MT","Iskoola Pota",
  "Matrix","Aclonica","VL Gothic","Verdana", "Arial",
]

al = 1   # Alignment value.
ww = 400 # Width reserved for the text
hh = 200 # Height reserved for the text
txt = "01234567899876543210" # Sample text for testing.

fnt[:name] = fonts[0]
mtds = [:name, :size, :bold, :italic, :shadow, :outline, :pixel, :color, :out_color]

sp1 = Sprite.new
sp1.bitmap = Bitmap.new(ww,hh)
sp1.x = (Graphics.width - ww)/2
sp1.y = (Graphics.height - hh)/2

sp2 = Sprite.new
sp2.bitmap = Bitmap.new(ww,hh)
sp2.x = (Graphics.width - ww)/2
sp2.y = (Graphics.height - hh)/2

sp1.bitmap.fill_rect(0,0,ww,hh,Color.new(255,255,55,255))

mtds.each do |mtd|
  sp2.bitmap.font.send(mtd.to_s+"=",fnt[mtd])
end
sp2.bitmap.draw_text(0,0,ww,hh,txt,al)

# Just a debug print to see the font properties
mtds.each do |mtd|
  p "#{mtd}: #{sp1.bitmap.font.send(mtd)}" if sp1.bitmap.font.respond_to?(mtd)
end

# Yeah... laziness at it's best! :P
# Didn't want to bother with sound effects much...
DataManager.load_normal_database

loop do
  Input.update
  Graphics.update
  sp1.update
  sp2.update
  SmoothAnim.update
 
  if Input.trigger?(:LEFT)
    Sound.play_cursor
    id = fonts.index(sp2.bitmap.font.name)
    id -= 1
    id = fonts.size - 1 if id < 0
    sp2.bitmap.clear
    sp2.bitmap.font.name = fonts[id]
    p "font name: #{sp2.bitmap.font.name}"
    sp2.bitmap.draw_text(0,0,ww,hh,txt,al)
  elsif Input.trigger?(:RIGHT)
    Sound.play_cursor
    id = fonts.index(sp2.bitmap.font.name)
    id += 1
    id = 0 if id > fonts.size - 1
    sp2.bitmap.clear
    sp2.bitmap.font.name = fonts[id]
    p "font name: #{sp2.bitmap.font.name}"
    sp2.bitmap.draw_text(0,0,ww,hh,txt,al)
  end
 
end
This is what I used to test it.
Just run it, make a screenshot, use any image editing program to magnify the image, and check the text positions.
The yellow area is supposed to be the area reserved for the text.
Thanks for your explanation. Now I understand what you mean.
However there is still one bug in sprite flashing. If you set flash color to nil, then the sprite will disappear. In RGSS, the sprite will keep disappearing for the rest of frames, while in RGD the sprite will disappear and gradually appear, which is not expected in some animation effects.
 

gstv87

Veteran
Veteran
Joined
Oct 20, 2015
Messages
2,315
Reaction score
1,330
First Language
Spanish
Primarily Uses
RMVXA
And I also noticed that no matter what I do, any text I draw with the default draw_text method is positioned slightly off to the left

confirmed (ish)
I get a 1px difference *on the vertical*, though...... BUT, RGD's render is more accurate than the original!

nuevo-3.JPG
 

Valentine90

Veteran
Veteran
Joined
Oct 5, 2017
Messages
56
Reaction score
19
First Language
Português
Primarily Uses
RMVXA
Can I disable text compression? I never understood the purpose of the original Game.exe text compression. I do not usually see this in other engines. Why should the text be compressed if this makes it difficult to see? And the current compression of the RGD was not good. Often when I set the width of the text equal to the size of the window, for example, the text barely arrives in the middle of the window and is already compressed.
Default (Game.exe original):
KRNNb47.png

RGD:
ABIvikZ.png

All the texts in my project were messed up, they were not messed up in the original Game.exe and I did not understand the logic used in the current RGD to fix this. I really do not know what to do, because now I need to put random values throughout the project so I do not have this problem. Therefore, it would be nice to be able manually turn off text compression.
 
Last edited:

Latest Threads

Latest Profile Posts

JRPG TextBox HTML - Part 2:
So I'm resuming work on the Shadowstar Trilogy. I've decided that it will take place between the end of G4 and the start of G5, and two of the Lost Rulers will be Twilight Sparkle and Sunset Shimmer (who is the moon princess in my AU).
Been working on some sprites, My favorite out of all of them is this guy, his name is Moss:
anyone else 'round here gonna be doing the retro game jam that's starting in a few days on itch.io?
I also wanted to say that my bro brought back nostalgia and got me a GBA SP for my birthday! Ah, the memories of Pokémon Sapphire and LeafGreen! It came in a gray shell but he ordered a red one so it'd look like the one I had as a kid. It looks brand new!
qhE9zC8.jpg
LsluASM.jpg

Forum statistics

Threads
108,947
Messages
1,040,810
Members
141,409
Latest member
TheChrisPdude
Top