![]() |
New Battle System
Battle engineHello, I created this project because I didn't like the way that generation III's battle engine by GameFreak was programmed in an algorithmic sense. I find it very inefficient, cluttered, and hard to modify as a ROM hacker. The idea of having an updated engine with C source code is very appealing and as such I've made this project. Contributions are welcomed and encouraged! Feel free to ask for any help you may need. How it worksFirst of all here's a Youtube video explaining, if you prefer that. A shorter text version will follow incase you don't wish to watch the video. Spoiler:
GameFreak's battle engine has it's checks and edge cases card coded directly into the engine which leads to some sloppy code. I seek to improve upon this by pushing responsibility of edge case handing to the moves themselves and having the engine be just a skeleton in which to run moves. You can think of it like a T.V (the base engine) which plays DVDs (moves). To do that, I've basically allowed moves to "interrupt" the normal chain of events which looks like this: 1) Check faster Pokemon 2) Faster Pokemon try to use move (accuracy checks ect.) 3) Calc damage 3) Apply dmg + recoil + drain 4) Do effect - status moves effects like baton pass for example 5) Apply secondary ailments/stat boosts from move 6) Start from 2) but with second Pokemon Basically a certain place in these steps (which are actually many smaller steps), the battle engine will check to see if the move has something called a callback which it wants to execute at that point in time. A callback, in this context, is essentially a function which the main engine is going to call and execute. The callback is written from the move with no context of what's happening in the engine itself other than time of execution. Some of these move callbacks are:
For specifics on when they run refer to the video. Names are kind of self explanatory. These callbacks are included as fields inside the move table for this engine, similar to PP, Accuracy and Base power for example. Moves remaining to be doneYou can find a list of them categorized over here: https://github.com/EternalCode/battle_engine/issues If you're just starting out, or have no programming experience, the moves under the "Easy Difficulty" section are still very possible for you! Quick Guide to BuildingI made a quick video to show someone how to build and get your hands on the project. The Readme.md file for the project is essentially a text version of the video I'm posting. I've done it in video format for those who requested it. Link to Readme: https://github.com/EternalCode/battle_engine/blob/master/README.md Vid: Spoiler:
|
Hmm, this seems pretty interesting, I can't believe there is no comments in here... I would love to help with this, but although I know some C programming from university, I've never done something like this. If there is anything I can do, I would be happy to help :3
|
I think I can help. My main goto language has been C for years, and I've dabbled in ASM programming, both inside and outside the Pokemon Hacking Community. PM me or reply in the thread if you want my help.
|
This sounds great!
|
Quote:
Quote:
http://chat.linkandzelda.com:9090/?channels=rh Join, and see if someone named FBI is online (that's me!). If I'm there type my name in the chat and I'll respond with more info. Quote:
-- Maybe I'll make update posts here on what's needed to pending work - work that needs doing. Or would it be preferred if I just dumped everything on my Github and had people contribute that way? Github is normally the way to go, but I don't want to gimp community participation by introducing version control software. We'll see how it goes, I'll probably use git for myself and have the other things in this thread. We can have both. |
I would prefer you to make update posts on here. Just giving a list of completed, in-dev and planned features.
|
Quote:
|
Quote:
Quote:
--- I'll edit the OP with stuff regarding the project soon~ |
Nice one! I am a noob when it comes to stuff like this so I have to ask how this will be implemented? It doesn't sound like it with be with Software so we can check/uncheck features and it doesn't feel right for it to be in an IPS patch. But I just check the thread and you are writing it in C so am I right in assuming that you will be releasing this as a software?
Sorry for the idiot question, many facepalms must be going on now. |
Awesome! ^O^ I was just thinking of creating a new battle system that is script-based but yours is so much better! (Which will mean my hack will be delayed more. Hahaha!) Happy hacking! ^O^
P.S. It would be awesome if it can support sideview battles for un-Pokemon Hacks. :D |
Quote:
|
Thanks for the reply, just went and checked the thread and I have seen it says 'Easy flexibility to add and delete things' so I should have have known. Trying to learn C# right now, but if you want to learn programming on the Internet, you really do need dual monitors.
|
Wow, this is an incredible undertaking!
I would love to help in any way possible, but I don't exactly know how to program in C (or really at all for that matter), haha... I wish y'all luck nonetheless! I look forward to the day that I can contribute to this meaningfully! |
Quote:
I might include a patch as well, but I'm unsure if I want to download LIPs or something yet. Quote:
Quote:
Quote:
--- So some updates here on my end. I finished the damage calculator mostly. Some of the names I use in the file are invalid because the associated #defines files have yet to be created. I've also written some scripts which generated #defines for moves and abilities. I'll make one for items shortly. You can see source here if you're interested: https://github.com/EternalCode/Battle-System EDIT: Also did the same for items, weather and types. You can add these files to you XSE if you wanted (https://github.com/EternalCode/Battle-System/tree/master/src/Defines) :D |
Nice to see some quick updates!
|
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. :) |
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:
|
Quote:
|
Wow, this looks awesome! Do you think it would be possible implement a capture styler option where you can catch pokemon pokemon ranger style?
|
Quote:
|
Quote:
Quote:
Quote:
Code:
Quote:
Quote:
|
This is a great idea! And you've been working on it very quickly.
I'm no C expert but if I see something I can do I'll surely give it a try. Also, after taking a quick peek through the damage calculator, I noticed that in get_base_attack you never actually check for the soul dew, but rather apply the bonus to all [email protected] https://github.com/EternalCode/Battle-System/blob/master/src/damage_calculator.c#L1361 (line 1361) |
Quote:
Quote:
Quote:
Quote:
To current date, people have offered to contribute, even asked for details, but I've yet to receive any dev. help as of yet. |
Quote:
|
Quote:
|
| All times are GMT -8. The time now is 8:40 AM. |
![]()
© 2002 - 2018 The PokéCommunity™, pokecommunity.com.
Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2016 The PokéCommunity / PokéCommunity.com.
PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator.
Acknowledgements
Use of PokéCommunity Assets
vB Optimise by DragonByte Technologies Ltd © 2023.