• 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.

Development: New Battle System

Blah

Free supporter
1,924
Posts
11
Years
I don't have much time to assist on this, but I do have one question.

Will the features involved be compatible with trainer editors? What I'm wondering really, is how will we call upon the newer battle styles?

This is a great project and it could change the whole field of hacking. Good luck in it and I hope you receive adequate help. :)

Yeah, so I'm going to be using a lot of the default tables for this stuff. I might make it read from a second seperate table to toggle certain flagging bits in the battle sequence. That way you edit your standard trainer battles via tool, and added special flags can be done with a hex editor quite easily.

This a great concept! Plus, it allows full control over the source. And programming in C is much more easier than doing ASM.
I would like to actively contribute to this resource, but few exams are remaining.
But I managed to get some time looking at the damagecalc code and found some bugs:
Spoiler:

Wow, thanks a lot. I really have no idea how half of these mechanics work, and I misinterpret bulbapedia a lot. Doesnt has been my go-to PokeDictionary for this sort of stuff, but obviously I try not to bother him with a lot of questions. I'll get to fixing these, and once again thanks for looking through and pointing them out :D

Perhaps, there's a tutorial on how to install these features

People are free to write tutorials if they want. But as far as I'm concerned all you need to do is:
Code:
cd path
python scripts/build
python scripts/insert
Into the terminal. So it's kind of straight forward.

Wow, this looks awesome! Do you think it would be possible implement a capture styler option where you can catch pokemon pokemon ranger style?
My first thought of that was that it sounded stupid, but to be honest you could get more diverse hacks from that.

So unfortunately, the GBA doesn't have a touch screen, and as such this style of capturing is physically impossible to implement. You could write your own emulator and make it possible to use your mouse as the stylus, but at that point it's not a GBA game and you should probably just make a new game, rather than a hack.
 
3,830
Posts
14
Years
  • Age 27
  • OH
  • Seen Feb 26, 2024

Blah

Free supporter
1,924
Posts
11
Years
I've checked a bit of your code. Sadly I don't program in C, though there some things I caught that might be improved :
Spoiler:
Spoiler:
 

Blah

Free supporter
1,924
Posts
11
Years

BLAx501!

Pokemon Flux
80
Posts
10
Years
To current date, people have offered to contribute, even asked for details, but I've yet to receive any dev. help as of yet.

I'm very busy with university these weeks, but I'll try to take a deep look to your Git, I'm not a total noob on C programming, so maybe there is something I can help :P
 
204
Posts
9
Years
  • Age 37
  • Seen Jul 26, 2021
i cant help with programming, but i migth can help with the ai, in pokemon showdown i reached top 3 on the normal ou ladder once and top 10 in random battles once.
 

Blah

Free supporter
1,924
Posts
11
Years
I've fixed all the stated errors, put in as much tool compatibility as I could (though I didn't do the life orb thing yet...sorry :D). It will actually compile now. If you see more random errors let me know. Currently working on the setup and graphical starting and such of the battle.


Read if you have time but don't know C or ASM & are interested in helping:
Spoiler:


EDIT: If you have suggestions for algorithms for certain things those are welcome to.
 
534
Posts
11
Years
  • Age 26
  • Seen Jul 24, 2023
I've fixed all the stated errors, put in as much tool compatibility as I could (though I didn't do the life orb thing yet...sorry :D). It will actually compile now. If you see more random errors let me know. Currently working on the setup and graphical starting and such of the battle.


Read if you have time but don't know C or ASM & are interested in helping:
Spoiler:

EDIT: If you have suggestions for algorithms for certain things those are welcome to.

Should the tables be in hex (hex editor format ie. FF FF FF FF) or just like 0xFFFF 0xFFFF or is there any other table format?
 

Blah

Free supporter
1,924
Posts
11
Years
Should the tables be in hex (hex editor format ie. FF FF FF FF) or just like 0xFFFF 0xFFFF or is there any other table format?

Neither.
Make a text file like this one https://github.com/EternalCode/Battle-System/blob/master/src/Defines/generation/pokemon
Note your text file could be neater, if you want an easier python program. I just copy-pasted this one from Wikipedia. After you get your text file set up, make a program (python preferably) which converts the contents of the text document -> a file with the hex string for the table.

The idea is to have a text file which is easy to edit that you apply the python script on, then you produce the table. That way in future, editing these tables are as simple as editing the text file and re-compiling.

I know it seems a little complicated, but if you make the first text file, I will write the python script (unless you can which would be great).
 
Last edited:

PokemonBen

Kanto Champion
60
Posts
8
Years
  • Age 24
  • Seen Apr 27, 2020
Are you wanting some do this for every move? Pretend this is tackle:

struct move_table {
u8 script_id; 5
u8 base_power; 50
u8 type; Normal
u8 accuracy; 70%
u8 PP; 15
u8 effect_accuracy; ????
u8 affected_targets; Single
u8 priority; ???
u8 contact : 1; I assume 0=no 1= yes
u8 protect : 1;
u8 magic_coat : 1;
u8 snatch : 1;
u8 mirror_move : 1;
u8 kings_2,k : 1;
u8 crit_chance : 1;
u8 padding_field : 1;
u8 is_special; 0
u16 move_id; 5
};

EDIT: Also that list has 720 Pokemon, isn't there 721?
 
218
Posts
10
Years
  • Seen Nov 12, 2021
Damage calculator doesn't handle this sort of thing. It simply just calculates damage.



Maybe later, it would've been nice to know the item table had a field like that before I made this code :x



This is definitely better, good catch.



That's a temporary solution. In one of the header files I've made some settings to use a table instead of this way, but I haven't gotten around to making the actual table so a switch statement was put for place-holding. I'm waiting for contributions for this kind of thing :D

To current date, people have offered to contribute, even asked for details, but I've yet to receive any dev. help as of yet.

For the first one, knock off get a 1.5 multiplier if it manages to knock an item
 

GOLDstandard

Eclectic
51
Posts
10
Years
Hey,

I'm impressed with how much work has been done. I don't know C but I do code and the damage calc looks honestly amazing. I'm curious how this engine will work in terms of emulating the game? Does this engine function as an emulator? Or will we still use VBA?

Edit: On lines 290-310, shouldn't the checks for species come before the check for move_type? Just a small nitpick, but it would increase the efficiency, since there are so many more times where, for instance, a water or dragon type move will be used when it's not palkia, than when palkia uses a non water or dragon-type move. It just breaks sooner if the species check is first I believe

Also, in the same file, at 948, natural gift changes the attacking type as well as the base power.
 
Last edited:

Blah

Free supporter
1,924
Posts
11
Years
Are you wanting some do this for every move? Pretend this is tackle:

struct move_table {
u8 script_id; 5
u8 base_power; 50
u8 type; Normal
u8 accuracy; 70%
u8 PP; 15
u8 effect_accuracy; ????
u8 affected_targets; Single
u8 priority; ???
u8 contact : 1; I assume 0=no 1= yes
u8 protect : 1;
u8 magic_coat : 1;
u8 snatch : 1;
u8 mirror_move : 1;
u8 kings_2,k : 1;
u8 crit_chance : 1;
u8 padding_field : 1;
u8 is_special; 0
u16 move_id; 5
};

EDIT: Also that list has 720 Pokemon, isn't there 721?
For the move table stuff check out this convo: http://www.pokecommunity.com/converse.php?u=471720&u2=365518

For the first one, knock off get a 1.5 multiplier if it manages to knock an item
added~

Hey,

I'm impressed with how much work has been done. I don't know C but I do code and the damage calc looks honestly amazing. I'm curious how this engine will work in terms of emulating the game? Does this engine function as an emulator? Or will we still use VBA?

Edit: On lines 290-310, shouldn't the checks for species come before the check for move_type? Just a small nitpick, but it would increase the efficiency, since there are so many more times where, for instance, a water or dragon type move will be used when it's not palkia, than when palkia uses a non water or dragon-type move. It just breaks sooner if the species check is first I believe

Also, in the same file, at 948, natural gift changes the attacking type as well as the base power.
So the battle engine is a replacement to the one that's currently in Fire Red. You build this version and replace the one that's currently in the ROM. So to answer your question, you'd be able to use your favourite Emulator or console to play a FR ROM with this engine inplace.

Yes, Natural gift and a few others are place holders until I get some tables working inplace. Fling, Natural power, mold breaker, sheer force, iron fist ect, will be using tables in the near future.

As for the comparison thing, you're totally right if I were deriving these values on each loop up, but they're pre-derrived. Also It'd only hit that part of code if the Pokemon is holding lustrous orb (which would be strange for anything that's not a Palkia).

Sheer Force Table:
Spoiler:


Perhaps not exactly the format you want, but I had it so I post it
So...I can't use this without a second reference file. How would I associate Move names -> Move IDs (which is needed to make the table)? I'd first have to generate my file for my #defines for moves, then use that to replace the move names here before finally converting. I was looking for something more like this:

Sheer Force Table:

Move_name Move_id
Move_name2 Move_id2
... ect
Thanks though :o

---------

Well, I managed to finish doing the set-up for the battle structs today. You can checkout which battle modes are supported by default (ones I'm coding atleast, if you wanted to, you could add your own). https://github.com/EternalCode/Battle-System/blob/master/src/battle_init.c

Finally, a note, if you're working on something, please let us know in the thread that way we don't overlap resources. Not that anyone is working on any code except me right now :c.
 

PokemonBen

Kanto Champion
60
Posts
8
Years
  • Age 24
  • Seen Apr 27, 2020
I see, I don't know Hex so I cannot help you with moves as I have idea how 0x23 = 40. However, if you need help with HTML... :P
 
325
Posts
10
Years
I see, I don't know Hex so I cannot help you with moves as I have idea how 0x23 = 40. However, if you need help with HTML... :P
Use an online dec -> hex converter. Hex, binary, and decimal are just different ways to show numbers, and hex is easier to work with for this kind of stuff. Hex is base 16 (0-F), decimal is base ten (0-9), and binary is base two (0-1). You can't learn hex because it's not a language, just a better way to show certain things in the ROM.
 

PokemonBen

Kanto Champion
60
Posts
8
Years
  • Age 24
  • Seen Apr 27, 2020
Use an online dec -> hex converter. Hex, binary, and decimal are just different ways to show numbers, and hex is easier to work with for this kind of stuff. Hex is base 16 (0-F), decimal is base ten (0-9), and binary is base two (0-1). You can't learn hex because it's not a language, just a better way to show certain things in the ROM.

I see, I know Binary (or at least 0=no, 1=yes.) But thanks for tips.

Edit: @FBI Is BluRose helping you with the moves? Just started doing Absorb but don't want to have no point to it.
 
Last edited:

Blah

Free supporter
1,924
Posts
11
Years
I see, I know Binary (or at least 0=no, 1=yes.) But thanks for tips.

Edit: @FBI Is BluRose helping you with the moves? Just started doing Absorb but don't want to have no point to it.

I don't know if he'll actually do it. I haven't been informed. Maybe you should start from the bottom up, likely he would've started with pound.
 

PokemonBen

Kanto Champion
60
Posts
8
Years
  • Age 24
  • Seen Apr 27, 2020
I don't know if he'll actually do it. I haven't been informed. Maybe you should start from the bottom up, likely he would've started with pound.

Dunno what list he'll be using then, was going to do it in alphabetical order using Pokemondb.net list of attacks in Pokemon.

I do have some questions. Could you tell me where to find the hex values for move types? Like in your Pound example, 0x00 = normal. Also, I get the Bitfield to binary but how did you calculate Bitfield, I don't know what that is.

Edit: Forget that bit field, I think I know how to work it out. I'll explain when I give you my first example.
 
Last edited:
Back
Top