[XP] Custom Resolution

Started by ForeverZer0, November 25, 2010, 03:28:40 am

Previous topic - Next topic

KK20

King is another scripter in the German community. He has his own Tilemap rewrite script.
PROS:
- Very smooth, FPS is pretty constant
- LiTTleDRAgo has made it compatible with a lot of scripts
CONS:
- Big maps = long loading times
- On top of that, you can't have very large maps as it will consume a lot of RAM
- Also on top of that, changing individual tiles (via $game_map.data[x,y,z] = TILE_ID) redraws the entire tilemap which leads to more loading times

Compared to mine
PROS:
- Change game resolution (duh)
- Smooth; dips a few FPS under normal but it is hardly noticeable
- Fast map loading times and can run 500 x 500 maps with autotiles on every layer easily
CONS:
- In VXA converted projects, even though the Tilemap#update method is faster, the game stutters on higher resolutions
- Not compatible with many scripts yet
- Still need to address the fullscreen issue

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!

sekiraze

Quote from: KK20 on December 28, 2013, 02:01:28 pm
King is another scripter in the German community. He has his own Tilemap rewrite script.
PROS:
- Very smooth, FPS is pretty constant
- LiTTleDRAgo has made it compatible with a lot of scripts
CONS:
- Big maps = long loading times
- On top of that, you can't have very large maps as it will consume a lot of RAM
- Also on top of that, changing individual tiles (via $game_map.data[x,y,z] = TILE_ID) redraws the entire tilemap which leads to more loading times

Compared to mine
PROS:
- Change game resolution (duh)
- Smooth; dips a few FPS under normal but it is hardly noticeable
- Fast map loading times and can run 500 x 500 maps with autotiles on every layer easily
CONS:
- In VXA converted projects, even though the Tilemap#update method is faster, the game stutters on higher resolutions
- Not compatible with many scripts yet
- Still need to address the fullscreen issue


looked into it; didn't like it for some reasons. i find yours better tbh. truly speaking i find yours running smoother. well maybe at least for now, because my maps aren't filled too much with events but if i would NEED to chose, i chose yours.

KK20

December 28, 2013, 09:49:58 pm #122 Last Edit: December 29, 2013, 05:10:07 pm by KK20
Note that King's rewrite was meant for VXA. I tried plugging it in an RMXP project for the heck of it and the graphics were all displayed wrong.

Massive Edit:

Going back to this:
Quote
- In VXA converted projects, even though the Tilemap#update method is faster, the game stutters on higher resolutions

I found out the problem. RGSS300.dll included in the kit (which is a modified version to handle larger game resolutions) cannot handle a ton of sprites. Performance drops significantly when a couple thousand sprites are created.

Of course the unmodified RGSS300.dll and RGSS301.dll can handle many sprites fairly well--it's just you can't change the screen resolution to anything but 640x480.

I even did the method described here, but it performs just as bad as the RGSS300.dll did.

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

...I completely missed the part where the .dll is no longer a dependency... So I think I very well might try swapping this one in =)

Good job on this man!
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?

LiTTleDRAgo

January 15, 2014, 12:47:11 am #124 Last Edit: January 16, 2014, 08:26:12 am by LiTTleDRAgo
resolution change: *Link Removed*
$resolution.change_resolution(800,600)


also, I write a simple addon to adjust default menu position to the center of the screen: Click


KK20

Well that looks interesting. I'll be sure to incorporate that into the script. I see you've been working on the script a bit from the added methods and aliases everywhere. :)

I like how it reverts the resolution back to what it should be when coming out of fullscreen. Going into fullscreen, though, looked weird--I could see the Window's Start button and highlight over items in my taskbar. Also, it seems you've changed the way the screen scrolls; no matter the resolution, it still uses the 640x480 "center-rule," if you get what I mean.

That add-on is really helpful for first-time users. I'll link to it in the first post. Thanks for your continued support :D

I've been wanting to get back to finishing this but other priorities, ya know?

SUPER EXCITED EDIT:

Okay, so I have been wondering for the longest time how Cremno's NoF12 (more importantly No Alt+Enter inside it) works. I was looking around the various keyboard functions until I found RegisterHotKey. After reading it and UnregisterHotKey, I got the impression that this was what I was looking for.

So, to see how the method worked, I whipped up this little thing and put it in module Resolution#initialize at the very end:

    @reghotkey = Win32API.new('user32', 'RegisterHotKey', 'LIII', 'I')
    @reghotkey.call(0, 1, 0x4001, 0x0D)

To those confused, it basically says "Register new hotkey ALT+Enter to current thread". The 0x4001 is just a combination of MOD_NOREPEAT and MOD_ALT, as seen on the page I linked to. 0x0D is the virtual key code for Enter.

I go to testplay the game and, to my surprise, Alt+Enter no longer put the game into fullscreen no matter how hard I tried. Curious, I ran another game at the same time and couldn't get it to fullscreen either--at least, not until I closed the game with this snippet in it first. This outcome is exactly the same as the NoF12.dll approach.

Would anyone care to back this up and remark if I've made an amazing discovery?

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!

Blizzard

If this really works, wanna bet that they made a DLL just so nobody can just copy it? xD
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


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

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

KK20

Yep! I'll agree to that reason.

DLL scripters think they're so cool because no one can see their code. I Falcon Punch their jaws.

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!

Blizzard

The only 2 reasons to make a DLL for RMXP are:

1. Complex CPU-heavy code or code that needs to run as fast as possible and therefore needs optimizations.
2. Code accessing several of other DLLs and for the sake of readability and wrapping making a new DLL with a simpler interface (usually still needs the other DLLs).

Somebody may consider encryption to be something that goes into a DLL, but every half-assed programmer knows that encryption based on obfuscation and/or algorithm complexity is weak encryption. Making DLL just for a few Win32API calls is really overkill.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


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

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

LiTTleDRAgo

January 16, 2014, 07:16:41 am #129 Last Edit: January 16, 2014, 09:27:04 am by LiTTleDRAgo
@kk20 : the center way is my miss, I tried to whip the script so that it can use undersized map (the map will be centered in the screen) but ran into glitch, you can look by creating an undersized map and have player walk around the border

edit : OK, it's fixed now, you can also use undersized map and that map will be centered in the screen, flickered map when fullscreen also fixed: Click

I don't think Resolution Log is needed anymore, since the "Undersized Map Graphical Bug" was beautified into a feature.

AliveDrive

Quote from: Blizzard on January 16, 2014, 03:28:49 am
The only 2 reasons to make a DLL for RMXP are:
...
Making DLL just for a few Win32API calls is really overkill.


So correct me if I'm wrong, but does this mean that H-Mode7 (which uses a DLL) could perhaps be done without a DLL?

This would be incredible for me, because I am working on making a game that's compatible with Neko which does not support DLL to my knowledge. Sorry for off topic.
Quote from: Blizzard on September 09, 2011, 02:26:33 am
The permanent solution for your problem would be to stop hanging out with stupid people.

Blizzard

H-Mode 7 (and normal Mode 7) are both int he first category IMO. They are CPU-intense and need all the optimization they can get.

Neko should still support any kind of SO file that was compiled as Ruby extension.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


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

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

AliveDrive

Well then maybe there is hope for it.

Currently the project runs without crashing and I can access the menu but when in the main screen it is always just black.

I wonder if my Galaxy S4 is powerful enough to run this without lag/at all.
Quote from: Blizzard on September 09, 2011, 02:26:33 am
The permanent solution for your problem would be to stop hanging out with stupid people.

KK20

Quote from: LiTTleDRAgo on January 16, 2014, 07:16:41 am
edit : OK, it's fixed now, you can also use undersized map and that map will be centered in the screen, flickered map when fullscreen also fixed: Click

I don't think Resolution Log is needed anymore, since the "Undersized Map Graphical Bug" was beautified into a feature.

Can't believe I forgot to comment on this. *cough*

ARFGHH! I've been wanting to implement that "center undersized map" idea for a long time now. Yes, with that, the Resolution Log is no longer needed. Now if only there is a no-DLL solution to ALT+Enter, we can finally address fullscreen options (otherwise, we're stuck with NoF12).

Take my hugs. All of them!

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

January 17, 2014, 06:39:50 am #134 Last Edit: January 18, 2014, 04:24:39 am by LiTTleDRAgo
there still problem at FPS, (I got 15FPS at resolution 1024x576 from F0's map in the demo)
I suspect there was too many unnecessary calculation in the script


Click to enlarge

KK20

January 17, 2014, 01:04:55 pm #135 Last Edit: January 20, 2014, 12:23:53 am by KK20
I'm getting around 28 standing still and around 21 when moving. Same resolution, same map.
I get the same results again on my stress test map (500x500, 3 layers of nothing but 7 animating autotiles).
Turning off "Reduce Screen Flicker" brings the numbers back up a bit (35 standing still).
Of course, this is being tested on a normal XP project, not a VXA converted one--which I have remarked about previously in this thread.

I don't know what could be considered an unnecessary calculation though. Like I have also said before, a large number of sprites dangerously lags the game, even if you don't update them. Something as simple as

s = []
for i in 1...5000
s.push(Sprite.new)
end

in Main is enough to drop FPS significantly. A resolution of 1024x576 uses 1920 sprites to draw the map. If you want to increase performance but sacrifice memory, use Bitmaps. Note that there's a limit for how many bitmap objects you can have before the game suddenly closes (just under 10,000) and that 100 100x100 size bitmaps takes less memory than 1 1000x1000 bitmap. EDIT: Huh, I could have sworn it was...my last test says otherwise.

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 just lol-ed when I creating this script: http://forum.chaos-project.com/index.php/topic,13795.0.html
at first I want to create something like multi layer script, but for some reason it become like that

LiTTleDRAgo

January 27, 2014, 05:56:54 am #137 Last Edit: February 17, 2014, 01:21:51 am by LiTTleDRAgo
found a bug with weather

Spoiler: ShowHide


also, the fix: *Link Removed*

KK20

:up:

I really appreciate the amount of work you are putting into making this script better and compatible with the add-ons you have made so far. I seriously need to spend some time to look at what you have done so far and keep up with the changes.

I guess the next things to work on are fullscreen and zoom-in/-out.

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

well, I don't think zoom is possible the way the script is

in King's tilemap, all I had to do is just


      sprite.x = @rows[i,0]*32-ox
      sprite.y = i*32-oy
      sprite.zoom_x = $game_map.zoom_x || 1.0
      sprite.zoom_y = $game_map.zoom_y || 1.0
      sprite.x = (sprite.x * sprite.zoom_x)
      sprite.y = (sprite.y * sprite.zoom_y)


but in your code, I can't do that the same way in King's