[XP] XP Ace Tilemap

Started by KK20, November 02, 2014, 05:53:24 am

Previous topic - Next topic

KK20

November 02, 2014, 05:53:24 am Last Edit: July 19, 2019, 09:58:19 pm by KK20
XP Ace Tilemap
Authors: KK20
Version: 0.42
Type: Tilemap Rewrite
Key Term: Game Utility



Introduction

In light of recent discoveries regarding the usage of RGSS3 in RPG Maker XP games, many users were left with a dilemma in choosing which Tilemap rewrite to use due to the vast differences between RGSS1's and RGSS3's Tilemap classes that would cause complications in this transition. I aimed to find the best Tilemap rewrite and decided that I would have to make my own. Like every other Tilemap rewrite before it, this implementation is in no ways perfect, boasting PROs and CONs.

This script is intended to be used for RPG Maker XP games using the RGSS3 library (unofficially coined RPG Maker XP Ace); however, it is entirely compatible with RPG Maker XP games in the RGSS1 library.

This work is protected by the following license:
Quote
Creative Commons - Attribution-NonCommercial-ShareAlike 3.0 Unported
( http://creativecommons.org/licenses/by-nc-sa/3.0/ )

You are free:

to Share - to copy, distribute and transmit the work
to Remix - to adapt the work

Under the following conditions:

Attribution. You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work).

Noncommercial. You may not use this work for commercial purposes.

Share alike. If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.

- For any reuse or distribution, you must make clear to others the license terms of this work. The best way to do this is with a link to this web page.

- Any of the above conditions can be waived if you get permission from the copyright holder.

- Nothing in this license impairs or restricts the author's moral rights.



Features

About the script:

  • XP and XPA (RGSS1 and RGSS3) compatible

  • Define your own custom resolution

  • Maps that are smaller than the game resolution are automatically centered

  • Drawing methods written in C-language, which has faster pixel-by-pixel operations than Ruby


Add-ons:

  • Customize frame rate animation and define unique patterns for your autotiles

  • Remove unnecessary priority layers to boost frames-per-second (FPS)

  • Extend the default RPG::Weather class to fit larger screens, or not

  • Transition graphics now adjust to whatever resolution you use (640x480 transition graphics on a 800x600 game window? No problem!)

  • more to add later...




Screenshots

None


Demo

None


Script

Includes script, DLL, and source code for the DLL:
v0.42 *NEW*
v0.41
v0.4
v0.36


Instructions


  • Place the script in 'XPA_Tilemap.rb' below the default scripts but above Main

  • Move 'XPA_Tilemap.dll' into your project folder (same directory as 'Game.exe')

  • Configure values at the start of the script




Compatibility

The script is still in its infancy. Thorough testing has not been conducted. Posting your observations would be greatly appreciated.
Users have reported Screen Flash to not work in their XPA games which I have yet to reproduce. It is unclear if my Tilemap script is causing the incompatibility or its the change in logic in RGSS3.

Transitions for larger resolutions are not supported as of yet, but a default fade-in/out exists. Consider using a transitions script.
I still have not thoroughly tested v0.3+ in XP so please advise that there may be potential bugs.

Screen Tone changes can lower the FPS of your game if using a larger resolution. This is further amplified if your tone uses a Gray value greater than 0. Tone changes are an expensive post-processing operation. Remember that RGSS was designed with 640x480 in mind--performance was built around that size.

Most scripts were designed with a resolution of 640x480 in mind. Here are a collection of fixes to address some of the more popular scripts like Blizz-ABS. You will need to replace all instances of SCREEN with SCREEN_RESOLUTION.


Credits and Thanks


  • KK20 - Author of this script and DLL

  • Blizzard - Tester and providing bug fixes

  • LiTTleDRAgo - Tester, bug fixer, and reusing code from his edits to Custom Resolution

  • Zexion - Tester and morale support

  • ForeverZer0 - Reusing code from his Custom Resolution script, found here:
                    http://forum.chaos-project.com/index.php/topic,7814.0.html




Author's Notes

Known Bugs:

  • Graphics.snap_to_bitmap behaves oddly in 640x480 resolution and doubling/halving the window size. Fix is to find unless XPACE && SCREEN_RESOLUTION != [640, 480] and remove && SCREEN_RESOLUTION != [640, 480]

  • When walking down and quickly opening the menu (assuming default project), you may see the tiles suddenly shift



I would appreciate it if you, the user, would be able to test this script for compatibility issues. This is a side-project of mine that I would like to see evolve over time. If you have any suggestions as well, post them.

Things currently planned:

  • Zooming in (but not zooming out) Not sure on this one yet...

  • Fullscreen for XP games

  • Transitions for larger resolutions



Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

noixez

First!
GOOOOOOOOOOOO KK20

But srs, liek awersome job on this mang
Born to destroy KK20

G_G

Looking forward to seeing this improve. Still setting up all the software and whatnot on my computer, RPG Maker is one of them not installed. I'll leave some feedback as soon as I can both XP and Ace running.

KK20

Other than just making it a bit more compatible, I'm not sure if there is a way to make it "faster". I've tried different approaches and this was the best I could manage. Anything else and we lose basic design features. Or if someone knew how to use a better graphics library in conjunction with RPG Maker, I'd love to hear. Otherwise, we'll have to wait for ARC or RPG.NET.

I am liking this Tilemap implementation though. Switching out Custom Resolution v96 for this in Advance Wars Engine brought the FPS back to 60. And I can still create multiple Tilemap objects and still maintain that 60 if I only use 1 level of priority, which it really is all it needs.

Transitions are going to be tricky. It seems they only apply to a 1024x768 area in XPA (and probably still 640x480 in XP, iirc). Tried importing a Transitions script, but it didn't help cover an area of 1200x800.

Still bug squashing as well. Zex said screen flash doesn't work, but I don't see what's wrong.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

G_G

I don't really understand how transitions work so I can't really help you there. I myself may still end up trying to do a tilemap used the Tiled map editor. Already have a decent idea on how to tackle it. I'll obviously have to rely on Ace for this since XP/VX parse JSON or XML far too slowly, though I suppose I could always do a one time parse and convert it to Ruby format. If we could actually draw on top of the window I might be able to do something.

LiTTleDRAgo

November 12, 2014, 03:47:14 am #5 Last Edit: November 12, 2014, 07:04:25 am by LiTTleDRAgo
Bug report:

this will happen when screen is shaking:


also when using a lot of animation / bitmap effects, the game will crash  :uhm:

KK20

Would you like to give me that demo? I spent a good number of days trying to perfect screen shaking.
You sure it's not something to do with floats in the equations?

Animation/effects of...what? More specific please. I don't see how that could cause the Tilemap to crash.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

LiTTleDRAgo

November 12, 2014, 07:08:58 am #7 Last Edit: January 16, 2015, 04:22:51 am by LiTTleDRAgo
どうぞ: *links removed*

KK20

November 12, 2014, 02:00:16 pm #8 Last Edit: November 12, 2014, 04:06:16 pm by KK20
I can confirm that it has something to do with XAS, but we all know how much of a nightmare that battle system is to navigate through.
I created an event with the script call:

$game_screen.start_shake(5,10,200)

and proceeded to walk up and down to force vertical screen scrolling. In XAS, I could get the disjointed tilemap in the pictures. In a clean project, I can't get it to happen.

Okay, it seems to be happening when along the map's edges. Performing a shake in the middle of the map wasn't doing anything.

EDIT: Put this at the beginning of Tilemap#ox=

    if !$game_screen.shaking? && -(@ox % 32) != @ground_sprite.x
      @first_update = true
    end


Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

PhoenixFire

Well, I placed in the current collaboration I'm working on, and it flows very smoothly. I like it! Great job KK!

Now to update the XPA download package with this..
Quote from: Subsonic_Noise on July 01, 2011, 02:42:19 amNext off, how to create a first person shooter using microsoft excel.

Quote from: Zeriab on September 09, 2011, 02:58:58 pm<Remember when computers had turbo buttons?

MetalZelda

November 13, 2014, 10:26:18 am #10 Last Edit: November 13, 2014, 06:42:25 pm by MetalZelda
Well well well this is a interesting script but I'm having issues

Spoiler: ShowHide


THIS LOOKS LIKE A VINESAUCE CORRUPTION THIS IS AMAZING 20/20 FOR ORIGINALITY
Spoiler: ShowHide


Perhaps it is due to XAS ... Or layers ... I don't really know

Zexion

It's due to xas, see above ^

KK20

November 13, 2014, 11:45:11 pm #12 Last Edit: November 14, 2014, 12:01:43 am by KK20
@MetalZelda:
Did you try doing what I last said?

@Phoenix:
Appreciate it :) Was wondering where you went :U

Also need to explain how to define custom autotile graphics. I'll probably have a different method when I get around to finalizing this.
Anyways, for you smart people, you know how you can see the autotile patterns by double clicking an autotile in your tile palette and how it creates a window of 8x6 tiles? You have to make your autotile look like that. It won't look as pretty in the editor though, so I was thinking of putting like a keyword in the filename for the script to find and replace it with in-game.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

PhoenixFire

@kk20 ~ Yeah, I haven't been all too active in the way of topics, but I've been lurking occassionally. IO also just got put as a donator, RMRK+ and Extra Access at RMRK, so I've had alot of reading to do there as well (I think we might be doing another contest soon). Additionally, I've been working on 13 Ghosts alot lately, because it is now a co-operative project with myself, an old member from here (tSwitch) one of our other coworkers (professional graphics desiner) and my wifeyness; needless to say, combine that with being a parent and having a job, and it equals out to being really busy lmao

In regards to the tilemap specifically, do you know off the top of your head what the maximum number of specific auto-tile custom update rules are that it accepts before it starts to lag a little bit? I haven't had any issues yet, but, I'm thinking about also releasing a preliminary "demo" of the game as a starter kit of sorts (think similar to the harvest moon, or zelda starter kits) and I would love to be able to include as much detail as is possible about all aspects of the kit within the documentation I would provide with it.
Quote from: Subsonic_Noise on July 01, 2011, 02:42:19 amNext off, how to create a first person shooter using microsoft excel.

Quote from: Zeriab on September 09, 2011, 02:58:58 pm<Remember when computers had turbo buttons?

MetalZelda

Quote from: KK20 on November 13, 2014, 11:45:11 pm
@MetalZelda:
Did you try doing what I last said?


Yup, tried, it works when I walk left / right but only on a map edge, and it's pretty much laggy (under 20 FPS), but some tricks might make this work 100% with XAS

KK20

Think I can take a look at your Scripts.rxdata? I mainly want to check for anything that changes Tilemap.ox and .oy since that is really the only explanation for such an effect to take place.

What FPS were you getting before and with what Tilemap? I'd think that XAS, like BlizzABS, is process heavy and is prone to number-crunching lag regardless of the Tilemap rewrite chosen.

Drago, I cannot seem to replicate the effect where the upper layers are drawn higher than they should be. I need to know the specifics of what you are doing and what is happening.

Phoenix, as a general pointer, having the autotiles update with very few frames in between causes more calls to the DLL and, in general, more lag. As for the custom autotile graphics, there shouldn't be any problem with lag in that department. Of course having 20 frame autotile animations everywhere would probably take up a good chunk of RAM.

Also, while messing around in Advance Wars Engine, changing the Sprite#color of the tilemap dropped the frame rate significantly (almost 20FPS drop), and this was just a 640x480 resolution with 1 priority layer.

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

LiTTleDRAgo

I'm just jumping normally (jump up / jump down) and I get that glitch

KK20

November 15, 2014, 03:20:28 am #17 Last Edit: November 15, 2014, 03:31:27 am by KK20
My suspicion was correct: it's float values modifying the Tilemap#ox/oy. Can't do that since I'm relying on those values to move the sprites that are drawing the tilemap.

sprite.x = 50
sprite.x += 0.0000000000000001 #=> 50
sprite.x -= 0.0000000000000001 #=> 49

I have a feeling that, for both of you guys, the pixel movement system you are using is causing this.

Anyways, you can try converting the ox and oy values being passed into integers and see if that works.

def ox=(ox)
  ox = ox.round
  ...
end

def oy=(oy)
  oy = oy.round
  ...
end

Other Projects
RPG Maker XP Ace  Upgrade RMXP to RMVXA performance!
XPA Tilemap  Tilemap rewrite with many features, including custom resolution!

Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

LiTTleDRAgo

zoom implemented : http://pastebin.com/XwScRzim

Spoiler: ShowHide
$game_map.start_zoom(x, y, zoom, duration = 20) # of course zoom had to be integer or else tilemap will glitch
$resolution.resize_screen(width,height)

Zexion

November 15, 2014, 11:43:18 am #19 Last Edit: November 15, 2014, 11:48:59 am by Zexion
Oh sweet ima try that out
Edit: Um, for some reason my game window doesn't go larger than 640x480