Below you will find pages that utilize the taxonomy term “AI”
Lua for Game Development — Chapter 14: Combat AI, Behavior Trees, Utility AI & Enemy Design
Combat AI determines the challenge, pacing, and tension of any action game.
Modern games use:
- State Machines (simple AI)
- Behavior Trees (modular, readable)
- Utility AI (dynamic decisions)
- Blackboards (shared memory)
- Squad AI (formations, flanking, roles)
- Boss AI (scripted phases + BT nodes)
Lua’s flexibility makes it ideal for building AI layers.
This chapter builds:
- Enemy archetypes
- Finite State Machine (FSM) combat AI
- Behavior Tree engine
- Utility-based decision system
- Aggro & threat systems
- Group tactics (flank, assist, swarm)
- Boss scripting (phases, triggers, timelines)
1. Enemy Archetypes
Define enemies in data:
Lua for Game Development — Chapter 13: NPCs, Town Simulation, Factions & AI Routines
NPCs breathe life into any game world:
- villagers with schedules
- merchants with stock
- guards who patrol
- hostile factions
- relationships
- dialogue that reacts to story flags
- simulation (hunger, work, needs)
- towns that evolve over time
Lua is perfect for simulation layers:
- lightweight logic
- hot reload
- easy-to-edit behavior packages
- clean data-driven content
- integrates with quests, story, and world triggers
This chapter builds:
- NPC definitions
- Behavior packages (wander, talk, patrol, work)
- Daily schedules (day/night cycles)
- Merchant system
- Factions & reputation
- Town simulation
- Social interactions
1. NPC Definitions (Data-Driven)
npcs/
villagers.lua
merchants.lua
guards.lua
1.1 Example NPC Definition
return {
elder = {
name = "Village Elder",
sprite = "npc_elder",
faction = "village",
behaviors = {"talk", "idle"},
dialogue = "elder_intro",
schedule = {
{time=0, state="sleep"},
{time=6, state="idle"},
{time=12, state="walk_square"},
{time=18, state="home"},
{time=22, state="sleep"},
}
},
}
NPC = data + behaviors + dialogue + schedule.
Lua for Game Development — Chapter 3: Practical Patterns for Real Games
Modern game development relies heavily on Lua’s flexibility.
Studios consistently use a set of Lua architectural patterns to build clean, scalable, and maintainable game logic.
This chapter presents the patterns used in:
- 2D/3D indie engines
- AAA game scripting systems
- LiveOps / network games
- Modular UI systems
- Defold / Love2D / Roblox (Luau) / Cocos2d-x Lua
- Custom C++ engines with embedded Lua
We will cover:
- Entity & component architecture (ECS-friendly)
- Messaging & event buses
- Timer systems & schedulers
- Finite state machines (FSM)
- Behavior trees (BT) in pure Lua
- Tweening & animation patterns
- Modular game script structure
This is the first “serious engineering” chapter in the book.
Modern Front-End Trends, Part 6: AI-Augmented Front-End Development
Introduction
For decades, front-end development was shaped by frameworks, browsers, and tooling.
But in the last two years, AI has become the most transformative force in how developers:
- build user interfaces
- manage state
- generate components
- scaffold entire apps
- write documentation
- test code
- debug performance issues
- delegate repetitive tasks
- explore new design ideas
AI has become an always-on co-developer—capable of generating production-grade UI, analyzing architectural patterns, and automating workflows that previously required hours or days of manual effort.