Author
Topic: Creating Enemies (Read 5303 times)

Hey.I have looked through the forums but not really found much in the way of what I'm looking for.If there is some thread I've overlooked, please direct me

Right anyway, I've been messing around with Meteor and Highwind etc. and was just wondering1. Does Meteor show ecounters for Bosses? Because, I don't think it does ;S2. If it doesn't, what are the ecounter codes for Bosses? I know it might sound totally stupid but I was going to make a sort of room full of bosses from previous parts in the game3. How do I create enemies/bosses? As I wouldn't mind making the game quite a bit harder and customising it4. How do I create attacks for enemies/bosses, as raising stats and changing some weaknesses around would just mean levelling up more which I don't find that interesting y'know?

I will write guide NOW!! Ok I'm on Easter vacation now, so why not write the %&#$ guide lol. At least I can start with this post, and try to answer any questions that might pop up. I bet there are many others on this forum can probably answer 'em too. I'm not at home now and didn't bring any files. That means I don't have any of my files available. I'll be back home Tuesday next week.

Before I start, just to make things clear, you need to know that there are a fixed number of battle models in the... uh battle.lgp was it? Anyway they are in the lgp archive where the battle models are stored (It's located in data\battle). Each battle model has it's own ID. That means, unless you want to make your own models, you have to use that is already used by the game.

Anyways...

Lets go through it step by step. In the scene the important sections are:

Enemy IDs (Battle model)

Enemy Data (skills, items, elements etc)

Attack ID list

Attack Data (moves enemies have)

Attack Names

AI

Formation

Enemy IDs (Battle model)To ADD enemies to a scene you have to find a scene that isn't full (has 3 enemies), and then add a ID. This part is the easy part 'cause the IDs is in the very beginning of the scenes. The 6 1st bytes. Which means each ID is 2 bytes long. To begin with, you should find a scene you know where the encounters in the game are. For testing purpose.

Lets say you want to use the MP's battle model. I believe the ID here is 0x0010. Then if ID 1 is XXXX and ID 2 is YYYY then ID 3 will be 0x0010.

Enemy Data (skills, items, elements etc)The next natural step would be to fill in the enemy data. Information on this is found HERE! To do this easy just use a scene editor. There are some parts of the enemy data that are unknown on the wiki but I'll try to explain 'em.

OFFSET LENGTH DESCRIPTION0x0038 16 I call this one "Body Animation" (BM). There are things tied to the attack data too. I think all enemies got 0x03 as the "standard" attack BM, and 0x04 is usually used as the magical and/or secondary etc. attack. Each BM is tied to an attack ID in the same order. That means that the 1st attack ID use the 1st BM. Each BM is 1 byte, 16 in all.0x0048 32 This isn't unknown, but the length is wrong (I think). 'Cause each ID is 2 bytes (see wiki). ??????? 6 I don't remember where this starts. The 2 1st bytes are the attack ID that the enemy uses under Berserk and Confuse. All 3 IDs will appear in the Manip. menu. I'll find out where it was when I return.0x00A2 1 or 2 I don't actually know what this byte is, but it might be what attack Odin will use. 0xFF10 means normal and 0xFF20 means the lance attack. I haven't tested this though.

Attack ID listThe next step is to to add your enemy's attack IDs in the attack ID list which starts at offset 0x0840 in each scene. Write 'em down in the same order as you did in your enemy's data (Enemy data). It doesn't have to be, but for the reason of order it's best to do this. If this confuses you let me explain a bit deeper:In the Enemy Data you make the enemy's attack IDs. Those attack IDs should also be in the general attack ID list at offset 0x0840. Each attack that are stored in the scene are above this list, and the order here (Attack data and the ID list) is the important ones. Attacks are given their ID to the corresponding # ID from the ID list. In other words, the 1st attack will be referred to as the 1st ID from the attack ID list in the AI. That means that enemies in the scene can indeed share attacks. In the Enemy data you just set what attack IDs the enemy use. And those IDs appear again in the AI.And if you got the gist of this you understand that the Attack names are stored in the same order.

Attack Data (moves enemies have)Next is to add the attacks. Naturally the enemy should have as many attacks as attack IDs (duh). The attack data start at offset 0x04C0, and each attack is 28 bytes long. I'll try to explain every byte.

Attack NamesAttack names are easy. Each attack is 32 bytes long. FF text encoding can be found HERE! Or use a tool.

AIAnd now for the tedious part: The AI. Each enemy in the game got it's unique AI. The AI script has a number of opcodes and is, well, "stack based". Opcodes can, for instance, push values or addresses on the stack, and then use those to execute commands, create variables, set addresses, check equality etc.

The AI section starts at offset 0x0E80. The 1st 3x2 bytes are the general pointers, which points to each enemy's AI section. 0xFFFF means no section. The 1st pointer will naturally always be 0x0006. As well will the 1st enemy's AI start at offset 0x0E86, 'cause there are 6 bytes of pointers. Each enemy's AI section always starts with 32 bytes of pointers to a specified AI section: Setup, Main, Counter General etc. The pointers hare are also 2 bytes, thus it's 16 pointers in total. An enemy hardly ever use more than 3-4 pointers. 0xFFFF means no section.

I have no clue at the moment what the others are, but they are barely used at all.For the actual opcodes you'll have to wait 'till I get home (it's funny how I always end up in these situations during holidays lol). It's possible to just copy another enemy's AI, but keep in mind you have that the AI contain the attack ID as well before an attack is executed. Replace those with the current attack IDs.

FormationsMoving on to formations. There are room for max 6 enemies in each formation, and it's 4 formation in each scene. The four different formations starts at offsets 0x0118, 0x0178, 0x01E8 and 0x0238. Each enemy has 16 bytes each that decides different things.

BOSSES?Now that your enemy is done, you may want to make some bosses too? Well that requires field editing. There are tools for that too.Well it is easier than it sounds (at least for the PC version I dunno for PlayStation). You kinda have to find some place in the field script that can trigger a "monster-in-a-box", e.g when picking up items etc. 1st you need to know the formation ID you want to trigger. Each scene has 4 formations. Scene1 has formation ID 0-3Scene2 has formation ID 4-7... and so on...And then insert a line in the field script with opcode 0x70. This opcode takes 2 arguments. Mak the 1st 0x00 and the 2nd equal the ID you want in hex. General info 'bout the field is found HERE! Meteor is a great tool for this. The opcode name is BATTLE.

I'm sorry if this was confusing 'but it should at least get you started.

As I see there are only 8 direct called scripts per unit in game (0 - 7).

Script 7 called before any action with priority 1-6 take place. Action with priority 0 will not be activate this. Priority 0 used for counter actions (maybe with something else).

Other scripts can be called manually fron other scripts using Ai Opcode 92 (run cmd) with action 0x22 (usually they use 0x20 whick is enemy attack, 0x24 - play animation). 0x22 seems run script defined with second argument for all entity in battle. Mainly it used for enemy escape from battle. All actions added with this runned script will have priority 0.

As I see there are only 8 direct called scripts per unit in game (0 - 7).

Script 7 called before any action with priority 1-6 take place. Action with priority 0 will not be activate this. Priority 0 used for counter actions (maybe with something else).

Other scripts can be called manually fron other scripts using Ai Opcode 92 (run cmd) with action 0x22 (usually they use 0x20 whick is enemy attack, 0x24 - play animation). 0x22 seems run script defined with second argument for all entity in battle. Mainly it used for enemy escape from battle. All actions added with this runned script will have priority 0.

Yup there are only 8 used in game. The last counter is used some places, and if I remember correctly Safer use this to remove self. Do you have an example where 0x22 is used?

As I see there are only 8 direct called scripts per unit in game (0 - 7).

Script 7 called before any action with priority 1-6 take place. Action with priority 0 will not be activate this. Priority 0 used for counter actions (maybe with something else).

Other scripts can be called manually fron other scripts using Ai Opcode 92 (run cmd) with action 0x22 (usually they use 0x20 whick is enemy attack, 0x24 - play animation). 0x22 seems run script defined with second argument for all entity in battle. Mainly it used for enemy escape from battle. All actions added with this runned script will have priority 0.

Yup there are only 8 used in game. The last counter is used some places, and if I remember correctly Safer use this to remove self. Do you have an example where 0x22 is used?

I didn't look at ai script directly, but I look at Terence Fergusson enemy mechanics. He note some misterious 0x22 action in enemies like Yuffie, Cactuar, Ultimate Weapon, Diamond Weapon and Sephiroth. Everyone use it to run away from battle. Quick look at 0x22 action function give me idea that it just run given script to all units in battle. I want to look at this script myself, but I dont have enough time. Very busy with reversing sense algorithm and converting FFVII models to Ogre3d format.