• 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?".
  • Forum moderator applications are now open! Click here for details.
  • 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.

Development: Wild double / triple battles

106
Posts
15
Years
  • Seen May 29, 2019
@slawter666: driver implemented a battle BG hack in BPRD (Firered German) which loads different bgs depending on a variable. Shouldn't be hard to port, but I'm not sure if he actually released the info. I'm not an ASM expert, but an animated background could go with the extended BG-loading routine easily, I guess. Same goes for different BGs for daytimes/seasons. A 256 bg should be possible somehow, but it is possible, that there are some background colors used in the standard battle screen. If this is true, it would be very hard to make 256 colors load properly (actually impossible without loading the other bg-palletes into the OBJ-palette...).

Thanks for the reply.

Could a (roughly) 256 colour background could be done using a similar method to Black Charizard's 256/240 colour Titlescreen? However he removed how he did it (although it might still be in some quotes, I haven't checked).
 

Meta Paradox

Researching FireRed...
56
Posts
12
Years
  • Seen Jul 18, 2011
Okay, if the double wild battle needs changing every so often EXTERNALLY with a hex editor, wouldn't writebytetooffset work? At least for wildbattle scripts?
 

Jambo51

Glory To Arstotzka
736
Posts
14
Years
  • Seen Jan 28, 2018
Okay, if the double wild battle needs changing every so often EXTERNALLY with a hex editor, wouldn't writebytetooffset work? At least for wildbattle scripts?

No. The byte in question is always written with the standard routine. And it's always written as 0x0. This needs some investigation. It is possible for me to make a routine which reads from lastresult for ghe wildbattle type, though.

I've got the game generating 2 random wild pokemon from the map's pokemon. Although i'm struggling to find where the buggy things are, atm.
 

miksy91

Dark Energy is back in action! ;)
1,480
Posts
15
Years
This is pretty much impossible if you ask me.

Reason:
It would be a difficult thing to make it so that 2 pokemon could appear at the same time but the real problem would be the coding for the battle not to end if you caught one pokemon (of course if the hacker wanted it to be so that the battle would end leaving the other pokemon uncatchable it would be possible, maybe).
 

sonic1

ASM is my life now...
77
Posts
15
Years
At 01065c put a branch to this routine:~
Code:
.thumb
.align 2

main:
LDR     R5, =0x20370CA  ' var 8009 adress. Chose this one because its not used often
LDRB    R5, [R5]
CMP     R5, #0xF 'If var 8009 is 0xF then go to new code. Else continue original code.
BEQ     new_code
STR     R1, [R2]
LDR     R1, =0x2023E82
MOV     R0, #0xF
STRB    R0, [R1]
LDR     R4, =0x8010665
BX      R4

new_code:        'What this code does is basically setting the double battle bit.
PUSH   {R7}
MOV     R7, #1  ' see the line up
ORR     R1, R7
POP    {R7}
STR     R1, [R2]'----------Rest of the routine
LDR     R1, =0x2023E82
MOV     R0, #0xF
STRB    R0, [R1]
LDR     R4, =0x8010665
BX      R4

Presto! With var 8009 with value 0xF set, you can now have double battles. Any double battles: Wild, trainer, wireless, safari, blah blah blah.

~Sonic1
 
Last edited:

Jambo51

Glory To Arstotzka
736
Posts
14
Years
  • Seen Jan 28, 2018
Ooh goody. Now, all that needs to be done is to write a routine that allows a wireless double battle to work!

Especially if each trainer tries to catch the same Pokemon.

Edit: Someone made a really good point on that video. I'll have to see to it. It is using surf to kill both opposing Pokemon. But, I don't think anything special will happen.

As you may have realised by now, it makes absolutely no difference if you KO them both at the same time as the game runs the checks properly.

I've managed to iron out most of the bugs with my routines now. The only problem now is that I can't find what tile the player is standing on, and as such, can't work out probabilities for how often they should occur.

I was trying to cook up a way for normal grass tiles to have a 1 in 20 chance or something, with "special" grass tiles having a much higher chance. If anyone could point me in the right direction for where to get a tile ID in the RAM/ROM, I will finish this hack off, and get it posted on here for all and sundry to use.

Also, 100th post! :D
 

Darthatron

巨大なトロール。
1,152
Posts
18
Years
As you may have realised by now, it makes absolutely no difference if you KO them both at the same time as the game runs the checks properly.

I've managed to iron out most of the bugs with my routines now. The only problem now is that I can't find what tile the player is standing on, and as such, can't work out probabilities for how often they should occur.

I was trying to cook up a way for normal grass tiles to have a 1 in 20 chance or something, with "special" grass tiles having a much higher chance. If anyone could point me in the right direction for where to get a tile ID in the RAM/ROM, I will finish this hack off, and get it posted on here for all and sundry to use.

Also, 100th post! :D
I believe you have to read the X/Y position of the player from the RAM, then manually load the tile ID from the ROM based on that.
 

Jambo51

Glory To Arstotzka
736
Posts
14
Years
  • Seen Jan 28, 2018
Here we have a newer update of the routines:

http://www.youtube.com/watch?v=pPUWIWztYrA

It's not perfect. You can't run from the battle, and you can only catch one of the Pokémon, but the music plays on winning the battle correctly now.
 
Last edited:

Pingouin_7

Guest
0
Posts
Weird.
I got my hands on a FireRed rom and when I checked 02022B4C it was already set to 03 for some reason.
Then when I edited it to 01, it started some kind of double battle with only one Pokémon on the right.

When I sent two Pokémon, one of them acted normal, but the second Pokéball flew all the way up to the wild Pokémon and some kind of glitchy line of mess appeared near my Pokémon's HP bar.
The game froze after the battle.
 

Liquid Twilight

Super Geek
50
Posts
12
Years
Wow. I glanced at this thread a day or two ago and I thought it would take you all a lot longer to get a almost fully functioning wild double battle going.

Now, I have no knowledge about anything you guys have done and I wouldn't know where to start implementing but in regards to running could you not run a check at the beginning of the escape routine to check if it is a double battle and if it is use a modified version of the runaway script.

E.g.

The formula for the normal Run routine is ((Speed of your pokemon) x 32 / (speed opponent) divided by 4, mod 256) plus 30 times (amount of escape attempts).

Edit: I forgot to add this would require the run command to be executed before any attacks happen and would require the battle to finish if successful ... but I imagine you all knew that already.

Also ...

In regards to a capture could you not force the routine to treat the captured pokemon as knocked out and then proceed with the battle as normal. Would this not enable the other pokemon to be captured? or does the game only allow for 1 capture per battle.

As I said, I have no knowledge of this sort of thing so please don't kill me, I'm just trying to help.

However for a wild double battle could it not be ((Speed of both player pokemon divide by 2) x32 / (speed of opponents) divide by 8, mod 256) plus 30 times (amount of escape attempts)

Thus effectively averaging out the wild pokemon to trainers pokemon ratio. If you need me to clarify the formula, just ask.
 
Last edited:

jabberjabber8

../\..
213
Posts
13
Years
I have been away for some time (just over 2 months) when I left we were painfully close to managing this but by the looks of it there has not been a post in this thread for months...

Does that mean wild double battles have been perfected or does it just mean we have given up?
 

Jambo51

Glory To Arstotzka
736
Posts
14
Years
  • Seen Jan 28, 2018
EDIT: Interesting. the video decided to stop working. Look down a couple of posts. Spherical Ice reposted it for me.

This is the latest on Double Wild Battles! Looking pretty good IMO, :D.
 
Last edited:
35
Posts
13
Years
  • Seen yesterday
Would it be possible to generate a double wild battle with another trainer?
Like in DPPt, you can team up with Riley and fight two wild Pokémon with Riley on your side.
 
Back
Top