|
Playing a background animation |
Frankincense
Member #14,367
June 2012
|
Hi guys, I want to make a background that is an animation. Obviously I could just create a sprite sheet, well unfortunately each frame is going to be around 1100x700 (or close), which is apparently too big for allegro to handle (?) Also I can't use a GIF as I can't see anyway of doing this (there was an addon, but it does not work for Allegro 5 and has licensing issues). I have also looked at .mng's, but there is basically no support for this and even if I somehow find a library that would work for me, it would probably be massively complex to get working. What other choices do I have? Or is there a way to get the sprite sheets working (or GIFs etc.) Cheers |
Neil Walker
Member #210
April 2000
|
use memory bitmaps if there's that much stuff you need to animate - allegro isn't the limitation it's the graphics card memory. or do it with a kind of dirty rectangle (i.e. your screens won't change entirely so have a table showing the bitmap(s) and locations for each frame - or how long to show each smaller bitmap in seconds before moving to the next), or simply just have multiple layers for the background to composite Neil. wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie |
Dizzy Egg
Member #10,824
March 2009
|
Make it 4 x smaller and stretch blit?
---------------------------------------------------- |
weapon_S
Member #7,859
October 2006
|
Allegro 4 has FLIC support. Allegro 5.1 has a video add-on. I don't have much experience with either, but I know you can encode FLIC with the program FFMPEG, and it looks ugly. |
CaptainVice
Member #13,313
August 2011
|
Animating something of that size sounds troublesome. Would memory bitmaps be fast enough? I know the few times I accidentally tried to use a decent sized sprite sheet from non video memory it lagged to hell. How much of the background is actually animated? IE could you do a static background and do smaller, individual animations for the moving parts? This would drastically reduce your video memory requirements. You could even chop up the large background into smaller pieces if it needs to scroll to further minimize memory usage. |
Frankincense
Member #14,367
June 2012
|
Thanks for the replies, I am trying to use the video addon in 5.1.2. But each time I try to compile I get an 'error LNK2019: unresolved external symbol __imp__al_open_video referenced in function _main' error, but only for the command 'al_open_video'. I have literally no idea why this is happening. I have tried both 5.1.1 and 5.1.2 and I am using msvc 2010. Any ideas? |
weapon_S
Member #7,859
October 2006
|
Have you added the video add-on (and your video back-end??) to the linker options? |
Frankincense
Member #14,367
June 2012
|
All I have done is download the build version of allegro 5.1.2 for msvc 2012, moved the bin, include and library folders into the correct directory, I didnt realise you had to do anything else? Is there something else I have to install? |
weapon_S
Member #7,859
October 2006
|
Before building Allegro (again) you have to build (or download ready-made) a video library Allegro supports. I know of FFMPEG (the library) and ogg (theora/vorbis). |
Frankincense
Member #14,367
June 2012
|
God this is a minefield of documentation, I cant seem to find anyone trying to do what I am trying to do. I can't find any pre-built ffmpeg librarys that resemble anything that I know. Apparently you can't build ffmpeg under msvc. Are there any links to a how-to for installing/building ffmpeg and linking so that I can play a video in my game? Why is playing a 2 sec vid clip so difficult? |
Arthur Kalliokoski
Second in Command
February 2005
|
I remember seeing the AVI demo in the OpenGL NeHe examples, maybe you could look at that and figure out a way. They all watch too much MSNBC... they get ideas. |
weapon_S
Member #7,859
October 2006
|
It should be possible to build under MinGW and then port it to MSVC. |
Frankincense
Member #14,367
June 2012
|
Ok I have downloaded the dev version of the build from that site (the one that contains the .lib and header files to I can use it) What do I need to do to use it? Do I just link in the .lib and hope the problem goes away? |
weapon_S
Member #7,859
October 2006
|
Frankincense said: All I have done is download the build version of allegro 5.1.2 for msvc 2012 Whoops, I've misread that because of your atrocious use of grammar (j/k ).
The files you have downloaded may have done steps 1 and 2. If that's the case, you only have to do step three. I'm not too familiar with MSVC, but somewhere there's a project option that tells which libraries to use. And it is there that you have to add allegro and allegro_video. |
jmasterx
Member #11,410
October 2009
|
I think you cannot use MSVC because FFMPEG uses C99, something M$ is incapable of implementing Agui GUI API -> https://github.com/jmasterx/Agui |
Peter Wang
Member #23
April 2000
|
Note that the video addon is fairly immature. The ffmpeg backend has unreliable synchronisation. The theora backend doesn't implement seeking. The theora libraries should build with MSVC, but probably painfully (lots of manual work). It definitely was for the libvorbis/libogg combination, which you will also need.
|
Frankincense
Member #14,367
June 2012
|
Brilliant so now I can't even do that! This is becoming a joke. Does anyone know to play a small video/gif in an Allegro game, that has a relatively simple setup and has a tutorial on how to do it? |
Neil Walker
Member #210
April 2000
|
You could try Dark Basic (http://www.thegamecreators.com/?m=view_product&id=2030&page=features) Neil. wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie |
weapon_S
Member #7,859
October 2006
|
jmasterx said: I think you cannot use MSVC because FFMPEG uses C99, something M$ is incapable of implementing The links I posted suggest that MSVC indeed doesn't implement the features needed for compiling the library. They also suggest GCC[1] can be used to compile libraries usable by MSVC. Frankincense said: Brilliant so now I can't even do that! This is becoming a joke. It probably can be done. Not much people have bothered to try, though. The missing synchronization only affects audio[2]. Quote: that has a relatively simple setup and has a tutorial on how to do it? There is no such way yet. You could decide to become a pioneer yourself and write down how you did it, and discuss the bugs you find with the Allegro developers. Or you could wait until such way becomes available. Or you could write a very simple bitmap streamer. I'll repeat: weapon_S said: The files you have downloaded may have done steps 1 and 2. If that's the case, you only have to do step three.
References
|
SiegeLord
Member #7,827
October 2006
|
Peter Wang said: The ffmpeg backend has unreliable synchronisation. I believe the synchronization issues have been fixed when the audio resampling issues were dealt with. "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
|