Author Topic: [XP] XP Ace Tilemap  (Read 29611 times)

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3038
  • LV: 372
  • Gender: Male
  • Bringer of Salt
    • View Profile
[XP] XP Ace Tilemap
« on: November 02, 2014, 12:53:24 PM »
XP Ace Tilemap
Authors: KK20
Version: 0.36
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
  • more to add later...

Screenshots

None

Demo

None

Script

Includes script, DLL, and source code for the DLL:
Dropbox Download

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.

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

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
« Last Edit: September 10, 2017, 07:30:11 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 noixez

  • Total Beginner
  • Posts: 8
  • LV: 1
  • Zexion's Evil Twin
    • View Profile
Re: [XP] XP Ace Tilemap
« Reply #1 on: November 02, 2014, 12:55:28 PM »
First!
GOOOOOOOOOOOO KK20

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

Offline G_G

  • Green Gmod Game_Guy AKA G4 AKA hyper-G AKA G-force
  • Global Moderator
  • Chaos Ultimate
  • ****
  • Posts: 6585
  • LV: 407
  • Gender: Male
    • View Profile
Re: [XP] XP Ace Tilemap
« Reply #2 on: November 04, 2014, 05:05:46 PM »
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.

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3038
  • LV: 372
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: [XP] XP Ace Tilemap
« Reply #3 on: November 05, 2014, 01:22:21 AM »
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 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 G_G

  • Green Gmod Game_Guy AKA G4 AKA hyper-G AKA G-force
  • Global Moderator
  • Chaos Ultimate
  • ****
  • Posts: 6585
  • LV: 407
  • Gender: Male
    • View Profile
Re: [XP] XP Ace Tilemap
« Reply #4 on: November 05, 2014, 01:41:21 AM »
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.

Offline LiTTleDRAgo

  • Astral Trancist
  • *****
  • Posts: 841
  • LV: 514
  • Gender: Male
    • View Profile
    • ~
Re: [XP] XP Ace Tilemap
« Reply #5 on: November 12, 2014, 10:47:14 AM »
Bug report:

this will happen when screen is shaking:


also when using a lot of animation / bitmap effects, the game will crash  :uhm:
« Last Edit: November 12, 2014, 02:04:25 PM by LiTTleDRAgo »

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3038
  • LV: 372
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: [XP] XP Ace Tilemap
« Reply #6 on: November 12, 2014, 11:14:16 AM »
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 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] XP Ace Tilemap
« Reply #7 on: November 12, 2014, 02:08:58 PM »
どうぞ: *links removed*
« Last Edit: January 16, 2015, 11:22:51 AM by LiTTleDRAgo »

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3038
  • LV: 372
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: [XP] XP Ace Tilemap
« Reply #8 on: November 12, 2014, 09:00:16 PM »
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:

Code: [Select]
$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=
Code: [Select]
    if !$game_screen.shaking? && -(@ox % 32) != @ground_sprite.x
      @first_update = true
    end
« Last Edit: November 12, 2014, 11:06:16 PM 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 PhoenixFire

  • Moderator
  • Astral Trancist
  • ***
  • Posts: 918
  • LV: 6
  • Gender: Female
  • ~That's an interesting notion, in it's own way~
    • View Profile
Re: [XP] XP Ace Tilemap
« Reply #9 on: November 13, 2014, 02:57:24 PM »
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..
Next off, how to create a first person shooter using microsoft excel.

<Remember when computers had turbo buttons?

Offline MetalZelda

  • Awakened Visionist
  • **
  • Posts: 82
  • LV: 1
  • Gender: Male
  • I love you :nohomo:
    • View Profile
Re: [XP] XP Ace Tilemap
« Reply #10 on: November 13, 2014, 05:26:18 PM »
Well well well this is a interesting script but I'm having issues

(click to show/hide)
THIS LOOKS LIKE A VINESAUCE CORRUPTION THIS IS AMAZING 20/20 FOR ORIGINALITY
(click to show/hide)

Perhaps it is due to XAS ... Or layers ... I don't really know
« Last Edit: November 14, 2014, 01:42:25 AM by MetalZelda »

Offline Zexion

  • Addicted to LoL
  • Chaos User
  • ******
  • Posts: 1511
  • LV: 69
  • Gender: Male
  • My anaconda don't...jk it does
    • View Profile
Re: [XP] XP Ace Tilemap
« Reply #11 on: November 13, 2014, 05:34:48 PM »
It's due to xas, see above ^

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3038
  • LV: 372
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: [XP] XP Ace Tilemap
« Reply #12 on: November 14, 2014, 06:45:11 AM »
@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.
« Last Edit: November 14, 2014, 07:01: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 PhoenixFire

  • Moderator
  • Astral Trancist
  • ***
  • Posts: 918
  • LV: 6
  • Gender: Female
  • ~That's an interesting notion, in it's own way~
    • View Profile
Re: [XP] XP Ace Tilemap
« Reply #13 on: November 14, 2014, 02:47:04 PM »
@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.
Next off, how to create a first person shooter using microsoft excel.

<Remember when computers had turbo buttons?

Offline MetalZelda

  • Awakened Visionist
  • **
  • Posts: 82
  • LV: 1
  • Gender: Male
  • I love you :nohomo:
    • View Profile
Re: [XP] XP Ace Tilemap
« Reply #14 on: November 14, 2014, 03:30:07 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

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3038
  • LV: 372
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: [XP] XP Ace Tilemap
« Reply #15 on: November 15, 2014, 12:56:06 AM »
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 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] XP Ace Tilemap
« Reply #16 on: November 15, 2014, 09:23:41 AM »
I'm just jumping normally (jump up / jump down) and I get that glitch

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3038
  • LV: 372
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: [XP] XP Ace Tilemap
« Reply #17 on: November 15, 2014, 10:20:28 AM »
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.
Code: [Select]
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.
Code: [Select]
def ox=(ox)
  ox = ox.round
  ...
end

def oy=(oy)
  oy = oy.round
  ...
end
« Last Edit: November 15, 2014, 10:31:27 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] XP Ace Tilemap
« Reply #18 on: November 15, 2014, 06:19:20 PM »
zoom implemented : http://pastebin.com/XwScRzim

(click to show/hide)

Offline Zexion

  • Addicted to LoL
  • Chaos User
  • ******
  • Posts: 1511
  • LV: 69
  • Gender: Male
  • My anaconda don't...jk it does
    • View Profile
Re: [XP] XP Ace Tilemap
« Reply #19 on: November 15, 2014, 06:43:18 PM »
Oh sweet ima try that out
Edit: Um, for some reason my game window doesn't go larger than 640x480
« Last Edit: November 15, 2014, 06:48:59 PM by Zexion »