
24a2: An ultra-minimalist game engine - jmlr
https://github.com/jamesroutley/24a2
======
derefr
I feel like, rather than having no sound at all, the ability to output a PC-
speaker-like beep (i.e. turn on/off a fixed-frequency, fixed-amplitude square
wave channel) might be nice. No parameters because otherwise you might get
distracted trying to trick it into sounding vaguely musical ;)

I’ve also always wanted to see something like this but with emoji for the
“graphics.” (Emoji are, after all, the standard graphics resource pack of our
era—like DOS box-drawing characters were for the 80s.) Maybe stick them as
labels on a grid of buttons, resulting in a similar look to _Chip’s
Challenge_.

~~~
prvc
That would defeat the purpose of being minimalist, don't you think?

------
jstanley
Wow, this is fantastic, what a great idea.

I've spent the morning knocking up a little Space Invaders clone, it's the
most fun I've had programming in ages. It's at
[https://incoherency.co.uk/24invaders/](https://incoherency.co.uk/24invaders/)
and the logic is mostly done, just got some graphics work to do.

I got into programming as a teenager by making shitty games, first with Blitz
Basic, and then with the Allegro C library.

My favourite parts of the Allegro community were the annual "speedhack" in
which people create a game over a weekend, and the informal "screenhack" in
which you create a game that must fit in 80x25 characters of C code. 24a2
brings back all the joy of those challenges for me.

~~~
nazgulsenpai
I was a teen also fiddling around those BASIC game programming engines like
Dark and Blitz Basic. That was so much fun.

All of my memories of Allegro mostly revolve around DJGPP. What an interesting
piece of software that was.

------
Waterluvian
I just love it. I can’t wait to make a bunch of toys with this.

I do think some very primitive sounds might be a good option. Don’t even use
files. Just use the AudioContext and provide an enumeration of a couple beeps
and boops. And I 100% support if the answer to this is “avoiding scope creep”

------
ArtWomb
Nice! I think you could do a port of the classic Milton Bradley board game
"You sunk my Battleship!" with this ;)

[https://en.wikipedia.org/wiki/Battleship_(game)](https://en.wikipedia.org/wiki/Battleship_\(game\))

~~~
tootie
This framework is based on a game loop that runs an update on each frame which
is more intended for real-time controls. I think a turn-based game like
battleship is a different paradigm.

~~~
setr
You always have to update every frame -- UI, sounds, animations, etc -- the
question is whether you update your game simulation every frame. But really,
you don't want to link your simulation-updates to your frame updates anyways,
real time or not, because then you get weird behaviors like different
framerates producing different physics (I believe it was quake that famously
let's you jump further if your framerate is higher).

------
jsf01
Is importing P5 a requirement for this engine to work? I know “minimal” can
mean a lot of things to different people, but I don’t think it P5 adds much
that you couldn’t trivially do without it in this case, and by stripping that
dependency away you’d be able to make a very strong case for this being an
ultra minimal engine.

~~~
esperent
I'm sure it's easy to render a 24x24 grid of colored dots using JS without any
kind of graphics engine. But I guess it's a stylistic choice - abstract out
the rendering code so that it's just an engine.

------
Impossible
I love the minimal API, but this would really be awesome if it was a hosted
fantasy console style environment with zero boiler plate and shareable links.
I know that sounds like a minor difference, but having to write even a little
bit of boilerplate in a minimalist environment is a source of friction. Also,
as said by many people in this thread, a simple sound API (PC speaker style
sounds, sfxr, 10 hard-coded effects, etc) should be added.

------
RobKohr
This could be fun to implement in arduino hooked up to a color led matrix that
also double as buttons.

------
harkal
I find that any game created with this game engine ends up being far more
code-heavy and complex than it would be without using it. In my mind, this
invalidates the argument of using an ultra-minimalist game engine at the first
place...

~~~
esperent
Of the two example games that come with the engine, skiing is 113 lines long
and snake is 158 lines long. Both include comments and don't make any attempt
at a brief style of coding, so their lengths seem reasonable to me.

What games have you seen that you feel are too code heavy, written using this
engine?

~~~
harkal
"Code heavy" of course in a relative sense. You can definitely make a snake
game with the same aesthetic in less that 158 line, and you won't need to
carry along the engine. I would also argue that the plain javascript version
will be easier to understand as you will not need to understand what the
engine is doing.

------
umvi
I love artificial constraints like this. Really forces you to innovate

~~~
dropit_sphere
And, in a sense, _allows_ you to innovate, by lowering the bar you feel like
you have to clear to make something of "quality."

~~~
CobrastanJorji
Exactly. The demo scene requires innovation, but the bar for entry is high.
This also requires innovation, but the bar is on the floor. Great idea! I'd
love to see game competitions around these sorts of arbitrary restrictions.

------
livre
Interesting idea, I recommend adding virtual arrow keys for mobile
compatibility.

------
Nzen
tl;dr A javascript framework with a canvas output of 24x24 grid of dots. These
dots can adopt nine distinct colors. Default input is arrow keys or mouse
click on one of the dots. Includes a short eight section tutorial and api doc
for two classes (game, gameconfig) and two enumerations (color, direction).
Has example games for snake and 'skiiing' (wall avoidance on a linear path).

~~~
accidentalrebel
Tldr is appreciated thanks

------
andrewnc
I just made my first game[0] with the engine!!

It was a pretty painless experience. Granted it encourages globals (and
JavaScript is not my favorite) but it was pretty great.

Maybe with an additional array/matrix library it would be perfect.

[0]
[https://andrewnc.github.io/games/pal_game.html](https://andrewnc.github.io/games/pal_game.html)

------
kentbrew
Here's Samegame in 24a2:

[https://kentbrew.neocities.org/samegame/](https://kentbrew.neocities.org/samegame/)

Wishing for a mouseover event....

------
flarg
Would be great for something like core wars!

------
morelisp
Strong shades of [https://perlenspiel.net/](https://perlenspiel.net/) (though
probably convergent evolution) - something to look at if you want just
_slightly_ more (variable-sized grid, pixel borders, sounds).

------
fierarul
Why 24x24 and not 80x25 I wonder.

------
saagarjha
The examples are cute and gave me a "graphing calculator game" vibe :)

------
kqr
I have no idea if this is any good compared to existing game engines, but the
limits imposed by its simplicity certainly tickle my creativity. If nothing
else, it could be a great prototyping space.

One question: have you considered making it mobile friendly somehow? Given
that all of the examples require arrow keys, it's a bit hard to demo on a
phone.

~~~
smabie
It can only render a 24x24 grid of dots, of course it "sucks" compared to
existing game engines..

~~~
kqr
I meant more in terms of architecture, extensibility, etc. I noticed it uses
rather procedural updates -- maybe other game engines use more functional
updates? I have no idea.

------
xwdv
Is there a place where games made with this engine are featured?

~~~
vgb2k18
Only one I found was the owner's website which has some examples...
[https://24a2.routley.io/](https://24a2.routley.io/)

------
dgreensp
I'd like to see some way to play the games on mobile.

------
tobyhinloopen
No mobile support is a missed opportunity.

Also misses bleeps. Beep boop

------
raldi
What's the a2 refer to?

~~~
jmlr
24A2 sort of looks like 24^2, which is what I originally wanted to call it,
and only uses alphanumeric characters. The combination of numbers and letters
also reminded me of P5 and pico-8, which were both inspirations

