Huge Moho Animation frames slowing/crashing AGS? [SOLVED]

Started by Play_Pretend, Mon 25/07/2005 07:33:41

Previous topic - Next topic

Play_Pretend

Hey, all.  I've been trying to use MoHo to make simple animations for my game. . .my first attempt was at a rocket coming in from offscreen, circling a planet, then shrinking and disappearing like it had flown down to the planet.  It came out beautifully on MoHo, just the rocket on a transparent background.  I exported it into 40 (and later, 60) individual frames that I imported into AGS as sprites.  But I guess since they're coming up as full-screen sized transparency sprites, they take up almost 100 Megs, which is obviously unacceptable.  With 60 frames running in three "Run after the last" loops in one view, it crashed my game, corrupted my Editor.Dat file and forced me to start the whole game over almost from scratch.  Fortunately I wasn't all that far along, and I still saved the room files I had already designed.

So what I wonder is, am I going to have to redo the scene with the rocket as a character or object, using move commands to try to get it to circle the planet?  After studying the manual, experimenting for 7 hours and reading posts on here, I still couldn't figure out how to simultaneously move and animate the rocket object so it would circle up and around, then shrink and disappear while it's still circling.  How do you use the Object.Move and Object.Animate commands at the same time?  Or is there some other command or script I should use?  Does anyone with experience with MoHo have thoughts on how to make this animation tiny and game-acceptable?  Thanks!

Candle

Can you make it in to a video ? the wmv files are a lot smaller .

Khris

AGS is able to play AVIs, MPGs and FLCs. I'm not sure whether Moho is able to export to one of these formats, though.

edit: Candle was quicker ;)

Candle

There ya go .

Code: ags

Moho is a 2D vector-based cartoon animation application. It is not an ink & paint tool that requires you to draw each frame of your animation by hand. In Moho, you draw your characters once at the beginning of an animation, then use powerful tools like bones to manipulate characters like puppets. Moho provides the complete set of tools you need to create an animated cartoon, from drawing and coloring to keyframe animation, multi-layer compositing and final rendering of QuickTime and AVI movie files. Moho can be used to create animation for video, film, or streaming over the web.

RickJ

I would make the rocket an object.  Crop all of your sprites so that they are just big enough to hold the rocket.  Import the sprites and then make a VROCKET view.  You can put 20 frames in one loop so if you do that your 40 frames will fill up 2 loops.

Next put something like the following in the room script.   Call InitRocket from the "First Time Player Enters Screen"  interaction to start the animation.  Work out what they should be for each frame and modify the InitRocket() function accordingly.  You will probably have to get the x,y positions by trial and error, unfortunately.   

You can modify FRAME_DELAY to adjust the animation speed to your liking.  The DQCycle mini-game, that's part of the current version of DemoQuest, uses a similar technique to animate the destination objects as the player gets closer to the end of the race course.
// Room Script 

#define FRAME_DELAY 10
#define MAX_FARMES  40

struct rocket {
   int x;
   int y;
};
rocket Rocket[MAX_FRAMES];

int Frame=0, Loop=0, RawFrame=0, Delay=FRAME_DELAY;

function InitRocket() {         // Call from "First Time Enters Screen" 
   int i=0;

   // Initialize frame positions
   Rocket.x =                     // Frame-0 position 
   Rocket.y =                    
   i++;
   Rocket.x =                     // Frame-1 position 
   Rocket.y = 
   :
   Rocket.x =                    // Frame-MAX_FRAMES position 
   Rocket.y = 
   i++;
}

function AnimateRocket() {  // Call from Repeatedly Execute
   int frame, loop;

   // Calculate delay between frames
   if (Delay>0) Delay--;
   else {
      // Reset delay
      Delay = FRAME_DELAY;

      // Increment to next frame
      if (RawFrame<MAX_FRAMES) {  // until animation is complete
         RawFrame++;
         if (Frame>=20) {           // Put 20 frames in each loop
            Frame = 0;
            Loop++;
         }
         else Frame++;

         // Set rocket's frame and position
         cRocket.SetView(VROCKET,Loop,Frame);
         cRocket.SetPosition(Rocket[RawFrame].x,Rocket[RawFrame].y);
      }
   }
}
   


Play_Pretend

Wow, thanks for the outpouring of info. . . :)  MoHo does export your animations as movie files, unfortunately I tried first doing it as an AVI, which by itself was 50 megs for my 5 second animation.  I just can't see that working, as I plan on having quite a few animated cutscenes in this sucker, and don't want people skipping over downloading it because it's too huge.  The only other option is SWF movie files, but near as I know AGS doesn't support those in its' play options.

Hmmm. . .I've been experimenting more while I prepared this reply, and it seems that if I'm willing to lose resolution and dim my colors through a compression codec, I could simply export to an AVI file that only takes up 550 KB or so.  *sigh*  Dang but I wanted those animations to be crisp and beautiful, though.

Thanks a ton for the scripting, RickJ.  I'm going to try my hardest to make that work before I resort to cheap looking movie files. :)

TerranRich

Status: Trying to come up with some ideas...

Play_Pretend

Yeah, I suppose so.  Can't think of anything better to ask, anyways. :)  Thanks a bunch, all!

simulacra

I certainly do not recommend AVI for movies like that. Convert into an MPEG (for compatability) or to WMV (for small-size and Windows compatability).

SMF spam blocked by CleanTalk