I want to build a strategy game using C and Lua. C++ is also an option.
I would like to create an environment where a player can move around. In the same environment, other actors (programmed in Lua) should be able to move around. Their Lua code should control how they move.
It sounds simple enough, but I wonder what would be a good design approach for this project.
As a simple example you can imagine a matrix that is the playing field. How do I write my code so that a player and several other (scripted) actors can move through it simultaneously?
The Lua code of the actors should be able to get information from the playing field. For example: an actor could be programmed to follow a fixed path, looking around along the way. Then if the actor detects an other player, it could change its behavior to follow the other player.
I imagine this problem has been solved many times, but I can't seem to find a simple example.
Any links to other designs and original ideas are much appreciated.