Problems while importing sprites for animations [SOLVED]

Started by nightmarer, Thu 07/05/2020 19:51:48

Previous topic - Next topic

nightmarer

Hello.

I've been developing for a while a game configured for 640x400 px resolution.
Recently one designer has joined the team and he did a work of background animation. The idea of this animation is to put all the sprites in a view, then display this view as an object in the screen.
The problem seems that this view has 160 sprites more or less, and each PNG image is 1MB  more or less, sized as 1177x250. So when starting to import sprites at one point having more than ten the application slows down indeed, so I can't import the sprites in a fast way. It takes almost ten seconds to import next sprite. Also if I finish importing all the sprites (or almost all) AGS becomes really slow and seems that is going to crush at any moment.
Also acsprset.spr size becomes 1'6 GB, I can't understand why if I import 160 sprites sized in 1 MB more or less the size of this file increases so much.
The problem is not in my computer, because I tried to do it in another computer I have that is able to render huge videos and the problem is the same. We tried in a third computer and we are having the same problem.
Also we tried to set sprite compression true and false. Nothing changes, we are having problems.
Does AGS support well projects in 640x400?
Can you please provide me a clue about what should be happening?

Regards.

Cassiebsg

AGs saves image data as bmp (?), you can turn compression for sprites on that should reduce the size of the acsprset.spr, but it it'll just make AGS be slower, since it it then has to uncompress the picture before displaying it.

If you need 160 sprites to make an animation. would it not be best to record it as a video file? (ogg is great)
There are those who believe that life here began out there...

Crimson Wizard

#2
AGS of course supports 640x400 projects, but it has issues with big sprite data because of how inefficiently it stores them.

Quote from: nightmarer on Thu 07/05/2020 19:51:48
Also acsprset.spr size becomes 1'6 GB, I can't understand why if I import 160 sprites sized in 1 MB more or less the size of this file increases so much.

Are you saying that only 160 sprites of 1177x250 make 1.6 GB, or there was something else besides them?

Anyway, animation of 160 large sprites will run pretty slow in AGS because it still does not have proper preloading and will be loading them right before displaying, which may slow down your gameplay too.
Using video if possible is one solution, another is to break single animation object into parts which animate and don't animate.

Gilbert

Quote from: Cassiebsg on Thu 07/05/2020 20:01:54
AGs saves image data as bmp (?), you can turn compression for sprites on that should reduce the size of the acsprset.spr, but it it'll just make AGS be slower, since it it then has to uncompress the picture before displaying it.
I'm not sure, but since the sprite data are compressed only using a RLE-scheme, which is simple enough that it could be decompressed readily into RAM. Compared this to the access speed of the storage device, it is possible that on some system it would be even faster when the data are compressed (unless you store the game on a VERY fast device, such as SSD?). For example, a sprite image is 10MB uncompressed the game has to load 10MB of data from your HDD, but if the sprite is only 500KB after compression it could be loaded and decompressed very quickly.

Crimson Wizard

#4
Quote from: Gilbert on Fri 08/05/2020 02:43:52
Quote from: Cassiebsg on Thu 07/05/2020 20:01:54
AGs saves image data as bmp (?), you can turn compression for sprites on that should reduce the size of the acsprset.spr, but it it'll just make AGS be slower, since it it then has to uncompress the picture before displaying it.
I'm not sure, but since the sprite data are compressed only using a RLE-scheme, which is simple enough that it could be decompressed readily into RAM. Compared this to the access speed of the storage device, it is possible that on some system it would be even faster when the data are compressed (unless you store the game on a VERY fast device, such as SSD?). For example, a sprite image is 10MB uncompressed the game has to load 10MB of data from your HDD, but if the sprite is only 500KB after compression it could be loaded and decompressed very quickly.

This is true, file operations are generally slower than operations in memory, and loading compressed sprites is faster because they are smaller, so time gained by loading smaller file size may exceed loss of time due decompression.
Actual difference may be only found by testing and comparing two cases in practice.

nightmarer

#5
Hello,
I tried to separate this animation in two different views but I'm still having this problem.
I took almost one hour to export all views and I'm having a acsprset file of 1,2 GB.
After that when I run this room it goes slow and lazy.
I can'understand why this is not working as it should.
It is a pity after all the work the designer has made is not able to work properly in AGS while importing the sprites in the first room.

Crimson Wizard

Don't use AGS, use a better engine. AGS is not being developed in a correct direction, project is stuck. It needs an overhaul of editing process, but this won't happen soon (if ever).

nightmarer

#7
:(


What do you recommend me to use then?

nightmarer

#8
Quote from: Crimson Wizard on Thu 07/05/2020 22:49:18
Using video if possible is one solution, another is to break single animation object into parts which animate and don't animate.
:confused: :confused:
But video playing pauses the game, this animation was prepated to set as a view in the background. As I see it is not possible I must start everything from the scratch but  in 320x200 px resolution, because AGS doesn't work well with 640 x 400 px.
I'm really disappointed with AGS. :( :( :( :(

Thank you all anyway I think that the best thing AGS has is its community.

Regards.

Cassiebsg

#9
It's possible to play video on the BG, you just need to use a plugin.

Edit: You can find it here: https://www.adventuregamestudio.co.uk/forums/index.php?topic=45348.0
give it a try before you give up.   ;)
There are those who believe that life here began out there...

Slasher

#10
Quote from: nightmarer on Sat 09/05/2020 16:03:32
Quote from: Crimson Wizard on Thu 07/05/2020 22:49:18
Using video if possible is one solution, another is to break single animation object into parts which animate and don't animate.
:confused: :confused:
But video playing pauses the game, this animation was prepated to set as a view in the background. As I see it is not possible I must start everything from the scratch but  in 320x200 px resolution, because AGS doesn't work well with 640 x 400 px.
I'm really disappointed with AGS. :( :( :( :(

Thank you all anyway I think that the best thing AGS has is its community.

Regards.

Just shows you that preparation is the key before you delve into something. Making sure that what you want to do is possible and simple to implement..

It's a case of hard work for no reward as it stands...  Such a shame.... Maybe you will find a way.... Sometimes there's a way if you think outside the box..


Crimson Wizard

#11
There are numerous 640x400 games made with ags, and even 1280x720. It's not a problem with resolution per se, it's a problem with resource management. Speaking of which, it's possible to make a 320x200 game that will have similar issues (less likely, but still), so imho it's better to first find out if there are other means to accomplish what you want.

Quote from: nightmarer
Quote from: Crimson Wizard on Thu 07/05/2020 22:49:18
Using video if possible is one solution, another is to break single animation object into parts which animate and don't animate.
I tried to separate this animation in two different views but I'm still having this problem.

But video playing pauses the game, this animation was prepated to set as a view in the background.

It's not very common to have 160+ frame animation full-background size, and your sprites, as you say, are  1177x250 in a 640x400 game. Do you really need this animation to be that big? Is all the 1177x250 area animating? Can you give an example of what is happening on background?

nightmarer

Quote from: Crimson Wizard on Thu 07/05/2020 22:49:18
It's not very common to have 160+ frame animation full-background size, and your sprites, as you say, are  1177x250 in a 640x400 game. Do you really need this animation to be that big? Is all the 1177x250 area animating? Can you give an example of what is happening on background?

Sure, it is a nightsky with northern lights and glowing stars.


nightmarer

Quote from: Cassiebsg on Sat 09/05/2020 16:59:53
It's possible to play video on the BG, you just need to use a plugin.

Edit: You can find it here: https://www.adventuregamestudio.co.uk/forums/index.php?topic=45348.0
give it a try before you give up.   ;)

Thank you very much! I hope it works.

nightmarer

Quote from: Cassiebsg on Sat 09/05/2020 16:59:53
It's possible to play video on the BG, you just need to use a plugin.

Edit: You can find it here: https://www.adventuregamestudio.co.uk/forums/index.php?topic=45348.0
give it a try before you give up.   ;)
This plugin rules!
It fixed it! Thats great! Thank you very much.

Cassiebsg

No problem, glad it could solve your problem.  :-D

But all credit goes to those who coded it and posted it for us to use. They deserve the big "thanks".  ;)
There are those who believe that life here began out there...

nightmarer

Quote from: Cassiebsg on Sun 10/05/2020 00:02:14
No problem, glad it could solve your problem.  :-D

But all credit goes to those who coded it and posted it for us to use. They deserve the big "thanks".  ;)
You are right, I will thank him in his post.

SMF spam blocked by CleanTalk