Author Topic: [XP] Custom Resolution  (Read 54502 times)

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3247
  • LV: 294
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
[XP] Custom Resolution
« on: November 25, 2010, 10:28:40 AM »
Custom Resolution
Authors: ForeverZer0, KK20, LiTTleDRAgo
Version: 0.97
Type: Game Utility
Key Term: Game Utility

Introduction

My goal in creating this script was to create a system that allowed the user to set the screen size to something other than 640 x 480, but not have make huge sacrifices in compatibility and performance. Although the script is not simply Plug-and-Play, it is about as close as one can achieve with a script of this nature.

Features
Note these were written at the time of v0.93. The following may not be entirely true for the later versions.
  • Totally re-written Tilemap and Plane class. Both classes were written to display the map across any screen size automatically. The Tilemap class is probably even more efficient than the original, which will help offset any increased lag due to using a larger screen size with more sprites being displayed.
  • Every possible autotile graphic (48 per autotile) will be cached for the next time that tile is used.
  • Autotile animation has been made as efficient as possible, with a system that stores their coodinates, but only if they change. This greatly reduces the number of iterations at each update.
  • Option to have the system create an external file to save pre-cached data for autotiles. This will decrease any loading times even more, and only takes a second, depending on the number of maps you have.
  • User defined autotile animation speed. Can change with script calls.
  • Automatic re-sizing of Bitmaps and Viewports that are 640 x 480 to the defined resolution, unless explicitely over-ridden in the method call. The graphics themselves will not be resized, but any existing scripts that use the normal screen size will already be configured to display different sizes of graphics for battlebacks, pictures, fogs, etc.
  • Option to have a log file ouput each time the game is ran, which can alert you to possible errors with map sizes, etc.

Screenshots

None.

Demo

Click here for the demo. Note, it uses v0.93.

Script

Here's the code for v0.93 (the last version ForeverZer0 made--few graphical issues):
(click to show/hide)
Below are two types of v0.96b, which addresses some bugs and entirely changes the way the tilemap is drawn.
Normal Version
DLL-less Version
* With the DLL-less version, there is no need to put 'screenshot.dll' in your project folder

LiTTleDRAgo modified the existing script further to bring the script to v0.97. Download it:
HERE!

Instructions

  • Place script below default scripts, and above "Main".
  • (OPTIONAL) Download Transition Pack by Fantasist from here (contains 'screenshot.dll'): http://www.sendspace.com/file/yjd54h
  • Alternate 'screenshot.dll' download link: http://www.sendspace.com/file/aiirus
  • Place the screenshot.dll from it in the game folder if using v0.93 or Normal version.
  • (OPTIONAL) Because larger resolutions do not change the positions of windows in scenes, LiTTleDRAgo created a script that centers these windows to make them look more visually appealing. Get it here.
  • Any further instructions are in the script.

Compatibility

This script is not going to be for everyone obviously. A bigger screen means bigger chance of lag.
Custom scripts will need to be made to have windows for your CMS, CBS, and other scenes fill the screen properly.

I have created a second thread for numerous compatibility fixes. You can also make requests for new ones.
Go here to view the post.

Credits and Thanks

  • ForeverZer0, for the script.
  • Creators of Transition Pack and screenshot.dll
  • Selwyn, for base resolution script.
  • KK20, for v0.94 (and above) and the Tilemap rewrite (many hours and pages of notes went into this to make it one of the most realistic rewrites out there)
  • LiTTleDRAgo, for using some methods from his Core Engine script to make a DLL-less version and continued support/contributions by editing the existing script and creating compatible add-ons

Author's Notes

Please report any bugs/issues/suggestions. KK20 will be happy to fix them.
EDIT: KK20 will no longer be providing support. He has moved on to XP Ace Tilemap.
Enjoy!
« Last Edit: May 31, 2015, 08:59:57 PM by KK20 »
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 19929
  • LV: 642
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: [XP] Custom Resolution
« Reply #1 on: November 25, 2010, 11:16:48 AM »
<3

So that's what you've been up to. <3

You think that your Tilemap is more efficient? Have you tested it or is it just an assumption? After all, the original Tilemap was made in C++.
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.

Offline Wizered67

  • Astral Trancist
  • *****
  • Posts: 512
  • LV: 16
    • View Profile
Re: [XP] Custom Resolution
« Reply #2 on: November 25, 2010, 06:05:55 PM »
Whenever I try to use this amazing script, it gives me an error on line 136.
Code: [Select]
no implicit conversion from nil to integer
And yes, I did put in the screenshot.dll

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3247
  • LV: 294
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP] Custom Resolution
« Reply #3 on: November 25, 2010, 07:44:04 PM »
@blizz:
I admit it is just an assumption. To be quite honest, I am not exactly sure how the default Tilemap works. From what I can see (at my current scripting level), I can't see how it could be much more efficient, if is using standard RGSS scripts.

@wizered:
I can't seem to reproduce the problem. If you can upload me an example project that it does it in, I will be happy to look into it. The script is not quite finished yet, and it is very possible that there are some bugs left to track down.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Offline The Niche

  • The Hair Man
  • Chaos User
  • ******
  • Posts: 1561
  • LV: -171
  • Gender: Male
  • Marvel at the hair.
    • View Profile
    • Laptops and Tea, the place to go for marketing your creativity!
Re: [XP] Custom Resolution
« Reply #4 on: November 25, 2010, 07:52:53 PM »
Well Zero, an impressive performance. I'm proud to have my soul owned by you :L. Anyway, I'd suggest making it so the window enlarges to the point that it's fullscreen, but doesn't overlap the taskbar.
Level me down, I'm trying to become the anti-blizz!
Ah, excellent.  You liked my amusing sideshow, yes?  I'm just a simple fool, my wit entertains the wise, and my wisdom fools the fools.

(click to show/hide)
I'm like the bible, widely hated and beautifully quotable.

Dropbox is this way, not any other way!

Offline Wizered67

  • Astral Trancist
  • *****
  • Posts: 512
  • LV: 16
    • View Profile
Re: [XP] Custom Resolution
« Reply #5 on: November 25, 2010, 08:05:32 PM »
Maybe it's just my computer. Anyway, I started a new project and it still gives the error. I uploaded the demo at http://www.sendspace.com/file/26ks62.

Offline Guilink

  • Trained Member
  • *
  • Posts: 26
  • LV: 0
  • Gender: Male
    • View Profile
    • Mana Extreme Online
Re: [XP] Custom Resolution
« Reply #6 on: November 25, 2010, 08:21:19 PM »
Whenever I try to use this amazing script, it gives me an error on line 136.
Code: [Select]
no implicit conversion from nil to integer
And yes, I did put in the screenshot.dll

I have the same error!

 :huh:
Waiting for BABS Controller for RMX-OS update! '-'

www.manaextreme.blogspot.com (my brazilian game-newblog)

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3247
  • LV: 294
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP] Custom Resolution
« Reply #7 on: November 25, 2010, 08:31:30 PM »
One thing to try is to restart your computer after putting in the screenshot.dll
I know Ryex had a similar issue with the WeatherCreator not reading the display.dll, but after he restarted, it worked fine. This is just an idea, but it is worth a try. Like I said, it will not do it for me, and is likely an issue with your PC's settings that I am not aware of.

Also, ensure that the dll is named exactly as this, and all downcase, although I'm not sure if it matters:

                                                            screenshot.dll
(Never used the marquee before, just trying it out  ;))
« Last Edit: November 25, 2010, 08:32:41 PM by ForeverZer0 »
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Offline Wizered67

  • Astral Trancist
  • *****
  • Posts: 512
  • LV: 16
    • View Profile
Re: [XP] Custom Resolution
« Reply #8 on: November 25, 2010, 08:35:16 PM »
In a few minutes a may try restarting, but I don't think thats the problem as I'm already using Game Guy's screenshot script that uses the screenshot.dll in a different project.

edit: are you sure its not just your script?(no offense) I just tried  different resolution script and it worked fine on my computer.....
« Last Edit: November 25, 2010, 08:39:23 PM by Wizered67 »

Offline Guilink

  • Trained Member
  • *
  • Posts: 26
  • LV: 0
  • Gender: Male
    • View Profile
    • Mana Extreme Online
Re: [XP] Custom Resolution
« Reply #9 on: November 25, 2010, 08:39:58 PM »
I also tried rebooting and it did not work
Waiting for BABS Controller for RMX-OS update! '-'

www.manaextreme.blogspot.com (my brazilian game-newblog)

Offline Wizered67

  • Astral Trancist
  • *****
  • Posts: 512
  • LV: 16
    • View Profile
Re: [XP] Custom Resolution
« Reply #10 on: November 25, 2010, 08:53:17 PM »
I'm not a very good scripter and I don't claim to be, but is it possible that the reason we are getting the error is that Resolution.new is not being called? When I put Resolution.new in the self.snapshot area, it does this
(click to show/hide)
I'm not quite sure if this is how the script was intended to work. The only problem is that it randomly gives an "undefined method +" error, although I don't know if that is my fault.

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3247
  • LV: 294
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP] Custom Resolution
« Reply #11 on: November 25, 2010, 08:57:07 PM »
I would say "yes" its the script right away, but not everyone is having this problem. I'm not going to take offense at that by the way. I don't know of a scripter who has never had bugs/problems with their scripts. I know I have had my share  ;).

But anyways, the fact that some experience it, while others don't, with the only difference being the hardware and PC settings kind of narrows it down. I would love to be able to help you, I don't like having scripts out there that don't work, but I personally cannot get it reproduce the error, and the best I can do is make educated guesses at what it could be.

The script makes calls using the Win32API module to make low-level calls to functions on your computer, which any number of priviledge levels, parental controls, etc. could effect, along with basic configuration settings. All of these are factors that I cannot foresee, nor account for in the script.

 :O.o:
Uh-oh. I may have forgot to include the method to call it. Resolution.new does need called. My bad.
I updated the instructions.
« Last Edit: November 25, 2010, 08:59:30 PM by ForeverZer0 »
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Offline Wizered67

  • Astral Trancist
  • *****
  • Posts: 512
  • LV: 16
    • View Profile
Re: [XP] Custom Resolution
« Reply #12 on: November 25, 2010, 09:21:59 PM »
Okay, so by using Resolution.new in the self.snapshot it does indeed work. However, after I move for I while I get an
Code: [Select]
undefined method + for nil:NilClasson the line
Code: [Select]
return $game_map.priority_data[$game_map.map_id][@x, @y] + z

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3247
  • LV: 294
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP] Custom Resolution
« Reply #13 on: November 25, 2010, 09:25:48 PM »
Call it in Main, before processing begins, not in snapshot. It needs called before the game starts, not during every transitions. I updated the post and instructions. They are a little more clear. It was my fault I forgot to mention that it needed called. Left that part out.  :P
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Offline Wizered67

  • Astral Trancist
  • *****
  • Posts: 512
  • LV: 16
    • View Profile
Re: [XP] Custom Resolution
« Reply #14 on: November 25, 2010, 09:30:35 PM »
Okay, I did that, but it still gives the same error.

edit: Also, if possible, you should make it so that you can't do alt + enter for fullscreen as that messes up the script.
« Last Edit: November 25, 2010, 09:33:48 PM by Wizered67 »

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3247
  • LV: 294
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP] Custom Resolution
« Reply #15 on: November 26, 2010, 12:10:41 AM »
Okay, I may have found a possible bug.
Add things to all three layers, save the map, and see if it still does it.
Let me know. If that fixes it, it is indeed a problem with the script.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

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] Custom Resolution
« Reply #16 on: November 26, 2010, 12:19:50 AM »
Props to you zero. I've seen you've done quite some scripting. Nice job :)

Offline Wizered67

  • Astral Trancist
  • *****
  • Posts: 512
  • LV: 16
    • View Profile
Re: [XP] Custom Resolution
« Reply #17 on: November 26, 2010, 12:47:03 AM »
That still doesn't fix it......

Offline ForeverZer0

  • CP's Pedophile
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3247
  • LV: 294
  • Gender: Male
  • Remember you are unique, just like everyone else.
    • View Profile
Re: [XP] Custom Resolution
« Reply #18 on: November 26, 2010, 12:51:02 AM »
I see from your pic that the resolution is changing. So what exactly is the problem, and when exactly is the problem occuring? During transitions? Just walking around? I'm sorry, but I am lost on this one... :O.o:
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 19929
  • LV: 642
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: [XP] Custom Resolution
« Reply #19 on: November 26, 2010, 12:55:47 AM »
I was thinking about using your Tilemap class in CP if it was more efficient. That's why I'm asking. :) I think the best way to test it would be a raw test on a couple of bigger maps with quite a number of events to see which one works better. Also, careful with the memory.
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.