Video background?

Started by , Sat 11/02/2006 19:29:37

Previous topic - Next topic

babyjoe

Hi everyone,

I just wondered if you could possibly give me any advice regarding the following:

I'm creating a point 'n' click game and in a couple of scenes I'm wanting to have some playable/interactive scenes. Basically, I'm wanting to have an aircraft flying through space (in the style of the following image:)



Now, my question is this -

Is there any possible way of having a scrolling background (perhaps a looped video) or would I have to animate everything through the use of sprites?


Cheers in advance for any help/advice given.

Elliott Hird

I'd find a way to overlay a few videos over a pre-rendered sprite.

scotch

It'd be great to be able to have videos play on the bg but it's not possible at the moment, you can have 5 background frames, but that probably isn't enough for you, you can also have a lot of full screen sprites and display them manually but that is slow and HUGE for filesize... I am not sure what is the best way to handle your situation.

DoorKnobHandle

Maybe the AGS 3D plugin might help? I couldn't think of anything else either.

GarageGothic

I'd use RawDraw and tiled dynamic sprites resized on the fly (no pun intended).  But it could get very slow on smaller CPUs. What resolution and color depth are you using, and what minimum hardware specifications are you shooting for?

(seeing as you're asking in the beginner's forum I'm not sure if this reply will do more damage than good. Just so you know, my suggestion requires quite a bit of scripting knowledge)

babyjoe

Well I won't say I'm a pro but I know what I'm doing just about. And I emphasise the 'just about' bit. ;)

I was merely after suggestions and tips and I've taken all points on board so far.

This is where I know it's going to get difficult though...

I'm running it at 800x600 with a 32-bit palette and am aiming this game to be ran on decent machines - preferably atleast 1Ghz with a 32-bit graphics card.

I know this is going to be very power-consuming but it's something I REALLY need in the game.


GarageGothic

At 800x600 and 32bit colors my suggestion would be much too slow I think. It would require creating, resizing and drawing at least 8 dynamic sprites per loop. Also, unless you have a solid knowledge of structs and arrays it would be difficult to manage everything going on. But at least on a concept level I think it could work. Maybe I'll whip up a demo someday, but for your project it's too slow. If you examine the Star Wars scroller module (and substute the text-to-sprite part of the code with resizing of pre-existing sprites), you'll get some impression of how I thought it could be done.

Also, I need to ask - do you actually need the player to navigate in this area, or is it background only? If you just want the plane to be able to swerve left and right, to avoid/shoot other planes or whatnot, it's do-able. If, on the other hand, you want to actually be able to turn (scrolling the window left and right) and having the ground update accordingly, you will be better off using the AGS 3D plugin like dkh suggested. I'm not sure how large textures it allows for though, since you would need to display quite a large surface for this to work (could be solved by placing multiple textured boxes next to eachother to form one large floor).

BOYD1981

if the paralax scroller plugin supportes vertical scrolling then he could in theory use that...

Limey Lizard, Waste Wizard!
01101101011000010110010001100101001000000111100101101111011101010010000001101100011011110110111101101011

fred

I'm using a similar effect in "Space Darling", the game I'm working on.

For real time battles (screenshot below) I have a scrolling starfield background, but it's actually implemented as a custom GUI where the background pic changes to create a scrolling effect. It's still slow on slow machines, but gives a very decent result on newer machines. And having the whole thing on a GUI that can be turned on and off and handled from the global script is perhaps easier than building a custom room for the functionality, although that may be a matter of personal preference.



(click to enlarge)


Your scene looks very 3d - and it's perhaps a little ambitious to build a 3d flight simulator in AGS. What kind of interaction will you put in the scene? battle, steering? a choice of where to fly to?


GarageGothic

#9
Quote from: BOYD1981 on Sun 12/02/2006 03:10:39if the paralax scroller plugin supportes vertical scrolling then he could in theory use that...

Well, if all he needs is 2D scrolling (like in any old top-down shoot-em-up), the issue would be much much easier. And yes, if so the parallax plugin could be used for objects like clouds etc. But I see now way that it could create the 3D scrolling effect suggested by the example screen.

Edit: You could also take a look at the motorcycle minigame in the AGS demo.

babyjoe

Thanks guys, the help and advice you're all giving is brilliant and I really appreciate that.

This section of the game DOES look 3D although isn't actualy 3D. I think perhaps that the best way forward would be to have a few animated sprites.

Yes, the player will be able to control the plane by swerving it from left to right while other planes/rockets rockets will come at him.

Alun

Hm...I can think of a way that might work for what you want...but it's a little hard to explain, so I'm sorry if this doesn't make sense...

Basically, what you do is you have a bunch of different horizontal "slices" of the background.  Each one can be static; they don't have to be animated at all.  But what happens is that each "slice" fits together with the next one when the next one is twice the size (or some other constant number X times the size; I'll just say "twice the size" as an example.)

You wouldn't need all the sprites on the screen at once; the ones at the horizon would be too far to see anyway.  Say, for example's sake, you fit three on the screen at once (in practice, you'd probably have more than that--let's say some number Y--but let's keep pick 3 for our example).  Now, if you didn't want any of your sprites to ever lose detail by being scaled to more than 100%, and you didn't want to tile them horizontally, each of your sprites would have to be big enough to span the screen when it was the top sprite--which means it would have to be, let's see, X^(Y-1) times the width of the screen.  If this seems like a bit much, you can easily get around that if you do tile them horizontally, or are willing to scale the "near" sprites more than 100%; I leave the details as an exercise to the reader.  ;)

So, what you do to start out with is you have sprite A at the bottom of the screen scaled to 100%.  Then you have sprite B just above it scaled  to 50%, and sprite C above that scaled to 25%.  You gradually move them down the screen, scaling them up as you go.  By the time sprite B ends up where sprite A was, sprite A has scrolled off the screen completely, sprite B is at 100%, sprite C is at 50%, and you've introduced sprite D at 25% where sprite C was to begin with.  Rinse and repeat.

Like I said, this is hard to explain, and I'm not sure I've conveyed clearly what I meant, but here's a page that does something similar (and is just neat to look at regardless ;) ): Take a look at the Flash animation linked here.  Then take a good look at the individual pictures (linked by the white squares at the bottom of the page), and figure out how they put them together and put the animation together.  That animation zooms in along all four sides of the screen, and you just need one, but similar principles apply.

Hope this makes sense; like I said, I'm having a hard time explaining exactly what I mean, and I'm not sure any of this came through in an understandable way...

Soup - The Comic Strip
http://www.soupcomic.com
Gods, heroes, monsters, and soup


SMF spam blocked by CleanTalk