Hey Theo - looks like the start of a nifty combat system. Figured I'd offer up some general thoughts and ideas on the system as it looks in your old preview, and on the AI, which you mentioned you're struggling with conceptualizing. In fact, I'm creating a similar system (in GameMaker Studio 2) for a future project "
How Badly", which also uses separate grids for enemies and allies (screenshot in spoiler below), so I've dealt with a lot of the same issues and opportunities that you probably have.
How Badly Early Dev Screenshot
On Grid-Based Systems and Movement
One of the major weaknesses of most combat systems that utilize a grid is the amount of "downtime" inherent in moving units around in order to get them in range to attack (not only are some turns spent without attacking, but even on turns where units can attack, there's still the time they spend moving). Where the spatial element doesn't add that much to the battle, it's wasted time. Where it
does add a lot to the battle, it's worth it but it still slows things down (which is why tactics games tend to have far fewer encounters than standard turn-based RPGs).
Now, your battle system has two separate grids, which seems to mean that movement is a little less important and it's easy to at least target
someone on the enemy team on turn 1 no matter where you start your turn. Yes, this means less wasted time. But it also means that while
positioning will be a big consideration in combat (for AoE damage, etc.), actual
movement will be a much smaller one. Based on your thread and video, I'm led to believe that:
- It's possible (and trivial) to move to any tile on your own grid, for free
- The only two reasons to move around are to avoid enemy AoE's (or create better ally AoE's), or to get into range to attack an enemy
- All things being equal, it's safer to be in the backline than the frontline
From this I'd conclude that the act of moving around is more of a menial "bookkeeping" task, and less of a strategic consideration. If you need to move forward to attack an enemy because of a range limit, you do it; otherwise, you move to the backline and use your action. There's going to be a lot of this "bookkeeping" going on, and it's going to unnecessarily slow down battles. You could go the route of having characters move into the necessary range automatically a la
Skies of Arcadia or
Trails in the Sky, and that wouldn't be too bad. But my instinct is that it might be ideal to discourage battlers from moving around too much by turning free movement into a very limited resource. For example, based on a battler's Speed, they generate some amount of free movement each turn (probably a fraction of a tile), which accumulate if unused. On their turn, they can spend (full) tiles they've earned to move around the grid as in your current system - spending that free movement in order to move. Now the player needs to actually think about how they position their characters because it will have more long-lasting effects. You could also provide the designer the option to allow unlimited free movement as in your current system, for designers who don't want this kind of complexity in their game. (In my own system for
How Badly, I allow the player to move their characters around, but I force them to expend that character's turn in order to do so. Range isn't a concept in my system, and movement tends to slow down combat, so I want the Move action to be a rare choice that's only used where powerful AoEs make it worthwhile.)
Ideas for Mechanics and Skills
Allowing skills to change the position of targets on the grid, or even the skill user, on the grid would be a cool feature that would really deliver on the greatest strength of your system, which is creative AoEs and positioning around them. For example, a gravity spell could pull nearby enemies toward a certain tile, a hammer blow could knock them backwards, and a rogue's Hit and Run state could move the Rogue to the back row after attacking.
While not appropriate for all games, highly-tactical games could benefit from a Line of Sight feature where some skills require a direct line of sight from the user of a skill to the target in order to be used. Most likely this would only be used on certain types of attacks and skills (bow and arrow attacks, "physical" magic such as fireballs, etc.), so you could have this consideration only be used where a notetag exists on the Skill to check LoS. Therefore, designers who don't want to use this feature at all could simply not add the notetag to any skill.
One final idea is to allow skills to create "walls" (or other "objects") in empty tiles on the grid, in order to stop enemies from moving around their grid, and even to block LoS attacks. Walls would essentially block any battler from moving into a tile. You could even allow the designer to specify, for some Troops in the database, that walls should pre-exist in certain slots for that troop if possible. This would allow the designer to design troops that require a very different movement strategy than usual! Perhaps characters need to snake around each other to get in range to attack... or perhaps the backline is off-limits and everyone is vulnerable!
About AI
The simplest way I can think of to handle AI for such a system (and admittedly, it's still a moderate job) would be to tap into RPG Maker's default algorithms, and modify them so as to ensure that an action is possible before choosing it. I'd probably have it pick a random skill from the enemy's movelist, based on priority in the Enemy Actions box on the Enemies tab, and pick a target right afterwards. Then, I'd check whether there's a tile that the enemy can move to where they can launch this skill on the targeted battler. If it's possible, the action is chosen, the enemy moves (if necessary), then the enemy uses its skill. If it's not possible, the random move selection is re-done. A "default" action (such as Do Nothing or Guard) could be allowed for enemies who go through the loop some large number of times and still can't find a valid skill, to prevent hangs.
If you want to allow for a more sophisticated AI - and I'd avoid adding this until after you've released the first "complete", working build of your script - then a Points system could be a good way to avoid ridiculous amounts of Branching, as well as offer the player a bit of flexibility as to how they utilize your AI. Enemies could forecast what the direct effects of using a certain move would be, assign points to each aspect, and choose the move that offers the highest point total.
Examples of direct effects would be: "I will deal damage", "I will apply a state", "I will heal an ally", etc. The AI might award 1 point for each 1% of HP it expects to damage an opponent battler by (also meaning that AoEs will award points for each target), 1 point for each 1% HP it will heal an ally, a designated number of points for applying different states, -10 points for every tile it needs to move forward in order to use the skill, etc. You can give the designer tools (via a config section) to weight different aspects; for example, a designer might make a game where positioning is very important so they want the tile penalty to be weighted at 300% (-30 instead of -10 for example). You could even allow notetags to be placed in the Note box on the Enemies tab to allow designers to give unique AIs to certain enemies (for example, a Berserker enemy that ignores its own positioning value, and overweights damage that it deals when making decisions)!
You could add even more sophistication to the AI by having it consider its opponents' abilities; for example, against a mage that could nail the monster from anywhere, the monster might not care how far forward it has to move in order to attack, and against an opponent with lots of AoEs, the monster might assign a points penalty to any skill that would force it to move too close to its allies. Aside from the extra workload on your part, this might also create an AI that is "too smart" in that it would make it difficult for players to actually use their skills in effective, satisfying ways. It's fun when the AI sometimes puts itself in situations where you can use an AoE and crush its dreams (especially since most RPGs demand that the player win every battle or take a Game Over). So there's definitely an element of diminishing returns in the amount of effort you put into the AI vs. how much it improves the player's experience. You don't want the AI to be a random, slobbering fool - but in an RPG, you don't want it to be Gary Kasparov either.
Targeting is another issue you'll need to tackle in such a points system. You could brute-force the approach by having enemies determine the points total for every combination of skill and (valid) target. That actually wouldn't be bad at all from a design standpoint; I just wonder how much processing power it would consume. Other approaches would be to choose a target based on some measure (such as targeting characters who are dealing the most damage, or characters who are the most injured), or to choose a random target but weight the random draw based on the above measures, or to add an Aggro System as a secondary system that's compatible with your grid system. The enemies choose a target, then they look at each skill knowing who they're targeting. (To be clear about Aggro systems - they're a system where characters develop "Aggro" (threat) within a battle based on the amount of damage they deal/heal, and certain other factors, and enemies tend to target whoever has the highest Aggro points. Aggro wears off over time so characters can drop their threat levels by lying low while their allies deal some damage. Sometimes each enemy tracks Aggro separately based on whether you damaged THAT enemy; sometimes it's just a total that all enemies follow.)
The reason I think the Aggro System could be a good idea, despite the amount of extra work it might mean for you as the script maker, is that it's very transparent to the player, and that it would actually interact with your grid system in a few really cool ways. When a vulnerable character has a high aggro score, the player can see that and decide to move that character to the backlines where they can't be attacked by strong melee skills, or get them away from allies if they think that character will be targeted as the center of AoEs. Additionally, it would be easy to allow the designer to create moves which manipulate aggro, such as a Vanguard skill that draws far more Aggro than it should based on the damage it deals, or a Rogue skill that deals damage but draws zero Aggro.