Puffer

creator of a game that doesnt exist yet
Veteran
Joined
May 2, 2016
Messages
268
Reaction score
653
First Language
Vietnamese
Primarily Uses
RMVXA
Hey, I'm looking for script that replace the black screen delay before most of scene such as map, title screen,save,.. I want player to know the loading and stuff so they don't thing that the game is crashed or something when they get transfer to new map, especially parallax mapping map, which take ton of time to load it up. I have check out MOG Hunter's script, but it is only for save, and it seem like a fake loading bar.


P/s: Sorry for my bad English!
 

Zalerinian

Jack of all Errors
Veteran
Joined
Dec 17, 2012
Messages
4,699
Reaction score
939
First Language
English
Primarily Uses
N/A
It is a fake loading bar, yes, but I haven't heard of any script (for any maker) that provides an actual loading screen.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
32,345
Reaction score
8,078
First Language
German
Primarily Uses
RMMV
I think you should take a step back and check something else:


On a regular game, switching maps takes less than one second - are you concerned that people take that second as a possible crash, or does your game take more than one second for switching maps?


If it's the second case, you should try to find out why your project is so slow before trying to cover that up...
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,193
Reaction score
841
First Language
Hungarian
Primarily Uses
RMVXA
It is a fake loading bar, yes, but I haven't heard of any script (for any maker) that provides an actual loading screen.



The reason for that is very simple actually.


The sole purpose of loading screens is to show the progress of loading the required files into your RAM.


Since no RPG Maker games use pre-cache systems for some reason (or at least I haven't heard about any), no script was made for this, because it is pointless without such a system.


If a game would pre-load the assets needed for the next map / menus / etc between transitioning, it would be very easy to show a real progress bar for it if the pre-load method is written well.


Showing a fake loading screen is more annoying than not showing anything at all, in my opinion.


But Andar is right, a map load should not take long at all, parallax or not, shouldn't matter, unless you use over-sized maps with tons of layers and if the image files for these layers are huge (in Bytes). That could take a while to load, but I can't even imagine how big your images could be to really feel the loading times between map changes. o_O


The loading speed also depends on your RAM type (and possibly CPU speed), so if you got old ones, your loading times will be slower naturally.
 

Zalerinian

Jack of all Errors
Veteran
Joined
Dec 17, 2012
Messages
4,699
Reaction score
939
First Language
English
Primarily Uses
N/A
The reason for that is very simple actually.


The sole purpose of loading screens is to show the progress of loading the required files into your RAM.


Since no RPG Maker games use pre-cache systems for some reason (or at least I haven't heard about any), no script was made for this, because it is pointless without such a system.


If a game would pre-load the assets needed for the next map / menus / etc between transitioning, it would be very easy to show a real progress bar for it if the pre-load method is written well.



While I'm sure that's part of it, there are actually plugins for MV to ease loading assets (I'm working on one myself, actually). Another reason it isn't implemented in VX Ace and below is that loading resources is synchronous, meaning nothing else happens while the file is being loaded. This is inefficient because if you're loading an enormous file, the game will noticeably hang while it's loaded in.


The only possible way VX Ace and below could get an actual loading screen (which should be unnecessary to begin with) would be using the Thread class to try and update the screen while the main thread loads resources, but I'm not even sure that the Thread class is available in RM (since it's so stupidly restricted), nor that a thread would be capable of updating the screen.


As a side note for anyone that might be asking why it's unnecessary for VX Ace and below to have a loading screen, while MV comes with one (albeit basic) out of the box is simple: RMMV is based around the web and being able to be run anywhere from laptops, desktops, mobile devices, and web browsers. Now, while each device might be able to run quickly enough to process the game at a good enough speed, network speed is often a very limiting factor. As a result, RMMV displays its loading screen while doing any level of loading because it's a very real possibility we could be waiting for a while for a resource to load over the internet, thereby making it necessary that we have a loading screen.
 

Sixth

Veteran
Veteran
Joined
Jul 4, 2014
Messages
2,193
Reaction score
841
First Language
Hungarian
Primarily Uses
RMVXA
Some systems, such as animated image systems which work by loading several images and cycling them, can benefit from pre-loading these images.


Whenever an image is loaded into the cache, a small freeze will happen. This is barely noticeable on higher end PCs, but on older ones, it is pretty obvious.


If these animated images need to be animated during gameplay, the first few frames of the animation will lower the FPS quite a bit and cause small lag spikes until the full animation cycle is loaded (all images are loaded). The amount of FPS loss depends on the size of the images loaded and the specs of the PC the game runs on.


Pre-loading these images would eliminate the FPS loss on the first animation cycle for them, not to mention that these animated images could potentially start at a later point too (so not during the transition), so it would be especially helpful to pre-load those images to preserve a smooth FPS during the whole gameplay.


Pre-loading the needed animations from the database would also majorly help in games where they are often used. Displaying these animations will always cause a small lag spike when they trigger. Doing this is especially helpful for real-time battle systems which often use animations such as an ABS or some hybrid systems.


Aside from animations, a project without custom scripts would not benefit more from pre-loading assets, but even than, pre-loading the often used animations and keeping them in the cache would make a huge difference in the performance of the game.


Here is an example of writing a loading bar code for images:

class LoadBar

def initialize
@sp = Sprite.new
@sp.bitmap = Bitmap.new(200,40)
@sp.x = (Graphics.width - @sp.bitmap.width) / 2
@sp.y = (Graphics.height - @sp.bitmap.height) / 2
@folder = "Graphics/ParallaxMaps/"
@files = Dir.glob("#{@folder}*.jpg") + Dir.glob("#{@folder}*.png")
@max = @files.size
@loaded = 0
@rate = 0.0
@color = Color.new(255,10,10,255)
update
Graphics.update
p Time.now
@files.each do |fl|
file = fl.sub(@folder,"")
Cache.load_bitmap(@folder,file)
@loaded += 1
update
Graphics.update
end
Graphics.wait(30)
p Time.now
end

def update
@rate = @loaded.to_f / @max
@sp.bitmap.clear
@sp.bitmap.fill_rect(0,30,@rate*200,10,@color)
@sp.bitmap.draw_text(0,0,200,24,sprintf("%1.2f%",@rate*100),1)
end

def dispose
@sp.bitmap.dispose
@sp.dispose
end

end

lbar = LoadBar.new
lbar.dispose



It's really a basic one, but it works well. Shows the progress of loading the specified images to the cache.


I couldn't be bothered to make it dynamic, just threw it together, but add a few arguments here and there, and you can make it load any image from any folder whenever you want, and show it to the user as well.


One thing to note though...


In the case of small image files, doing this will actually slow down the loading process a bit because of the progress bar drawing.


In the case of big files, it still slows it down a bit, but because the load time for bigger files is already kinda long, the slowdown here is barely noticeable.
 

Latest Threads

Latest Posts

Latest Profile Posts

Made the "My Beating Mystery" board today:
3ENFLSC.png

in Grim Trigger episodes 3 & 4, the main characters play a Clue rip-off board game called "My Beating Mystery" (haha), so of course I had to draw the board for it. Can't decide if I wanna add blood or not
Jeez...
I finally decide, after several ppl asking me to, to create a gamethread about project M... And my internet craps out on me halfway through the process :(
making my first game is like trying to stuff all my experience with old games into one
so its slow and painful when i dont get it right... i bet the next game is gonna be finished earlier!
When you don't find any time to work... :kaocry:
First Ten Minutes of my Caretaker inspired game

Forum statistics

Threads
110,398
Messages
1,052,979
Members
143,458
Latest member
KyN19
Top