Author Topic: Can I improve high resolution animation that lags?  (Read 511 times)

Hi everyone!

I have been working on a game for the previous months. Now in the last steps of the process I want to see if I can improve the animated intro story, which is lagging a lot.
Because I use very high resolution animations (the game is in 1600x900, sometimes I have animations with 1600x900 sized sprites and additional animations on top of that), the animation becomes really slow and starts lagging, so that even the background music lags and cracks and pauses. And that is even before I added sound effects and voice over.
That's why I come back here again to seek help from creative, competent and inspired minds!

So far I tried changing the graphics driver to Direct3D 9, and turning "Limit display-mode to 16bit" as well as "Render sprites to screen resolution" to 'true'. I feel as if it improved the lagging a little bit, but the lagging still exists, especially during the higher resolution animations. Also, during the gameplay after the intro, I would like to animate the grass in the foreground, but doing so slows the game down. It creates lagging and the character does not move fluently anymore. (The grass covers a big area (1600x500). Also the animated grass is in the foreground so I cannot turn it into a background animation, in case you're thinking about it :) ) Increasing the sprite cache size does not work.

Are there any ways and tricks to reduce the lag or even eliminate it?

I'm aware most people don't create adventure games with those size dimensions and might not encounter this problem too often, so I'm really thankful for anyone who can help!
« Last Edit: 17 Nov 2019, 19:57 by TheManInBoots »

Jack

  • Think deviant
    • I can help with AGS tutoring
    • I can help with scripting
    • I can help with story design
    • Jack worked on one or more games that was nominated for an AGS Award!
Re: Can I improve high resolution animation that lags?
« Reply #1 on: 17 Nov 2019, 20:03 »
I have done some high res full screen animation tests with the same disheartening results. Turning off the sprite compression will make it faster, but will also make your game a lot bigger. Luckily compressing the game itself with another program for a download will bring the size down again significantly.

Would it be possible to separate the animations into smaller parts? Assuming not the whole screen is animated.

I don't know whether .ogv videos can be used instead of backgrounds in AGS, but it might be faster. As I understand, the codec is supported by AGS itself, so you don't have to worry about the codec being installed on the player's computer.

Cassiebsg

  • Cavefish
  • Fleeing the Cylon tyrrany...
    • Cassiebsg worked on one or more games that won an AGS Award!
    •  
    • Cassiebsg worked on one or more games that was nominated for an AGS Award!
Re: Can I improve high resolution animation that lags?
« Reply #2 on: 17 Nov 2019, 20:11 »
OGV video playing in the BG is only supported using a plugin (which might mean you get stuck in windows only mode, if the plugin can't run on other systems).

I'm not sure if you are animating a "cut scene" or the play world in it self. If it's a cut scene you can just replace it with a full sized animated frame or a video. If it's the play world thingswill get tricky and I'm not really the best one to give advice on it.  ;)
There are those who believe that life here began out there...

Re: Can I improve high resolution animation that lags?
« Reply #3 on: 17 Nov 2019, 20:54 »
AGS currently has two bottlenecks when it comes to hi-res sprites and animations:

1) Loading sprites.

AGS streams sprites upon request into "sprite cache" from the file, and this means that it may start reading file alot right before or during the animation.
At the moment (AGS 3.5.0) there's still no means to tell AGS to preload sprites by command, but to work around this there is a precaching technique where you force sprite to load using some operation. Unfortunately this is not documented, so may require investigation to find simpliest action that works. For instance, setting object's Graphic property does not load sprite until object is redrawn, which kind of defeats the purpose. But setting graphic to mouse cursor (using Mouse.ChangeModeGraphic) does --- I know that because I looked into the engine code.
So in theory you could try to preload all sprites for the next scene by calling Mouse.ChangeModeGraphic in a loop.

Another important factor here is sprite cache size. If it's not large enough to store all the sprites, then some of the loaded ones will be discarded before loading next ones. If you have a looping animation, this may lead to problems again.


2) Converting native bitmaps to textures.

When running Direct3D or OpenGL renderer, AGS must convert bitmaps to corresponding texture format. This process may be slow for large number of hires gfx. Unfortunately, at the moment AGS does not cache textures along with sprites, and so textures may actually be discarded earlier, when you change object graphic for instance. Also, these textures are not shared between objects, so even if two objects use same sprite, they may still end up having two duplicating textures that are created and updated separately. Improving this may be one of the primary TODOs for the next version of AGS, because people begin making hires games with big animations more often. But I am afraid there's no possible workarounds that you could use yourself at the moment.
EDIT: thinking about this, Jack's suggestion from above may work: try splitting up animation frames into pieces that change and pieces that don't change (and even - pieces that change often and rarely), and display them on separate objects. This will reduce amount of pixels needed to be updated to texture each turn.


To sum up, I'd frankly say that the best course of action would be to delay using lots of hires animations in AGS for now, and keep reminding this problem to engine developers to prioritize this...

Other than that, if you need these primarily for the cutscene, maybe trying playing video instead, as Cassiebsg suggested above.
« Last Edit: 17 Nov 2019, 21:14 by Crimson Wizard »

Re: Can I improve high resolution animation that lags?
« Reply #4 on: 25 Nov 2019, 16:02 »
Thank you for your answers!


Jack

Turning the compressing off actually helps, thanks! (And yes my game is 3 GB bigger now  :P)
But it's quite irregular, sometimes the animations are more smoothly and sometimes more laggy!
Yes, I assume I will probably use an .ogv video for the animation, that will be some work to turn it into an actual video, but it might be the only option.
For the background (or rather foreground)  in-game animation of the grass, I found out that it actually helps to reduce the number of sprites in the animation loop to speed up the game and animation.
I know that there is decent compressing software for free online, but do you have a program that you prefer for compressing your game?




Cassiebsg

From what I read in the AGS index I believe that playing videos (both .ogv or other standard formats as .mpg or .avi) are supported with plugins that are built in the engine and that function on both windows and mac computers (only not on Linux), so I believe it will be fine.
I am mainly animating a cut scene, only the grass animation is in the play world.
About the full size animation, that's actually where the problem comes up, full sized animated frames are not animated fastly and smoothly, the game begins to lag and freeze or at least slow down, when you have enough frames in the animation. Even if it is only one full sized animated frame. But I'll look into the option to play it as a video. That will hopefully work.




Crimson Wizard

I'm not sure if I understood how exactly you want me to use the "Mouse.ChangeModeGraphic" function.
I tried putting "Mouse.ChangeModeGraphic" in Repeatedly execute triggered by a bool to keep it in a loop while the animation runs, but that seemed to only slow it down.
Now I placed a "Mouse.ChangeModeGraphic" function in front of each scene.
Do I need to load each sprite of the animation as the mouse graphic in order to preload it? Or do I simply run the "Mouse.ChangeModeGraphic" command no matter what sprite I use as the mouse graphic, and all the sprites automatically preload? (I used a random sprite.)
How exactly does it work with the engine code?

There definitely seems to be a problem on how sprites are saved. When I have several longer animations with more sprites, it becomes worse. But I set the sprite cache to 50GB and it still lags.
Sometimes I just turned animated objects or characters transparent and let them keep animating while the next scene starts. Since you said the sprite cache is limited I made sure to not let anything animate in the background transparently in a loop.

It still lags. The weird thing is that sometimes it lags more, sometimes less for no obvious reason, when I test run it several times. But it does not display the animation as it should.

So, it seems that I will turn the intro story into a video and play it that way.

(If I get to it, I'll make sure to drop a few lines in the engine development)
« Last Edit: 25 Nov 2019, 16:25 by TheManInBoots »

Re: Can I improve high resolution animation that lags?
« Reply #5 on: 25 Nov 2019, 16:34 »
I'm not sure if I understood how exactly you want me to use the "Mouse.ChangeModeGraphic" function.
I tried putting "Mouse.ChangeModeGraphic" in Repeatedly execute triggered by a bool to keep it in a loop while the animation runs, but that seemed to only slow it down.
Now I placed a "Mouse.ChangeModeGraphic" function in front of each scene.
Do I need to load each sprite of the animation as the mouse graphic in order to preload it? Or do I simply run the "Mouse.ChangeModeGraphic" command no matter what sprite I use as the mouse graphic, and all the sprites automatically preload? (I used a random sprite.)

You call Mouse.ChangeModeGraphic for each sprite you need to preload and it will get preloaded. Only sprites you call ChangeModeGraphic with are preloaded while you do so.

The time of call is up to you. You have to understand that calling this function does not magically make your animation faster, it merely allows you to control the time of sprite loading operation. After that, if sprite stays in memory, animation does not need to load it while it plays.
Normally I'd suggest do this when/before the scene starts. I guess it's even possible to put a "loading, please wait" text on screen while you do that.
« Last Edit: 25 Nov 2019, 16:38 by Crimson Wizard »

Re: Can I improve high resolution animation that lags?
« Reply #6 on: 25 Nov 2019, 18:20 »
Okay, I will give it a try, this pre-loading technique might actually work.
When I restart the game and play the animation again after having played part of the animation before, that part of the animation is fluid (so apparently even when you close the game, the sprite cache is still saved with the loaded sprite files). But I also have too many sprites in my animation to save them all at the same time in the sprite cache. (That's why when I restart and play the animation again after having played the WHOLE animation, it does not work anymore, because the first sprites have already been deleted and so continue to get replaced before being displayed)

Do you know if the sprite cache limit is based on the number of sprites, or by the overall file size/used space of the sprites?  (I assume file size because higher resolution animations lag more, but I'd like to know for sure)
And if I pre-load the frames of a certain loop in this way and then I animate two objects with the same loop (that I just pre-loaded), the sprites are pre-loaded for both objects at the same time, and don't take double the sprite cache size, right? (Because you mentioned the texturing on the other hand is being done separately every single time). Knowing this could help me to re-structure my animation properly.  Maybe I can work around having to pause in the middle of the animated story just to load the new upcoming frames into the cache.

And I assume there is no way to increase the sprite cache limit, right? (The sprite cache in Default Settings seems to have no effect on this)

A "Loading..." symbol is a nice idea. :)
« Last Edit: 25 Nov 2019, 18:27 by TheManInBoots »

Jack

  • Think deviant
    • I can help with AGS tutoring
    • I can help with scripting
    • I can help with story design
    • Jack worked on one or more games that was nominated for an AGS Award!
Re: Can I improve high resolution animation that lags?
« Reply #7 on: 25 Nov 2019, 18:28 »
I use winrar, but any tool that allows you to set the compression level of a zip file will do. pkzip is free and will do everything you need. It has a terminal interface.

Re: Can I improve high resolution animation that lags?
« Reply #8 on: 25 Nov 2019, 18:47 »
When I restart the game and play the animation again after having played part of the animation before, that part of the animation is fluid (so apparently even when you close the game, the sprite cache is still saved with the loaded sprite files).

IDK how that is possible. Maybe there's a misunderstanding on how this works, or I do not quite understand what you mean.

Sprite file (acsprset.spr) is where sprites are stored on disk. Sprite cache is an array in memory where sprites are stored while you played the game. Engine does not save sprite cache anywhere. Each time you start the game (run exe, that is) sprite cache is empty and is only filled as you play. Nothing is preloaded until necessary.

On the other hand, if you play animation in game, and then play same animation again without quitting the game (closing the program), then some or all of the sprites may be still be in the cache and no extra loading would be necessary.


Do you know if the sprite cache limit is based on the number of sprites, or by the overall file size/used space of the sprites?  (I assume file size because higher resolution animations lag more, but I'd like to know for sure)
And if I pre-load the frames of a certain loop in this way and then I animate two objects with the same loop (that I just pre-loaded), the sprites are pre-loaded for both objects at the same time, and don't take double the sprite cache size, right? (Because you mentioned the texturing on the other hand is being done separately every single time). Knowing this could help me to re-structure my animation properly.  Maybe I can work around having to pause in the middle of the animated story just to load the new upcoming frames into the cache.

Sprite cache size means roughly the size of sprites in memory. I say roughly, because it does not account for certain "locked sprites". But I don't remember if it also counts DynamicSprite sizes as well.
If you use same sprite number in multiple frames, views, or objects, that's the same sprite, and once loaded it does not have to be duplicated multiple times.

And I assume there is no way to increase the sprite cache limit, right? (The sprite cache in Default Settings seems to have no effect on this)

Of course there is, why would the setting exist otherwise?!
The "Default Setup" has effect only on freshly installed game  (that's why it's called default). I suspect the manual does not explain this very well, so I will have to update the wording there...
"Default setup" is overidden by user settings. Presumably you have already created them by running winsetup once. So you should change both Default Setup and user settings (by running winsetup).
Actually, you may not touch Defaut Setup at all until or unless you are sending your game to someone else.

PS. Just be careful with the big sizes. Sprite cache takes real computer memory, and there are other things in game that also do, and there may be other applications running at the same time... if you are going to load all your 10 GB sprites in memory that will make an impact on player's PC perfomance (and may crash the game) :).
« Last Edit: 25 Nov 2019, 19:10 by Crimson Wizard »

Cassiebsg

  • Cavefish
  • Fleeing the Cylon tyrrany...
    • Cassiebsg worked on one or more games that won an AGS Award!
    •  
    • Cassiebsg worked on one or more games that was nominated for an AGS Award!
Re: Can I improve high resolution animation that lags?
« Reply #9 on: 25 Nov 2019, 20:01 »
Just for clarification.
I was not talking about playing a simple cutscene video. I know AGS supports that with no need of extra plugins at all. But you must know that this video will play in the foreground, so if you need AGS to add text, voice over or something else, you won't be able.

I was talking of playing a video in the background, so that you can display text, run voice over, GUIs, etc over the video. In this case you will need to use a plugin for ags.
You can find the plugin here, if you need it: https://www.adventuregamestudio.co.uk/forums/index.php?topic=45348.0
There are those who believe that life here began out there...

Re: Can I improve high resolution animation that lags?
« Reply #10 on: 06 Dec 2019, 16:12 »
Jack

I appreciate the recommendation.


Cassiebsg

My first priority for now is to explore the options I have that work for both the windows and Mac platform.
But do you know if it is possible with this plugin to play an animated object on top of the playing video?
It's not addressed in the thread.
This would prove to be really helpful if the other options fail.
Thanks for the link.


Crimson Wizard

So, the sprites were actually being saved in the sprite cache even after I closed the game and re-started it, that's actually what I meant. But I opened the game from the game editor, so not via the .exe or winsetup file. If that is actually surprising to you and you want to look into it, I used the AGS 3.5.0.17 / RC1 version. I haven't tested it on the more recent versions. Also it only worked when the "Compress the sprite file" option was set to false.

I'm actually looking forward to the day that my computer is going to crash because of a 2D point and click game lmao.
When I pre-load part of the animation cutscene into the sprite cache and then start the .exe or winsetup file it works.
But when I pre-load ALL the sprites of the animation I receive this error message at some point during the pre-loading process after the game started:


And it does not matter if I set the Sprite cache size to 1GB, 10GB or 15 GB and then export the game. When I start the game I still get the error message at the same point.

I interpret the message in the sense that the sprites of the complete animation have a size of 5,76 GB, and since the working memory of my computer is less than 5,76 GB the engine has no way to save them.
I have no knowledge on how to read these kind of messages, so tell me if my interpretation is wrong.

Another option that could really save me with this issue is if I could actually play music while the sprites are loaded into the sprite cache. Right now the music starts stagnating and faltering when it plays while the sprites are loaded into the sprite cache.
If I could play sounds and music while sprites are saved into the sprite cache I could use a slowly animated frame/ a still frame/ a black frame while the new sprites are loaded into the cache in the middle of my animation cut scene, and in this way I could avoid the sprite cache to be overloaded by uploading each half of the sprite group separately, instead of all at once. Maybe if I use certain audio formats, or use specific functions or do anything else I might be able to prevent the sounds from faltering?

Side note on pre-loading:
Is the engine loading the sprites faster into the sprite cache if I use the "Mouse.ChangeModeGraphic" function on every sprite, instead of playing every single loop of the animation cutscene on an objec? Or is it taking the same amount of time?

EDIT: Right, you already told me that the sprite is not loaded into the cache until the object is being redrawn. And there is no way to work around it by placing the object outside the screen or covering the object by another object? It still means that it's not being redrawn? Actually you could set a characters transparency to 99, and run the character through all the loops. I don't believe you can actually see it when the transparency is set to 99 on a black background.
Still I assume it takes longer because of the texturing and redrawing.
« Last Edit: 06 Dec 2019, 19:16 by TheManInBoots »

Cassiebsg

  • Cavefish
  • Fleeing the Cylon tyrrany...
    • Cassiebsg worked on one or more games that won an AGS Award!
    •  
    • Cassiebsg worked on one or more games that was nominated for an AGS Award!
Re: Can I improve high resolution animation that lags?
« Reply #11 on: 06 Dec 2019, 17:15 »
But do you know if it is possible with this plugin to play an animated object on top of the playing video?
It's not addressed in the thread.

It can, as it renders the movie in the background. You can then have characters, objects, GUIS, text, audio, etc over it.
You can see the plugin in action on this game by mandle: https://www.adventuregamestudio.co.uk/site/games/game/2118/
Or my own game in the intro and start movie/cutscene: https://www.adventuregamestudio.co.uk/site/games/game/2201/ (all text, music and voice are AGS scripted. This allows to change the music and translation files, and still only use one movie).

There are those who believe that life here began out there...

Re: Can I improve high resolution animation that lags?
« Reply #12 on: 06 Dec 2019, 19:32 »
So, the sprites were actually being saved in the sprite cache even after I closed the game and re-started it, that's actually what I meant.

Sorry, but I still can't understand what you mean by that. Do you mean that animation sprites are found in the cache when you re-launch the game, even before you do the preload? How did you find that out? Or do you mean something else? I am confused by words "saved in sprite cache". Sprite cache does not exist in between game launches.


And it does not matter if I set the Sprite cache size to 1GB, 10GB or 15 GB and then export the game. When I start the game I still get the error message at the same point.

I interpret the message in the sense that the sprites of the complete animation have a size of 5,76 GB, and since the working memory of my computer is less than 5,76 GB the engine has no way to save them.
I have no knowledge on how to read these kind of messages, so tell me if my interpretation is wrong.

Of course your interpretation is correct, you may set any number for sprite cache size, but if your computer memory is less, that won't work and may eventually crash the program.


Another option that could really save me with this issue is if I could actually play music while the sprites are loaded into the sprite cache. Right now the music starts stagnating and faltering when it plays while the sprites are loaded into the sprite cache.

Perhaps, try turning threaded audio on. Right now it's only possible to do by hand by setting following in a acsetup.cfg
Quote
[sound]
threaded=1

BTW this reminds me, we should add this to Default Setup, and maybe to winsetup too...


Is the engine loading the sprites faster into the sprite cache if I use the "Mouse.ChangeModeGraphic" function on every sprite, instead of playing every single loop of the animation cutscene on an objec? Or is it taking the same amount of time?

I believe loading itself will take same amount of time, since that's exactly same operation.
For actually preparing sprites for display on screen there may be additional action of course, but it's something that cannot be avoided.
« Last Edit: 06 Dec 2019, 19:34 by Crimson Wizard »

Re: Can I improve high resolution animation that lags?
« Reply #13 on: 07 Dec 2019, 00:58 »
It can, as it renders the movie in the background.

Great, I'll keep it in mind. I'm currently downloading the games to check it out a little.

Perhaps, try turning threaded audio on.

I tried (with both acsetup files). It did not work. There is nothing else I can do?
If there was a way, the problem would be solved and I could finish my cutscene!




Do you mean that animation sprites are found in the cache when you re-launch the game, even before you do the preload? How did you find that out?
YES, the animation sprites were found in the cache when I re-launched the game, even before I did the preload.
I started the game from the editor when I observed this. The parts of the animation I had played the previous launch were fluid.

BTW this reminds me, we should add this to Default Setup, and maybe to winsetup too...
Sure.

For actually preparing sprites for display on screen there may be additional action of course, but it's something that cannot be avoided.

OK, so it DOES take more time right? And for the re-drawing of sprites, an object that is covered by another object, are its sprites being re-drawn or not when it's animated?
« Last Edit: 07 Dec 2019, 14:05 by TheManInBoots »

Re: Can I improve high resolution animation that lags?
« Reply #14 on: 07 Dec 2019, 16:10 »
Perhaps, try turning threaded audio on.
I tried (with both acsetup files). It did not work. There is nothing else I can do?
If there was a way, the problem would be solved and I could finish my cutscene!

I wish I had a way to test it, but I dont have a game with large sprites at the moment (I may try making a dummy game later).

But, could you show how do you do preloading in script?
I think it's worth trying to add Wait() command in this process. For example, if you have 1000 sprites to preload, load 100, call Wait (time may be adjusted), then continue.
Simple example (untested):
Code: Adventure Game Studio
  1. int counter;
  2. for (int i = 0; i < 1000; i++)
  3. {
  4.       Mouse.ChangeModeGraphic(eModeLookat, i);
  5.       counter++;
  6.       if (counter > 100)
  7.       {
  8.             Wait(10); // experiment increasing/decreasing the delay
  9.             counter = 0;
  10.       }
  11. }
  12.  



Do you mean that animation sprites are found in the cache when you re-launch the game, even before you do the preload? How did you find that out?
YES, the animation sprites were found in the cache when I re-launched the game, even before I did the preload.
I started the game from the editor when I observed this. The parts of the animation I had played the previous launch were fluid.

Engine does not do anything that could lead to this. The only explanation that I have is that maybe operating system keeps some of the loaded data in its own cache and this allows for faster inserting them back into engine memory when it asks to load files from disk. I heard Windows actually may do that with larger apps so it's faster to start them up later.



For actually preparing sprites for display on screen there may be additional action of course, but it's something that cannot be avoided.

OK, so it DOES take more time right?

It takes extra time to put them on display, in addition to loading (regardless of how and when you load). I hope we will improve (reduce) this extra time in later versions.


And for the re-drawing of sprites, an object that is covered by another object, are its sprites being re-drawn or not when it's animated?

Good question, and I think they are. This may need more investigation, but from a quick look into engine code, these are conditions under which the object is skipped:
1. Object is off (Visible = false)
2. Object is off the room limits.
It's interesting to note that this is not the optimal check, as it should probably test whether object is actually shown in viewport.
Furthermore, something I noticed only now, it does not work for all outside positions, but only when an object is beyond rightmost X border (object.x > room.width), or topmost Y border (object.y < 0).

Snarky

  • Global Moderator
  • Private Insultant
    • Best Innovation Award Winner 2018, for his numerous additions to the AGS open source ecosystem including the new Awards Ceremony client and modules
    • Snarky worked on one or more games that won an AGS Award!
    •  
    • Snarky worked on one or more games that was nominated for an AGS Award!
Re: Can I improve high resolution animation that lags?
« Reply #15 on: 07 Dec 2019, 16:40 »
Furthermore, something I noticed only now, it does not work for all outside positions, but only when an object is beyond rightmost X border (object.x > room.width), or topmost Y border (object.y < 0).

Probably because otherwise you'd have to take into account the object height/width to decide whether to draw it.

Re: Can I improve high resolution animation that lags?
« Reply #16 on: Today at 00:12 »
I think it's worth trying to add Wait() command in this process. For example, if you have 1000 sprites to preload, load 100, call Wait

How does waiting after 100 sprites make any sense? My game starts lagging from only one full-sized sprite on sometimes. If it has not been loaded into the sprite cache I display a sprite and the music starts clicking and pauses for a second before the next sprite is displayed. Sometimes it clicks and breaks several times during one single sprite when I have a full 1600x900 sized animation.
After 100 sprites I have already 100 lags.

I experimented anyways with the idea of adding a Wait function, but after each Mouse.ChangeModeGraphic function, in case that creating some time gap between each sprite loading might help.
Something like this for example:

Code: Adventure Game Studio
  1. int sp=1;
  2. while(sp>0&&sp<1001)
  3. {Mouse.ChangeModeGraphic(eModeUsermode2,sp);
  4. Wait(10);
  5. sp++;}
  6.  

But that does not work.

I wish I had a way to test it, but I dont have a game with large sprites at the moment (I may try making a dummy game later).

Yeah,I'd appreciate it, that is probably the best way to go about it. I tried to recreate the situation with 90 large sprites in a separate game but it did not lag. It's just happening in my game. Maybe you need a big enough amount of sprites?
However it is acting really bizarre in my project. The whole game seems to freeze while the sprite is loaded into cache. I added an animated Loading symbol as the (5 frame) background animation of the room, since those sprites are handled independently from the sprite file, but even the background animation starts to freeze. Also the music playback -and everything else happening on the screen- freezes... it seems like the whole game comes to a halt and waits for the sprite to be loaded into the cache before continuing.
I don't know if I have to send you the game again in order to find a way to fix this sigh. But maybe you are able to replicate the situation.

The only explanation that I have is that maybe operating system keeps some of the loaded data in its own cache (...) I heard Windows actually may do that with larger apps so it's faster to start them up later.

I know nothing about that. It's possible.

It takes extra time to put them on display, in addition to loading (regardless of how and when you load). I hope we will improve (reduce) this extra time in later versions.

I experimented a little bit with the putting on display. The engine displays an animation with the highest possible speed (of 40 frames/second) without delay: 40 frames within 1 second, even for high resolution animations. And when it is not fast enough to display it, it simply skips one sprite in the loop, but one wouldn't notice because it's animated so fast. (So used for loading sprites it probably does not even slow down the loading process, put simply skips a few sprites). Honestly I think it's working good enough ... but it's especially the process of loading into the sprite cache which really slows things down...

And actually the object animation and redrawing thing is not really important. I only thought animating the object might be easier to script, but that is not at all the case. Plus you are limited to 40 sprites per second, while you can loop the Mouse.ChangeModeGraphic up to 150.000 times in less than a second, so that says everything. It's very interesting to know about the object sprite display, though.

Probably because otherwise you'd have to take into account the object height/width to decide whether to draw it.
That makes total sense.
« Last Edit: Today at 00:24 by TheManInBoots »

Re: Can I improve high resolution animation that lags?
« Reply #17 on: Today at 00:34 »
40 frames/second is not the highest possible speed, it's the default. You can change this rate using SetGameSpeed.

Re: Can I improve high resolution animation that lags?
« Reply #18 on: Today at 01:05 »
Ok, good to know, it works until 1000 loops per second I see. And for the sprite loading, do you think you'll be able to create a dummy game?
« Last Edit: Today at 01:54 by TheManInBoots »