ladyabaxa: (idiot skeletor)
I figured I could explain a little bit about how things work in Shining Force 2. This is all stuff I've figured out through trial and error playing the game over and over again so asking me nitty gritty programming questions is useless because I can't answer them.

Ahem, moving right along.

the Caravan screenshot 1

This is what the battle window looks like in the Caravan (well, there's technically more but it wasn't important for this post and got cropped). I have Zeon himself selected and he shows up in the editor as Rohde's sprite facing up. This isn't important because we know what his unit number is: 98. The Item window is a feature that hasn't been implemented yet and shows up greyed out for all units. X and Y are the unit's coordinates. It can be hacked in using a hex editor by someone knowledgeable in ASM but requires supporting event flags to work. The item is byte 6 in the character's data table with byte 5 being the item's state.

Order Sets determine special AI functions. Use special move order tells the unit to follow a specific unit on the map. If set a Force Member the unit will attempt to seek and attack that person. In the default game this is always set to Bowie probably because he is the only player character whose death ends the battle. Move to Point commands the unit to move to a point specified under AI Zones. Follow Ally tells the unit to follow the numbered ally until said ally dies or enemies come into range.

The AI number specifies which general routine will be run when that unit's turn comes up. There are 16 in all, listed as 0-15, but some are empty routines that make a unit stand around (not that having at least one of those is a bad thing).

Zeon Guards and Prism Flowers have a root AI exception and ignore whatever is set here for their own subroutines. Neither of those can be added to a map unless you are able to ASM hack the battle AI to add the supporting scripts they need. Otherwise the game might freeze once the flower's turn comes up. Don't try this unless you've got a good idea of what you're doing.

That said, the AI number can, in a general sense, be equated to an increasing aggressiveness scale. I'll go into much greater depth about AI in a later post. It doesn't have the patrol routines from Shining Force 1, unfortunately, so that isn't an option.

Region-triggered Spawn is precisely what it sounds like. Regions are sections of the map defined under AI Zones. Checking this box produces two results based on what other options are enabled. 1.) Ticking the box and selecting a region causes the unit to spawn once a player character enters the linked zone. 2.) Ticking just the box makes the game wait until a secondary trigger fires to spawn the monster. Right now there is only one secondary trigger and that is opening a treasure chest in battle - only treasure chests, other tiles don't work! This is what makes monsters-in-a-box work. Please note that if you want the monster to drop whatever is in the chest when slain that item has to be added as the unit's extra item.

Continually Respawn should be pretty obvious. This means the unit respawns on its starting coordinates when slain as long as no other unit occupies that spot. ??? cuts the experience awards given to player characters who attack that monster in half. This means a tough, badass monster can be placed earlier then it would normally while restraining how much experience it gives out.

the Caravan screenshot 2

Okay enough text. It's time to actually show some of this stuff off! I've got the AI Zones tab open now to show off regions and points. The region is the green box. The point is the little blue box. I've mentioned before how trigger regions control triggered spawns but they also tell specific units whether to be active or not. There are some variables dependent on specific AI settings but the basic gist is untriggered units patrol around their starting point (always moving 1 tile vertical and 1 tile horizontal) doing a whole lot of nothing until a force member enters the trigger region and activates them (activated units remain active for the rest of the battle). Untriggered units can and will heal allies.

A unit can have 2 trigger regions associated with it. Entering either works.

the Caravan screenshot 3

In my viddler WIP videos I had one curious Pyrohydra who sat around doing nothing. I've got that particular unit selected in the above screenshot to show how that is done. This devil's only job is to stop intrepid player characters from running up the walkway to Zeon and trigger the reserve units too soon. It doesn't move because the trigger region its attached to is behind it and there isn't enough space to allow it to move the 2 steps it would each turn. This is a less-then-optimal solution until I can edit the tilemap and remove that walkway.

the Caravan screenshot 4

Points are used to tether specific units to one part of the map. This example is a shugenja who has been programmed to move north and remain close to the point in blue. There will be more on using points in the AI post.

the Caravan screenshot 5

This is to show a point that has been moved. Just adjust the X and Y coordinates as needed. Points exist in all battles that have a pre-battle cutscene but the cutscenes don't require (or just doesn't read) the battle script points because I've edited almost all of them and they've had no effect on the cutscenes themselves.

That's all for this installment. This has been an introduction to editing battles in the Caravan. Later!
Date/Time: 2010-09-23 12:21 (UTC)Posted by: [identity profile] omnimirror.livejournal.com
Ahhh, good old continuous respawn. I remember having to plug up the spawn points with various units in order to get through that battle.

Nice tutorial. It took me a bit to absorb everything, but it might be something fun for me to mess with in the future...though I wouldn't put any stock into that, I probably won't ever get around to it.

Also, great comeback in your most recent test battle. I thought you were wrecked early on. Adjusted Kiwi looks really good with the more scaled HP/defense and multiple special attacks.
Date/Time: 2010-09-24 02:32 (UTC)Posted by: [identity profile] ladyabaxa.livejournal.com
I wanted to give him a lightning breath attack and make him a true mini-Gamera but alas there is no such thing in the game and I don't know any assembly to add such a thing.
Date/Time: 2010-09-25 05:15 (UTC)Posted by: [identity profile] omnimirror.livejournal.com
Bummer. It would have been totally sweet, plus with three different attacks his specials would likely have procced a lot more.