Shoot the core: The development of Gyro

Introduction:

This project started with a local byte battle between myself, Blossom and Rho/Trepaan. Here Blossom combined the use of a perspective floor with a traditional polar-tunnel which she dubbed 'the flunnel'. A slightly simplified form of this shape was used as an inspiratioj for the reactor-shape in this intro and all the rest followed from there.

Development:

The intro consists of all kinds of different elements that will be introduced during the intro, such as the colored reactor shape that will be revealed in different segments over time, the blob of atoms (both static and moving through the reactor), the title text and the way the realtime custom palette interacts with tha action on screen.

First we'll calculate the reactor shape for each pixel on the screen using: Z=(X*X+Y*Y*3+1)/999 color=X/Z+t)//1&Y//Z

To calculate the final color we'll and the color values with the part number W&11 which in combination with setting the custom palette takes care of the reactor buildup.

On top of the background we'll draw the atoms using 2 counter loops: One for each particle which will be used for calculating the atom's position, and another nested loop for drawing a series for filled circles that make up the shape of the atom.

for o=1,numatoms do
(calculate atomx,atomy,r)
for Z=0,4 do circ(atomx*r-Z,atomy*r+68-Z,r-Z*2,-Z)end
end

Palette and Audio:

The custom palette and bit-banged audio is done inside the background update loop, to avoid having to include a seperate loop.

Custom Palette: poke(16320+Y%24,Y%24*(2*math.cos(t/49+Y%3)+4))
Audio bitbanging: poke(65440+Y,3*t%43)

Progression:

Quite some time and bytes were spent on getting the intro progression right between the background buildup,showing and moving the atoms around and showing the intro title. By combining the toggling of all these seperate elements with the custom background palette I think we were able to deliver something in terms of progression that went beyond what was done in other fantasy console intros at the time (including our own work).

Sourcecode:

Here is the code for the TIC-80 version (formatted a bit for readability):

function TIC()
t=time()/29W=t//99|2
for Y=-68,67 do
poke(16320+Y%24,Y%24*(2*math.cos(t/49+Y%3)+4))
poke(65440+Y,3*t%43)
for X=-120,120 do
Z=(X*X+Y*Y*3+1)/999
pix(X+120,Y+68,(X/Z+t)//1&Y//Z&W&11)
end end
r=math.cos(t/49)*6+6
for o=1,W&8 do
for Z=0,4 do circ(120-math.cos(t/49-11)*4*(W&16)+math.cos(3*math.cos(t/19+o*5))*r-Z,math.cos(t/9+o*5)*r+68-Z,r-Z*2,-Z)end
end
print(W&12>8 and'g y r o'or'',104,65,r%5+12)
end

And here for the PICO-8 port

::f::n=t()*11w=n/32
for y=-63,64,2do poke(12869,-n&8+w%6)sfx(1)for x=0,16do x=rnd(32)*4-64z=(x*x+y*y*3)/399circ(x+64,y+64,1,({1,12,7})[x/z+n&y/z&w&7])end end
for i=1,w&8do r=w+i/8y=cos(r)*16for z=0,2do circfill(sin(r)*48+64-z,y+60-z,y-z*4-4,({13,6,7})[z])end end
?w&24>8and'g y r o'or'',50,62,7
goto f

And with that the intro was finished and released at Inercia Demoparty 2021.

Conclusion:

Back in 2021 this intro served as a nice experimentation with using custom on-the-fly palettes and what was possible in terms of intro progression.

For more information, you can check out the intro at demozoo: Gyro (2021)

Return to blog overview