I've been working on some much neglected basic stuff and killing some bugs recently. The game's much more performant and there are far fewer memory leaks. Switched to LuaJIT too, which is pretty nice. Broke a whole bunch of stuff, then fixed it, collision detection is still pretty iffy but I hope to resolve that soon, probably tomorrow night but damn if I'm not busy like, all the time. Working on this game keeps me sane, though.
I'm terrible at writing about this. It's actually simple. The idea is to pretty much create a scriptable way to give mobs about the same amount of information as a player, a memory that prioritizes survivable behavior and de-emphasizes, duplication, and the ability to make decisions by examining their environment and making decisions based on scripts. The idea is to teach AI's to play the game like a player. So here's the picture.
[1] (Launch Game: Read in and check parameters, configuration files)
\
\
[2] (Generate Map: Loop over every cell in the map and decide what
\ kind of cell it is. This part of the picture TBC)
\
[4] (Mobs Think, Player Sees: In the moment just before player
/ \ takes a turn, mobs poll the environment and plan a move)
/ \
[4b]_______[4a] (Player Takes Turn: The player takes a turn right
(Mobs Do: The \ before the mobs.)
plan from step 4) \
[5] (Exit: if the player decides to.)
As I work on this documentation, I'm getting really good at re-building all the packages, repositories, installers, and web-sites automatically. That's pretty cool. Still need to get things crystallized though.
Well I've got the system for moving information from the native part of the engine to the scriptable part of the engine which lets me take information from the running game and make decisions about what to do with it from the scripted part of the engine, which is the model for the AI. On a per-mob basis, the native part of the game tests a region surrounding the mob for collisions. This is the mob's line-of-sight, metaphorically speaking. Everything that is in that region is placed in a lua table and made accessible to a function. This function by default is "default()" but it can also look for a function defined at map generation time. The return value of this function is a move that the mob is allowed to make. As usual, I'm mostly, but not entirely, keeping up at writing documentation for how to actually use it.
Well it's about time I actually start getting used to this development blog. Today I'm going to get the beginnings of the Mobile Non-Player Entities going, and by that I mean I'm going to make their behavior scriptable. I'm trying to plan the whole thing very carefully, because LAIR is supposed to be a minimal resource organizer that outputs a game. Ideally, I'd like to register as few functions with Lua as possible and limit the amount of information available to any given Mob. For now, I'm just going to make them all run into the nearest northward wall, though. Once that's done, I'm going to make a new screencap to put on the homepage.
Hello Blog!