Tools and GUI for arduboy game creation – thoughts and ideas

Good day, dear colleagues.

In this topic, I would like to talk about all things that can help wanna-be arduboy game developers – existing ones and ideas for new possible tools.
In the past, there were talks and discussions about Bitsy-like solutions or blocks programming environments – very helping for non-programmers, indeed, but very demanding on the developer’s side. But maybe there are somehow less complicated solutions, that still can make development for arduboy more appealing and fun?
Recently, I discovered a very interesting fantasy console (actually, a variant of Chip8 fantasy console) named Octo. It looks simple, but cool, and has some basic, but important elements -

Integrated sprite editor, with the possibility to copy-past sprite code into the program.

Sound editor, also with the possibility to copy-past compositions into the game code.

An interpreter, that can run our game on a computer screen in real-time.

Integrated manual. Very important thing, by my opinion, that can be used to learn console-specific commands or to copy-paste them into the code.

In Octo’s specific case, there are a lot of other things, referring to Chip-8 of assembly capabilities and presets.

I think it’s an interesting direction for game creation environment development – (as it seems) less demanding than Pico-8 or Bitsy, but still appealing and helping.

I’ll be glad to read your opinions and thoughts. Also, it would be great to collect past attempts to talk about GUI and existing game-making tools in one thread.

Thank you and best regards,
Ilya.

3 Likes

Some existing tools and interesting utilities -

AB Sprite Editor by Pharap - I think, the most advanced AB drawing tool up to date.

Dark&Under - Level Designer by filmote and Pharap - interesting design tool for an existing game, possibly could become a basis for some kind of “Bard’s tale construction kit” for arduboy.

Lode Runner Level Editor by filmote

Bitsy-Converter: convert Bitsy Scripts into Arduino source files by haroldo-ok

All The Arduboy Image Converters

2 Likes

I actually looked at this a while back because I was considering building a CHIP-8 compiler.

I gave up on the project because I wasn’t sure if it was better to build a CHIP-8 assembler that worked with a low-level assembly language or a CHIP-8 compiler that used a high-level programming language (which is what Octo does).

If there’s interest I could resurrect it, however we’ll need something different to CHIP-8 for Arduboy because of the Arduboy’s spec. The Arduboy doesn’t have enough buttons to support the CHIP-8’s 16-button keypad.

There’s also the question of what memory a CHIP-8 program modifies, but with a compiler rather than an assembler it becomes possible to hide memory addresses from the programmer and thus control how much read-write and read-only memory is allocated to the program, the same way GCC knows to put some data in the Arduboy’s RAM and other data in progmem.

However, if I were to write a compiler, it would be a desktop program - learning to deal with JavaScript would be too much effort. If we needed something web-based, someone else would have to do it.

Anything for the Arduboy would most likely have to be precompiled and bytecode based to get any kind of reasonable performance out of them.

Interpreters are generally slow or memory hungry by nature of how they work - an interpreter that doesn’t build a parse tree has to get through a lot of characters before it does anything useful, while an interpreter that builds a parse tree has the overhead of the parse tree to worry about.

It’s less demanding in the sense that you don’t need to do as much work to produce a game, but the games are more limited and the language is probably not as user-friendly as Lua.


For the record: I also worked on this.

I have no claim to the Lode Runner editor though, that one was entirely @filmote’s work.

As I’ve mentioned in other threads, the big issue with Bitsy is just lack of documentation.
I’m presuming @haroldo-ok actually went to the trouble of reverse-engineering Bitsy, which is a respectable feat.


For anyone who is interested, here’s some sample code from my abandoned CHIP-8 compiler project. I tried several different languages. Note that I only got to the stage of parsing the code, not compiling it.

(Click arrows to view code samples.)

Language A:

Language A is a sort of assembly hybrid: programming-language-style syntax at the top level with assembly-style syntax within function blocks.

include "system.txt"

function main
{
	:loop:
		LD V1 5
		LD V2 10
		CALL draw
	JP loop
	
	SYS exit
}

function draw
{
	LD F V3
	DRW V1 V2 5
}
Language B:

A simple programming language with new-line terminated statements and many specific keywords (system functions are hardcoded).

include "othersample.txt"

function main
{
	if V0 == 10
		jump main

	unless V0 == 10
		jump main

	while V0 == 10
		jump main

	clear screen

	system exit

	call main

	return
}
Language C:

A simple programming language with semicolon terminated statements and fewer keywords (system functions are manually given aliases).

import "Hello.txt"

constant mask = 0xEF;

system clear 0xEEE

function main
{
	constant m = 0xFF;

	function inception { return }

	V0 = 0;

	unless (V0 = m) do
		call inception;

	if (V1 != V2)
		then call inception;
		else call hello;

	while (not pressed V0)
		V1 += 1;

	until (pressed V0)
		V1 += 1;

	repeat VF = key; until (pressed VF)
}
2 Likes

The emulator comes “close” to this, with the various quick links here:

You get a similar type experience but obviously it would be WAY better if it was all integrated together in to one app.

I would love to see something like this, but I haven’t found anyone to take up the challenge. I’m not a good enough programmer to do this, barely enough to even manage such a thing.

Actually, this scenario you describe and similar to what you’ve shown in octo, was actually what the arduboy website was originally intended to be. You were supposed to be able to come to the website, type in some code, use an integrated image editor, with the documentation readily available (possibly even with in line code suggestions for library functions). And the ability to compile, upload to a public game repo.

Without going into details, I had paid someone for a whole year to do this but, was not actually doing the work, I trusted them since they were my friend and found out that they were lying about it the whole time. I had put so much time and money into the project, it nearly killed the company and it’s nothing short of a miracle that I was able to keep things going. A large part of that is just the dedication of moderators and contributors to this community by making it a thriving ecosystem despite the lack of properly organized tools.

But that brings us to now:

I’m finally in a position to fund a project like this, and have been casually asking around to see if anyone can build such a thing. The next step is to actually put out a job posting and actively looking for people to hire, but as I mentioned before a real challenge is that I barely know enough to manage someone in a situation like this.

I only really know what I want the end result to be, so I would need to hire someone who already had a strong vision for how to implement the necessary features.

So if there is anyone out there who would like to build something like this please do message me and and love to work together!

And finally, the drag and drop block language, and the site being fully usable in mobile would be the icing on the cake and very likely I could go for a round of investment based on that. So again, if someone out there can take this on it presents a great opportunity to grow the business so let me know!

Totally support this!

1 Like

I brought up the Octo more as an example of the possible work environment, and less because of the Chip-8 itself. Arduboy is a totally different system indeed.
As Kevin said in his comment, there is an online arduboy emulator and it is exactly what I was talking about - one can write the code and try it directly. The next big thing is to integrate a sprite editor and documentation into one work environment. Actually, the sprite editor can be in a different window - and one you made would work great, especially with the possibility to directly copy the sprite code to the working window of the emulator.

(I must say, that despite my high school\ army and university foundation in asm and C++ programming I need to recall and learn a lot to really understand what it takes to make any complex program - and I want to thank you for the willingness to explain things)

Part of the reason you see a lot of these all-in-one systems for things like Octo/CHIP-8 and PICO-8 but rarely for a ‘proper’ development system is because it’s a lot easier to create setups like that for simpler/artificial programming environments. Even with Playdate’s Pulp, the code produced isn’t general, it uses a simpler, dynamic language (Lua) and targets a specific game engine.

(Note: This is also why the tools you cited are for specific engines - D&U’s engine, Lode Runner’s Engine, Bitsy’s Engine. Constraining an editor to a specific engine is much easier, and even then it can take weeks to make it decent and squash all the bugs.)

If you create a simplified environment then you have more limitations and less need for advanced tools. Hence if someone were to create something like Octo/Bitsy for Arduboy and then create an all-in-one editor for it, that would be easier to do than to create an all-in-one system that could produce ‘normal’ Arduboy programs.

Theoretically you could take the emulator and add an image editor and some sort of built-in documentation system, but it likely wouldn’t be as powerful as a proper editing set-up.

Personally, I’m not really convinced this is necessary.

As long as there’s an emulator, a sprite editor and good documentation, I don’t think having them all in the same window is necessarily any benefit versus keeping them side-by-side in separate windows.

That said, with a decent code editor and the right setup, it’s already possible to have the library documentation ‘built-in’ to one’s code editor.

Though I think what’s lacking in that department is a beginner-friendly tutorial that explains how to set up a better code editor.

I believe there’s even a way to launch the emulator from VSCode/VSCodium, but I don’t have the emulator installed. I have my editor configured to just compile & upload at the press of a single key.


Unfortunately most academic institutions don’t actually teach that, which is partly why most programmers are self-taught. It’s also partly something that comes from experience, and partly from doing a lot of reading.

You can thank the fact that I still remember what it was like to be the only person in the room who didn’t know the difference between a megabyte and a gigabyte, or what RAM is (or what it looks like).

1 Like

The key is packaging it together so someone with no experience with any of it only needs to take one action and be provided with everything in one place. The goal was to bring people to the front page with a library of playable games right there on the front page and then you could click into this type of editor/emulator.

The first step was created for the purpose of moving this goal forward so at least now you could go to that one emulator page and have the resources you need but you still kind of have to be a self starter and gather together some of the important information.

For intrepid users, like most on this community, and certainly true for those who contribute, we like a good challenge and digging in is where the fun begins. But making lowering the barriers to entry and making it easier for people to intuitively learn the platform has huge benefits.

It’s an axiom of mine that if you want to encourage a behavior you should make it so easy that it can happen by accident.

I’d love to imagine where someone ends up on the arduboy website and within a few minutes is drag and drop code elements to make a hello world. It’s possible now but it takes quite a while.

Also for a wider audience I would love to see more verbose or “plain language” error messages. That’s one of the things that arduino does ok at least it automatically takes you to the offending line of code.

Sure but expecting people to have vs code and know how to use it is precisely the barrier I want to avoid.

The whole reason Arduino became popular was that you don’t have to set up a build environment to start writing and using code.

1 Like

You do though: you have to install the Arduino IDE, and then the libraries.

That’s not much different to installing VSCode/VSCodium and installing a few extensions.

That’s not going to happen for ‘standard’ Arduboy code (i.e. C++ code) for several reasons.

The first and most obvious problem is that you would have to either edit the compiler or create some additional analysis tool that could parse and understand the code. (Even the emulator is using GCC to compile the code, so it gets the same error messages that the Arduino IDE gives out.) At best, you could take the messages GCC outputs and somehow process them to provide more context.

Even if you did that, you’ve got two other major problems:

  • You can’t predict what the programmer’s intent was, so you can’t tell them what their actual problem is. At best you can provide a list of common causes for a particular error.
  • Some error messages won’t make sense unless you understand the rules of the language. Explaining those rules would likely take several paragraphs of explanation, which is a job that’s probably better suited to a tutorial or another programmer.

For example the error “static member function cannot have a cv-qualifier” means precisely what it says on the tin, but to understand the problem properly you’d have to know what static member functions and cv-qualifiers are, and possibly why you aren’t allowed to mix them.

You could create a tool that points to the cv-qualifier(s) that need(s) to be removed, but what if the problem is actually that the function isn’t supposed to be static?

Hence the compiler actually can’t decide what needs to be done. Only the programmer knows what they intended to write, so only the programmer can decide the correct course of action.

Ultimately, all you can do is provide a list of potential solutions and links to documentation or tutorials that explain the underlying concepts. There’s no escaping the necessity of actually learning the language, its rules, and how to make those big decisions.


This is one of the reasons I’ve been focusing on the idea of creating some kind of simple CHIP-8-like language/environment though.

A simpler language would have simpler error messages, simpler syntax (possibly one without semicolons - Lua manages to do it, as did Pascal once upon a time), and would likely use a simpler custom compiler that could be fully controlled and fine tuned.

Again, there’s a good reason you only see these kinds of all-in-one tools for scripting languages and specific game engines, and not for more advanced programming languages.

However, even with the FX to store the bytecode on, RAM is still a limiting factor because it limits what can be achieved without careful planning.

Might be true but I think you could gain a lot of ground just by checking basic syntax first before throwing it through a full compiler.

A more friendly “oops you might have forgot a semi colon here” or “oops forgot to close your for loop”. Wouldn’t be that difficult to write I imagine there are already solutions for it.

And to your point is I guess why I’m having trouble trying to find someone to develop the emulator further is that people who are smart enough to do so would rather build it their own way.

Also I don’t think you need an Arduino account to install it lol.

Except that C++ is a context-sensitive language that is notoriously hard to parse.

You’d have to do the job of the preprocessor (i.e. interpret and replace all the macros) before you could even begin to say which syntax is and isn’t valid.

#include <iostream>

#define THIS_IS_LEGAL ;

int main()
{
  std::cout << "A legal program" THIS_IS_LEGAL
}

(Sure, you could say “a beginner is never going to attempt something like this” and try to ignore the problem, but you can never be sure someone won’t attempt it.)

Actually, you’d (probably) be surprised…

Consider these two programs:

int main()
{
	while(true)
	{
		std::cout << "Hello world\n";
}
int main()
{
	while(true)
	{
		std::cout << "Hello world\n";
	}

In each case, is it the main function that’s missing a curly brace or the while loop?

A ‘conventional’ parser would actually tell you that it’s the main that’s missing a curly brace in both cases, because a ‘conventional’ parser ignores whitespace and thus sees both of those examples as the same string of tokens.

To be able to claim otherwise, you would need a compiler that tokenises the whitespace and tracks the indentation level. The reason compilers drop the whitespace in the first place is because including the whitespace often makes a parser a lot more difficult to write and work with. (It also increases memory usage because the whitespace stays in memory instead of being discarded.)

But even if you could detect the indentation and say “main is missing a curly brace” or “this while loop is missing a curly brace”, consider this: what if the problem is actually that there are one too many curly braces?

Perhaps the programmer intended to write this:

int main()
{
	while(true)
		std::cout << "Hello world\n";
}

Which is equally legal. Now you’re getting into the territory of stylistic convention.

Speaking of style, what happens when the parser has to deal with different brace styles?

What if the person is using inconsistent indentation (as is common with beginners)?

Things very quickly become complicated and ambiguous.

By no means is it impossible to create something that could do the job, but it’s by no means easy, and it would be full of weird edge cases and some potentially very tough decisions.

If the goal is to hide ‘scary’ error messages from fledgling programmers (not that I necessarily agree with that goal), then a block editor will do a better job because it (theoretically) prevents syntax errors being produced in the first place. But again, that’s something that people usually reserve for simpler languages (e.g. Lua, Python, JavaScript). Getting one to produce C++ is likely going to be a lot of work.

With all due respect, from what I’ve seen I think your problem with the emulator is a lack of experienced JavaScript developers (on the forum), or at least ones prepared to do the amount of work involved.

As long as you want to do web-oriented things, that’s going to continue to be a big sticking point.

If you find one, do let me know, I’d be interested to see what decisions/compromises they have made.


You don’t need an account to install VSCode or VSCodium.

(I presume you’re thinking of Visual Studio, which does need an account as of VS2017.)