News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_Carnivius

Loading bars help?

Started by Carnivius, 10:12, 28 June 14

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Carnivius

Haven't been able to do much proper game stuff this week due to acting in a play (final performance is tonight and tomorrow I shall be catching up on sleep) but I've been tinkering with the fake tape loading routine for my cpc-like games I got wondering what do the coloured bars actually mean?   Are specifc colours used depending on the code and why do they often seem different in other games?   Also what does the speed of the bars mean?   I'm just trying to understand these better to make the fake tape loading look a bit more authentic.

Here's a screenshot of it so far.   Obviously it's not animated here but in the actual game the image is drawn as you'd expect from left to right in each row over the top of a blank dark blue 'canvas'.   The colour bars flash about in colours and different sizes all crazy.   At moment it's cycling through 9 colours picked from the same 16 as the loading picture.  So I just need some help understanding which colours should be used and how many of them and the min and max sizes of the bars.


Favorite CPC games: Count Duckula 3, Oh Mummy Returns, RoboCop Resurrection, Tankbusters Afterlife

arnoldemu

Quote from: Carnivac on 10:12, 28 June 14
Haven't been able to do much proper game stuff this week due to acting in a play (final performance is tonight and tomorrow I shall be catching up on sleep) but I've been tinkering with the fake tape loading routine for my cpc-like games I got wondering what do the coloured bars actually mean?   Are specifc colours used depending on the code and why do they often seem different in other games?   Also what does the speed of the bars mean?   I'm just trying to understand these better to make the fake tape loading look a bit more authentic.

Here's a screenshot of it so far.   Obviously it's not animated here but in the actual game the image is drawn as you'd expect from left to right in each row over the top of a blank dark blue 'canvas'.   The colour bars flash about in colours and different sizes all crazy.   At moment it's cycling through 9 colours picked from the same 16 as the loading picture.  So I just need some help understanding which colours should be used and how many of them and the min and max sizes of the bars.



The colours are specific to the loader used. The loader is often a variant of the spectrum ROM loader and they have chosen the colours they wanted to make it look nice to them. So feel free to choose what you want. If it should be reproducable then often a specific continuous range is chosen which is a power of two.
E.g. 2 4 8 16
The loader will use the CPC hardware number to choose the colour and the numbers and colours are documented in the gate array doc on my website.
Using this means it can be reproduced closer on a real amstrad but its up to you.

Data on tape is split into bits. So 8 per byte. On tape it is stored as a series of sound waveforms. The length of a waveform for a 1 is often twice the length of a zero.

So the thickness of each line tells you if its a one or zero. So split into one or zero work out length and put them on the screen. That should give you a close approximation.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Carnivius

Quote from: arnoldemu on 12:54, 28 June 14
The colours are specific to the loader used. The loader is often a variant of the spectrum ROM loader and they have chosen the colours they wanted to make it look nice to them. So feel free to choose what you want. If it should be reproducable then often a specific continuous range is chosen which is a power of two.
E.g. 2 4 8 16
The loader will use the CPC hardware number to choose the colour and the numbers and colours are documented in the gate array doc on my website.
Using this means it can be reproduced closer on a real amstrad but its up to you.

Data on tape is split into bits. So 8 per byte. On tape it is stored as a series of sound waveforms. The length of a waveform for a 1 is often twice the length of a zero.

So the thickness of each line tells you if its a one or zero. So split into one or zero work out length and put them on the screen. That should give you a close approximation.

Ah right.  I been loading up some tape files into JavaCPC Desktop and yeah you're right, the colours seem to be aesthetic and even the amount varies between games and sometimes even during the same game.   RoboCop briefly alternates between a full 16 colour one (where the bars are of equal thickness) and a two colour (blue and black of various thicknesses) before settling on the blue and back while drawing it's image.

Also the actual drawing of the image seems different on some games.  RoboCop and R-Type simly draw each line from top to bottom whereas Head Over Heels does the process I already have (shown in my screenshot above where it's split into segments of 8 pixels high).

Also I notice the bars are rarely ever straight.  Will have to work on that for mine.
Favorite CPC games: Count Duckula 3, Oh Mummy Returns, RoboCop Resurrection, Tankbusters Afterlife

pelrun

The bar size/shape depends on the position of the raster beam when the border colour is changed by the loader. Since there's no real feasible way for the loader to synchronise with hsync, it'll almost always change mid-scanline.


So if you're faking it, all you need to do is pick a random spot on every scanline where you're doing a colour change, and colour left of that point in the top colour and right of it in the bottom colour.

Gryzor

That was a nice question on Carnivac's part - why some loading images appear line-by-line from the top and others are split in 8-pixel sections that appear line-by-line?

arnoldemu

#5
Quote from: Gryzor on 19:30, 28 June 14
That was a nice question on Carnivac's part - why some loading images appear line-by-line from the top and others are split in 8-pixel sections that appear line-by-line?
Normally it's top line, then line 8 etc the reason is that this is how screen ram is organised so loading is done to each memory address in turn.

Another loader reads the data into memory backwards so the picture appears similar to normal method but in reverse.

Then they started to load them line after line. To do this they load lots of 80 byte blocks which is the width of the screen and they have a list of memory addresses for each block to make this possible.

If you have a list of ram locations and length you can load the picture and main file as you want. The main trick is that each block is joined together with a special sequence of sound waves, otherwise you need lots of leader sounds and lots of pauses making loading slower.

Pacland appears to load as if it was in the order of a bbc micro screen I.e. in 8 pixels tall cells side  by side.

The answer is the loader has a list, they organise the data this way because they made the loader.

My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Carnivius

Quote from: pelrun on 16:31, 28 June 14
The bar size/shape depends on the position of the raster beam when the border colour is changed by the loader. Since there's no real feasible way for the loader to synchronise with hsync, it'll almost always change mid-scanline.


So if you're faking it, all you need to do is pick a random spot on every scanline where you're doing a colour change, and colour left of that point in the top colour and right of it in the bottom colour.

I think I know what you mean and I added that this morning (sort of in reverse though cos if I added the extra partial line after the rectangle then the next rectangle would overlay on top of that line hiding it so I put the line at the top and drawing from the other side so it still looks right and is actually visible). 
Favorite CPC games: Count Duckula 3, Oh Mummy Returns, RoboCop Resurrection, Tankbusters Afterlife

Gryzor

Thanks Arnoldemu, interesting stuff, I had always been wondering...

Carnivius

arnoldemu sure does know a lot of cpc stuff. :)
Favorite CPC games: Count Duckula 3, Oh Mummy Returns, RoboCop Resurrection, Tankbusters Afterlife

Carnivius

#9
Here's it with the raster beam thingy thing whatevers so the bars aren't fully rectangular.   Tried to go for a gradient colour scheme but I think it feels a bit 'urban' for an otherworldy spacey shooty game so I might keep this colour scheme for RoboCop: Prime and do a different one for Cosmic Prison Commando.  I don't know.  The colours do seem to fit Jack though.

Obviously looks better in motion with the bars all going random and crazy.

Favorite CPC games: Count Duckula 3, Oh Mummy Returns, RoboCop Resurrection, Tankbusters Afterlife

Gryzor

This takes me back :)

Say, how long are you planning the "loading" sequence to be?

Carnivius

#11
Standard speed will probably be about 30 seconds or so.  Have already coded it though that holding down a particular key 'turbo loads' it by changing the AnimSpeed variable making the image lines appear in under a few seconds.

Fixed alignment of the raster bits (as when looking at CPC screenshots I could see they always aligned in multiples of 8 ) and I've flipped the orangey gradient so the black and whites are shared with the blue gradient creating a smoother effect.  Also it sort of reminds me of the copper bar gradient effects seen in the background of many Amiga games.   Think I'm quite happy with it now.   When the image is complete the loading bars disappear leaving the border black as if it's finished loading.

Also have been working on the actual game itself, revamping the engine to match the similar code used in RoboCop: Prime for drawing, menus, control handling and other nifty bits I had improved while creating Robo's engine.

Favorite CPC games: Count Duckula 3, Oh Mummy Returns, RoboCop Resurrection, Tankbusters Afterlife

arnoldemu

very nice.
the alignment comes from the time for an OUT instruction which is used to set the colour.

really nice and authentic.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Carnivius

Quote from: arnoldemu on 17:56, 30 June 14
the alignment comes from the time for an OUT instruction which is used to set the colour.

So on a real CPC, are the loading bars actually really one colour index which keeps changing value multiple times as the screen is refreshing or something?
Favorite CPC games: Count Duckula 3, Oh Mummy Returns, RoboCop Resurrection, Tankbusters Afterlife

pelrun

Pretty much. Whenever the raster beam is writing anywhere other than the screen area, the gate array is continually reading and outputting the value from the border colour register. So if you change it mid frame, the rest of the screen draw from that point on will have the new border colour... until it gets changed again, of course.

ralferoo

I've tried a bunch of different colour schemes for loading, and most times I end back with a variant of the traditional spectrum loader because it offers one advantage - during the pilot tone (the long continual tone at the start of a block), you can judge if the volume is about right by the lines being roughly equal sizes. Too loud and it's mostly yellow, too quiet and it's mostly blue.

The "Spanish style loader" is usually just adding one to the colour each time a bit is detected, but there are a few places in the colour palette where similar colours exist in a row and these don't look very nice.

I've also tried experimenting with changing the colour based on the time between each pulse (on most loaders, these would cause 2 distinct values, but my loader could have 4 distinct values), but it didn't look good. I've also tried using the actual value of the input data but this changes too slowly and looks rubbish for runs of the same byte.

Carnivius

Does it mean it's possible to display all 27 colours at once?   I mean in the raster thingy.  Not that it would look much good but I'm curious.
Favorite CPC games: Count Duckula 3, Oh Mummy Returns, RoboCop Resurrection, Tankbusters Afterlife

arnoldemu

Quote from: Carnivac on 14:56, 01 July 14
Does it mean it's possible to display all 27 colours at once?   I mean in the raster thingy.  Not that it would look much good but I'm curious.
yes
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Powered by SMFPacks Menu Editor Mod