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
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
Make it 4 x smaller and stretch blit?
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.
The gist of these approaches is that they stream the file from disk (with a buffer). Not as easy as it sounds.
Memory bitmaps might be an option. I wouldn't try to load a 700MB movie, though.
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.
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?
Have you added the video add-on (and your video back-end??) to the linker options?
(I'm not familiar with MSVC.)
You have to have Allegro compiled with video support. I believe theora of vorbis is one of the few totally free back-ends.
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?
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).
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?
I remember seeing the AVI demo in the OpenGL NeHe examples, maybe you could look at that and figure out a way.
It should be possible to build under MinGW and then port it to MSVC.
Apparently this guy has done so. You might have to build all the dependecies, though. But then you get support for A LOT of codecs.
Found via this.
I was curious too
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?
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 ).
Which files did you exactly download?
This is what generally needs to be done to get video in your program:
Build and install (some) video library
Build and install Allegro
Link against video add-on (and maybe the video library)
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.
If the files you have downloaded don't include step 1 and 2, only then you have to rebuild Allegro like I said before.
I think you cannot use MSVC because FFMPEG uses C99, something M$ is incapable of implementing
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.
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?
You could try Dark Basic (http://www.thegamecreators.com/?m=view_product&id=2030&page=features)
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.
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].
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:
The files you have downloaded may have done steps 1 and 2. If that's the case, you only have to do step three.
The ffmpeg backend has unreliable synchronisation.
I believe the synchronization issues have been fixed when the audio resampling issues were dealt with.