Terv

Using the VX Ace engine in your XP games - the kiss tutorial!

66 posts in this topic

head.png

How to use the VX Ace engine in your XP games
in no more than 10 minutes - keep it simple, stupid!


de-icon.png Auf theutsch bitte

1. Introduction

In the following I am going to explain you how to use the engine of VX Ace (RGSS301.dll + Game.exe) in combination with your XP games which I fully entrust to everybody, for several reasons:
  • Lag no more: The new Ruby Version 1.9.2 is about 5 times faster than ancient 1.8.1 and will give your game an enormous performance boost, especially if you're an avid eventer.
  • Hyperliquid rendering: The XP engine is well-known for its stuttering scrolling and the associated tearing (graphics being cut). The image is lacking in calm, particularly in window mode. However after you have seen how beautifully soft and silky smooth your game looks with the new engine you're not going to want to miss it anymore.
  • Improved font rendering: The VX and VX Ace engine implemented an improved font rendering which makes your character more refined and a pleasure to read.
  • 60-120fps: While XP's standard frame rate is at a punny 40fps you can set the frame rate in Ace's engine up to 120fps with a single script call.
  • Up to 1024x768 in fullscreen: in combination with a suitable script you can easily more than double your resolution from 640x480 to 1024x768 - in fullscreen too.
2. Required Files and Licences

Even though you can get all the files either from the Ace RTP (dll) or any game (Exe), you officially need a valid VX Ace maker licence in order to use them in your own game. A trial licence is in no way inferior to a bought one. You can't tell whether the creator of an XP game using the Ace engine had or has a valid licence or not from looking at it.

For convenience reasons all for this tutorial required files and scripts are contained in my pack.png XP Ace Upgrade Kit.


3. Step-by-step instructions
  • 3.1 Remove RTP dependency
Copy all used ressources from the XP RTP into your game folder. The RTP is usually located at C:\Program Files (x86)\Common Files\Enterbrain\RGSS\Standard or C:\Program Files\Common Files\Enterbrain\RGSS\Standard.
  • 3.2 Insert the Engine
Copy Game folder files\Game.exe and RGSS301.dll from the kit into your game folder.
Copy the folder Fonts into your game folder. Game.exe always checks whether these font files are present there if they're not already installed on the system. It's irrelevant whether they are used in your game at all.
RMXP version 1.02 or 1.04: Open your Game.ini and see what is written behind Library=. Rename the file RGSS301.dll accordingly (in most cases to RGSS102E.dll).
RMXP version 1.05: Refer to the solution of this report.
  • 3.3 Paste Scripts
Paste Scripts\RPG Module.txt above all other scripts in your project.
Paste Window Padding Fix.txt above Main.
Replace Main with Main.txt.
Optional: If you're using print in your game, paste Print.txt above Main.

The Tilemap class is unalterably compiled in the RGSS dll and its task is to read map files and build maps as we know them. Since VX and Ace are using a different mapping system and thus a different tilemap class, you need a replacement that knows how to deal with your XP maps.

At the moment there are 6 alternatives (=rewrites) in Ruby and 1 in C++ (WhiteFlute):
Pros | Cons
  • WhiteFlute [Recommended]: Extremely stable, rather efficient | May require small edits to Tilesets and scripts
  • me [Recommended]: Fluid rendering and highly stable, also at higher resolutions | Incompatible with smooth scrolling scripts
  • ForeverZer0 [Recommended]: Great performance, especially at higher resolutions | Occasional display bugs
  • The King [Recommended]: Very liquid rendering, many additional features | High RAM consumption, possibly long map loading times
  • poccil: Decent for small and mid-size maps | Micro stutters on large maps
  • SephirothSpawn: Absolutely fluid and stable rendering | Requires SDK Part I+II and parts of MACL Complete, Bugs
  • RTH: Okay for small maps | Heavy stutters on large maps
Paste the script of your choice below the standard scripts and above your own scripts. If you're using Sephiroth's rewrite please note that SDK and MACL have to be above the tilemap script.
  • 3.4 Adopt Windowskin
Either edit your windowskin so that the elements match those on an Ace windowskin or use Scripts\Windowskin Converter\Windowskin Converter.txt.
  • 3.5 Optional: Encrypt Project
Download the VX Ace trial and install it. Create a new project, delete all files in your new Ace project folder without closing the maker, then paste all XP game files into the Ace game folder. Now select File -> Compress Game Data... -> (Create Encrypted Archive) OK. An self-extracting archive will then be created, containing a .rgss3a file instead of Data and Graphics folders.
Keep in mind that the rgss3a encryption has been cracked and released 5th of June 2012.


4. Bag of tricks
  • In order to use a resolution beyond 640x480 use Game folder files\(optional)\RGSS300.dll and a script supporting custom resolutions (e.g. me's or ForeverZer0's rewrite). Furthermore change Graphics.resize_screen(640, 480) in Main accordingly.
  • To slow down in-game graphics to XP speed again use the script call Graphics.frame_rate = 40. This also decreases CPU load en passant. You can set the wanted fps to anything between 10 and 120.
  • All differences between RGSS v3 and v1 can be listed in the page.png VX and page.png Ace help file by searching for (RGSS2) respectively (RGSS3).
5. Credits

Dargor - XP->VX tutorial
ForeverZer0, LiTTleDRAgo, me, PK8, poccil, RTH, SephirothSpawn, The King, WHITE-FLUTE - scripts in the kit
Terv - everything else


6. Appendix: Error messages, known incompatibilities & solutions

It's quite likely that the first thing you will see from your tuned XP game is a mysterious error caused by a script that used to never make any trouble. In most cases it's just a small thing and can be easily fixed in minutes. However if you know as much about Ruby as the man in the moon, or encounter a more persistent error, there's a dedicated bugtracker now! Presenting you


logo.png
www.Aluxes❤Eric.tk


I hope you liked my petty tutorial. Feel free to ask if you got questions or correct me when something is phrased cloudy :)
 

88x31.png
How to use the VX Ace engine in your XP games by Terv is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License.

Edited by Terv

Share this post


Link to post
Share on other sites

I was actually trying to use VX engine on RMXP and I succeeded in making everything compatible but the Tilemap, so this comes like an unexpected thunderbolt...

It looks like you actually succeeded in doing what I was to do ;)

 

Very nice tutorial and idea, this is surely amazing.

Using RMXP's Maps Editor combined with RGSS3 could really help creating amazing things.

 

Jens

Share this post


Link to post
Share on other sites

XP/RGSS3 bugtracker is up and running, feel free to post there if you have problems, or already solved them and want to tell us how you did it :D

Edited by Terv

Share this post


Link to post
Share on other sites

Just a question... in practice, you haven't replaces RGSS scripts with RGSS3, but you ported VACE player on RMXP?

 

In case this isn't true, how have you managed to configure RMXP database to be compatible with RGSS3?

 

For VX to XP conversion, I had to manually add functions like the dual weapon option and to translate each instance of the database into a new form which could be read by the new script set. VXACE comes with a lot of new features which can't be translated in a simple and useable manner...

 

That's different from what I thought before, but it's still a great idea ;)

Mine was different: I worked on a RMXP project in order to use RMVX scripts on it... and I almost succeeded in doing that.

 

I'll keep on following this topic, it looks interesting.

 

Jens

Share this post


Link to post
Share on other sites

Just a question... in practice, you haven't replaces RGSS scripts with RGSS3, but you ported VACE player on RMXP?

In case this isn't true, how have you managed to configure RMXP database to be compatible with RGSS3?

This is not about using RGSS3 with XP maps (it would also break RGSS1 script compatibility), it's about implementing the new ruby version as well as other improvements (rendering etc.). Database files are read by the RGSS1 standard scripts which remain untouched. That's why this tutorial can be done in a couple minutes and that's why you cannot use RGSS3 scripts (but still use all your old RGSS1 ones).

Trying to combine the Ace engine, RGSS3 scripts/databases and XP maps will probably result in a horrible workflow as you'd need to use two makers simultaneously. And still being able to benefit from all the great XP scripts is a huge advantage. There's no point in willingly doing without them.

 

Edited by Terv
Jackus ♪ likes this

Share this post


Link to post
Share on other sites

I want your babies. No, seriously. This is awesome and amazing and I love you for it.

 

Already run into a couple bugs, though, which I've posted to the tracker. Hopefully they can be ironed out quickly. I'm quite excited by this!

Share this post


Link to post
Share on other sites

I have posted answers for both your reports, check them out :)

Share this post


Link to post
Share on other sites

Awesome! Looks like the game.ini issue is fixed, but the SDK is still plaguing me. Methinks I need to work on dumping that whole thing. It's been handy for some parts, but others have been nothing but headaches.

Share this post


Link to post
Share on other sites

This is fantastic. Very well-presented. So, just to clarify, our custom RGSS1 scripts still work fine?

Edited by Sailerius

Share this post


Link to post
Share on other sites

Yep, most of your RGSS1 scripts will work right away. However about 1 out of 15 will throw up errors due to incompatibilities caused by either the change to Ruby 1.9 or RGSS3's hidden classes. These errors are usually rather easy to fix. Often it's just one or two lines. For every more obstinate error there's the bugtracker.

Share this post


Link to post
Share on other sites

So, I've noticed you CAN set your resolution higher, however altering the numbers in the relevant scripts (I'm using the one by me™) doesn't seem to have any actual effect on the game. Am I missing something?

Share this post


Link to post
Share on other sites

What resolution are you trying to use? Is the window itself getting resized, but the map not extended?

Did you replace your dll with the one from Game folder files/(Optional)? Did you also change both the resolution in the tilemap rewrite and Main?

Edited by Terv

Share this post


Link to post
Share on other sites

I tried bumping it up to 1024 x 768. The window and map are the same size as if I have it set for 640 x 480. I replaced the DLL with RGSS300.dll. I changed the resolution in both the tilemap rewrite on both lines and Main.

Share this post


Link to post
Share on other sites

I know nothing about programming, but I wanted to know if I could make use of this. Is it basically just a way to get games made with XP to run better, or is there more? Like, can I use types of events that were introduced in VX but were absent from XP (assuming there are any)?

Share this post


Link to post
Share on other sites

@Allerka: Now that's really wierd, could you please check if it doesn't work for you in the project template neither? Maybe it's related to your other custom scripts or PC setup, but that's unlikely.

 

I know nothing about programming, but I wanted to know if I could make use of this. Is it basically just a way to get games made with XP to run better, or is there more?

You probably won't need any specific scripting knowledge yourself.

The biggest advantage of this is the poweful and improved new engine which makes games look and run better. Besides that there are some nice Ace features available, e.g. fullscreen video playback without having to install anything beforehand.

However it doesn't bring you features that are included either in Ace's editor (database, autotile features, whatever) or in the base RGSS3 scripts you can edit. It's just a quick way to brush up your game.

 

Best give it a try for your own one, it's easy and can be done in minutes.

Edited by Terv

Share this post


Link to post
Share on other sites

I was wondering if you can still open the game in the xp editor once you do this to the project?

Share this post


Link to post
Share on other sites

Yep, that all still works fine!

 

 

 

@Terv: Well, I feel dumb. I actually DIDN'T give it the proper DLL. I fixed that, and now the window is resizing itself and everything. However, it's only filling part of the window, ala:

 

post-9407-0-31121100-1363620566_thumb.pn

 

In the tilemap processor, the relevant lines regarding window size have been edited to read:

 

 WindowRect = Rect.new(0,0,1024, 768) BitmapRect = Rect.new(0,0,1024 + 64, 768 + 64) # Recommended BitmapWindowOffset = (BitmapRect.height-WindowRect.height)/2/32

 

And then the line in Main reads:

 

Graphics.resize_screen(1024, 768)

 

 

post-9407-0-31121100-1363620566_thumb.pn

Share this post


Link to post
Share on other sites

I was able to recreate the described behaviour, which is strange as people have been reporting that their higher resolution worked just fine with this script. Also tested it on some VMs (XP, Vista) and it's the same there.

I will look into it and update this post as soon as there's news.

 

If the feature should really be broken (dang, I remember running my game in 1024x768 as a test!) you can always use F0's rewrite, it's even a whit better when it comes to fluid scrolling.

Edited by Terv

Share this post


Link to post
Share on other sites

In Spriteset map make the viewports:

@viewport1 = Viewport.new(0, 0, 800, 600)    @viewport2 = Viewport.new(0, 0, 800, 600)    @viewport3 = Viewport.new(0, 0, 800, 600)

Next in Game_Player

 CENTER_X = (400 - 16) * 4   # Center screen x-coordinate * 4  CENTER_Y = (300 - 16) * 4   # Center screen y-coordinate * 4

And finally in Game_Map

  #--------------------------------------------------------------------------  # * Scroll Down  #     distance : scroll distance  #--------------------------------------------------------------------------  def scroll_down(distance)    @display_y = [@display_y + distance, (self.height - 19) * 128].min  end  #--------------------------------------------------------------------------  # * Scroll Right  #     distance : scroll distance  #--------------------------------------------------------------------------  def scroll_right(distance)    @display_x = [@display_x + distance, (self.width - 25) * 128].min  end


The 19 and 25 are the max number of tiles on screen at any one time:

800/32=25

600/32=18.75 (round to 19)

 

Edit:

Ooh test battles also don't like me.

Add this to the rpg module:

module RPG  class System    class TestBattler      def initialize        @actor_id = 1        @level = 1        @weapon_id = 0        @armor1_id = 0        @armor2_id = 0        @armor3_id = 0        @armor4_id = 0      end      attr_accessor :actor_id      attr_accessor :level      attr_accessor :weapon_id      attr_accessor :armor1_id      attr_accessor :armor2_id      attr_accessor :armor3_id      attr_accessor :armor4_id    end  endend
Edited by Fomar0153
Sumasuun likes this

Share this post


Link to post
Share on other sites

Hm, does anyone know why I'm getting a 'the specified procedure could not be found' error? It's got nothing to do with RGSS or anything it seems, it's an actual windows error...I'll run through the instructions again and see what I might've done wrong, but I was pretty sure I followed them correctly! OTL

 

edit: Figured out what I did! Mistook the instruction about renaming the .dll for changing it in the .ini ^^; 

 

and I got a bug of course~ (this'll take a while to get working I suspect). 

Edited by SorceressKyrsty

Share this post


Link to post
Share on other sites
Fixed your bug, but I can't do any further testing because I'm lacking files and the game crashes. Edited by Terv

Share this post


Link to post
Share on other sites

Just for knowledge...  is RMVXAce Lite license enough to legally use this method? Or do you have to purchase a full RMVXAce license?

 

Jens

Share this post


Link to post
Share on other sites

Officially you should have a licence that allows you to publish a game running the two aforementioned binaries. This might be a trial licence as well as one you paid for.

The Game.exe and RGSS301.dll that come with VX Ace Lite are byte-identically equal to those of the full version and thus in no way inferior (well, they are the same).

This leads me to the conclusion that a VX Ace Lite licence is legally enough in order to run your XP game with VX Ace's engine.

 

Thanks for pointing this out, will add it to the tutorial.

Edited by Terv

Share this post


Link to post
Share on other sites

If your game is commercial, you can definitely not use a Lite license. You would need to have both Ace (full version) and XP licenses.

If it's a free game, then Lite should be enough (but someone may correct me on that). Note though, it's against the EULA to use anything to modify the Game.exe and RGSS301.dll files, and I assume that's what's been done here, so if you want to stay legal, what version of the maker you have is not the only thing to consider.

Share this post


Link to post
Share on other sites

Important point you made there, of course licence restrictions still apply.

it's against the EULA to use anything to modify the Game.exe and RGSS301.dll files, and I assume that's what's been done here

 

Just to assure staff people on here, no modifications are made to the compiled binaries, they can be and are used as they are, straight from Ace's environment.

Edited by Terv

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.