Pokémon Essentials v18 progress report

Maruno

Pokémon Essentials dev
Essentials Developer
Posts
234
#1
Hi everyone!

This is a progress report for the next version of Pokémon Essentials, which will be version 18. Before I begin, no, I'm not announcing my retirement or anything like that. This really is just a progress report.

The next version of Pokémon Essentials, v18, is intended to be focussed on the battle system. More specifically, the battle system code is being tidied up and rearranged to make it better and easier to work with, and with some new features which this post will talk about.

So what's happening?

1. Tidying up and rearranging

The battle system is currently crammed into just a few long script sections, which makes them tough to navigate. Chunks of code are often in unreasonable places, or at least could be relocated to somewhere better (e.g. duplicated code that can be consolidated). Some battle mechanics don't work quite right, such as the timing for throwing a Poké Ball. Some mechanics I just want to make work differently, such as making a move hit all targets at once rather than one after the other (this is the original reason I wanted to focus on the battle system this time, actually, and making this change took much longer than I expected).

To this end, I've been moving and improving a whole lot of code. I've been renaming and repurposing methods and variables, with the result being that virtually every third party script that affects battles will be incompatible with v18 without rewrites. I know, I know, but that's how it goes.

2. Triple battles and so on

Although I think triple battles won't look good (the screen's too small to reasonably show six Pokémon in battle with their data boxes at once), I decided to improve the code to support triple battles. Actually, I generalised the code completely, meaning not only are single/double/triple battles possible now, but so are 1v2, 3v1, 2v3 and any other permutation of "number of Pokémon on each side of battle". It's entirely possible to have a battle where you use one Pokémon against two opposing trainers who use one and two Pokémon respectively (i.e. it's 1v3).

Higher numbers are also possible with the code (it's completely generalised, as I said), although certain information such as Pokémon sprite coordinates aren't defined if there's 4+ Pokémon on a side, so if you want that many you'll have to add that information yourself. It should be easy enough to do, though.

I've also improved the target-choosing step of using a move to work with all these sizes of battle, and made a proper menu for it (like the command and moveset menus), rather than just relying on making the Pokémon sprite flash (although it'll still do that).

3. Ability/item handlers

Currently the code for held item and ability effects are hardcoded into the battle scripts, and you'd have to go digging around to find one or create a new one. I've taken (most of) them out of the battle scripts now and put then into handlers: standalone chunks of code that live separately outside of the battle scripts. This is not only tidier all round, but will make it easier to make new effects - you can put your new code in a new script section so you can easily keep track of it.

4. Animations

I've rewritten a bunch of hardcoded animations, such as Poké Ball-throwing, the battle scene appearing at the start of battle, data boxes appearing and disappearing, that kind of thing. They used to be shown in several different ways, which was inconsistent, but now they all use a common animation format which I adapted and improved upon.

I've also improved on some of these animations. Thrown Poké Balls get a better trajectory, HP and Exp bars fill up much more nicely now, and some animations have been combined as it turned out they were basically the same thing. Oh yes, and there's now support for the Pokémon sprites performing a one-off animation when they enter battle (technically playing the Pokémon's cry is a part of this).

5. AI

The AI has been moved out of the main battle class into its own. Little bits of it have also been rewritten, such as when it chooses whether to use an item instead of a move. It now knows how to use many more items (but having said that, the extra items are just variants of ones it already knew how to use, like all the Full Heal-type items). The battle system now also uses the same code for item usage as the player's items use, so you no longer need to code in item effects twice just because you want the AI to use them.

6. Lots of other things

I've changed so much of the battle code, and I've made other improvements and bug fixes I'm not going to describe in this post. At the bottom of this post is a link to a detailed change log of what's been done so far.

It's highly likely that I've fixed some bugs without knowing it. It's also likely that I've created all-new bugs instead. That's why I'll be opening up Essentials v18 for testing before its official release, to track down and fix problems beforehand.



Since this is an update post and not a release, it makes sense that I haven't yet done everything I want to do for Essentials v18. So what hasn't happened yet?

1. Gen 7 move/item/ability effects

I just haven't done this yet. It makes sense to hold off until I've finished rewriting the various scripts that will be involved with the Gen 7 effects. I do want to do these, though.

Conversely, I'm ignoring Z-Moves. They're stupid anyway, and I can spend my time on better things instead.

2. Battle parameters

These are things like "make it a double battle" or "forbid capturing the Pokémon". Extra rules that apply to the battle. I've got a big list of the ones I could think of, and I want to implement a decent way to use them. My plan is that you'd queue up battle parameters (in much the same way as you queue up what BGM you want to use for the next battle) and then the next battle makes use of them all. In a similar vein, some parameters could be put into trainers.txt (e.g. instructions for which Pokémon to use first/last).

I'm on the fence about this one. They're low priority, at least, and I may end up foregoing them just to save some time.

3. More information

I had the idea a while back of making a panel appear when choosing a move to use, which displays information about that move (power, accuracy, description, etc.). You'd be able to show or hide it, of course. Turns out that's a feature in Gen 7. Never mind, I'd like to add it anyway. However, it's not necessary and that makes it low priority, and again I may skip it to save time and bring out the release sooner.

I also want to create the ability splash panels (those graphics that pop up indicating that a Pokémon's ability has triggered). I just haven't started on these yet.

4. Superfast mode

In the Options screen there's a way to turn off (some of) the battle animations, but that's all it does. I wanted to see if I could implement an "even faster" mode to appease the people who have been spoiled by accelerator buttons in their emulators. I'd cut down everything I could think of to the bare minimum to get as much speed as possible. Naturally, this would take some time to implement, and I'll probably drop the idea for now for that reason.

5. Finish off what I said I've done

While I've listed things I've done above and in the change log (see below), some of those things I haven't completely finished. A few animations (such as fainting) haven't been rewritten yet, other animations could do with polishing, rewriting and optimising code is an ongoing process, a number of ability/item effects haven't yet been transcribed into handlers, etc. There's also a lot of testing to do, which I'll rely on the pre-releases for.

I also have about 15 pages' worth of notes about things that need doing before v18 can be called finished (and they're only the things I'm currently aware of).



I'm fully aware that it's been over a year and a half since the last version of Essentials came out. Believe me, it frustrates me more than anyone that it's taking so long, and I can only say that overhauling the battle system is a big project and I have a life to lead as well. I'm torn between cutting corners to get a quicker release and, well, not cutting corners. As I mentioned, for v18 I plan to have some (semi-)public testing before the actual release, but I just don't know when that'll happen.

You can read the full change log (of what I've done so far) for v18 here: https://pastebin.com/8wXtaHaC

Regards!
 

Luka S.J.

Wastage of Time
Member
Posts
87
#2
Gotta say, I'm excited for everything listed above! While I have the personal stake of having most my work for the battle system being completely trashed :D I feel this adds even more opportunities and potential to expand and expand. I guess I'll have to crawl back out of my hole for a bit once v18 drops. Looking forward to it!
 

JoelMatthews

Pokémon Nebula Dev
Member
Posts
6
#3
Don't worry about the wait. You're doing this entirely for free and from the looks of it, you've been hard at work. I'm excited to see what you've done and thank you for your dedication! ^_^
 

Hollow_Ego

Trainer
Member
Posts
76
#6
That is super exciting! I'm really looking forward to the changes in the battle system.

I'd like to volunteer for testing!
 

Maruno

Pokémon Essentials dev
Essentials Developer
Posts
234
#8
That's nothing like what I'm intending for the superfast mode. Simply increasing the frame rate doesn't solve anything; the game itself is the problem if it's too slow. Not that I think the battle system is too sluggish - superfast mode is just a courtesy for anyone who's only intent on grinding and wants to save time doing so.

Plus the battle animations are no longer sped up by having a higher frame rate anyway, so Klein's script will do nothing.
 

FloofyPanthar

Doing it myself and it still isn't done right
Member
Posts
51
#9
That's nothing like what I'm intending for the superfast mode. Simply increasing the frame rate doesn't solve anything; the game itself is the problem if it's too slow. Not that I think the battle system is too sluggish - superfast mode is just a courtesy for anyone who's only intent on grinding and wants to save time doing so.

Plus the battle animations are no longer sped up by having a higher frame rate anyway, so Klein's script will do nothing.
I think that speedup mode should be a debug feature, for developers to quickly get to the part of the game they want to test
 

DerxwnaKapsyla

Overseer of the Abyss
Member
Posts
55
#11
I think that speedup mode should be a debug feature, for developers to quickly get to the part of the game they want to test
The whole reason Speedup Mode would be implemented is for the people who are so used to having a turbo button in emulators. Restricting it to a developer-only/debug tool seems counter productive to that.
 

Thunder

Novice
Member
Posts
10
#12
The whole reason Speedup Mode would be implemented is for the people who are so used to having a turbo button in emulators. Restricting it to a developer-only/debug tool seems counter productive to that.
Devs can probably turn it off if they don't want their players to have access to it.
 
Top