• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[EM] Battle Engine Upgrade (On Halt, Will undergo reboot!)

Status
Not open for further replies.
88
Posts
8
Years
  • Age 37
  • Seen May 10, 2017
One final question (since after this I will have dealt specifically with every area of the engine :p ):

Is there a way to make the moves appear for custom movesets? I have altered the general learnsets for pokemon, but leaders will have custom movesets.

I have looked at the ini file and there only seems to be a section for move effects, and not actual moves. The move effects is for the moves editor part of G3T, not the trainer editor. I have G3T and AdvancedTrainer available for trainer editing. Perhaps I need to d/l a different tool to accomodate for these added moves.

Thanks

Found a problem with Snow Warning. It activates and then stays forever. If you use another weather effect, such as sunny day, BOTH weather effects will remain in effect (ie, sun and hail). Not sure if it affects other abilities that start weather, but I think Snow Warning is the only post gen 3 weather ability so probably not.
 
Last edited by a moderator:
794
Posts
10
Years
Found a problem with Snow Warning. It activates and then stays forever. If you use another weather effect, such as sunny day, BOTH weather effects will remain in effect (ie, sun and hail). Not sure if it affects other abilities that start weather, but I think Snow Warning is the only post gen 3 weather ability so probably not.

Good catch. Weathers are stored as flags and I just set the weather flag instead of clearing and then setting the flag. It's fixed now.

As for more moves, simply edit the ini file.
 
88
Posts
8
Years
  • Age 37
  • Seen May 10, 2017
Nice one. I've found a way around the trainer movsets too, which makes it easy enough.

Seems to be an issue with Focus Blast's animation and palette though on build.
focus%20miss.png
 
88
Posts
8
Years
  • Age 37
  • Seen May 10, 2017
Sorry I seem to be messaging a lot. I figured you would prefer to hear about issues as soon as possible in order to fix them. If not, then ill wait until Ive got a lot and then ill send them all at once.

Engine seems to have messed up the move effect for Dragonbreath. It acts as a draining move now.

https://www.youtube.com/watch?v=tGdkLPGGVEg
 
794
Posts
10
Years
Sorry I seem to be messaging a lot. I figured you would prefer to hear about issues as soon as possible in order to fix them. If not, then ill wait until Ive got a lot and then ill send them all at once.

Engine seems to have messed up the move effect for Dragonbreath. It acts as a draining move now.

https://www.youtube.com/watch?v=tGdkLPGGVEg

Nah, you're finding bugs, it's all right. :D
But yeah you may wait a bit and send all of them at once, but it's up to you.
Dragonbreath is fixed.
 

rickonstark

the forgotten son
39
Posts
8
Years
Since I have no life lot of free time, i decided to try Magic Bounce/Coat based on Magic Bounce
and turns out that Magic Bounce/Coat doesnt work on the ff:
Confide
Encore
Forest's Curse
Heal Pulse
Odor Sleuth
Play Nice
Powder
Spikes
Taunt
Topsy-Turvy and the move doesnt work.
Torment
Trick-or-Treat and the move doesnt work.

and the ff bugs came out:
Disable bounces back but it fails, when it should disable the move disable. lol
Spite bounces back but also fails, when it should reduce the pp of move spite.
Venom Drench, Eerie Impulse, Noble Roar and Parting Shot bounces back but the moves dont work.

also
Protect moves should take effect first before Magic Bounce so if the user is hit by moves like thunder wave it would not be reflected.
And Magic Bounce shouldnt activate when the user is in semi-invulnerable state like fly, dig, etc.

other bugs i found:
Water Shuriken hits only 2 times even with Skill-link.
Explosion doesnt faint the user and doesnt work with damp.
Memento works like the move magnitude.
Simple Beam says that the target acuired unburden instead of simple.
Tickle has wrong effect and raises stats instead of decreasing them.

Topsy-Turvy, Trick-or-Treat, Venom Drench, Eerie Impulse and Noble Roar i think are unfinished moves but well just letting you know. :)
 
Last edited:
794
Posts
10
Years
Since I have no life lot of free time, i decided to try Magic Bounce/Coat based on Magic Bounce
and turns out that Magic Bounce/Coat doesnt work on the ff:
Code:
Confide - fixed
Encore - fixed
Forest's Curse - not affected according to bulbapedia
Heal Pulse - fixed
Odor Sleuth - fixed
Play Nice - fixed
Powder - fixed
Spikes - fixed
Taunt - fixed
Topsy-Turvy -  not affected according to bulbapedia
Torment - fixed
Trick-or-Treat - not affected according to bulbapedia, move script fixed
Code:
Disable bounces back but it fails, when it should disable the move disable. lol - Fixed
Spite bounces back but also fails, when it should reduce the pp of move spite. - Fixed
Venom Drench, Eerie Impulse, Noble Roar and Parting Shot bounces back but the moves dont work.
Code:
Protect moves should take effect first before Magic Bounce so if the user is hit by moves like thunder wave it would not be reflected.
And Magic Bounce shouldnt activate when the user is in semi-invulnerable state like fly, dig, etc
Fixed
Code:
Water Shuriken hits only 2 times even with Skill-link. - fixed
Explosion doesnt faint the user and doesnt work with damp. - fixed
Memento works like the move magnitude. - fixed
Simple Beam says that the target acuired unburden instead of simple. - fixed
Tickle has wrong effect and raises stats instead of decreasing them. - fixed

Topsy-Turvy, Trick-or-Treat, Venom Drench, Eerie Impulse and Noble Roar i think are unfinished moves but well just letting you know. :)
Yeah, they're not done yet.
Nice bug finding :D
 
132
Posts
9
Years
  • Age 23
  • Seen Apr 21, 2024
So to update the base, we would take test.gba, rename it to BPEE0.gba, and then follow the initial steps again with no free space issues?

Also, Dazzling Gleam has a BP of 18 instead of 80.
 
794
Posts
10
Years
So to update the base, we would take test.gba, rename it to BPEE0.gba, and then follow the initial steps again with no free space issues?

Also, Dazzling Gleam has a BP of 18 instead of 80.

It doesn't matter whether you'll use test or not as everything will be overwritten as long as you don't change the location chosen in the insert and linker.ld files.
Fixed Dazzling Gleam's BP.
 
88
Posts
8
Years
  • Age 37
  • Seen May 10, 2017
Left this a few days just in case I found anything else in the meantime. Gyro ball seems to be pretty wonky. I mean, it works, but it seems to make the enemy sprites go all dodgy. Sometimes it makes the sprite disappear, sometimes it just makes it look funny.

https://www.youtube.com/watch?v=YCwhZ2B1Ngc
 
112
Posts
8
Years
  • Age 27
  • Seen Mar 15, 2024
Just a question, how can I find offsets of secondary attack animations, for example solar beam's second turn animation?
 
2
Posts
7
Years
  • Age 32
  • Seen Aug 20, 2016
Just to push the limits of the project, I have been trying to get it to work atop an existing hack (Blazed Glazed). I can get it to compile and load-up without a hitch (0x08F30000, in case you're curious). From what I can tell, most everything is working well, with the exception of learnsets for Gen 4+.

Taking Turtwig as an example (being a starter in this particular hack), it is supposed to commence with both Tackle and Growl. Having uncommented TURTWIG_MOVESET and added it to the learnset_table within Learnset.c, I can view the learnable pool within a hex editor and view the table's offset in the debug list (if output on insertion) – both look good to me. However, the in-game learnset for Turtwig seems to be incorrect, commencing with Astonish and Growl.

I tried finding Turtwig in the hex editor, and manually re-assigning its learnset pointer to the new offset output by this implementation, same deal. Reading back through the thread there is a lot of talk of PGE not working, resetting the learnset table pointer, etc – all makes sense considering you guys bumped the learnset move marker up to 16 bits. I did notice that none of the original <=Gen3 Pokemon have had their learnset pointers reassigned, so my only conclusion is that you guys are calculating the location of the table programmatically, based on some runtime variable.

Any information on this? I'm guessing I need to either modify the repo somewhat or my existing Gen 4+ table extensions will need to be re-written to accommodate the new battle system. I can provide offsets, screenshots, etc. as needed.
 
Last edited:
794
Posts
10
Years
Just to push the limits of the project, I have been trying to get it to work atop an existing hack (Blazed Glazed). I can get it to compile and load-up without a hitch (0x08F30000, in case you're curious). From what I can tell, most everything is working well, with the exception of learnsets for Gen 4+.

Taking Turtwig as an example (being a starter in this particular hack), it is supposed to commence with both Tackle and Growl. Having uncommented TURTWIG_MOVESET and added it to the learnset_table within Learnset.c, I can view the learnable pool within a hex editor and view the table's offset in the debug list (if output on insertion) – both look good to me. However, the in-game learnset for Turtwig seems to be incorrect, commencing with Astonish and Growl.

I tried finding Turtwig in the hex editor, and manually re-assigning its learnset pointer to the new offset output by this implementation, same deal. Reading back through the thread there is a lot of talk of PGE not working, resetting the learnset table pointer, etc – all makes sense considering you guys bumped the learnset move marker up to 16 bits. I did notice that none of the original <=Gen3 Pokemon have had their learnset pointers reassigned, so my only conclusion is that you guys are calculating the location of the table programmatically, based on some runtime variable.

Any information on this? I'm guessing I need to either modify the repo somewhat or my existing Gen 4+ table extensions will need to be re-written to accommodate the new battle system. I can provide offsets, screenshots, etc. as needed.

Hah, looks like the creator of this hack didn't change much in the battle engine. As far as I know, it should work on every rom that didn't modify the battle engine. The issue would be obviously hooks and custom functions.
But anyway, to answer your question. Movesets past gen 3 won't work because you've put them in the wrong order in the table. Now:
in the vanilla roms after the last pokemon by ID that is Chimecho there are slots for an egg and all unowns, I'm not sure how much that is. What you could do is add, say, 40 pointers to the turtwig moveset at the end of the table and gradually erasing one, until you find which one belongs to Turtwig. What's more, you have to know what indexes the pokemon have. Most likely, the creator just went with national dex order, but stuff like forms may have strange IDs.
You can see pokemon ID in the ram, provided you've got him in the party or box (or opponent has it), if you don't know how, feel free to ask!

Also, to answer how the learnset table works:
- the location of the table is set at run-time, based on the start offset
- the table is not repointed, because the most important functions that use it have been rewritten, meaning there's no need for that
 

Bulbadon

Might or might not come back
106
Posts
9
Years
  • Age 26
  • Seen Aug 26, 2016
Any ini for G3HS?

I tried making an ini by copying the offsets in the PGE ini but it doesn't work. It shows all the new abilities and move names but when i add or replace the move on a Pokemon it turns into a different move. It turns into a move that's in the end of the list. I think I'm missing an offset or something.
 
2
Posts
7
Years
  • Age 32
  • Seen Aug 20, 2016
Hah, looks like the creator of this hack didn't change much in the battle engine. As far as I know, it should work on every rom that didn't modify the battle engine. The issue would be obviously hooks and custom functions.
But anyway, to answer your question. Movesets past gen 3 won't work because you've put them in the wrong order in the table. Now:
in the vanilla roms after the last pokemon by ID that is Chimecho there are slots for an egg and all unowns, I'm not sure how much that is. What you could do is add, say, 40 pointers to the turtwig moveset at the end of the table and gradually erasing one, until you find which one belongs to Turtwig. What's more, you have to know what indexes the pokemon have. Most likely, the creator just went with national dex order, but stuff like forms may have strange IDs.
You can see pokemon ID in the ram, provided you've got him in the party or box (or opponent has it), if you don't know how, feel free to ask!

Also, to answer how the learnset table works:
- the location of the table is set at run-time, based on the start offset
- the table is not repointed, because the most important functions that use it have been rewritten, meaning there's no need for that

Okay, thanks for your help! Much appreciated!

However, I'm still not certain I fully understand. From what I've seen in pouring over hex and VBA memory dumps, often a reference to a table object (at least, via pointer) is arbitrary – thus, no table iteration is required, taking an action similar to this pseudocode :

Spoiler:


However, the reason I'm not getting the right learnset now, is because, in reality, it's getting a marker/index from the Pokemon in question. Which it then, essentially, adds it to the learnset table's initial offset? A la :

Spoiler:


Thus, at least for this this battle system, the existing Pokemon table and the new learnset table (along with others, I can imagine) need to run in parallel, having a 1:1 relationship with each other so that the indices match up. If so, this would explain the garbage output, since it's not reading from the appropriate index. It should also indicate that I can modify the lookup method, instead of throwing in 40+ TURTWIG_MOVESETs and hoping for the best.

Again, please correct me if I'm wrong! I'm likely looking at this from too much of a C-based perspective, and I know you guys are piggy-backing quite a few vanilla helper functions, so I may may be overthinking it, or I may just need to dive into the disassembly of the 'nilla functions to see what's going on. That said, once I can wrap my mind around this, I'd be happy to contribute to the project if you need a hand! (I'm a software engineer.)

EDIT: for the sake of transparency, I tried appending TURTWIG_MOVESETs ~40 times and tried to repoint Turtwig's learnset to a number of the resulting offsets to no avail. I also tried adding variable numbers of EMPTYSLOT_MOVESETs as padding, prior to a TURTWIG_MOVESET within the learnset_table, and that didn't seem to work once re-pointed either. Perhaps I'm misunderstanding this haha.

A couple of offset samples I'm going by to give you an idea of where my head is at (assuming the first bit of pseudocode above is accurate) :

0x08F30000 : Battle System Upgrade base location
0x08324900 : Turtwig's original learnset location (pre-patch, working)
0x08F5965C : New learnset table location (post-patch, working on <=Gen3)
0x08F59CD0 : Turtwig's new learnset location, tested re-point here (post-patch, present but not working)
0x08F59D04 : Chimeco's learnset location within new table, included for proximity (post-patch, present untested)
 
Last edited:
Status
Not open for further replies.
Back
Top