Author Topic: [FF7 PSX] How to find enemy encounters in memory?  (Read 9380 times)

Raziel80

  • *
  • Posts: 119
    • View Profile
How to find enemy encounters in current area in memory, during gameplay? I want to find Battle ID and Probability for this battle for each area from field files, but in memory. Each unique area can support up to: 6 Normal battles and 4 Special Formation battles. I found several, but I don’t see how they are connected to each other. I want to add this data to my trainer to see which enemies you can meet in the current area. This data is located in very different places in memory. Maybe FF7 uses some kind of pointers for this?
« Last Edit: 2020-06-26 23:16:43 by Raziel80 »

nfitc1

  • *
  • Posts: 3011
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: [FF7 PSX] How to find enemy encounters in memory?
« Reply #1 on: 2020-06-28 18:13:30 »
I can tell you the addresses on the PC version (0xCFF45C). I don't think it translates directly to the PSX. That points to the data in memory that you're looking for. I think the memory structure it points to goes something like this:

0x0 - word; overall encounter rate
0x2:0xD - words; 6bit encounter chance/10bit formation value. There's a chance that these can be encountered "preemptively".
0xE:0x15 - words; special formations in same format as above. Checked first in order. I believe they are two preemptive followed by one back attack and one side attack. Those formations cannot be overriden by preemptive, but can go up/down in probability of encountering with preemptive materia.
0x16 - word; probably nothing. Likely an alignment buffer.

Raziel80

  • *
  • Posts: 119
    • View Profile
Re: [FF7 PSX] How to find enemy encounters in memory?
« Reply #2 on: 2020-06-30 02:08:44 »
I can tell you the addresses on the PC version (0xCFF45C). I don't think it translates directly to the PSX. That points to the data in memory that you're looking for.
Found these pointers for psx. Thanks for the help. PC version has 2 pointers: 0xCFF444, 0xCFF45C and PSX version also has 2 pointers.

I think the memory structure it points to goes something like this:

0x0 - word; overall encounter rate
0x2:0xD - words; 6bit encounter chance/10bit formation value. There's a chance that these can be encountered "preemptively".
0xE:0x15 - words; special formations in same format as above. Checked first in order. I believe they are two preemptive followed by one back attack and one side attack. Those formations cannot be overriden by preemptive, but can go up/down in probability of encountering with preemptive materia.
0x16 - word; probably nothing. Likely an alignment buffer.

It looks like this:
0x00 - byte; may be enabled/disabled, encounter group 1
0x01 - byte; overall encounter rate
0x02 - battle 1 (0x02 - 0x0D - 6 words)
0x04 - battle 2
0x06 - battle 3
0x08 - battle 4
0x0A - battle 5
0x0C - battle 6
0x0E - back attack 1 (0xE - 0x15 - 4 words)
0x10 - back attack 2 (according to the Makou Reactor)
0x12 - side attack
0x14 - attack from both sides
0x16 - word. alignment

0x18 - byte; may be enabled/disabled, encounter group 2
0x19 - byte; overall encounter rate
0x1A - battle 1-6 (0x1A - 0x24 - 6 words)
0x26 - 4 special formations (0x26 - 0x2C - 4 words)
0x2E - word. alignment

Abashi76

  • *
  • Posts: 64
    • View Profile
Re: [FF7 PSX] How to find enemy encounters in memory?
« Reply #3 on: 2020-07-08 15:00:50 »
Why isn't there a program for opening the memory about the world map?

Raziel80

  • *
  • Posts: 119
    • View Profile
Re: [FF7 PSX] How to find enemy encounters in memory?
« Reply #4 on: 2020-07-10 07:26:23 »
Why isn't there a program for opening the memory about the world map?
As far as I know, there is no such program, because not many people are interested in it.

nfitc1

  • *
  • Posts: 3011
  • I just don't know what went wrong.
    • View Profile
    • WM/PrC Blog
Re: [FF7 PSX] How to find enemy encounters in memory?
« Reply #5 on: 2020-07-10 15:56:38 »
There's just that that much done with the WM because there's not much that can be done with it. There is one script editor which is limited primarily on the lack of information of the format of the scripts themselves. The bulk of the game takes place in fields or battles so more time and effort has been focused there.

Abashi76

  • *
  • Posts: 64
    • View Profile
Re: [FF7 PSX] How to find enemy encounters in memory?
« Reply #6 on: 2020-07-12 17:42:30 »
As far as I know, there is no such program, because not many people are interested in it.

There is practically nobody interested in modding this game anymore. I have heard of attempts to change the world map before. On example is New Threat tried to add a forest near Midgar. Two mods added custom battle formations on the world map.