Introduction:
After taking my first foray into Atari ST coding the previous year and creating two intros in the same month, I completely stopped using 68000 assembler for the rest of the year and got back to working on other platforms again. So by the time that Sommarhack 2023 was approaching, I knew that I needed to get back on the 68000 horse again to create some productions at the summer Atari parties. And since 68000 Assembler is still not my prefered flavor, I was happy to let it go again directly after the development of these two productions ;-)
Algorift (256 Bytes, Atari ST):
Having been able to check out the level of competition the previous year at Sommarhack, I really wanted to up my game again for this years production. And as I promised myself not to exclude the TOS header from the filesize that also ment I had about 32 bytes less to work with than my direct competitors.
Visuals:
I wanted to see if I could improve the wow-factor on the visuals compared to last years intro by re-allocating some of the sizebudget previously spent on sound and pre-intro stuff to generate the 3D visuals in this intro.
One thing I also knew from the start was that I wanted to make the visuals more dynamic by having the camera move up and down through the scene. This ment that I couldn't rely on some clever display-pointer switching, but needed a slightly more elaborate way to copy selected parts of the scene to the screen.
This intro uses 3D Raycasting to generate the visuals, which takes a direction-vector for each pixel on the screen and steps through 3D space using a fixed stepsize. Using this technique we're able to generate a simple 3D Scene using binary operations to determine the final configuration of the block-geometry. Fortunately this can be done by using all integer math which is perfect for the 68000 CPU.
The main block geometry configuration is (X XOR Y) >> 8 AND Z AND 8
in 8:8 fixed point space, which will
give us these checkboard configurations of Blocks that are spaced out into different layers in
the Z direction.
D5=RayDirX, D6 = RayDirY, D7=RayPosZ
)
; Initialize Ray Position
D2=0
D3=0
D4=0
RAYLOOP:
; Step through 3D space
D2=D2+1
D3=D3+D5
D4=D4+D6
; Determine Geometry Configuration
D1=(D3^D4)>>8
D0=D2+D7
D0=D0&D1
Branch to RAYLOOP unless ((d0&8) or (d2>99))
; Determine Geometry Color and Plot Pixel
Once we have a hit on the geometry, we'll calculate the final pixelcolor by calculating a depth-shaded texture pattern on the geometry, for example by using the lower part of our fixed-point calculation (D0,D1) and / or the distance D2 depending on the exact look you are looking for.
Then for this particular intro I've added a slight twisting effect was to the 3D space/position when tracing along the depth axis to make things look a little more interesting.
Color palette:
In previous productions I've generated palettes using code that would work by just keep adding a number to a register and writing directly to the color-palette memory, abusing the fact that color-channels would overflow to get interesting color-ramps (like for example the nature-tones used in the Matka Natura intro mentioned below) as well as not requiring the need for a seperate register as a color-index counter.
However for this intro I needed a bigger color-ramp and I didn't want to settle for a standard grayscale or coder-colored ramp, so I had to look for a new method to generate my color palette by combining the required code for enabling the supervisor mode with the palette generation code.
; enable supervisor mode (and set d7 as a palette counter)
moveq #$20,d7
move.w d7,-(sp)
trap #1
; generate warm-toned monochrome palette
lea $ffff8240.w,a1 ; VID_COLOR0
palloop:
move.w d1,(a1)+
add.w #$0911,d1
subq #4,d7
bcc.s palloop
The above code allows for the warm-toned colorscheme that I was able to use in this intro.
Audio:
The Atari ST is known for its high quality built-in MIDI support. Therefore this intro features some simple MIDI / MT-32 audio, but will work in theory with any MIDI synthesizer connected to the built-in MIDI-out port.
Matka Natura (128 Bytes, Atari ST):
This intro actually took a long time to get working properly. Ofcourse we've seen IFS fractals done before on various platforms (including the Atari ST), but those productions were using a set of fixed rules or matrix-values for their transformations (dragon curves, ferns, levi, etc.) which will either extra code or data for each new shape.
I've been searching for quite some time for a method that would allow me to generate an infinite amount of (leaf) fractals in a small size, which would require making your the IFS transformations dynamic. But when you start to introduce random alterations to the fractal itself, it will quickly dissolve into complete random noise.
Over the years I've discussed this idea with other sizecoders like Hellmood and others who have looked into similar things. The challenge here is to find some way of introducing pseudo-random elements that will also be predictable enough to keep the IFS transformations in check.
Long story short, after years of trying to tackle the problem myself I finally was able to find a method that would keep the regular IFS transformation predictable enough as well using the last known position of the previous fractal shape as a new seed for the next shape in a stable enough matter.
Here is the result:
The intro capture runs for about a minute, but it will keep generating new leaf shapes forever. After the release of the original intro at Silly Venture 2023, I also created an Amiga OCS port for Matka Natura which was then added to the original archive.
Conclusion:
While last years intros were already quite nice, I'm quite happy with how the 2023 offerings turned out. With Matka Natura breaking some new ground in small sized IFS fractal generation and Algorift being ported over to Jaguar as well as getting a Nano Award nomination that year.
For more information, you can check out the intros at demozoo: Algorift (2023) / Matka Natura (2023)