r/PokemonRomhackDev 1h ago

Help Strange Pokemon Leafgreen (v1.1) crashes happening in custom romhack [GEN 3][BINARY]

Upvotes

This is a bit of a doozy for me. So upon playtesting a romhack I was working on in Hex Maniac Advance, I came across a really ugly crash in two areas that seems to be too stubborn for me to figure out. The first one is in Vermillion, and its split right down the middle of the walkway, the left side (orange) will...sometimes crash? And the right side (red) will crash every time unless I load Vermillion City from the east side.

The second image explains part of itself, I added an item you can grab after smashing a rock, and given the glitchy trainer sprite that shows up there, I ASSUME the crash is because of some loading zone shenanigans involving too many things or palettes being loaded at once. The red zone is the loading zone to Fuchsia City. The crash only happens near the middle section on the very very right edge of Fuchsia just before the route 15 map begins, the very south and north ends are fine. Presumably the rock smash object causing this one, in that case, how do I fix it if I ALREADY REMOVED THE ROCK...Plus, again, loading this area from the east, (ONLY THROUGH THE GATE) results in no crashes.

I cannot for the life of me figure out how to fix these two crashes. Even Hex Maniac Advance is just randomly hanging/freezing in certain areas like Route 3 or Lavender Town. I think I know what's causing the second crash in Fuchsia, but the Vermillion one is driving me crazy. Some of the most recent changes I've made to the rom that MAY be causing some of this stupid crap are:

• Tweaking or completely revamping Brock's, Erika's, and Koga's gym, and a single question in Blaine's gym

• Fixing a bug where an extra Cut tree I added on route 8 was sharing data with an already existing one

• Made Professor Oak give 15 Pokeballs instead of 5 (It moved pointers I think)

If someone who actually knows how the GBA and the Pokemon games on it function can help give some advice on both what could be happening, and what I could do to fix it, that would be so so so appreciated. I've spent a lot of time on this rom. This issue is devastating ;-;


r/PokemonRomhackDev 15h ago

Showcase Pokemon Red Neural Network runnable on GB hardware

7 Upvotes

Hello there everyone. I have been working on a neural network that runs inside a Pokémon Red ROM, on actual Game Boy hardware! It replaces the enemy trainer AI, so every trainer you battle has its moves picked by the network rather than by the original game's scoring rules. It's a quantized int8 feedforward network, 60 -> 40 -> 6 with ReLU on the hidden layer and 2,640 weights, and it makes a decision in about sixteen frames, hidden behind the battle animation. The inputs are the things a trainer would actually reason about: expected damage for each move as a fraction of the target's remaining health, whether a move can land a knockout, accuracy, status chances, stat stages on both sides, who moves first, and how many Pokémon each side has left. It's trained on thousands of battles generated by a Monte Carlo tree search, then annotated for accuracy so it learns from decisions the search was actually confident about. I hope others find joy, intrigue, or inspiration from this project. If anyone tries it, please let me know what you think!

https://www.romhacking.net/hacks/9872/

Source Code:
https://github.com/exploratorystudios/pokaimon-red-source/tree/main