Finding a programming language for dummies

I don’t know if it’s allowed to ask this question here, but I will try in any way.

I am looking for a simple programming language that the average user understands and writes, because in the game I do. I am building my framework in C ++.

I reviewed Lua, but I think this is probably too complicated for the average user.

To do this, you only need basic actions, such as going forward, shooting, capturing, installing it here, etc. This is a tile based game.

+4
source share
3 answers

If you think that Lua is too complicated, you are probably not looking for a common programming language (another suggestion would be Python). Instead, consider creating a domain-specific language . I will make some assumptions here about your game, but you could, for example, implement a rule-based scripting language, where each script represents an adversary’s behavior:

can_see(player) and distance_to(player) > 100: run_towards(player) can_see(player) and distance_to(player) < 100: shoot_at(player) default: wander() 

At each step of the argument, the first matching rule can be satisfied. In this case, you will need some form of hysteresis so that your NPCs cannot make a decision.

This basically reduces your programming language to one if-else-if with a limited number of keywords and operators to be used. You can even create your own IntelliSense editor specifically for your language. If your users are ready for this, you may have nested rules:

 can_see(player): distance_to(player) > 100: run_towards(player) default: shoot_at(player) 

At some point, you can begin to allow variables and user-defined functions, but then from the very beginning, a general-purpose language would be the best choice! So, you see, the main question is to find a balance between versatility and convenience.

+4
source

Lua is a great choice. This is exactly what Lua was designed for.

You can greatly influence how easy it is for your users how you develop the Lua API for your game. If you are developing a complex, difficult to use API, or require them to use more complex functions in Lua, then this will be more complicated. If you instead create an API that is easy to use, then it should be easy for people to start with examples and pick up what they need to know.

+9
source

Just create a graphical interface to create a game workflow?

You can take a look at: http://en.wikipedia.org/wiki/List_of_educational_programming_languages , which can be understood by beginners

+2
source

Source: https://habr.com/ru/post/1402687/


All Articles