In the making: Arukanoido – an Arkanoid clone

Discussion, Reviews & High-scores

Moderator: Moderators

Post Reply
User avatar
pixel
Vic 20 Scientist
Posts: 1330
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

Re: In the making: Arukanoido – an Arkanoid clone

Post by pixel »

tokra wrote:Yes, it's really impressive :D Mike could probably explain in more detail how this works. In short: The algorithm tries all 2048 combinations of background/border/auxiliary-color (16x8x16) and for each combination tries to optimize each of the 240 char-colors (including multicolor). So that's some 8 million calculations right there. Conversion on my 2008 PC takes about a minute.

I would suggest however that the picture is modified to include the new name of the game and clean the rough edges. As it is I would not suggest to use it for the game, not only because of the obvious copyright-reasons.
Oh, it does bitmap conversions? :shock:

Mike should work on better PR for Minipaint. 8)
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
User avatar
tokra
Vic 20 Scientist
Posts: 1120
Joined: Tue Apr 27, 2010 5:32 pm
Location: Scheessel, Germany

Re: In the making: Arukanoido – an Arkanoid clone

Post by tokra »

The bitmap-conversion tool is unreleased as of yet I think. MINIGRAFIK, MINIPAINT and its accompanying tools are really powerful.

I must admit however it's sometimes a little difficult to follow what's out there, since it is now spreaded over several threads. A sticky-post with a MINIGRAFIK/MINIPAINT-overview might help.

Otherwise I see Mike mentioning the tools in any thread where it is applicable, you can't really blame him for not promoting it enough. Problem is there are not that many pixel-artists out there for the VIC-20 really...
User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: In the making: Arukanoido – an Arkanoid clone

Post by Mike »

Pixel, tokra has pretty much nailed down how the converter works. Two important details should be added to the explanation, however - first, the converter does not: first reduce to 16 colours and then apply the restrictions of the VIC, but rather: apply the restrictions and only then reduce - with dithering! - each character cell to the remaining colours (2 or 4). Second, I made sure that the converter processes *linear* intensities of the R, G and B channels.

The other details of the error/distance function between two colours (such as the colour weightings) and the accuracy of the used palette are much less important: but if you don't take gamma into account, darker areas of the image are inadvertently 'lighted up' with stray pixels, furthermore the colour balance is disturbed, which is especially noticable with weakly saturated colours (i.e., greys) in the source image.

Given a set of 3 global colours, the distance function then aims to minimize the error of each attribute cell, trying out all 8 foreground colour and hires/multi, which can be done independently of the other attribute cells, so there's no combinatorial problem involved. In the end, that actual set using the 3 global colours with the least total error over all attribute cells is output.

I didn't release the converter however, because often enough the restrictions of the underlying graphics mode (MG bitmap) *are* actually so severe, that the converter just can't find a good set of 3 global colours - and then the result becomes just a colourful pixel pulp, with the dithering part helplessly roaming around to minimize the error. A "debug" version of the converter allows me to "clamp" one, two or all global colours, but even that doesn't always lead to improved results. :(

So there's still a good opportunity for pixel artists to better the results of the converter. That's the good side of this. :mrgreen:
User avatar
tokra
Vic 20 Scientist
Posts: 1120
Joined: Tue Apr 27, 2010 5:32 pm
Location: Scheessel, Germany

Re: In the making: Arukanoido – an Arkanoid clone

Post by tokra »

Just a quick addition. For the Arkanoid-conversion I used the "dither-free"-version of the converter. I tried the 1D and 2D-dithering versions but they produced an overpixelled mess, just as Mike said.
User avatar
pixel
Vic 20 Scientist
Posts: 1330
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

Re: In the making: Arukanoido – an Arkanoid clone

Post by pixel »

Even on the C64 you can only knock it off with two screens plus sprite layers it seems: http://www.syntiac.com/tech_ga_c64.html

And, yes, at least there's no algorithm for good taste. ;)
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: In the making: Arukanoido – an Arkanoid clone

Post by Mike »

pixel wrote:Even on the C64 you can only knock it off with two screens plus sprite layers it seems: http://www.syntiac.com/tech_ga_c64.html
I <3 parrots. :D

My ppm2mg converter does quite a nice job on the first example of the site (download):

Image

And here's the same picture in 208x256 VFLI. :mrgreen:

Image

The colour bars on the right side show the three global colours as they are allocated to each raster.
User avatar
pixel
Vic 20 Scientist
Posts: 1330
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

Re: In the making: Arukanoido – an Arkanoid clone

Post by pixel »

Impressive! Just to push this a little more back on topic: no digital audio with VLI modes. Only sloppy, jittering raster effects could be done.
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: In the making: Arukanoido – an Arkanoid clone

Post by Mike »

pixel wrote:Impressive! Just to push this a little more back on topic: no digital audio with VLI modes. Only sloppy, jittering raster effects could be done.
Huh!? ;) The display routine of the VFLI mode sets $900E (beside other registers) to a new value on each raster, for all 256 lines of the picture. And, of course, it's cycle stablized. For the moment, just the current volume setting is retained, but in principle the routine could also read off values in a table to set the lower nibble.

For the remaining 312 - 256 = 56 lines, the CPU is available for user programs, and NMI generation could be activated to continue the digi sample. Maybe not at a total sample rate of 15625 Hz, but every second, third, or fourth line (and 312 *is* divisible by 2, 3 or 4) so you could have sample playback at ~8 kHz, ~5 kHz or ~4 kHz (and using the same rate during the displayed 256 lines as well).

Just remains the problem to refresh the (double) sample buffer in the remaining CPU time.

BTT. ;)
User avatar
pixel
Vic 20 Scientist
Posts: 1330
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

Re: In the making: Arukanoido – an Arkanoid clone

Post by pixel »

Mike wrote:
pixel wrote:Impressive! Just to push this a little more back on topic: no digital audio with VLI modes. Only sloppy, jittering raster effects could be done.
Huh!? ;) The display routine of the VFLI mode sets $900E (beside other registers) to a new value on each raster, for all 256 lines of the picture. And, of course, it's cycle stablized. For the moment, just the current volume setting is retained, but in principle the routine could also read off values in a table to set the lower nibble.
So, how many cycles do you have left for each line? Cycle counting is fun…
Mike wrote:For the remaining 312 - 256 = 56 lines, the CPU is available for user programs, and NMI generation could be activated to continue the digi sample. Maybe not at a total sample rate of 15625 Hz, but every second, third, or fourth line (and 312 *is* divisible by 2, 3 or 4) so you could have sample playback at ~8 kHz, ~5 kHz or ~4 kHz (and using the same rate during the displayed 256 lines as well).

Just remains the problem to refresh the (double) sample buffer in the remaining CPU time.
Hmm… wasting loads of memory with tables over tables over sample snippets?
Mike wrote:BTT. ;)
Bwhat!? :D
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: In the making: Arukanoido – an Arkanoid clone

Post by Mike »

pixel wrote:So, how many cycles do you have left for each line? Cycle counting is fun…
$9110, $9005, $900E and $900F are updated on each raster. The display routine is optimized for space, not unrolled, and reads the data off tables. However, most stores to $9005 are actually redundant, as $9005 only needs to be changed when half of the picture has been displayed. It's just easier to write it on every line to keep the cycle times the same.

If the loop is unrolled, the update for each line can commence in 18 or 24 cycles total. The current routine uses all registers for the 3 stores to $9005, $900E and $900F and an INC instruction to $9110 to "group" these changes at the end of each line (and the change of the background/border register exactly happens during HSync... 8)) so these 4 writes happen within 13 cycles.

With an unrolled version, *plenty* of time to do other things, of course. And I already had thought about doing in-line splits, for example.

However, these considerations only apply to the display of VFLI images on a VIC-20 with modified hardware. With an unmodded VIC-20, the update of the colour RAM to "emulate" the FLI takes up all remaining cycles during a raster.
User avatar
pixel
Vic 20 Scientist
Posts: 1330
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

Re: In the making: Arukanoido – an Arkanoid clone

Post by pixel »

Mike wrote:However, these considerations only apply to the display of VFLI images on a VIC-20 with modified hardware. With an unmodded VIC-20, the update of the colour RAM to "emulate" the FLI takes up all remaining cycles during a raster.
Hrmph… now you've really peaked mastery of off–topicness. :mrgreen: And I was already hoping… :lol:
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
User avatar
Mike
Herr VC
Posts: 4816
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: In the making: Arukanoido – an Arkanoid clone

Post by Mike »

That's why I already wrote BTT (Back To Topic)... but what can I do if you insist? :wink:
User avatar
pixel
Vic 20 Scientist
Posts: 1330
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

Re: In the making: Arukanoido – an Arkanoid clone

Post by pixel »

The reflections from the Vaus may be more to your liking now. It behaves like it'd be round and not flat in the middle, though. Not sure this is like the original.
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
User avatar
beamrider
Vic 20 Scientist
Posts: 1447
Joined: Sun Oct 17, 2010 2:28 pm
Location: UK

Re: In the making: Arukanoido – an Arkanoid clone

Post by beamrider »

Just took a look at the latest version. Seem really nice and smooth. Defintely plenty fast enough.

Are you going to animate those things floating down eventually like the arcade? Oh and bring on the sound ASAP :D
User avatar
pixel
Vic 20 Scientist
Posts: 1330
Joined: Fri Feb 28, 2014 3:56 am
Website: http://hugbox.org/
Location: Berlin, Germany
Occupation: Pan–galactic shaman

Re: In the making: Arukanoido – an Arkanoid clone

Post by pixel »

beamrider wrote:Just took a look at the latest version. Seem really nice and smooth. Defintely plenty fast enough.

Are you going to animate those things floating down eventually like the arcade? Oh and bring on the sound ASAP :D
Don't you think it's difficult enough already?

Just kidding… sure. :D But they'll open a can of worms. :( It's microseconds away from not running smooth already. Watched some arcade videos and this is so not like the original. Should have done things a little simpler.
A man without talent or ambition is most easily pleased. Others set his path and he is content.
https://github.com/SvenMichaelKlose
Post Reply