Exciting new information regarding Pixelmon!
User avatar
By DanielN
#241378
IntroductionIt has been almost 12 months since the last written update we did on the waiting glitch and what we were doing to combat it. Since then, we have seen reports of the waiting glitch drop down to almost none with only three known sources of the glitch remaining (all of them being caused by non-battle issues) most of which are actively being tackled. This first big push into combating the battle glitches in Pixelmon was a resounding success, and since then we have been trying to continue that work and as such improving the quality of battling as a whole in the Pixelmon experience.

So, what have we been doing to improve battles over the last year? At the end of the last post we identified that, the erroneously named, “unit testing” was the way forward. This was a mistake, as what we intended to identify was not specifically unit testing, but integration testing. The key difference here is that unit tests are designed to test things in isolation, whereas integration tests are for testing the interactions between many different components. Whilst our specific wording may have been incorrect, our intent was the correct one and since that post we have made hundreds of tests for various different parts of the battle engine, and a year after our first dev blog we have reached over 600 battle tests. These tests ensure that Pixelmon battles function as intended, such as checking abilities work, or moves do the correct amount of damage for the specific circumstance presented.

Here is a list of a few, of the many, battle bugs that we have found through writing our tests that were previously unidentified:
  • Imposter applying after Neutralising Gas leaves the field
  • Fixed ShieldsDown blocking all non-entry hazard statuses
  • Fixed owned Minior not changing to core form when out of battle
  • Fixed SlowStart not resetting count when NeutralizingGas disappears
And many, many, more.


Continuous Integration (CI)During this period we also released Pixelmon on the latest version of Minecraft for the first time in over five years. With this monumental achievement we also gained access to Mojang’s new Game Test suite. This system allows you to visualize tests in game, and also run a Minecraft server specifically with the task of running all the game tests. This is important as this allowed us to integrate the battle tests, and all of our other game tests, into our CI.

What is Continuous Integration (CI)? Continuous Integration is the practice of continually integrating code changes into a central place collaboratively. By integrating changes often, we can then test them together to ensure the end product functions as expected from the average player's perspective. To do this, we use a tool that we call pipelines, which trigger any time a developer uploads a change to the Pixelmon project.

This has been a big step forward for us in regards to battle stability. When a developer uploads their changes, we have our game tests run against it, ensuring the most fundamental parts of Pixelmon are working, even before we move to the manual testing phase. We also run each of our battle tests 1,000 times, which ensures we cover a lot of potentially unexpected behaviors, and randomness. For instance, these help cover situations that might change if you execute a critical hit, or if specific abilities have different, exceptional interactions together, which weren't previously observed before. Therefore, every time we make a change to the battle code, we simulate over 600,000 battles, and all in the span of less than 10 seconds.


Additional ImpactsWhilst this post is mainly focused on how we are improving battling for Pixelmon, and what we want to do going forward, it is important to acknowledge that the introduction of these game tests has also had impacts on other areas. For example, in the second half of 2023 we introduced a game test that attempts to load historic party and PC storage from every version of Pixelmon that we’ve released since August. This allows us to ensure that huge breaking issues, such as parties or PCs failing to load, are far less likely to happen in future releases we make. We've also implemented testing around simple things like catching Pixelmon to ensure we don't accidentally break commonly used functionality unexpectedly. This has been another huge step towards creating a much more stable, and reliable Pixelmon.


Next StepsOur first step going forward will be to continue expanding our extensive suite of tests moving forward. Whilst we are extremely proud that we have managed to write 600 battle tests and nearing 300 other game tests in just the last 5 months, our ambitions are much greater than that alone. We first want to make sure that we cover as much of the battle engine with testing as possible, to ensure that when we make large changes to the engine in the future we can be extremely confident that nothing has broken between versions.

Something that we feel is lacking, that doesn’t strictly impact the stability of the battles, is the user experience of battling in Pixelmon. Once battling is at a point of unparalleled stability an important goal is to make sure that our battle UI matches that stability, and improves the experience of battling as a whole. Whilst it is important for battles to function well, there’s no point in them functioning at all if they don’t look good or are not easy to use.

Following that, we are looking at making battles more extendable using the datapack systems that we’ve been utilizing so extensively for everything else. This starts with smaller things, such as introducing datapackable types, but then extends to much larger projects such as datapackable moves, abilities and held items.

Finally, the ultimate goal is still to make a system that can be replayed, and work in a transactional fashion for the optimal debugging and reviewing experience. However, this is a much longer term goal and is on a much different scale in terms of difficulty.


ConclusionOverall, battles in Pixelmon have come a long way over the last year and it is exciting to think where they may be at the end of the next. We will still continue to improve the stability and experience, whilst expanding with the new features as they come out. If you think you could assist us in our goals as you have unique battling knowledge then please apply to our team here.

JOIN THE TEAM