English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. Blitz Basic

 
 
Thread Tools
Old 31 August 2017, 12:27   #1
earok
Moderator

 
Join Date: Dec 2013
Location: Auckland
Posts: 1,529
Blue Thunder and TimeGal - General concepts and Blitz implementation

The two FMV games I worked on were coded in Blitz, I thought it might be worthwhile briefly going over how the engine was developed. Please let me know if there's any specifics you'd be more interested in.

Unlike the CDXL format (which is designed for streamed playback), the FMV in those two games are broken up into numerous files to be loaded into buffers - I've given this custom format the extension ".bank" as it's literally just files intended to be used with Blitz bank commands.

There are advantages to this approach: Playback can be more reliable than CDXL - as, in a worst case scenario, the game will pause until the Bank is fully loaded (rather than immediately running into audio and graphical issues). It's also fairly easy to understand and implement.

But also disadvantages: Starting from a specific frame is difficult, also instant playback is impossible as an entire bank needs to be loaded first.

Each .bank file is made up of:
- 1 or more frames, as raw uncompressed bitmaps of fixed size, simply appended end to end. These can each be assigned to a Blitz Bitmap object using CludgeBitmap.
- An IFF audio file appended to the end. This can be assigned to a Blitz Sound object using DecodeSound.

Say, if the game was configured to play back at 10FPS, and a .bank contained ten frames, then the .bank would also contain one second of audio. So each .bank file contains a fixed-length section of the full FMV video.

The engines can be configured with an arbitrary number of buffers (Blitz Bank objects that are constantly reused), but at least two are needed - one is fully loaded before the game can be started, and the others are loaded from disk to memory.

The core game loop is handled inside a VBLANK interrupt (SETINT 5), which includes:
- Testing for input (aborting the game and jumping to the game over screen if the correct input is not received)
- Updating the frame counter and displaying the current frame on screen
- Playing audio from the currently loaded bank
- Display onscreen control hints (just using Hardware sprites, as this is the easiest way to overlay graphics over top of HAM)

Outside of the main game loop, only one function is performed - there's a simple While loop that constantly checks if all of the buffers are in use. If a buffer is free (a buffer is marked is free as soon as the game has finished playing the audio and video from that .Bank file), it immediately loads the next .Bank into that free buffer.


Creating the .Bank files themselves was bit of a frankenstein approach - Windows utilities chopped up the source .AVI into individual frames and short sound clips and converted those files into more Amiga friendly formats, and then a custom Blitz tool glued them back together as the .Bank files.
earok is offline  
AdSense AdSense  
Old 01 September 2017, 18:38   #2
E-Penguin
Banana

 
Join Date: Jul 2016
Location: Darmstadt
Posts: 363
How did you load from file at the same time as updating graphics? Were you in Blitz mode?
E-Penguin is offline  
Old 01 September 2017, 21:18   #3
earok
Moderator

 
Join Date: Dec 2013
Location: Auckland
Posts: 1,529
Quote:
Originally Posted by E-Penguin View Post
How did you load from file at the same time as updating graphics? Were you in Blitz mode?
The games run in QAMIGA mode almost all of the time, just using BLITZ mode to run CreateDisplay.

Updates to the graphics are run inside the SetInt 5 block (mostly DisplaySprite for control ques and DisplayBitmap to change frame), while at the same time a simple While loop outside of the Setint block is used to load the next buffer.
earok is offline  
Old 01 September 2017, 22:00   #4
Cylon
Registered User

 
Join Date: Oct 2014
Location: Europe
Posts: 466
Why not consider using the anim cmds, as they are less space and cpu consuming? Well, maybe a liitle more CPU, but there are longer anims possible, maybe even diskplay.
Cylon is offline  
Old 01 September 2017, 22:20   #5
earok
Moderator

 
Join Date: Dec 2013
Location: Auckland
Posts: 1,529
Quote:
Originally Posted by Cylon View Post
Why not consider using the anim cmds, as they are less space and cpu consuming? Well, maybe a liitle more CPU, but there are longer anims possible, maybe even diskplay.
Both games were designed with the CD32 in mind as the primary platform. Having a 2x speed CD-Drive, it takes a second to load 300kb. Even if the graphic data was compressed to half that through anim compression, you'd still need to decompress all that on an 020 CPU in half a second in chipram. Disc space is not such a concern as 45 minutes of video can be stored on a CD in that format, CPU is used minimally as the uncompressed bitmap are loaded direct to memory without any conversion at all (Timegal can be played comfortably on an A500 68000 with HDD)
earok is offline  
AdSense AdSense  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
"Blue Thunder" CD32 FMV engine prototype earok project.CD32 Conversion 31 31 August 2017 12:15
Rolling Thunder vs Thunder Jaws Solo Kazuki HOL data problems 1 20 June 2016 08:09
Amiga design concepts thinlega Retrogaming General Discussion 1 22 July 2002 01:23

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 04:43.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Page generated in 0.12426 seconds with 14 queries