Best way to summon enemies to fight for you?

I'm working on a combat scenario where the player summons monsters to fight for them. This is an early version of what I've got:



It's pretty functional, and does most of what I need it to do. Both "players" (enemy AI and human) summon monsters, and it looks the same. However, it actually works differently for the player and the AI.

The "enemy player" summons "enemies" in the database. This is nice and simple. This is using HIME's "Enemy Reinforcements" plugin.

The "player character" actually summons party members from the database that are dressed up to look like enemies, and auto-fight to act like enemies. This uses SRD's "SummonCore" plugin.

This works (as you can see), but it has two problems:
  • It creates a lot of duplication in the database, which is a real pain.
  • Having both "enemies" and "actors" as "monsters" means I have a lot of duplicate logic for the states (this is the bigger problem I want to fix)
  • Longer matches result in slowdown. I think this is because the game doesn't "clear away" player-party-members properly when they die, as the idea of continually summoning more and more party members probably wasn't accounted for in its design. (less of a problem as I'll just make the games shorter)
Is there any way to summon "enemies" to fight for the player in this manner - taking the enemies out of the actual enemy entries in the database?

If I could summon "enemies" to fight for the player, it would immediately allow me to remove a lot of duplication and make things simpler.
Well technically you could summon enemies into the player-side without needing to have actor duplicates for them, it all depends if you can code it or find a coder who could write it for you.

I'm still trying to think how much of a pain or not that will be to write though.. It will also probably depend on how much battle related plugins you have, because some of them might not account for that, and making sure that the new summon system should work for all other plugins you're using would make it harder.

Having both "enemies" and "actors" as "monsters" means I have a lot of duplicate logic for the states

I don't quite get this one, states do apply to both actors and enemies anyway right?
I don't quite get this one, states do apply to both actors and enemies anyway right?

Sorry, I mean "states" in a scripting sense, not RPG-battle sense. So for example, when a creature dies, it fires off one bit of scripting for an enemy and one bit of scripting for a friendly creature. Because they are technically different "things" (enemy vs. actor) they need a fair bit of unique scripting.
I see, actually I suggest keeping it that way because that's how the engine handles enemies and actors anyway.. The more you try to remove the boundary between them or use one for the other, the more possibility for incompatibility with stuff that were written with the default engine behavior in mind.

This is also why most party summon codes need the summons as actors rather than enemies. As much as we can change that, it will increase the chances of incompatibilities with other stuff if we do.

These are some data differences between enemies and actors that can lead to problems down the line (these are also the possible areas that are needed to be changed for your idea to work):

1) Actors have levels, enemies dont. Unless you're using an enemy level script.
2) Actors when created in-game, creates a Game_Actor object which persists thru the game. Enemies during battle are created as Game_Enemy objects but after the battle ends, those objects cease to exist too.
3) Actors have classes, and can have level based skill learning based on the class. Enemies dont have that.
4) Actors have equipment, Enemies do not

Its actually easy to create a Game_Enemy object from an enemy database entry and feed it to the Game_Party members array, but making sure that they work without problems is a different scenario.

You will probably still end up needing some checks here and there to tell the game that this is a party member but is from enemy data, so in a sense it defeats the purpose of making them from enemy data in order to reduce the checks.

And this is talking only about the game's default systems, it gets more complicated when you start adding plugins that are battle related.

BUT, please take note that these are all just theoretical ideas from me. I'll be more than glad to know that my worries are actually false.

Original thread: https://forums.rpgmakerweb.com/threads/best-way-to-summon-enemies-to-fight-for-you.106438/