Author Topic: [XP] RMXPAce -- Using the VX Ace engine in your XP games  (Read 83969 times)

Offline Ethereal

  • Total Beginner
  • Posts: 5
  • LV: 0
    • View Profile
Re: [XP] RMXPAce -- Using the VX Ace engine in your XP games
« Reply #300 on: March 25, 2017, 04:49:09 AM »
hi
Sorry to bother you, but the link is broken  :(

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3045
  • LV: 372
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: [XP] RMXPAce -- Using the VX Ace engine in your XP games
« Reply #301 on: March 25, 2017, 07:48:49 AM »
Thanks for reminding me. Dropbox changed how the Public folder works so all the shared file links don't work anymore. I've updated the links on the first post.

Now because of this, I wonder how many old scripts/resources here are gone forever now since those users aren't active.



Other Projects
RPG Maker XP AceUpgrade RMXP to RMVXA performance!
XPA TilemapTilemap rewrite with many features, including custom resolution!


NNID: KK20-CP
Discord: KK20 Tyler#8901
Join the CP Discord Server

Offline LiTTleDRAgo

  • Astral Trancist
  • *****
  • Posts: 841
  • LV: 514
  • Gender: Male
    • View Profile
    • ~
Re: [XP] RMXPAce -- Using the VX Ace engine in your XP games
« Reply #302 on: March 25, 2017, 11:59:29 AM »
You should update the kit as well, I noticed the tilemap used is still v0.12b.

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3045
  • LV: 372
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: [XP] RMXPAce -- Using the VX Ace engine in your XP games
« Reply #303 on: March 27, 2017, 01:56:18 AM »
I can just release whatever fixes I made and call it v2.1 tomorrow. Still in the process of making a tech demo.

EDIT:
Updated to Version 2.1
  • Updated XPA Tilemap to v0.32
  • Removed Unlimited Resolution as this has been moved over to XPA Tilemap
  • Superclass Mismatch Fix moved lower in script list as it was not running Console Output
  • Updated Ruby 1.8 Methods to v1.1 (includes Array#to_s, String#delete and #[])
Download



Other Projects
RPG Maker XP AceUpgrade RMXP to RMVXA performance!
XPA TilemapTilemap rewrite with many features, including custom resolution!


NNID: KK20-CP
Discord: KK20 Tyler#8901
Join the CP Discord Server

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3045
  • LV: 372
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: [XP] RMXPAce -- Using the VX Ace engine in your XP games
« Reply #304 on: June 20, 2017, 04:48:40 AM »
I downloaded the Steam version of RMXP to test the weird issues it was having with XPA projects. One of them was the location of the RTP. Sure this can be easily resolved by either loading your project with all the RTP assets or installing the RTP package from the official RPG Maker website, but I found a way to read the registry of the RTP location. It seems to reside in
Code: [Select]
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Enterbrain\RGSS\RTPso, knowing that, I updated the Load RTP script like so:
(change is in RPG::Path.getRTPPath)
Code: [Select]
#===============================================================================
# Load RTP File
# Author: joe59491, edit by LiTTleDRAgo
# Version : 1.40
#-------------------------------------------------------------------------------
# [ Description ]
# Loads RMXP RTP assets so that the user does not have to manually import all of
# them into their project.
#
# [ Instructions ]
# There is nothing to do here.
# Please keep this script in its current location.
#
# It is highly advised to not modify this script unless you know what you are
# doing.
#===============================================================================
if XPA_CONFIG::RTP_LOADER

module Load_RTP_File
 
  RMXP  = true
  RMVX  = false
  RMVXA = false

end
 
#==============================================================================
# ** Ini
#------------------------------------------------------------------------------
#  
#==============================================================================
module Ini
  #--------------------------------------------------------------------------
  # * self.readIni
  #--------------------------------------------------------------------------
  def self.readIni(item = "Title")
    buf = 0.chr * 256
    @gpps ||= Win32API.new("kernel32","GetPrivateProfileString","pppplp","l")
    @gpps.call("Game",item,"",buf,256,"./Game.ini")
    buf.delete!("\0")
    return buf
  end
end

#==============================================================================
# ** String
#------------------------------------------------------------------------------
#  
#==============================================================================
class String
  #--------------------------------------------------------------------------
  # ● UTF8_to_unicode
  #--------------------------------------------------------------------------
  def to_unicode 
    @mbytetowchar ||= Win32API.new("kernel32","MultiByteToWideChar",'ilpipi','I')
    len = @mbytetowchar.call(65001, 0, self, -1, 0, 0) << 1
    @mbytetowchar.call(65001, 0, self, -1, (buf = " " * len), len)
    return buf
  end
end

#==============================================================================
# ** RPG::Path
#------------------------------------------------------------------------------
#  
#==============================================================================
module RPG
  module Path
    #--------------------------------------------------------------------------
    # * Constant
    #--------------------------------------------------------------------------
    FindFirstFile = Win32API.new("kernel32", "FindFirstFileW", "PP", "L")
    FindNextFile  = Win32API.new("kernel32", "FindNextFileW", "LP", "I")
    ReadRegistry = Win32API.new("advapi32","RegGetValue","lppllpp","l")
    #--------------------------------------------------------------------------
    # * getRTPPath
    #--------------------------------------------------------------------------
    def self.getRTPPath(rgss,rtpname)
      return "" if rtpname == "" or rtpname.nil?
      size = [256].pack("L")
      # Get the registry value's length
      ReadRegistry.call(
        0x80000002, # HKEY_LOCAL_MACHINE
        "SOFTWARE\\Wow6432Node\\Enterbrain\\RGSS\\RTP",
        "Standard",
        2, # REG_SZ
        0, # Null
        0, # Null, so that we can get value's length
        size)
      buffer = size.unpack("L")[0] # Length stored in 'size'
      path = "\0" * buffer         # Now we know how long the string is
      # Get the registry value itself
      ReadRegistry.call(
        0x80000002, # HKEY_LOCAL_MACHINE
        "SOFTWARE\\Wow6432Node\\Enterbrain\\RGSS\\RTP",
        "Standard",
        2, # REG_SZ
        0, # Null
        path,
        size)
      path.delete!("\0")
      path = path + '/' # Ensure trailing forward slash to path name
      path = path.gsub("\\","/").gsub("//","/")
      path
    end
    #--------------------------------------------------------------------------
    # * Class Variable
    #--------------------------------------------------------------------------
    @@RTP = []
    if Load_RTP_File::RMXP
      @@RTP << self.getRTPPath('RGSS','Standard')
      (0..3).each do |i|
        @@RTP << self.getRTPPath('RGSS',Ini.readIni("RTP#{i.to_s}"))
      end
    end 
    @@RTP << self.getRTPPath('RGSS2',"RPGVX")    if Load_RTP_File::RMVX
    @@RTP << self.getRTPPath('RGSS3',"RPGVXAce") if Load_RTP_File::RMVXA
    @@RTP.reject! {|rtp| rtp.nil? || rtp.empty?}
    #--------------------------------------------------------------------------
    # * self.findP
    #--------------------------------------------------------------------------
    def self.findP(*paths)
      findFileData = " " * 596
      result = ""
      for file in paths       
        unless FindFirstFile.call(file.to_unicode, findFileData) == -1
          name = file.split("/").last.split(".*").first
          result = File.dirname(file) + "/" + name
        end
      end
      return result
    end
    #--------------------------------------------------------------------------
    # * self.RTP
    #--------------------------------------------------------------------------
    def self.RTP(path)
      @list ||= {}
      return @list[path] if @list.include?(path)
      check = File.extname(path).empty?
      rtp = []
      @@RTP.each do |item|
        unless item.empty?
          rtp.push(item + path)
          rtp.push(item + path + ".*") if check
        end
      end
      rtp.push(path)
      rtp.push(path + ".*") if check
      pa = self.findP(*rtp)
      @list[path] = pa == "" ? path : pa
      return @list[path]
    end
  end
end

#==============================================================================
# ** Audio
#------------------------------------------------------------------------------
#  
#==============================================================================
class << Audio
  #--------------------------------------------------------------------------
  # * Alias Listing
  #--------------------------------------------------------------------------
  [:bgm_play,:bgs_play,:se_play,:me_play].each do |meth|
    $@ || alias_method(:"#{meth}_path", :"#{meth}")
    define_method(:"#{meth}") do |*args|
      args[0] = RPG::Path::RTP(args[0]) if args[0].is_a?(String)
      send(:"#{meth}_path",*args)
    end
  end
end

#==============================================================================
# ** Bitmap
#------------------------------------------------------------------------------
#  
#==============================================================================
class Bitmap
  #--------------------------------------------------------------------------
  # ● Alias Method
  #--------------------------------------------------------------------------
  $@ || alias_method(:rtp_path_init, :initialize)
  #--------------------------------------------------------------------------
  # ● Object Initialization
  #--------------------------------------------------------------------------
  def initialize(*args)
    args[0] = RPG::Path::RTP(args.at(0)) if args.at(0).is_a?(String)
    rtp_path_init(*args)
  end
end

#==============================================================================
# ** Graphics
#------------------------------------------------------------------------------
#  This module handles all Graphics
#==============================================================================
class << Graphics
  #--------------------------------------------------------------------------
  # ● Alias Method
  #--------------------------------------------------------------------------
  $@ || alias_method(:rtp_path_transition, :transition)
  #--------------------------------------------------------------------------
  # ● transition
  #--------------------------------------------------------------------------
  def transition(*args)
    args[1] = RPG::Path::RTP(args.at(1)) if args[1].is_a?(String)
    rtp_path_transition(*args)
  end
end

end
I only tested this on a Win7x64. No guarantees if this is 100% foolproof.
« Last Edit: June 20, 2017, 04:50:20 AM by KK20 »



Other Projects
RPG Maker XP AceUpgrade RMXP to RMVXA performance!
XPA TilemapTilemap rewrite with many features, including custom resolution!


NNID: KK20-CP
Discord: KK20 Tyler#8901
Join the CP Discord Server

Offline LiTTleDRAgo

  • Astral Trancist
  • *****
  • Posts: 841
  • LV: 514
  • Gender: Male
    • View Profile
    • ~
Re: [XP] RMXPAce -- Using the VX Ace engine in your XP games
« Reply #305 on: June 20, 2017, 12:20:22 PM »
I downloaded the Steam version of RMXP to test the weird issues it was having with XPA projects. One of them was the location of the RTP. Sure this can be easily resolved by either loading your project with all the RTP assets or installing the RTP package from the official RPG Maker website, but I found a way to read the registry of the RTP location. It seems to reside in
Code: [Select]
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Enterbrain\RGSS\RTPso, knowing that, I updated the Load RTP script like so:
(change is in RPG::Path.getRTPPath)

*redacted*

You forgot VX and VXAce, the edit only hardcoding RTP for XP.
It should be:

Code: [Select]
"SOFTWARE\\Wow6432Node\\Enterbrain\\#{rgss}\\RTP",
"#{rtpname}",

Shortened ver
(click to show/hide)

This will allow XPAce to load VX and VXAce RTP too (Priority RTP loaded will be XP > VX > VXA).

Code: [Select]
    # Tried these in Scene_Title
    @sprite = Sprite.new
    @sprite.bitmap = RPG::Cache.title($data_system.title_name)
    #-------------------------------------------------------------------------
    bmp = Bitmap.new("Graphics/Titles1/Book")
    @sprite.bitmap.stretch_blt(@sprite.bitmap.rect, bmp, bmp.rect)
    bmp.dispose
    #-------------------------------------------------------------------------

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3045
  • LV: 372
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: [XP] RMXPAce -- Using the VX Ace engine in your XP games
« Reply #306 on: August 01, 2017, 10:07:39 AM »
Updated to Version 2.2
  • Uses XPAT v0.35 (which was updated today)
  • Superclass Mismatch Helper got some minor changes
  • Load RTP now pulls from the registry (explained in posts above)
  • Marshal.load now calls Kernel#load_data instead as this method ensures strings are encoded in UTF-8



Other Projects
RPG Maker XP AceUpgrade RMXP to RMVXA performance!
XPA TilemapTilemap rewrite with many features, including custom resolution!


NNID: KK20-CP
Discord: KK20 Tyler#8901
Join the CP Discord Server

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3045
  • LV: 372
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: [XP] RMXPAce -- Using the VX Ace engine in your XP games
« Reply #307 on: September 10, 2017, 07:27:40 AM »
Update to version 2.21
  • The Marshal.load encoding issue seems to be highly situational and rare to come by. Basically, unless you're a scripter and/or using some file-saving/-loading feature that RMXP does not natively support, I'm fairly certain you will never come across this. The only reported instance was with Blizzard's DREAM script. As such, I pulled the aliased method from the package.
  • XPA Tilemap updated to v0.36
« Last Edit: September 10, 2017, 07:34:43 AM by KK20 »



Other Projects
RPG Maker XP AceUpgrade RMXP to RMVXA performance!
XPA TilemapTilemap rewrite with many features, including custom resolution!


NNID: KK20-CP
Discord: KK20 Tyler#8901
Join the CP Discord Server

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3045
  • LV: 372
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: [XP] RMXPAce -- Using the VX Ace engine in your XP games
« Reply #308 on: September 13, 2017, 09:09:49 AM »
Updated to v2.22
XPA_Window is updated to v1.1



Other Projects
RPG Maker XP AceUpgrade RMXP to RMVXA performance!
XPA TilemapTilemap rewrite with many features, including custom resolution!


NNID: KK20-CP
Discord: KK20 Tyler#8901
Join the CP Discord Server

Offline BoisterousHero

  • Awakened Visionist
  • **
  • Posts: 65
  • LV: 0
    • View Profile
Re: [XP] RMXPAce -- Using the VX Ace engine in your XP games
« Reply #309 on: November 04, 2017, 08:46:48 AM »
I seem to be having a bit of trouble with XPA Tilemap, notably, whenever the custom plane class is enabled, I can't launch the game without it crashing. ("Windows has encountered a problem...") etc. This means changing the resolution or enabling the no-wrap option.

I tested a clean project and the problem isn't there, so I understand this is a script conflict/configuration issue. The problem is I'm mostly unsure as to what to look for to try to debug/make things compatible.

I also am getting a considerable amount of map stutter. The game's FPS stays at 60, but I am getting horrible microstutters which I assume are event lag. Is this an inherent issue with RPG Maker XP? I noticed there is a bit of stutter in the clean project, I'm not sure if there are any potential solutions or it's just the nature of the beast.

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3045
  • LV: 372
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: [XP] RMXPAce -- Using the VX Ace engine in your XP games
« Reply #310 on: November 04, 2017, 09:35:23 AM »
It's not the Plane rewrite. I just commented out the Graphics module in the script and it stopped crashing. Still looking...
EDIT: It's the Unknown Scripter's resolution breaker code. Fuck.
EDIT 2: Oh thank god, it's an easy fix.

I'm not sure where you got your RGSS301, but it's definitely not from the 2.22 package. You need that specific one for the "assembly magic" that script uses. File size should be like 1053KB.
MD5 file hash: DD25855AC39D32DA033902FC58FA210B

As for the lag, can you give me an example? Everyone has different definitions for lag.
« Last Edit: November 04, 2017, 09:48:02 AM by KK20 »



Other Projects
RPG Maker XP AceUpgrade RMXP to RMVXA performance!
XPA TilemapTilemap rewrite with many features, including custom resolution!


NNID: KK20-CP
Discord: KK20 Tyler#8901
Join the CP Discord Server

Offline BoisterousHero

  • Awakened Visionist
  • **
  • Posts: 65
  • LV: 0
    • View Profile
Re: [XP] RMXPAce -- Using the VX Ace engine in your XP games
« Reply #311 on: November 04, 2017, 04:29:31 PM »
Hmm. I'll double check the .dll, I was pretty sure I was using the correct one but I'll have a look.

As for lag, I'll post an example. I haven't had a chance to test it on my non-Windows 10 machine so I've yet to rule out computer-aided problems.

Notably, scrolling the screen (using an event) shows it the most. It is not a smooth scroll, with significant stutters. I only assumed it was map related because if I use something to display the FPS, it doesn't drop below 60 even when the stutters occur. I'm going to take a minute to test on another computer, though.

Offline BoisterousHero

  • Awakened Visionist
  • **
  • Posts: 65
  • LV: 0
    • View Profile
Re: [XP] RMXPAce -- Using the VX Ace engine in your XP games
« Reply #312 on: November 04, 2017, 04:34:11 PM »
Ah! It was the RGSS301.dll. That is bizarre, I was almost certain I copied it straight from the XPA folder, but perhaps I blacked out and replaced it with a different one, or something.

Lag still exists, will post an example of some kind when I get a moment.

Offline BoisterousHero

  • Awakened Visionist
  • **
  • Posts: 65
  • LV: 0
    • View Profile
Re: [XP] RMXPAce -- Using the VX Ace engine in your XP games
« Reply #313 on: November 08, 2017, 02:48:50 AM »
An update on this, I have a demo for my game here:
http://forum.chaos-project.com/index.php/topic,15812.0.html
The "lag" I talked about is present walking around town.

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3045
  • LV: 372
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: [XP] RMXPAce -- Using the VX Ace engine in your XP games
« Reply #314 on: November 08, 2017, 03:53:03 AM »
You sure it's not just the smooth scroller?



Other Projects
RPG Maker XP AceUpgrade RMXP to RMVXA performance!
XPA TilemapTilemap rewrite with many features, including custom resolution!


NNID: KK20-CP
Discord: KK20 Tyler#8901
Join the CP Discord Server

Offline BoisterousHero

  • Awakened Visionist
  • **
  • Posts: 65
  • LV: 0
    • View Profile
Re: [XP] RMXPAce -- Using the VX Ace engine in your XP games
« Reply #315 on: November 08, 2017, 04:06:03 AM »
Positive. Even with it disabled, it's present. In the intro cutscene where it says "Three Months Later", I actually have the smooth scroller disabled (it was wonky with the "scroll map" event), and I noticed it skips around quite a bit.

I did try a fresh XPA install and still noticed it, though not as aggressively, especially with a larger map. I piled up a bunch of events and noticed it really doesn't make a difference, which is why I'm not sure if it is even event related.

Offline BoisterousHero

  • Awakened Visionist
  • **
  • Posts: 65
  • LV: 0
    • View Profile
Re: [XP] RMXPAce -- Using the VX Ace engine in your XP games
« Reply #316 on: November 08, 2017, 04:29:52 AM »
Tried a few things, and got some different results (Clean project with just XPA):

  • Made a 50x50 map and put a bunch of events and a few layers of tiles in one spot; noticed a tiny bit of stuttering, mostly when moving in/out of areas with lots of events/tiles.
  • Had a thought that maybe tileset size made a difference, so I loaded in one of those "ultimate exterior" 256x10000 (or whatever) tilesets and tried selecting from different portions of the set, noticed a little more stutter in the areas with tiles but not as much.
  • Threw in a bunch of autotiles and noticed the stutter increased a fair amount, especially in the areas with autotiles.
  • To further this, I made a map with just animated autotiles and noticed the stutter was really obvious in the piles of autotiles.

I don't know of the likelihood of it relating to the Tilemap rewrite, and it's really hard to judge since RPG Maker XP used to be native 30FPS, I'm not sure if it's just an inherent flaw with RPG Maker XP.

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3045
  • LV: 372
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: [XP] RMXPAce -- Using the VX Ace engine in your XP games
« Reply #317 on: November 08, 2017, 04:33:04 AM »
It's most likely the tilemap rewrite then. But I don't know how I can improve it honestly.



Other Projects
RPG Maker XP AceUpgrade RMXP to RMVXA performance!
XPA TilemapTilemap rewrite with many features, including custom resolution!


NNID: KK20-CP
Discord: KK20 Tyler#8901
Join the CP Discord Server

Offline BoisterousHero

  • Awakened Visionist
  • **
  • Posts: 65
  • LV: 0
    • View Profile
Re: [XP] RMXPAce -- Using the VX Ace engine in your XP games
« Reply #318 on: November 08, 2017, 04:53:38 PM »
Oh man, a "I don't know" from KK20 is rough. Do you think one of the other Tilemaps suggested in your OP would resolve the problem? Or not really, considering yours is written specifically for XPA?

Next question is transitions, the custom plane class nukes transitions and they don't work properly, I know this is known. Are there any recommended transition scripts, or is the resolution a bit more complicated than that?

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 19930
  • LV: 642
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: [XP] RMXPAce -- Using the VX Ace engine in your XP games
« Reply #319 on: November 08, 2017, 06:27:10 PM »
KK20, have you thought about using SSE2 or something like that? It could heavily boost blitting performance and AFAIK most old CPUs support it. IIRC Pentium 2 already had SSE2 support. I definitely know that Intel Atom CPUs support at least SSE2. And IIRC AMD CPUs know how to emulate SSE2.

EDIT: https://en.wikipedia.org/wiki/SSE2

Keep in mind, this is next level shit, probably unlike anything you've done so far in terms of programming.

EDIT: What it does in short: Imagine you copy an array. The CPU has to copy value by value, there's not way around it. But if you use Intel intrinsics, you can make use of the media co-processor and literally copy multiple pieces of data at once. You tell the co-processor what you want copied and it executes it in a parallel manner rather than value by value. This is quite often used in image processing. I remember that either one or both libjpeg and libpng use them to improve loading speed. And it improves loading speed several times, maybe even more than a whole order of magnitude.

EDIT: I can't seem to find the code in libpng and libjpeg. But it does exist in libwebp.
« Last Edit: November 08, 2017, 06:37:13 PM by Blizzard »
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.