Tweaking enemy formations based on party size?

Ask and answer questions about making games and related topics. Unrelated topics go in that other forum.

Moderators: marionline, SDHawk

Post Reply
User avatar
Foxley
Metal Slime
Posts: 832
Joined: Sat Nov 09, 2013 5:54 pm

Tweaking enemy formations based on party size?

Post by Foxley »

One thing I've noticed playtesting my game Snowshoe Forest is that when it's just the main hero as single party member, encounters with regular enemies can be pretty dicey. But as soon as 1 or 2 allies join, the same battles are total steamrolls.

Was thinking of tweaking enemy formations to add more enemies based on party size, but I'm not sure how to do this. Can you rewrite foemaps? I can't find anything like that in plotdict.xml and I'm not sure what the best way to do this is. Make duplicate formations and use an instead-of-battle script to override them?
User avatar
SwordPlay
Chemical Slime
Posts: 966
Joined: Sun Jan 22, 2017 9:32 am
Location: London, England
Contact:

Post by SwordPlay »

I think you might use this section to tweak formations. Adding or removing enemies.
http://hamsterrepublic.com/ohrrpgce/doc ... 0Functions

add enemy to formation (formation, enemy id, x, y, slot)


delete enemy from formation (formation, slot)


and "reset formation" and "reset formation slot"

Changes do not carry over in saves

"set battle countdown" might be helpful for controlling whether battle occurs or not.
http://hamsterrepublic.com/ohrrpgce/doc ... ecountdown
Last edited by SwordPlay on Sun Mar 11, 2018 5:20 am, edited 5 times in total.
User avatar
kylekrack
Liquid Metal Slime
Posts: 1240
Joined: Mon Jun 16, 2014 8:58 am
Location: USA
Contact:

Post by kylekrack »

There are "is in party tags" for heroes and stuff like that, right? You could write an instead-of battle script that checks for heroes, and use a different formation set depending on how many you have. That sounds simple, right?
My pronouns are they/them
Ps. I love my wife
User avatar
FnrrfYgmSchnish
Metal Slime
Posts: 741
Joined: Thu Jun 18, 2009 4:37 am
Location: Middle of Nowhere

Post by FnrrfYgmSchnish »

Rather than checking for each hero, maybe check to see which party slots don't have a hero in them and then shrink down the default "full strength" battle formation to something more appropriate for how many blanks you have.

Code: Select all

if(hero by slot(#) == -1)
-1 is what the engine spits out in any situation where a script's checking for something but there's nothing there, so using hero by slot this way will tell you if slot # is empty.

If you have more than 4 heroes in your game that would make it a bit quicker, since you only have to do three checks rather than going down a long line of hero-in-party tags for everyone. There's probably an even simpler way of doing it, but that's the first idea that comes to mind.
Last edited by FnrrfYgmSchnish on Sun Mar 11, 2018 8:33 am, edited 1 time in total.
FYS:AHS -- Working on Yagziknian NPC walkabout sprites
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

What you're looking for is the "room in active party" command.

You could edit the formations with a script. But for more control you can do it manually, creating different formation sets for differing numbers of heroes, and pick one with an instead-of-battle script. You could use switch blocks, or just give the formation set variants consecutive IDs. Use the "random formation" command to pick from the set, like "fight formation(random formation(form set + room in active party))"
Last edited by TMC on Sun Mar 11, 2018 1:28 pm, edited 1 time in total.
Post Reply