Games with Programming as a Mechanic

I'm looking to discuss potential feel of my programming-themed Roblox game.

There are lots of games where programming is the entire point of the gameplay. Usually puzzle games like Turing Complete, TIS-100, Silicon Zeroes. I’m talking specifically about games where programming is not the main challenge but is an additional mechanic used essentially as lategame content. I would consider Factorio’s circuits and Redstone to be in this category. I’m also counting mods that add these mechanics, such as Computercraft (Minecraft) or KoS (KSP). However, I am not counting games which teach you a real programming langue for the express purpose of using it outside the game.

If you have played one of these, I have some questions about your experience.

  1. Obviously, what game was it and how did the programming work? Was it traditional text input, block or flowchart based, or emergent from another game mechanic?
  2. If the mechanic was optional, did you use it?
  3. If you tried it and didn’t like it, what was the biggest barrier to you using it? What would you change? If instead you did like it, did you ever encounter an issue where you had an idea that the system was not able to support?
1 Like

I have attempted this! It is about coding swords using points available to you to allocate them to different aspects!

It didn’t go so well because a programming themed roblox game
first: only programmers can play it
second: there is a lot of pain in terms of making a stable api for people to access methods you want to be accessible, and uhhh nothing actually worked for some reason. For this project, I made my own programming language.
If i were to give advice, make the language either A: lua or b: a VERY simple programming language
Make the APIs well documented and not buggy
Guide the player through everything, expect the new player to be someone who never programmed before, because most likely they aren’t
Main reason it failed though was because it just was really buggy and terrible map design
Oh i failed to mention; it is text based

1 Like

I am also making a custom language and the complexity is under control so far. It’s very intuitive to do things like move units in a pattern (its an RTS), have them follow patrols, or follow other units. I will check out your game. In the meantime I have found several games using Games-Stats that are a close match to the ideas I have: Duskers, Nimbatus, EXAPUNKS, and Craftomation 101.

Nice! I would be interested to see your custom language’s syntax once/if you have it done

I will send you the documentation once its in better shape, adding a lot of features at the moment. It’s a simple LL(0) language like you’d use for a command line. Anything that would be a runtime error in a real language does something useful instead. Here are some programs that currently work:

Move in a fixed pattern:

SetNav 10 10
Yield --waits until the next movement turn
SetNav 11 10
Yield

Follow the furthest unit:

--Scan for units, select the furthest one (Scans are sorted by distance)
--Set Nav direction towards that unit
SetNavDir Select -1 Scan

Stay away from other units:

--This time select the closest unit and move the opposite way
SetNavDir Invert Select 1 Scan

I have feedback here. Number literals to signify like positions of units works, but if someone wants to get closest or farthest, it would be a lot easier to understand if it was an identifier instead, as follows:

SetNavDir Select Farthest Scan

or

SetNavDir Invert Select Closest Scan

And maybe a with syntax to make it easier to understand the last two code examples
where with would be

With <array> Select <index>

so,

SetNavDir With Scan Select Furthest

or

SetNavDir Invert With Scan Select Closest

These read better but they have consequences for the grammar that I don’t want to change.

These two are doable because Select knows the type returned by Scan

SetNavDir Select Farthest Scan
SetNavDir Invert Select Closest Scan

This one is possible only by making the second argument to With an expression. The way calls currently work does not allow an intervening keyword. I can’t really explain why this is a limitation without explaining function signatures, which I haven’t documented very well yet. The short version is trying to recognize a keyword like Select in the middle of two arguments to With will cause an ambiguity with other kinds of indexing.

With <array> Select <index>

Let me revisit this in a few weeks because it’s not entirely out of the question, it will depend on two mechanisms that aren’t designed yet: Implicit indexing and function signatures.

I’ve tried here and there to make a game with programmable stuff myself but never really got any good results. I love it when games allow you to make kinda whatever like from the depths has breadboards and lua, scrap mechanic can really go far with the logic gates and more I can’t recall now.
Honestly if there’s anything I can help with I’d love to contribute with such a game

I will keep you posted on progress. So far it feels pretty good to use.

1 Like