Author Topic: Enemy AI and HP data?  (Read 9502 times)

EmperorSteele

  • *
  • Posts: 933
    • View Profile
Enemy AI and HP data?
« on: 2004-07-22 18:35:52 »
Well, everyone's been making mods to make the game "prettier", though I'd like to put my hand in at creating (of having someone create) a higher-difficulty mod.  Has the data for monster stas been cracked yet, and if so, how do I get at it to edit it?  

Sorry if this is all in Gears, halkun, but the length of the document is rather... intimidating o_o;; so i havn't bothered to consult it yet.

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
Enemy AI and HP data?
« Reply #1 on: 2004-07-22 23:27:05 »
It's scene.bin, but the tools to extract/reinsert the data hasn't been created yet. The data is compressed in chunks and you have to be able to uncompress it, alter it, recompress it, and insert it back into scene.bin

Gears will be getting better when I add a little more oganazation to it. Right now I'm trying to get as much stuff into it as I can.

One of the attactive aspects about FF7 I like is that it's easy to discover new things but very hard to alter them. Unless you are willing to put a lot of effort into writing custom tools, the system is pretty difficult to muck with.

Let me epsouse my personal opinion, by which I mean no offense to what you are trying to accomplish.

I find myself a vertern of the romhack "scene" I have a long list of been there/done thats that I have done with various games throughout the years. I had reversed about 80% of FF1, worked on a clone for "Adventure" for the 2600, translated portions of FF6, made graphic hacks of various games for my amusiment, ripped sprites, dicsovered opcodes, decrypted font matrixes, created DTE tables, created my own glyph look up table,  and even wrote my own program to take RPG data from one game and place it into another.

I find making "hardtype" patches a waste of time. The original people who designed the experiance and difficulty curve did so using mathmatics that's beyond anything I could ever do. Most growth curves are calculated very carefully over a long period of time. Tossing the balance off, in my experance, adds nothing to the game, and actually "breaks" it a little bit.

On the same line, I find dialog hackers that want to put swear words into every other line of a script immature and childish

Not that I'm saying that's what you want to do.

However watching characters act out of character is not funny to me. Often times people who put swear words onto the mouths of video game characters do so because thier mothers won't let them say the words out loud.

Nude patches are teh lam3, but you already know my opinion on haw3t t1fa b3wbiez wif teh t3xturez.

Gears, when it is finished will allow many people do bend the game in ways it was never intended, however a long tern goal with the document is to teach. I would love to see a day where Gears is used to make a FF7 engine clone, and also as a foundation for new, original end-to-end content to be created. That would make me really happy.

If you want to try you hand at an RPG with a higher difficulty, I would suggest downloading "Nethack" and get back to me when you beat the game. I've been playing it for almost eight years now and have yet to beat it myself.

There was a point to this, but I can't seem to remeber it now ^_^

Terence Fergusson

  • *
  • Posts: 262
    • View Profile
Enemy AI and HP data?
« Reply #2 on: 2004-07-23 00:04:42 »
The tool would not only have to extract the data, but *IDEALLY*, it should divide enemies and attacks back into their component IDs for easy editing.  Attack and monster data are *REPLICATED* for each component part of Scene.bin they appear in; a coder shouldn't have to manually edit each and every instance of this to change the game.

And as a reply and addition to halkun's comments:

First, while some mathematics may have been used, the large majority of balancing is done though beta-testing: you actually *fight* against the monster using teams of around the selected levels and see how it fares.  Then you tweak a few numbers and try again.  And again.  Until you're happy with it.

Other monsters are made more and less difficult by comparing to stuff in the same area.

Anyhow.  Returning to Hard Mode type patches.

Changing the stats isn't enough to do a viable Hard Mode.  That would just be nonsensical.

A *GOOD* Hard Mode version should change stats, attacks *AND* AI in a way to make the game MORE CHALLENGING.  You want the player to actually use *STRATEGY* rather than raw power to defeat enemies.

For this, you will probably need to even change stuff in the EXE (I recommend having the MDef Bug fixed, as it enables a possibility for even more strategy), or stats on other items (Materia bonus/penalty stats would be interesting, as would changing some of the item stats).

A lot of these things are documented, some are known but not documented as much, and some (like AI Data) have still to be worked out.

If you're truly serious about working on a Hard Mode patch, I suggest you design/brainstorm/discuss what you'd like to do first, and go over what might be possible.

 ===

Oh, and for the record:

Enemy Stats: Almost completely known.
Attack Data: Almost completely known.
AI Data: Almost completely *UNKNOWN*.
Enemy Formations: Basic structure known.
Random Encounters: Basic structure known.
Enemy/Attack IDs: Known.

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
Enemy AI and HP data?
« Reply #3 on: 2004-07-23 00:26:53 »
I concour.

Having armor attributes that that can defend against shout, pierce, slash, punch will bring a neat dynamic to the game. I always found it funny that the sound effects and "ka-balm" graphics reflected what kind of attack was being used, but it wasn't really much different to the reciever.

I have seen too many hardtype patches that simply changed all the hit points an order of magnitude and the experiance gained by half. I would like to have Gears enable *creativity*

Making new dificulty curve: Creativity +
Making new compatible engine: Creativity +++
Making all new content with new engine: Creativity +++++

data_lore

  • *
  • Posts: 11
    • View Profile
Enemy AI and HP data?
« Reply #4 on: 2004-07-23 02:29:59 »
yeah, I understand that it is a LOT of work, but a new graphics engine would be really kick***!!

Cyberman

  • *
  • Posts: 1572
    • View Profile
Enemy AI and HP data?
« Reply #5 on: 2004-07-23 03:05:07 »
Quote from: halkun
I concour.

Having armor attributes that that can defend against shout, pierce, slash, punch will bring a neat dynamic to the game. I always found it funny that the sound effects and "ka-balm" graphics reflected what kind of attack was being used, but it wasn't really much different to the reciever.

I have seen too many hardtype patches that simply changed all the hit points an order of magnitude and the experiance gained by half. I would like to have Gears enable *creativity*

Making new dificulty curve: Creativity +
Making new compatible engine: Creativity +++
Making all new content with new engine: Creativity +++++

I think the original idea to make a compatible engine is the best route.  I like the idea of 'expansion' of games and still being able to play the old. I'm still wondering about the shinra soldier dolls myself. :)

Once you have the engine, then you can make the new content.  Of course the big issue then becomes save state information, however one thing at a time. Rome wasn't built in a day I've heard ;)

Cyb

EmperorSteele

  • *
  • Posts: 933
    • View Profile
Enemy AI and HP data?
« Reply #6 on: 2004-07-23 06:44:07 »
Yikes o_O

No offense taken, halkun.  I wasn't talking about doing anything awful to the game (nudie patch, lol); however, the only "secret" to beating any mosnter is to level up, and you can eventually just pummel them.  That doesn't sound like the work of a mathmatically complex difficulty curve o_o

More monsters should have higher physical defense, and FORCE you to use status spells, so that way, you actually HAVE to equip materia like Transform or Seal if you want to defeat some enemies.  You know, that kinda thing.

However, i hadn't quite realized how much of ff7 is left to be poked at.  *sighs*

Perhaps in the future...

oh, and, "Nethack", huh?  sounds fun ^_^

Cyberman

  • *
  • Posts: 1572
    • View Profile
Enemy AI and HP data?
« Reply #7 on: 2004-07-23 13:45:18 »
Quote from: EmperorSteele
Yikes o_O

No offense taken, halkun.  I wasn't talking about doing anything awful to the game (nudie patch, lol); however, the only "secret" to beating any mosnter is to level up, and you can eventually just pummel them.  That doesn't sound like the work of a mathmatically complex difficulty curve o_o

Well.. I've noticed that some enemies get stronger as you level up, some don't.  You don't get as much experience though.

Quote from: EmperorSteele
More monsters should have higher physical defense, and FORCE you to use status spells, so that way, you actually HAVE to equip materia like Transform or Seal if you want to defeat some enemies.  You know, that kinda thing.

Yes they did that purposefully to force the player to use Materia and get into the Materia system as it is a critical part of the story as well.

Quote from: EmperorSteele
However, i hadn't quite realized how much of ff7 is left to be poked at.  *sighs*

Perhaps in the future...

oh, and, "Nethack", huh?  sounds fun ^_^

Nethack yes here is the official site.  It's pretty fun actually JUST read the rumors file, you'll choke laughing.

Cyb

mav

  • *
  • Posts: 239
  • The Sauce team
    • View Profile
Enemy AI and HP data?
« Reply #8 on: 2004-08-13 19:01:06 »
Lately, I've been working on scene.bin file, to understant it, so I can write some app to change values in it. The problem is that this file is divided to 32 sections that have *exact* size - 8 kB. And if you change anything in some file, then save and gzip it, the size is diffrent. I can extract those files, look at every single stat, but I can't repack the archive right now. But I'm not giving up :).

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
Enemy AI and HP data?
« Reply #9 on: 2004-08-13 22:53:34 »
you have to pack the extra space with FF FF FF to get the file size correct

mav

  • *
  • Posts: 239
  • The Sauce team
    • View Profile
Enemy AI and HP data?
« Reply #10 on: 2004-08-14 07:33:31 »
Last night I was programming a bit, and I wrote an extractor. It get's out all the files from scene.bin, and gunzip them, so you can hexview them. Next I'll work on Repacker. If I succeed, this forum will be first place to know :).

I'm wondering if the game likes it when I make e.g. section one with 11 files and section two with 7 files (they normally have 12 and 6)...

Cyberman

  • *
  • Posts: 1572
    • View Profile
Enemy AI and HP data?
« Reply #11 on: 2004-08-14 23:50:48 »
A good question I suggest you try it and find out. One thing I've noticed is that there aren't too many tools to create an ISO from a group of files.  If you are wondering why scane.bin is aligned to 8K sections, I'll demystify the reason. It's not, actually it's aligned to 2K sections, IE sector on the CD.  You'll notice this is true with pretty much all the files on the disk.
Of course that will make deciphering FF8 and FF9 image files a WEE bit easier I dare say ;)

Cyb

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
Enemy AI and HP data?
« Reply #12 on: 2004-08-15 01:00:56 »
Sounds like Square is bypassing the Bios file functions and going for direct sector reads. That must mean there should be a univeral table somewhere....This might be an intresting factoid to put in the "Kenrel" section.

(Sector reads are still a BIOS function, but have a little less overhead that the fopen() bios call)

hmmm postulation:

That might be why the game loads so darned quickly. The Kernel can kick off a file thread without calling the BIOS fopen()  This prevents the whole system from coming to a screaching halt as it opens and loads the file sections. The file thread can suck in 2k at a time and pass control back to the kernel proper to do other thread management.

That's why the TOC is in the BIN file. You can just read in the whole file can count gzip headers to get to the right section, but you would stall the system if you tried anything that "big"

The question is. Are the Kernel threads round-robin, or queued?

mav

  • *
  • Posts: 239
  • The Sauce team
    • View Profile
Enemy AI and HP data?
« Reply #13 on: 2004-08-15 06:45:16 »
Tools to extract / reinsert has been created...yesterday :). You can find them on the other topic in Game Tweaking. Now only think to do is learn everything you can about AI scripts, and we can do such mod. We know already how to change statistics, win/steal items and such. So why don't give it a try ?

Edit: I made Guard Scorpion unstoppable :D. Screen:


halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
Enemy AI and HP data?
« Reply #14 on: 2004-08-15 08:40:36 »
Terrence is doing the AI mod thing.... This's gonna be huge, and I'm gonna have to insert the monster into Gears. It doesn't help that I didn't work in Gears at all last weekend because of the carsh and was busy reoginazing my MP3 collection on Naru this weekend.

This is a screenshot of halkun "working" on his computer

The Skillster

  • *
  • Posts: 2284
  • Loving every Final Fantasy
    • View Profile
Enemy AI and HP data?
« Reply #15 on: 2004-08-15 09:08:54 »
:D oh yea!!! this is a godsend!
Thanks,

blackeyed_cn

  • *
  • Posts: 33
    • View Profile
Enemy AI and HP data?
« Reply #16 on: 2004-08-15 17:13:13 »
OMG,are you talking about Scene.bin??
there is a pdf that tell structure of this file,have not U seen it before??
It include 256 gz files,and it's easy to find some data such as enemy' name/attack name/HP/MP....For my translation,I created a program to edit enemy's name and attack's name.
But,I still can not find where the AI data is.....  :(


mav

  • *
  • Posts: 239
  • The Sauce team
    • View Profile
Enemy AI and HP data?
« Reply #17 on: 2004-08-15 19:29:24 »
Why didn't you tell this to anybody ? :P
Can you tell me, how you're expanding in-battle dialogs ? For example, I want to change text "Attack while it's tail's up" to "Don't attack while it's tail's up", but I don't know how to do this. Basically, I don't know where are pointers pointing to these dialogs.

blackeyed_cn

  • *
  • Posts: 33
    • View Profile
Enemy AI and HP data?
« Reply #18 on: 2004-08-15 19:50:53 »
Quote from: M4v3R
Why didn't you tell this to anybody ? :P
Can you tell me, how you're expanding in-battle dialogs ? For example, I want to change text "Attack while it's tail's up" to "Don't attack while it's tail's up", but I don't know how to do this. Basically, I don't know where are pointers pointing to these dialogs.

I am new here today...u see..I am here seeking some help in FF7 files..
I can not remember it clearly cause I wrote it month ago...but I can give you the delphi code,I download your soft,it shows that u write program by delphi7.0 too.. :)
Can u talk to me on the MSN,I know you added my MSN,but why do not say 'hi' to me?

Cyberman

  • *
  • Posts: 1572
    • View Profile
Enemy AI and HP data?
« Reply #19 on: 2004-08-16 00:40:20 »
Quote from: halkun
Sounds like Square is bypassing the Bios file functions and going for direct sector reads. That must mean there should be a univeral table somewhere....This might be an intresting factoid to put in the "Kenrel" section.

(Sector reads are still a BIOS function, but have a little less overhead that the fopen() bios call)

hmmm postulation:

That might be why the game loads so darned quickly. The Kernel can kick off a file thread without calling the BIOS fopen()  This prevents the whole system from coming to a screaching halt as it opens and loads the file sections. The file thread can suck in 2k at a time and pass control back to the kernel proper to do other thread management.

That's why the TOC is in the BIN file. You can just read in the whole file can count gzip headers to get to the right section, but you would stall the system if you tried anything that "big"

The question is. Are the Kernel threads round-robin, or queued?

Yes.. this includes the (drum roll) FMV's which are sector aligned in any case.  I think the file structure was just left that way because FF7 was being rushed to be released (there is a thread reguarding this fact just by coincidence). It makes much more sense to have all the files sector aligned and loaded than actually using the ISO9660 system.  It is possble however they still used that, at least just for the sector references. This may also be the reason why if you bump a file to large the entire ISO image is off.  As the directory information needs updated as well.  Reading the ISO directory directly is much faster and saner than using the bios (and going through all the playstation BIOS handling overhead).

As for Round robin versus queueing. My guess would be round robin. As it's easier to implement and less likely to cause priority inversion conflicts.  Basically this means each task is given a time slot it's local stack etc is restored, any kernal commands are queued to the kernal, then it's preempted.  The kernal checks for new IO and updates things at the kernal level, then passes to the next thread.  Very simple.

Cyb

Lord_Skylark

  • *
  • Posts: 115
    • View Profile
FF1
« Reply #20 on: 2004-08-18 10:46:39 »
Hulkan, you said that you did FF1 hacking.... I was wondering if you knew where the data was stored that calls up the set ecnoutners. Such as when you step on a certain tile on the map, an auto-battle is called up (mainly enemies in front of treasure chests)

Thanks,
~Sky

L. Spiro

  • *
  • Posts: 797
    • View Profile
    • http://www.memoryhacking.com/index.php
Enemy AI and HP data?
« Reply #21 on: 2004-09-03 13:19:39 »
blackeyed_cn, where is that .pdf file?

If you have it on your hard drive I would like a quick send if you don’t mind.

If you don’t have it at all and can not find it, well, I don’t code in Delphi but I can follow any language to tell what it is doing.  It may be helpful to send the source anyway.  Are you willing to do that?


My MSN is [email protected].


L. Spiro

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
Re: FF1
« Reply #22 on: 2004-09-03 17:10:05 »
Quote from: Lord_Skylark
Hulkan, you said that you did FF1 hacking.... I was wondering if you knew where the data was stored that calls up the set ecnoutners. Such as when you step on a certain tile on the map, an auto-battle is called up (mainly enemies in front of treasure chests)


Goodness, it's been so long. Your best bet is getting FFHackster, change the data using that, and see when in the rom the data was changed. There are "tile attributes" via a look up table, but I don't remeber where...