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

eri0o

Re: Can I improve high resolution animation that lags?
« Reply #40 on: 20 Jan 2020, 22:03 »
Quote
Dynamic Sprites. These cannot be released until game author tell so by calling DynamicSprite.Delete(), obviously

Wait, if a dynamic sprite goes out of scope (losing that pointer forever), it doesn't get deleted?

Re: Can I improve high resolution animation that lags?
« Reply #41 on: 20 Jan 2020, 22:07 »
Quote
Dynamic Sprites. These cannot be released until game author tell so by calling DynamicSprite.Delete(), obviously

Wait, if a dynamic sprite goes out of scope (losing that pointer forever), it doesn't get deleted?

It does get deleted. I did not want to go into each detail about dynamic sprite, because it's not relevant to the issue.

eri0o

Re: Can I improve high resolution animation that lags?
« Reply #42 on: 20 Jan 2020, 22:11 »
Thanks!
« Last Edit: 20 Jan 2020, 22:21 by eri0o »

TheManInBoots

  • Epically wrote function to declare an int
Re: Can I improve high resolution animation that lags?
« Reply #43 on: 22 Jan 2020, 20:20 »
I'm glad, those are valuable insights Crimson Wizard.

It's cool to know all this. I experimented with it, and I was able to reduce the locked sprites to 100 KB in my original game with the video intro.

What striked me however is that it tells me that I have only 131172KB total sprite cache available. Only 131 MB?

I set the Sprite cache to 2 GB in Default Setup.
I saved the game in the editor.
I built the .EXE file.
I ran the game from the editor.
I ran the game over the winsetup file. Same result.

I have 3,84 GB usable RAM.
I have 1,759 GB total Graphic card memory.

Why could it be that I have only  131MB free cache??


Thing is... it does not seem to unlock locked sprites after calling Mouse.ChangeGraphic again.
Ok, good thing we also talked about the other means to preload sprites! It's always good to find out a little bit more beyond what seems relevant at the moment!

I also found another bug, related to locked size counter
Does the locked size counter actually have a limit?

I also removed obligatory player's view precaching. That made game startup almost instant for me.
Same for me, with your plugin there is no frozen black screen.


Side note: The character who's view sprites are locked into cache is always the character ID 0. I tried setting different characters as player anywhere in the scripts before the room was loaded, but that did not work (maybe it could be possible if you communicate directly to the machine...). I think it's not the first player's view, but simply Character ID 0's view that is being locked.
In order to reduce locked sprites I set character ID 0 to an empty view and created a different character whom I set up as my player.

Also interesting to know: the Speech, Idle and Blinking view are not being locked into cache. Only the normal view.
« Last Edit: 22 Jan 2020, 20:32 by TheManInBoots »

Re: Can I improve high resolution animation that lags?
« Reply #44 on: 22 Jan 2020, 20:34 »
What striked me however is that it tells me that I have only 131172KB total sprite cache available. Only 131 MB?

I cannot answer this, what are other numbers in the message? It should say "Sprite cache size: X (limit Y, locked Z)".

Does the locked size counter actually have a limit?

Yes, technically it's 4 billion, as a 32-bit unsigned integer, but it is not used for anything but statistics.

The character who's view sprites are locked into cache is always the character ID 0. I tried setting different characters as player anywhere in the scripts before the room was loaded, but that did not work

You can set it in the editor, by opening a character for edit and pressing "Make this the player character" button (it's right above the view preview).
« Last Edit: 22 Jan 2020, 20:37 by Crimson Wizard »

TheManInBoots

  • Epically wrote function to declare an int
Re: Can I improve high resolution animation that lags?
« Reply #45 on: 31 Jan 2020, 00:04 »
what are other numbers in the message? It should say "Sprite cache size: X (limit Y, locked Z)".
It says:
Code: Adventure Game Studio
  1. Sprite cache size: 78319KB (limit: 131172 KB, 100 locked)
But actually don't worry, it's fine.
As soon as the sprite cache size surpasses the limit, the limit grows with it, so it's not actually a problem for me.
I thought the limit defines the maximum cache size.
You can set it in the editor, by opening a character for edit and pressing "Make this the player character" button (it's right above the view preview).
Oh yes of course, you're right. Been so long I used the button, I didn't even see it! Thanks.


And anyways, I'm happy you also found a few things that can be improved in the engine and that can make the program better.
« Last Edit: 31 Jan 2020, 00:07 by TheManInBoots »

Re: Can I improve high resolution animation that lags?
« Reply #46 on: 31 Jan 2020, 00:34 »
It says:
Code: Adventure Game Studio
  1. Sprite cache size: 78319KB (limit: 131172 KB, 100 locked)
But actually don't worry, it's fine.
As soon as the sprite cache size surpasses the limit, the limit grows with it, so it's not actually a problem for me.
I thought the limit defines the maximum cache size.

It should! so... weird. But if you are running that test build I made, maybe I broke something else unintentionally...

TheManInBoots

  • Epically wrote function to declare an int
Re: Can I improve high resolution animation that lags?
« Reply #47 on: 01 Feb 2020, 20:55 »
Hm... It's actually when I build and run the normal game from the editor. And I tried it out, it's the same when I start it via the winsetup.
This sprite cache seems to be a real trouble maker!
You told me about the counter that is inaccurate. The sprite limit is not very accurate now as well it seems. Maybe I'm just interpreting it wrong.
However I wonder if multiple inaccuracies like that could also lead to game crashes in more extreme situations, like high resolution animations.

EDIT: Just to clarify what I meant by it, because I talked about inaccuracies before in this thread:
If the game does not keep track correctly of the statistics (the sprites, the maximum sprite cache etc.) maybe some calculation will create an error or the engine believes sprite cache is full even though it isn't.
« Last Edit: 05 Feb 2020, 03:20 by TheManInBoots »