Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
In my game I made a Singleton Lua VM class, made a wrapper class (for AI). So when an object is created its component (the AI class) preloads its special script for the object. I exported C/C++ functions to lua VM (such as getPosition, getPlayerPosition, checkCollideTile, ... ) So those functions can be called from the script. Implemented AI::getActions (a C++ function), which "asks" LuaVM to run an update function (from the preload script) for the object. I hope it all make sense. P.S. Keep in mind you can significantly improve your productivity if you use a game engine. Also You can look at FOSS games which use Lua for scripting (i.e, wesnoth: https://github.com/wesnoth/wesnoth )
Lua is perfectly capable for providing scripting support, both to support mods, or to write gameplay logic. Because of that, it's used in plenty many places. The core engine code can be C/C++, and this is what something like Love2D does, for example. For performance, you can use LuaJIT, if vanilla lua doesn't do it for you.
Related posts
- Low end Strategy games
- Hello do you guys know a free game to just chill with my friend.
- [PC][Before 2014] 2D Turn based strategy game like Fire Emblem
- For fans of turn-based combat in games, what makes it engaging to you? And what are some of your favorite games that utilize turn-based combat?
- Whoever come up with the idea of crusade. Can I Punch you a million times