Adding depth: The development of Corda

Introduction:

This project started its life after the very first Lovebyte in 2021, where I remember Orby doing a 2-layer tunnel effect which I thought was kinda cool. So after the event I started messing around with such an effect myself, saved it somewhere and kinda forget about it.

Then 2022 comes around with the Dihalt party happening in January. Having participated the year before with our first 256 byte Fantasy Console intro I started to dig the archive to see if there was something there that could make an intro. Here is what we ended up with:

Development:

The layered tunnel effect that we had was still very basic and would need some work tweaking the look'n feel and adding a bit of progression and (very limited) sound.

The basis of the tunnel effect is is basically having 2 perspective tunnel calculation that have their centerpoints (x,y) moving across the screen for a more dynamic movement. For each pixel on the screen the angle q is then calculated using the atan function and distance r using pythagoras. From here 2 perspective values v,z are calculated. Now we have everything setup for our final color calculations.

To calculate the final color we'll use a conditional assignment that either calculated the color for the top or the bottom layer, depending on the value of (q+v)%8>4 to represent the swirl of the top-layer.

Progression was then added by having the bottom layer slowly emerge over time and then later in the intro add the second layer and the title text and then after a while reverse the process to close out the intro. The skipping of the pixels with 1.7 was done deliberately as a stylistic choice to give the intro a bit less of a standard TIC-80 look.

Here is the code for the TIC-80 version

function TIC()t=time()/499W=t//8 cls()
for o=0,71 do poke(65436+o,-t*64%60)end
for o=0,32640,1.7 do
x=o%240/99-1+math.sin(t/5)
y=o/24040-.5+math.sin(t/7)
q=math.atan(x,y)*5.12-t
r=(x*x+y*y)^.5
v=3/r+t
z=6/r+t
poke4(o,1/r>v%(W>8 and 5-math.sin(t/17)*2or 0)and(q+v)%8>4 and 15-(q//1&(q+v)//1)%4or (q//1&z//1)%4*r/(4-math.sin(t/29)*3))
end
print(W&4>0 and"c o r d a"or"",96,64,t/4%4-5)
end

And here for the PICO-8 port

cls()pal(4,0)pal(2,13)::a::t=time()
for j=0,128,2do
poke(12869,-t*99&11)sfx(1)
for i=t*9&1,128,2do
s=sin(t/49)*72
c=sin(t/47)*64
x=i-64+s
y=j-64+c
q=atan2(x,y)*32-t
r=sqrt(x*x+y*y)
v=t*9/r+t*2
pset(i,j,r>6and(q+v)%8>4and(q&(q+v))%4+4or(q&v)%3*r/199)
end end
?t>15and'corda'or'',4,66,t%3+4
flip()goto a

And with that the intro was finished and released later at Dihalt 2022 where it won the tiny intro competition.

Conclusion:

While Corda is definitely not our best intro, I think its still a fine addition to our catalogue and turned out pretty okay for its shorter-than-usual development time.

For more information, you can check out the intro at demozoo: Corda (2022)

Return to blog overview