English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 05 June 2021, 09:13   #1
ImmortalA1000
Registered User
 
Join Date: Feb 2009
Location: london/england
Posts: 1,347
Can you write 100% CDTV games with AMOS/Blitz?

I was wondering if somebody knew if either AMOS or Blitz BASIC allowed control of playing audio tracks on data+CDDA CD-ROMs on a CDTV rather than just loading files from the data track via CD0: accessed by AmigaDOS commands to load data files instead of HD0:

I always wanted to write a Cinemaware style game for the CDTV (so no shit hypercard ropey things like Psycho Killer etc) BUT I want to have speech in the game and background ambient sound/music stored as various audio tracks.

For speech it becomes complex because I need to be able to play a specific track from a specific point as the total number of tracks is limited (max 99?) so I would need to be able to tell the CDTV to play track 03 from 9 minutes 22 seconds to 10 minutes 5 seconds AFTER it has finished loading in any data for the scene (backgrounds, anims, ambient sound effect like crickets chirping to get a particular character to say a specific thing all sync'd up.

Doing graphics today is so easy because everything is already in a digital format, it takes minutes to grab screenshots from Alien Syndrome arcade and make almost perfect copies in EHB mode today vs 1980s pissing about with digitisers and composhite video quality or even lighting of yellow lightbulbs for background images to be grabbed. Blitz is no slower than the framerates of action sequences in things like It Came from the Desert when you are trying to shoot the ant's antennas and 1mb is quite a lot of memory if it is mostly going to be used for a static background and a 12.5fps anim brush of the characters in the scene moving talking style graphics (so no need for CDXL just Dpaint anim files and an IFF background image etc) and CDDA tracks are played realtime so just a seek time issue on the single speed CDTV drive to account for when starting the speech.

I suppose you could still load in speech samples as required via IFF SVX files but 1mb is not that much memory really and you need to load the entire speech segment after already loading the anims/data for the scene and that's going to be like playing a Cinemaware game with loads of disk swapping so I would like to keep blank screens while stuff loads to a minimum.

(although if you were doing a space game you could have a shot of a space ship over a colour cycling background while you load the next level a bit like in Stargate Atlantis when they are using FTL to get to and from Atlantis cut scenes)
ImmortalA1000 is offline  
Old 05 June 2021, 10:10   #2
Coagulus
Gets there in the end...
 
Coagulus's Avatar
 
Join Date: Sep 2005
Location: Wales
Posts: 862
There is a cd32 library for Blitz (think it's installed with the ultimate Blitz CD) which handles playing of audio tracks. Not sure if it works on CDTV though.
Coagulus is offline  
Old 05 June 2021, 11:10   #3
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,186
For mastering the CDs to make them bootable, some of the files on the Amiga Developer CD 2.1 are mandatory. The disk mastering software requires a particular model of Phillips CD writer but I think later versions of WinUAE can emulate it with any old CD writer.

Blitz compiles cleaner than AmosPro so if you want any amount of computing performance, Blitz should be used. All CDTV models come with 1 meg of Chip RAM and ECS so that will help with screen scrolling bigger than 4096x4096 virtual screen size. They don't come with any higher clock speeds though.
Samurai_Crow is offline  
Old 05 June 2021, 11:22   #4
Bruce Abbott
Registered User
 
Bruce Abbott's Avatar
 
Join Date: Mar 2018
Location: Hastings, New Zealand
Posts: 2,544
Quote:
Originally Posted by ImmortalA1000 View Post
I was wondering if somebody knew if either AMOS or Blitz BASIC allowed control of playing audio tracks on data+CDDA CD-ROMs on a CDTV rather than just loading files from the data track via CD0: accessed by AmigaDOS commands to load data files instead of HD0:
I haven't done any coding in Blitz or AMOS (prefer assembler for the control and efficiency it provides) but if these compilers can create structures and call system library functions then they should be able to do it.

Quote:
For speech it becomes complex because I need to be able to play a specific track from a specific point as the total number of tracks is limited (max 99?) so I would need to be able to tell the CDTV to play track 03 from 9 minutes 22 seconds to 10 minutes 5 seconds AFTER it has finished loading in any data for the scene (backgrounds, anims, ambient sound effect like crickets chirping to get a particular character to say a specific thing all sync'd up...

I suppose you could still load in speech samples as required via IFF SVX files but 1mb is not that much memory
In the CDTV 'multimedia' title that I coded we wanted to play classical music tracks in the background while loading images etc. CDDA would not have worked because loading anything would interrupt the music, so we just digitized the audio and preloaded it into RAM. There was enough memory for a reasonable length of looping music plus all the other stuff.

A feature of the CDTV that I did make use of is that files are contiguous on the disc, so once a file is opened you can safely load it sector by sector via DMA direct to the destination, which is far more efficient than going through the file system. With this you can quickly load in graphics and sound clips as a single block of data, then while playing/animating a character you can be loading the next lot of data into another buffer. With careful planning and keeping associated files close together on the disc you can do this seamlessly even if the gameplay is non-linear.

CDDA is good for playing background tracks when you have all the graphics etc. loaded into RAM so you don't need to access the disc. It's not that great for spot sound effects but is fine when the sound doesn't have to be precisely synched, eg. the player might complete some task and the 'reward' is a new sound track that plays for a little while before going back to the normal background track.

Quote:
(although if you were doing a space game you could have a shot of a space ship over a colour cycling background while you load the next level a bit like in Stargate Atlantis when they are using FTL to get to and from Atlantis cut scenes)
Yes, with tricks like color cycling and moving the screen around you can do nice animations without using a lot of memory or CPU/Blitter time. Take that famous boing ball demo for example,- the 'bouncing, rotating' ball is actually a static image that appears to move over the background but in reality the whole viewport is being moved, and color cycling is used to make it appear to rotate.
Bruce Abbott is offline  
Old 07 June 2021, 08:51   #5
ImmortalA1000
Registered User
 
Join Date: Feb 2009
Location: london/england
Posts: 1,347
Thanks to all the replies

It was really just me wondering if I would be able to initiate CDDA track play commencing via software control once I had finished loading the data needed for the program to run the next scene level so I could do something like Simon the Sorcerer or It Came from the Desert Turbografix edition etc with very rich animation and speech (but without using crappy CDXL for FMV type rubbish PC-CDROM game designs).

Imagine trying to write a CD audio player inside Blitz (my preferred choice for performance) or Amos with the ability to set start and end points in minutes:seconds within the program to play a CDDA track. If I can do that with some sort of patch/library we're good to go with a test game

I keep meaning to research what tools were used for things like Rocket Ranger and It Came from the Desert because I want to do a game like that (technically not artistically) but imagine if Cinemaware only did games for 40mb HD equipped OCS Amigas. Arcade quality sequences are out of the question but the ropey frame rate/controller input update shooting the antenna off the ants etc in ICftD never affected the review scores so Blitz is more than up to the job of that performance with some good design of large numbers of frames for a couple of bobs over static backgrounds ...so we get CD-ROM FMV style games using anim-brush characters over static screens and CD quality background music/ambient sound and/or speech for all the scenes easily streamed via CDDA tracks.

Perhaps I could combine some of my oddball EHB fog tricks and Cinemaware NEVER used copperlists so wasted too many colours on sky graduations etc. I can see how to do VGA quality games using copper and EHB fog ideas for some scenes without breaking a sweat even in Blitz (1 large bob+crosshair to shoot antenna off ants is not going to kill the game engine and on It Came from the Desert on an A500 the frame rate is about 5fps like some C coded Atari STFM shit anyway, actually It Came from the Desert action sequences need an A4000/040 to be playable most of the time just like 2D PC DOS games are shit unless you had a 486 at the very least).
ImmortalA1000 is offline  
Old 07 June 2021, 12:51   #6
Cobe
Registered User
 
Join Date: Jan 2014
Location: Belgrade / Serbia
Age: 41
Posts: 999
Quote:
Originally Posted by Coagulus View Post
There is a cd32 library for Blitz (think it's installed with the ultimate Blitz CD) which handles playing of audio tracks. Not sure if it works on CDTV though.
That lib wont work with cdtv. But there's an example on one of the Bums how to use cdtv.device. And cause of cd32's backward compatibility with cdtv, it will work on cd32 too.
Cobe is offline  
Old 08 June 2021, 06:44   #7
CaptFuture
Registered User
 
CaptFuture's Avatar
 
Join Date: Aug 2020
Location: Netherlands
Posts: 25
Quote:
Originally Posted by ImmortalA1000 View Post
Thanks to all the replies

Imagine trying to write a CD audio player inside Blitz (my preferred choice for performance) or Amos with the ability to set start and end points in minutes:seconds within the program to play a CDDA track. If I can do that with some sort of patch/library we're good to go with a test game
The CD Audio standard actually supports indices within tracks, which allows you to start playback somewhere in a track other than just the beginning. So basically it allows you to subdivide a track further for more fine grained random access. Sample CDs back in the day often used this index feature to overcome the 99 track limit of CD, although very few consumer CD players supported it.

The good news is that cdtv.device supports it. The CDTV_PLAYTRACK command allows you to specify start and stop track numbers AND index if you want. (Doing this in AMOS Pro is possible, although very messy.)
CaptFuture is offline  
Old 09 June 2021, 01:09   #8
ImmortalA1000
Registered User
 
Join Date: Feb 2009
Location: london/england
Posts: 1,347
Quote:
Originally Posted by CaptFuture View Post
The CD Audio standard actually supports indices within tracks, which allows you to start playback somewhere in a track other than just the beginning. So basically it allows you to subdivide a track further for more fine grained random access. Sample CDs back in the day often used this index feature to overcome the 99 track limit of CD, although very few consumer CD players supported it.

The good news is that cdtv.device supports it. The CDTV_PLAYTRACK command allows you to specify start and stop track numbers AND index if you want. (Doing this in AMOS Pro is possible, although very messy.)
Ah yes, that was a thing on one of my Jarre CDs I think, a single 10-15min track but with index numbers to jump to the middle or last segment of the tune. My memory is not what it used to be for recalling stuff from scratch.

Can I do this in Blitz BASIC?

(I could only ever hope to write a Cinemaware style game engine in BASIC~ and not C or some other language)
ImmortalA1000 is offline  
Old 09 June 2021, 01:20   #9
Samurai_Crow
Total Chaos forever!
 
Samurai_Crow's Avatar
 
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,186
Blitz supports inline Assembly much better than AmosPro so even if somebody has to write a wrapper function using Assembly, it should still be possible.
Samurai_Crow is offline  
Old 12 June 2021, 13:46   #10
ImmortalA1000
Registered User
 
Join Date: Feb 2009
Location: london/england
Posts: 1,347
Well that went right over my head so I guess it's beyond me.

Shame, I worked out a whole load of stuff to do a sort of Fear the Walking Dead version of something like an Amiga Cinemaware game (with copperlist and EHB for static background scenes with characters 'talking'). Short term missions/goals, tasks to complete from action sequences like re-capturing the MRAP and also using it later, building your 'army' it was interesting...it turned out to be 50/50 Defender of the Crown and It Came from the Desert with a sprinkling of C64 Law of the West thrown in for the long term goal of getting people on your side (with a limited total_population_value).

I suppose I could write something where speech scenes need minimal graphics memory but then technically it's just an Amiga hard disk only game and 1mb RAM size is going to be an issue. I bet if you want reasonable length conversations AND ambient sounds all loaded in advance so the entire 'cinematic' scene is seamless and unbroken it is going to be a tight squeeze for a CDTV.

Shame, sounds like this is not something particularly easy without using specific CDTV tools (which may or may not be out there). I wonder what Jim Sachs used for Defender of the Crown II development or if it is in any way related to Cinemaware tools for Rocket Ranger/Wings and could be adapted.
ImmortalA1000 is offline  
Old 12 June 2021, 17:03   #11
Cobe
Registered User
 
Join Date: Jan 2014
Location: Belgrade / Serbia
Age: 41
Posts: 999
Quote:
Originally Posted by ImmortalA1000 View Post
Ah yes, that was a thing on one of my Jarre CDs I think, a single 10-15min track but with index numbers to jump to the middle or last segment of the tune. My memory is not what it used to be for recalling stuff from scratch.

Can I do this in Blitz BASIC?

(I could only ever hope to write a Cinemaware style game engine in BASIC~ and not C or some other language)
Yes, you can do it from Blitz. No need for asm.
Cobe is offline  
Old 12 June 2021, 20:32   #12
ImmortalA1000
Registered User
 
Join Date: Feb 2009
Location: london/england
Posts: 1,347
Well that's good news. I can carry on seeing if I could design a simple short demo and fleshing out some sort of plot and placeholder anims/backgrounds and come back to you guys when I am at the point when code needs to be written
ImmortalA1000 is offline  
Old 10 August 2023, 05:18   #13
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
I've de-tokenized the CDTV device example from the Ultimate Blitz Basic CD

Code:
;
; accessing exec level devices
;

NEWTYPE.Node:*ln_Succ.Node:*ln_Pred:ln_Type.b:ln_Pri:*ln_Name.b:End NEWTYPE

NEWTYPE.List:*lh_Head.Node:*lh_Tail:*lh_TailPred:lh_Type.b:l_pad:End NEWTYPE

NEWTYPE.MsgPort
  mp_Node.Node
  mp_Flags.b
  mp_SigBit.b
  *mp_SigTask.w
  mp_MsgList.List
End NEWTYPE

NEWTYPE.Message
  mn_Node.Node
  *mn_ReplyPort.MsgPort
  mn_Length.w
End NEWTYPE

NEWTYPE.IOStdReq
  io_Message.Message
  *io_Device.b           ;Device
  *io_Unit.b             ;Unit
  io_Command.w
  io_Flags.b
  io_Error.b
  io_Actual.l
  io_Length.l
  *io_Data.b
  io_Offset.l

;add particulars to device here
;  rate.w:pitch:mode:sex:chmask.l:nmmask.w:vol:sampfreq
;  mouths.b:chanmask.b:numchan.b:pad.b

End NEWTYPE

;
;initialise messageport and iorequest for talking to device
;

DEFTYPE .IOStdReq cdio
DEFTYPE .MsgPort myport

myport\mp_Node\ln_Type=4
myport\mp_MsgList\lh_Head=&myport\mp_MsgList\lh_Tail
myport\mp_MsgList\lh_TailPred=&myport\mp_MsgList\lh_Head

cdio\io_Message\mn_Node\ln_Type=5
cdio\io_Message\mn_ReplyPort=&myport
cdio\io_Message\mn_Length=SizeOf.IOStdReq

;
; attempt to open device
;

If OpenDevice_("cdtv.device",0,cdio,0)<>0 Then Print "cant open cdtv":MouseWait:End

signal.l=AllocSignal_(-1):If signal<0 Then End
myport\mp_SigBit=signal
myport\mp_SigTask=FindTask_(0)

;
; cdtv package specific stuff
;


NEWTYPE .subq
  status.b:addrctrl:track:index
  diskposition.l:trackposition.l
  validupc.b:pad1:pad2:pad3
End NEWTYPE

DEFTYPE .subq mysubq

;
; test command
;

  #_INVALID=0:#_RESET=1:#_READ=2:#_WRITE=3:#_UPDATE=4
  #_CLEAR=5:#_STOP=6:#_START=7:#_FLUSH=8:#_NONSTD= 9

  #SUBQMSF=51
  #PLAYTRACK=43

cdio\io_Command=#PLAYTRACK                    ;SUBQMSF
                                              ;cdio\io_Data=0     ;mysubq
cdio\io_Offset=1                ; start track
cdio\io_Length=2                ; end track

DoIO_ cdio                ; err.l=DoIO_(cdio)

;NPrint mysubq\status
;NPrint mysubq\status
;NPrint mysubq\status
;NPrint mysubq\status
;MouseWait

CloseDevice_ cdio
FreeSignal_ signal
MouseWait
End

Last edited by earok; 10 August 2023 at 05:29.
earok is offline  
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Thinking of jumping ship from Amos to Blitz Brick Nash Coders. Language 26 08 July 2022 19:05
BLITZ 2.1 or AMOS Pro best for full AGA sprite support? ImmortalA1000 Coders. General 10 12 May 2019 10:01
Missing AMOS and Blitz Basic Quickmatch tags Master484 HOL data problems 6 26 March 2019 13:57
AMOS or Blitz Basic 2 Dreedo Coders. General 42 23 September 2014 21:48
Top 100 / Bottom 100 games Galaxy AMR news 8 10 March 2007 12:10

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 16:18.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.08534 seconds with 15 queries