How to integrate programming into game

You misunderstood what I was saying. You have in your head this idea of a cyberpunk game where the player is hacking. That’s cool. You did not provide that information until later in the same post where you said telling us that stuff doesn’t matter. But it does.

Again, evidenced by the responses. Because people were posting guesses about what you might actually want to do with it.

Ok, so not about the fact that they are interpreted instead of compiled? FWIW, python is the most popular language in the world for introduction to programming.

Sure. Which also means that people could use your game as a virus delivery mechanism. Tell people to copy this code and run it and then people infect themselves with backdoors. This is one of the biggest dangers of using a real programming language in a videogame - social hacking. It’s important to make sure that you understand the security implications, because you can be named in a lawsuit even if it wasn’t your intention.

There are python and JavaScript versions of Godot.

Which is fine, but again, keep in mind that this introduces another way for people to get hacked. This is in fact, the reason people don’t like saving Resources - because executable scripts can be stored in them if you don’t sanitize them. I would recommend you think about how you’re going to sanitize anything incoming.

What happens when code run in your game accesses the OS? Are you going to stop it? Are you going to give them a limited number of commands that work like @renevanderark suggests?

These are all questions to consider, because you’re going to get them as soon as your game is announced, let alone launched - and not having very good answers will get you not only bad publicity, but could prevent you from being hosted by Steam, Itch, Apple and Google if they decide you are a security risk to your users.

My son’s been modding Primordialis with Lua modules. He has no programming skill beyond what he learned on scratch but turns out that’s more than enough to get a lot done.

But the way this game just runs these Lua modules looks like quite the security hazard to me. That being said, there’s a Steam based community of modders that appears to be moderating each other’s work somewhat too.

Point being: as a parent, I’m not convinced that hosting platforms are going the lengths of protecting customers all that much.

The kids want to hack, it seems. :see_no_evil_monkey: :hear_no_evil_monkey:

Lua specifically has tools for providing ways to prevent OS access when running inside a game though.

I wish that was true.

This used to be true, and that’s why games that let you use some programming were so amazing. You could fiddle with them and they would sneakily teach you how games and programming work. Going back even further, DOS also did the same for a lot of people.

Kids these days likely do not care for games like these, and the likelyhood of someone trying their best to be malicious through games like these are absolutely tiny. The payoff is basically nothing.

Hello,

In Space Engineers, a programmable block allows you to write a C# class body that compiles on the fly and only whitelisted namespaces are allowed (e.g., System.IO is restricted).Users are responsible for ensuring they do not block or lock the game’s main thread. And this has been considered an experimental feature for at least 11 years now​:joy: