[XP] Custom Resolution

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

Previous topic - Next topic

Wizered67

Sorry for being confusing. The problem is that when I get to the map, after walking around for a while, it will suddenly crash and give me the error I mentioned before.

ForeverZer0

November 25, 2010, 07:07:24 pm #21 Last Edit: November 26, 2010, 12:26:36 am by ForeverZer0
@blizz
I can do some testing, if you would like. The map I have been using for testing this script is somewhat large, though I'm sure there will be larger maps in most people's games. I have a method I made for testing efficiency, which can log the number of miliseconds a method takes to execute. It's not perfect, but it will usually get you in the ballpark.

I know I am walking a thin line with the memory. This is actually about the third version. I was torn trying to delegate on when to make sacrifices to on-the-fly processing, and when to do it to RAM. This version is pretty close to what the final version will be. I do have one question with regards to loading the cached data. Would it be more efficient to load the entire hash when the game is loaded and reference it only the key I need for the map, or not load any of it, and only load the values of the hash for the map on the fly when the map is created. I really don't know how efficient the method is to open a file and Marshal load it, so I wanted to stay clear of constantly loading data this way every time a new map is encountered.
The reason for the files was to drastically reduce the number of iterations needed to be done at run-time, which I think could help with any lag issues due to a larger map.

One more question, in ABSEAL, how did you come up with the value of 1600 for the sprite size. I want to also include an aliased method in the final version that will resize the sprite accordingly for the defined resolution if ABSEAL or BABS is being used.


EDIT:

TEST MAP SIZE: 1024 x 576

Okay, after some testing, here are the results. The average time a map takes to initialize is 0.320 with this script, and only 0.070 without it. This is definitely something I need to look into. The average update time is dead even, both ending with an average time of 0.025 after 400 updates (Graphics.update included).

I'm relatively pleased with the results. Although the initialization timing is longer (still only 1/3 of a second), I did manage to keep the update method the same, which is far more important. This basically means that once the map is loaded, no sacrifice is being made updating a screen 192% larger.
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.

Ryex

impressive man impressive. the init time is hardly a problem, and when you thing about it i makes sense as it uses more memory for a larger screen there is no way it could not use more memory and it is a fair trade off for dead even update times on a larger screen. how big was the screen you were testing on? and will you test the limits and go higher to see the effect?
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

ForeverZer0

The test map was 1024 x 576, and yes I plan to test it on even bigger maps, though not until tomorrow.
I'm sleepy. Too much turkey.

Glad you like.  :haha:
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.

Ryex

no I mean what was the screen size normal it is 640 by 480 what was it in the test? and will you test bigger like 1600 x I forget the standard resolution (clearly that is an extreme and likely never be used but it is still a good thing to know.)
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Blizzard

Quote from: ForeverZer0 on November 25, 2010, 07:07:24 pm
I know I am walking a thin line with the memory. This is actually about the third version. I was torn trying to delegate on when to make sacrifices to on-the-fly processing, and when to do it to RAM. This version is pretty close to what the final version will be.


If you keep it within several MB, then it's not a problem. Even a couple of dozens of MB are marginally acceptable.

Quote from: ForeverZer0 on November 25, 2010, 07:07:24 pm
I do have one question with regards to loading the cached data. Would it be more efficient to load the entire hash when the game is loaded and reference it only the key I need for the map, or not load any of it, and only load the values of the hash for the map on the fly when the map is created. I really don't know how efficient the method is to open a file and Marshal load it, so I wanted to stay clear of constantly loading data this way every time a new map is encountered.
The reason for the files was to drastically reduce the number of iterations needed to be done at run-time, which I think could help with any lag issues due to a larger map.


In Blizz-ABS I load the passability data on demand as well and it doesn't seem to be a problem. You should definitely calculate it in advance and load it separately. But whether you want to load it all at once or only load the current map, that's up to you. I think loading only the current map is fine.

Quote from: ForeverZer0 on November 25, 2010, 07:07:24 pm
One more question, in ABSEAL, how did you come up with the value of 1600 for the sprite size. I want to also include an aliased method in the final version that will resize the sprite accordingly for the defined resolution if ABSEAL or BABS is being used.


I needed a high threshold value so I simply used 1600. I could have used 0xFFFFFFFF, but there was no need for it. 1600 should cover the size of most, it not all character sprites that somebody would use. This is actually used to destroy the sprite when it's outside of the screen since RMXP renders sprites outside of the screen. Feel free to take parts of that code and adapt it.

Quote from: ForeverZer0 on November 25, 2010, 07:07:24 pm
TEST MAP SIZE: 1024 x 576

Okay, after some testing, here are the results. The average time a map takes to initialize is 0.320 with this script, and only 0.070 without it. This is definitely something I need to look into. The average update time is dead even, both ending with an average time of 0.025 after 400 updates (Graphics.update included).

I'm relatively pleased with the results. Although the initialization timing is longer (still only 1/3 of a second), I did manage to keep the update method the same, which is far more important. This basically means that once the map is loaded, no sacrifice is being made updating a screen 192% larger.


The initialization might possible take longer on relatively smaller maps due to the extra data loaded, but I'm sure that larger maps should load faster than without your script. There's usually a threshold under which a script like this is actually less efficient. But that actually doesn't matter since the difference is so small that you won't notice (0.3 seconds is really not something that you notice that much compared to 0.07).
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.

ForeverZer0

@ryex
Sorry, I just scanned your message and thought you were asking the screen size. The test map size was 75 x 55. It had a medium amount of events on it, though with this particular test, I was not so much concerned with the effect events happen to have. I'll probably do some more in-depth testing tonight, with even larger maps, and test differences with the number of events, etc, etc.

Future plans:

  • Adjust the way the autotile and priority data is loaded.
  • Create a method to have ABSEAL work correctly with this.
  • Make some fixes for a few default systems, such as weather, message boxes, etc.
  • Possibly find a way to create a way to have windows automatically correct themselves using a different resolution, but I doubt this is very practical, and will likely lead to only more issues. 
  • Attempt to cut down on RAM usage if possible.

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.

Ryex

lol I WAS taking about screen size you just kept saying map size. so the resolution was 1024 x 576? wow thats fairly big you should go to at least 1400 x 900 to test it out.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

ForeverZer0

My monitor resolution is only 1366 x 768.  :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.

G_G

I could test it out. My resolution is 1920 x 1200 well its actually my grandmas but same difference.

Ryex

I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

WhiteRose

My monitor is 1920x1200. I could test it for you if you'd like.

The Niche

Ok, I've got a probwem with the script. If I try to use it with BABS, it throws me an error, complaining about the pixel_rate in BABS part 3 being undefined for nil class.
Level me down, I'm trying to become the anti-blizz!
Quote from: winkio on June 15, 2011, 07:30:23 pm
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.



I'm like the bible, widely hated and beautifully quotable.

Dropbox is this way, not any other way!

123th

error in game map
  def setup(map_id)
...
...
...
   $game_system.scroll_x = 0

undefined method "scroll_x=" for nil:NilClass

ForeverZer0

Quote from: 123th on December 12, 2010, 05:26:14 pm
error in game map
  def setup(map_id)
...
...
...
    $game_system.scroll_x = 0

undefined method "scroll_x=" for nil:NilClass


I have no clue where your getting that from. That's not in the script, nor is even the proper class to reference "scroll_x". That is used in Game_Map, not in Game_System. You either added that as an edit yourself, or it is a mistake in another script you are using, nothing to do with this one.

What are other scripts are you using?
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.

123th

Quote from: ForeverZer0 on December 12, 2010, 06:01:03 pm
What are other scripts are you using?


mmm... damned patch... reinstall rmxp really help  :shy:

ForeverZer0

December 12, 2010, 07:04:13 pm #36 Last Edit: December 12, 2010, 08:56:28 pm by ForeverZer0
I added a few compatibility fixes, which I placed in a new section in the main post. Currently the fixes only include the weather systems (that I know of), but expect more to come soon. Feel free to ask for a fix, but I only will be doing it for either default RMXP scripts, or widely popular and distributed scripts. I will not being doing it for some obscure script that know one ever heard of that you found on a random forum located in Cambodia.

EDIT: Nevermind. I'm starting a new topic with it.
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.

The Niche

Quote from: The Niche on December 12, 2010, 09:58:27 am
Ok, I've got a probwem with the script. If I try to use it with BABS, it throws me an error, complaining about the pixel_rate in BABS part 3 being undefined for nil class.
Level me down, I'm trying to become the anti-blizz!
Quote from: winkio on June 15, 2011, 07:30:23 pm
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.



I'm like the bible, widely hated and beautifully quotable.

Dropbox is this way, not any other way!

G_G

@F0, sorry I havent been able to test the script with the resolution. I'm sorry. Got really busy at my grandmas house then forgot about it. I might be able to return the results within 2-3 weeks.

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.