Dear viewer, these subtitles were generated by a machine via the service YouTube and therefore are (very) buggy. If you are capable, please help us to create good quality subtitles: https://c3subtitles.de/talk/2527 Thanks!
[Music]
so good afternoon we are here at the
Nerds of
the and cros
Hine stage at the CCC camp
23 and we have uh the next talk is um
called Celeste bringing an indie classic
to Pico system and uh it's a from
Andreas also known as um pix
Panka and he is into um retro Computing
and electronic music and uh before we go
also to the stream out there we have a
this stage have a
hashtag um it's on paper but you can
also use it it's a # CC
cm23 not X or CCC camp 23 not X and if
you use it in F in fivar we can take
your questions and
um and and and read them out loud here
so and uh without further
Ado welcome to the stage thank
you welcome to my talk Celeste bringing
an indie classic uh to Pico system uh
thank you all for being here I hope
you're enjoying the camp so
far um show me with hands how many of
you have heard of or played
celest okay almost all of you that's
good um this talk is also not not only
about celest but also about um Pico
system if you could switch
once this little device it's a small
handheld that is a geared much towards
people who like to make their own games
and not just play
them um but more about that in a
minute let me start with some background
about what is pixel
art from
1972 to 1995 uh pixel art was simply
called computer
Graphics starting with Pawn
all the
way been in
2D but then in 1995 the PlayStation came
along and uh everything was about 3D 2D
was obsolete outdated old hat nobody was
interested in it everything moved to 3D
even if those early worlds were pretty
lacking in
detail but then starting in 2004 there
was an indie game called Cave Story
which started as sort of pixel art
Renaissance it's still very popular so
it's not a trend it's it's here day
pixel art is
very
uh still in use
today today we we have um mainly three
flavors of pixel art on one end of the
spectrum we have have um new games for
vintage Hardware like um Sam's journey
and the great thing about these games is
that uh with uh culminated
knowledge and experience uh these games
often surpass uh the commercial games of
the
era then in the middle of the spectrum
we have games that look kind of old but
are U more advanced underneath for
example they may not observe as Sprite
limit or they have bigger worlds uh than
used to be or they are simply uh
programmed uh in um more modern
Frameworks that that take a lot more
resource and then we have at the high
end uh what I would call High pixel art
which is combines um pixel art with a
nextg look and pixel is not an aesthetic
and artistic choice and not a technical
necessity
anymore which brings me to Celeste
Celeste is certainly uh a high pixel out
game was released in
2018 and for an indie game it had an
astounding uh number of copies over man
Willam and it's u a game um in the re of
u a really difficult Precision
platformer where where you die a lot and
you learn by trial and error and it also
has a really great story and a quite
deep story frankly uh with some topics
of identity if you read between the
lines but inside Celeste the the full
release is a hidden as an Easter
ARG um celest now called classic uh
which is a prototype done in
pq8 um which precedes the full release
but it's also inside the commercial game
if you find
it which brings me
to
pq8 um probably have heard about it as
well it's a fantasy console it's like an
emulator for a machine you've never
heard
of and that didn't not really exist in
real
life it's uh inspired by the baby Ste
micro uh it's uh Creator zap head as as
as a child and if you boot it up you're
you see a command line and you used to
program this in basic but now it's a
lure and it has integrated tools for
creating tiny games and it's still very
popular for game Gams if you have uh
prototyping something if you don't have
a lot of time and has a lot of
constraints and these are made to
uh uh make you more creative so uh
you're not uh confused with with too
many choices and it still has a really
strong
Community which brings me finally uh to
the Pico system it's a tiny handheld
based on the rest B Pi Pico
microcontroller but combines it in a
nice form factor with a battery it's
overclocked out of the box it has a
small piece of speaker it does a little
bit of tiny kazio sty
sounds it gives you 6 hours of battery
which is um thanks to the uh um P piku
that really uh consumes a lot uh tiny
amount of
power um and it has a generous amount of
16 megabytes of uh fles ROM and
executing Place R which I'll talk about
a minute and has a tiny uh Square
screen uh inside it's powered by the
rber pi Pico or
rp240 it's a new microcontroller from
West Bay with uh two core zero cores but
also some additional Hardware like for
example a hardware division Unit A
interpolator
uh lots of dma channels and uh P
programable iio which is a special
feature of the U
pipo it's quite a confusing for some um
if they see pq8 and P system they think
it's the same it is not here you see
some um differences and uh
similarities both are do have a square
and high
screen p in name p in size we reduced
controls but um pq8 has a lower runtime
with some overhead whereas P system by
default runs uh with a compiled
C++ p8 has lots of ram um Lua has a
minimum of 2 megabytes and very little
ROM the games are just 32k in size um
with pickle system it's reversed you
have lots of ram 16 megabytes uh but
very little Ram 365 kilobytes and lastly
p8 needs a pretty beefy processor for
what you're getting uh 1 GHz at least
and P system is over collect to 250
mahz so um when I began porting the
first question is um why don't we just
Port the pq8 one time um that could play
all kinds of games games and the
question is that simply do Ram
requirements um make it impossible there
there was an attempt to uh expand the
ram um but it ran like eight or 10 FPS
because uh it's really slow and there's
no strip down equivalent on the L side
like micropython for python so it's just
um too big for for this tiny
microcontroller and yeah if you try it
on Pak rate on a full Rasberry Pi one
you will even have some slowdown
so it's just too much so it's a direct
Port
um Pico system has an amazing amount of
Frameworks to offer there six or seven
of them that you could choose from uh I
choose to go with the official uh PCO
system SDK because it first has a
reduced
footprint um and and if you look at the
API you will notice some similarities um
looks kind of the same um but I want to
mention two additional Frameworks you
could use uh 32 Blitz SDK is the most
powerful certainly uh from a bigger
machine and a pretty new one micro JS uh
not micro uh which is easiest for
beginners you just need a web
browser so uh when I started porting the
the first step was to convert all the
assets uh so I wrote Python scripts to
import the spread sheets and also do
some color format
conversion
um more about that in a minute uh
secondly uh we have map data which is
the level data this is also converted
and um some p8 games lose use
compression because 32k is really little
but that's not necessary for p system so
we can remove the compression um there's
no actual loading it's just uh ROM
addressed directly and and and so it
works like the consols of all you're not
loading you're not pausing um you just
access a memory address and your level
data is all
there and lastly um there's some sound
uh conversion Pate is known for its chip
Tunes um sadly they don't work on this
one
um but they also converted what is there
at as sound effects and for all this
conversion of the file formats they're
really uh explained in detail in the pq8
wiki so that's a great
resource um I me talk about a bit more
in detail about the colors I hope you
can see those colors P has just um 16
colors but they're really cleverly
chosen uh artistically so it looks a lot
more colorful than 16 colors uh suggest
there's even a hidden pette of another
16
colors
um and it works with old school tricks
like pallet swaps uh this is a chess
prototype I did um you the chess pieces
are the same spot but just recolored
with pallets wrapped
and in the old times um you also use it
for uh color cycling effects that look
pretty amazing but they don't use uh
practically no resources even on on Old
machines because the the the pallet
change um costs almost nothing and you
can do some animation style that's just
a cycling of colors so that's the two
reasons Pig still uses
pallets uh PCO system on the other hand
has uses the
st7789 display it's pretty common uh
display with a uh controller to uh to
power it it has a
18 bits of color which is 260,000
colors also works in 16bit color mode
with 62,000 colors and lastly uh in
12bit modes with which gives you 4,000
colors and uh
we go with this 12bit color mode um
which gives us exactly the amga palette
of
4,096
colors but there a problem um um if you
store 12 bits um inside 16 bits you can
uh read them out efficiently via memory
copy you have to skip a
uh uh for bits um but there's some p is
assembly and it's connected via dma to
the memory and then it uh processes
those bits and first um some away and
with this saves us 25% of the SBA
bandwidth and this is great because SBI
bandwidth is the one limiting factor uh
for the refresh of this
display and yeah those 12 bits stored um
in two bytes uh means one nibble that's
the word for for bits
uh can be used for full Alpha
transparency um which looks great and
it's uh uncommon for an eight or 16bit
machine um so what I did um when pting
uh the the SDK out of the box has some
So-Cal blend modes there's copy which is
just a memory copy as so from Source uh
to the screen um it ignores what's
what's there then we have mask which is
one bit transparency and finally we have
a a mode with full Alpha transparency
and of course this one is the
slowest and I added additional um Pate
blend modes um a new one um called
Sprite U which uses a transparency map
this is a feature of P rade where you
can assign some colors to be transparent
or not
um secondly uh
pallet um yeah because um there are
pallet effects and that means um colors
are changed after the effect um so the
screen is already already
drawn and then uh which we decide on a
pallet change change it afterwards and
to enable this um I used this
transparency nibble to store the
original pigate color index instead so
so um I can reassign whenever there's a
pallet change and but I also want to use
the full 4,000 colors so maybe combine
or enhance an existing game so I finally
have convert which uh copies those
pallet colors to full
rgba okay secondly uh the game Loop is
every game has has an internal game Loop
that uh reads data from the controller
um updates the game logic and finally
draws the
screen um the st7 89 has a different
refresh rates you can use um 50 HZ is
the default I go here for 60 HZ and the
great thing about this uh this play is
it has a dedicated vsync pin uh so we
have uh we can sync through display and
this displ I used to start the game Loop
so uh we don't have a timer but the
display Z drives the refresh and this
saves up to one frame of latency for us
and uh lastly um pick rate is made for
exactly 30 FPS so I just wait twice and
then I have exactly 30 FPS and uh if you
count up um the time uh it really um
keeps the time
correctly um there's a bit of detail um
regarding the screen uh p8 has 128 by
128 pixels really odd and unusual
resolution uh pickle system has just 120
by 120 uh this doesn't sound like much
of a difference if we have a scrolling
game um cutting off four pixels um
doesn't hurt but uh for a single screen
game like Celeste sometimes there are
some important objects that would be
hidden I hope you see the red outline so
I implemented a u moving camera that
follows the player
that also tries not to bounce back and
forth with some uh
limits so only when it needs
to okay last porting aspect of these uh
P of speaker
sounds
um we have lots of uh sounds in original
but we are only left with uh wave and uh
noise channels and let me show you what
it sounds
like yeah that that's what's left of the
sound but still it gives a nice
feedback and I use the second core to
decouple the the sound uh speed from the
frame
rate okay um before I come to this last
SL let me just show you quickly what it
looks like if you could switch to the
camera so here's the
last you can play it and
it R in full speed
um there are
pickups and because it runs on a
Raspberry Pi I changed the pickups to a
to be a
Rasberry but you can always um change it
back to the original
strawberry so that's done one minor
addition okay um the last point is um
I'm I've done it again and try to Port
it
again uh this time in
R using as chonos and embed rust and it
uses embedded graphics and embedded
Graphics core and I'm starting from
scratch and
uh the first uh thing I did was this
Sprite routine uh which uh passes the
spreadsheet and now whites it using ah
you should switch back to
the camera
please
uh it PES the spreadsheet and displays
it uh as you can see right now it's
still a bit slow uh which is because we
are not using a frame buffer yet we're
just moving directly VI SBI to the
display but yeah that's um the future of
this port and uh I also want to um
convert The Lure code this time not by
hand but with a abstract syntax poer um
to make it a general framework for
porting p r games to the pck system
thank
[Applause]
you well thank you very much um pix bka
um as was um I think you could have used
more time for getting more deeper into
it so but who have want to know more can
ask you
like the side of the stage because we
need to make u space for the next uh
next talk that is already in preparation
and will happen here in my watch died in
um 18 minutes so and we need that time
to for this um change the stage but
thank you very much for coming and thank
you very much for coming here
[Applause]
thanks