Animated Background Frame Limit

Started by RyosFace, Thu 23/01/2014 22:43:57

Previous topic - Next topic

RyosFace

So, as it is I've just started with AGS and from much research I've come to the conclusion that animated gifs are not supported as backgrounds. It appears you must import each image one by one up to and no more than 5 frames.

My question is there any way to bypass this limit? I have pre-rendered backgrounds that I've animated for another project in which I'd like to import in this software but I find that 5 frames in inadequate to my needs. For example, one of my backgrounds contains 40 frames, in which each frame is a slightly different image, and another 156. Is there no way to import these as backgrounds other than dividing the number such as importing everything 31st frame (for the 156 frame background) because I've tried doing that and while it works it is both undesirable and unplesant. If it's not possible, I understand and I thank you to all who have taken time to read this very novice question and to anyone who can supply a clear answer.

Long days and pleasant nights.

Ghost

The hard limit is 5 backgrounds frames, yes. There are some workarounds but you will have to decide for yourself if they are worth the effort.

First, many people prefer to use multiple objects for animations (for example, some reflections on water, and maybe a ticking clock, all in the same room). An object can be assigned a view, and a view has unlimited frame capacity. So it is common practise to create a couple of objects to animate, while the background itself remains static.

This leads to the logical next step: Technically you can create one screen-sized object, import all your frames and assign them to a view, then set the object baseline so that it is always at the back of everything else, and have it animating. This even gives you good control over the animation since you can start and stop it whenever you want.

I have no idea how big the impact on your frame rate will be with a fullscreen object (I assume you are using a higher resolution, and not 320x240), but, well this IS a workaround.

Crimson Wizard

Another way is to script animation by manually drawing frames over room background, triggered by the timer (see Room.GetDrawingSurfaceForBackground and DrawingSurface usage).

Can't say if that will be better than animated object, depends on overall room design; also testing needed to see how that will affect frame rate (but probably not much different from animated object way).

RyosFace

@ghost Yes, it is larger than the standard size and I've thought about creating objects to build a background but I think that it would be too difficult to implement in that my backgrounds have detailed lighting effects which would not work well as an object.
-----------
@Crimson Wizard, I'll take your advice and try that. It's a good suggestion and hopefully I can find it script suits my needs.


Thanks for your replies!

Ghost

As you describe it (larger resolution, each frame of animation required) Crimson's attempt should be the best solution. Tiny note, this will defenitely have heavy impact on your file size- not a deal breaker but you should keep it in mind ;)

Also, just saw this was your first post: Welcome to the forums! (nod)

RyosFace

#5
Crimson Wizard, can that script command draw external backgrounds, I've looked through it and it appears to only draw simple motifications to an already existing background?

Thank you, Ghost, I am glad to be here! For further clarification as to what I meant here are some example images. (They are apng, and are animated natively in firefox, to see them in chrome you must use an extension.)





Video

My original project is an episodic Shenmue fan game in the form of a visual novel. It uses screenshots from the original game but animated by me. (The game does not have the animations originally.) I plan to finish the first episode in the first engine I've used but I find that AGS has better porting options available for me if I choose to do so and that an adventure game would greatly suit further episodes of the project.


edit: and yes, if I decide to use AGS I'll 8bitify the backgrounds.

Crimson Wizard

#6
Quote from: RyosFace on Thu 23/01/2014 23:50:36
Crimson Wizard, can that script command draw external backgrounds, I've looked through it and it appears to only draw simple motifications to an already existing background?
Idea is to draw animation frames over the existing room background.
Since you are making a "Visual Novel" kind of game, I assume it does not require characters walk around the screen and be affected by dynamic lighting? In this case simply drawing frames over should suffice.

RyosFace

Quote from: Crimson Wizard on Fri 24/01/2014 00:04:58
Quote from: RyosFace on Thu 23/01/2014 23:50:36
Crimson Wizard, can that script command draw external backgrounds, I've looked through it and it appears to only draw simple motifications to an already existing background?
Idea is to draw animation frames over the existing room background.
Since you are making a "Visual Novel" kind of game, I assume it does not require characters walk around the screen and be affected by dynamic lighting? In this case simply drawing frames over should suffice.

Visual Novel only for the first game. Ideally each episode would be a different genre.

Crimson Wizard

#8
Having more clear head now (;)), on other thought using animated object would work faster at runtime. Drawing over room background involves at least two drawing operations: copying a frame over, rendering on screen, where animated object will make only one operation (rendering on screen), because it does not overpaint itself every time, just increases frame counter.

To further increase speed (in case of necessity) you may only cover animated part(s) of the room; though obviously that would require more work (cutting images, etc).

SpacePirateCaine

Hi RyosFace,

It's been mentioned already, but you can accomplish a lot with objects - most of the background from my game, Kuma Story, was done as animated objects - they were very minimalist, but ultimately you could even do your entire animated background as an object that is the entire size of your background. Walk-behinds and walkable areas are easily set up and you can even use a static frame as reference, since the background object will be overlaid on top of your other background frame.

Also, Shenmue fan game, eh? Sounds interesting.
Check out MonstroCity! | Level 0 NPCs on YouTube! | Life's far too short to be pessimistic.

RyosFace

Quote from: SpacePirateCaine on Fri 24/01/2014 08:00:20
Hi RyosFace,

It's been mentioned already, but you can accomplish a lot with objects - most of the background from my game, Kuma Story, was done as animated objects - they were very minimalist, but ultimately you could even do your entire animated background as an object that is the entire size of your background. Walk-behinds and walkable areas are easily set up and you can even use a static frame as reference, since the background object will be overlaid on top of your other background frame.

Also, Shenmue fan game, eh? Sounds interesting.

Thanks for your advice, I've come to the conclusion that using objects and splitting the animated background into several pieces to be the best and easiest discourse as well. I'll just have to try to optimize the animations in that I could make the lighting an object itself.

SpacePirateCaine

It should also be noted that splitting into various pieces may not even be necessary - though it will allow for independently animating elements. If you have already animated your background as a single animated background, similar to the image you posted above, that could easily be translated into a single object and used as your background.
Check out MonstroCity! | Level 0 NPCs on YouTube! | Life's far too short to be pessimistic.

soulcypher

#12
I have a question which is connected to this older topic.

Is it possible to set a scripted event animation of one object with 90 frames?
Could  each frame be set with 720p resolution?
Thanks


This is my first post

Slasher

I suppose you could make the objects as big as required and make a view and add the object frames there, perhaps spilting up onto 4 views and have each loop run the next loop etc etc...

it may well slow down the game but you could try a few and see how it goes.

soulcypher

Quote from: slasher on Wed 31/08/2016 17:29:18
I suppose you could make the objects as big as required and make a view and add the object frames there, perhaps spilting up onto 4 views and have each loop run the next loop etc etc...

it may well slow down the game but you could try a few and see how it goes.

I would like to set up background res to 1280*720. Could I then make object centered with the same res and cropped?
That way I could keep the object detail when animated.


Do you mean to separate loops in 4 views, each with 25 frames?

Slasher

#15
I'm not sure how your room actually looks but you could make the object the same way and size as you have made the room only it's an object instead of a room imported background. Make sure the said object lines up (x y) with the background itself so it covers all the room.

Splitting up into 4 views makes it easier to put in the frames.

And don't forget to make it Clickable=false;

See how it goes.

Good luck

RickJ

You mentioned GIF files early on ... If I remember correctly GIFs can be imported in one step so that each frame becomes a sprite. (I think).

SMF spam blocked by CleanTalk