HACKER Q&A
📣 amichail

Why don't games allow you to automate some gameplay via programming?


Wouldn't this be a great way to encourage young people to learn programming?

For example, a game like No Man's Sky could have a python-like language that you can use to automate some repetitive tasks.


  👤 glorioushubris Accepted Answer ✓
Sometimes games don't do this due to genre conventions/player expectation.

In 2006 Square-Enix shipped a simple programmable system for gameplay automation with the gambit system in Final Fantasy XII. It let you put together a hierarchical list of if->then statements for how characters behaved during battle. It essentially let players "equip" a battle strategy the same way they would equip weapons or armor. This seemed like something highly desirable, since Final Fantasy (and JRPGs in general) had lots of repetitive, grind-y encounters where the tactics didn't change from battle to battle.

People hated it. The popular dismissive criticism was, "Who wants to sit and watch a game play itself?" Players were used to picking and timing all their actions by hand during battles. Many Final Fantasy players back then resented the game "taking away" something they expected and wanted in the game. (It didn't; you could turn gambits off at any time and play the old way, but players got mad anyway because the gambit system seemed like how you were "supposed" to play it.)

In the years since there's been a much more positive re-evaluation. As of the 2017 release of the remastered Final Fantasy XII: The Zodiac Age, most of the retrospective reviews had come around to "actually, the gambit system is really clever." But the initial response was so strongly negative that we've never seen the like again in a Final Fantasy game.

There are some games where things not being automated is, for many players, the whole point.


👤 dtagames
Many games do allow modding and Lua, a popular language for that, is a good starter language that's a lot like JavaScript. Mod.io[0] is good place to find games that use their excellent modding API which makes it easy for programmers to create mods, easy for the studio to distribute them, and easy for players to install them from within the game.

I say this as an experienced programmer who never modded a game before and was induced to write one [1] by this capability. It also made me learn Lua, and I'm glad I did!

To more directly answer your question, it's a lot of work for developers to permit any kind of UGC (user-generated content) and modding definitely falls in this category. One reason Lua is so popular as a modding language is that it creates an absolute sandbox and can even individually sandbox functions and language elements, making it ideal for allowing users to code against some aspects of the game but not all of them -- and not giving access to any of the game's code itself. These are always factors if you allow any user code.

[0] https://mod.io/g

[1] https://mod.io/g/foundation/m/barrel-ofish


👤 jesuscript
Because programming now days is basically botting in games. I’ve botted in WoW for example, and just using the program required you to manage waypoints and sort out how your character moves around, what they pick up, how long they fight, and so on.

It’s kind of unfair to bot. You would need to create a game that has unfair systems that would be cruel for a human being to play manually. Then programming the game becomes fun.

Early WoW grinding was a little unfair (many MMOs can be). I wish I could legitimately write bots for Eve Online for example. The current incarnation of dealing with said cruelty is auto-play (your character literally plays automatically, like a bot) in mobile MMOs, but I can imagine developers getting some joy out of an absurd MMO where programming what your character does requires scripting it. These would very advanced and niche games though.


👤 awb
I always wanted that feature too in RTS games. But, I think the build up to the exciting parts might be part of the excitement. If it was just non-stop action, it might be overwhelming.

Plus, there's no reason why the entire game couldn't be automated, at which point it's no longer a game.

But, I agree it would be cool if at least some of the logic was exposed an editable. One tricky part would be endless loops or overloading memory, so they would need to be careful about the actions that they make programmable.

Might even be a fun way to recruit future dev talent for the gaming company.


👤 ingonealan3
Most games don't allow you to script them because you wouldn't be playing them as intended, for better or worse. Secondly, if we're talking about games with a multiplayer element, it would allow you to gain an advantage against those players that play in the intended way (this group also being considered the target audience by the devs, again, for better or worse).

On the other hand, people modify and script games anyway. It happen for both games that permit it, and games that condone it, and even for games that try to prevent it. It takes the form of mods and cheats.

And lastly, as other have pointed out, there's plenty of games that are actually designed to be played through scripting. I'll add one example here that I've enjoyed playing a little: https://screeps.com/


👤 constantcrying
It is a niche, which requires a very substantial amount of development time. 95% of players would most likely just copy a script from the wiki to minmax.

There are some games where the core gameplay is programming, but those are their own niche.

>Wouldn't this be a great way to encourage young people to learn programming?

I don't see how it would. To be quite honest most this is how we teach kids software ideas are completely out of touch.

Nobody wants to play a game about shooting aliens and flying around a galaxy, but then suddenly has to figure out how to learn some stupid scripting language to minmax.

The reality is that most children (and adults) do not care about software and never will. You shouldn't be appealing to everyone, you should be appealing to those who show interest and engagement. Give them something to experiment and break, that is how you learn.


👤 felipellrocha
Many people have tried that in the past, but none have become super popular games. Maybe it's just not what people want, or maybe we haven't seen a game that has cracked that formula yet.

👤 solardev
For many games, the grind IS the game. If you automate that away, there isn't much of a game left... examples are the bots for games like D3 (RoSbot) and MMOs. Or, if you for some reason love the game but hate the grind, it's easier to just use a trainer (for single player games) or buy currency (MMOs).

At the end of the day, games purposely put challenges in front of you because they are games, not because they are trying to optimize for efficiency.

There are factory-style games where the game IS about making algorithms and dealing with bottlenecks and such (Factorio, Satisfactory, Dyson Sphere Project) and/or programming games like Leek Wars or Autonauts and/or idle-battlers (especially on mobile) that automate much of the fighting and looting and such (Necrosmith).

The selection "games that would be improved by end-user programming without being made trivial" is probably pretty small. Most games aren't really that hard, just grindy and/or twitchy.


👤 logicalmonster
1) Is there a substantial difference between the existing concept of modding and what you're saying here? I think so, but I want to check to ensure I understand. Could you provide some "No Man's Sky" pseudocode to indicate what you'd want the script to do?

2) The goal of a game designer is to create fun experiences that you actually want to do. If game designers announce they're including scripting for the purpose of automating repetitive tasks, it would probably feel embarrassing to them because any boring and repetitive parts of their games should feel like kind of a personal failure on them.

3) I'm not a full-time professional game developer, but I'd imagine that trying to implement some kind of highly polished scripting that's user-accessible represents a significant additional effort in many cases for very marginal financial benefits. It's not just building this feature that would be required, but you'd be introducing a potential new security/stability risk that would need to be extensively checked, as well as having a big system that needs to be documented and supported for users.


👤 aidomi
Have you taken a look at https://leekwars.com/?

Still has a pretty active community, and the gameplay revolves around programming your 'Leek' to fight other leeks in a battle-bot type situation. The language you write the code in isn't python-like (it's called LeekScript), but it's easy to pick up.


👤 WorldMaker
They haven't been popular as games on their own, but there is an "ancient" legacy genre of games designed to played via code, sometimes even competitively. The competitive ones especially have a rich history and often have themes of robot fights/robot battling/robot wars.

Several major early, famous Kickstarters were "teach programming as a game" games such as Codemancer and (board game) Robot Turtles.

It will likely never be a mainstream thing in games. There are too many risks that giving access to programming scripts inside of games might accidentally "ruin" the intended experience: both in terms of users automating a game too much and finding it boring, and in users finding exploits and hacking the game into unintended states.

Still, it's always great to see explorations of it even if it is kept mostly to its own mini-genre. I know that some of the programming-inspired puzzles in The Castle of Dr. Brain and the Island of Dr. Brain were quite influential to me at certain ages.


👤 bick_nyers
I had an idea some time ago about an RTS that doesn't have micromanagement, but instead is built around the idea that you are picking, upgrading, and tweaking AI at all levels (individual soldiers to regional generals to fiscal policy of your economy). Some decisions you may be faced with are do you spend resources to improve your army, or do you spend them to improve an AI. The lowest level of micromanagement control you may have would be the general direction you want your army to move as well as whether to take an offensive or defensive strategy, with some "flavors" attached to them (reckless vs. conservative perhaps).

👤 Our_Benefactors
Try Bitburner. It’s an RPG idler game with the flavor of a trip through the matrix, hacking underworlds, and cyberpunk augmentations, all in JavaScript. It’s free.

👤 stormbeard
This sounds a bit like you want Factorio or Satisfactory.

👤 qsort
The philosopher of science Bernard Suits, cogently characterized games as the deliberate selection of inefficient means[0].

For some time I played MtG competitively, an activity that involved me paying money for pieces of cardboard.

Treating a game as though it's productivity software is an incorrect point of view.

[0] https://www.jstor.org/stable/186102


👤 ingenieros
Minecraft has a free Raspberry Pi edition which allows python input from the player. It's been a few years since I tried it out and I can't recall exactly what the limitations were, but it was definitely aimed at teaching players the basics of programming.

👤 thedevindevops
Screeps is literally a programming game, you might find it interesting

👤 poulpy123
There are many programming game (screeps, adventure land, Turing complete, some zachtronics like puzzle game) but the gameplay have to be designed around that or it breaks the game

👤 whateveracct
A basketball RTS game where you design plays live by "programming" the players' decisions and reaction flowcharts would also be fun.

👤 remarkEon
The kOS mod in Kerbal Space Program does exactly this. Very satisfying to write a script and then launch something into a particular orbit.

👤 whateveracct
I think a Pokémon game where you script the grinding (basically how to move + what moves to use) would be a fun addition.

👤 michalf6
Check out Colobot, it's a game around exactly this idea. You can program robots to do menial tasks for you.

👤 hombre_fatal
Because the ideal solution is to just improve the UX.

👤 n65463f23_4
sounds like a fun game...