Welcome back to another Epsilon update! We hope you had a nice start to 2019, and that you are excited for this month’s update. After the many reveals for December and several questions we’ve had from fans, we decided to share a more technical update for this month.
One of the most complex systems in Pokémon is of course the battling. Over 20 years of development and additions to Pokémon has made it so that this system is a large undertaking to replicate. In the last year we’ve made large strides in this, so today we’ll be explaining how this system works.
One of the first things we did for our battling code was splitting up the graphical front end from the logic back end. This means our code can easily be run without any of the graphical overhead, which allows for useful functionality, such as unit testing and machine learning. An entire battle can be run in milliseconds!
After this the actual battle loop is somewhat simple. Each Pokémon chooses what it wants to do; for example, choosing a specific move, switching into another Pokémon, or running away, after which the actual turn runs. The choices are gathered, ordered according to type, priority, and speed, and then run sequentially.
Up until this point the logic for battling was fairly simple. However, battling starts getting more interesting when unique effects, such as those related to moves, abilities, and so on, start to be considered. Without these effects battling would indeed be very bland, and as such each has its own unique flavour.
We thought long and hard about how to handle these effects best. We wanted to make these effects easily accessible and editable to less experienced, starting-up fangame developers, and allow our users to be able to mod these files later on. To accommodate this, we decided to handle these effects through easy to edit scripts. We initially worked with Lua, but its dynamic typing combined with the sometimes complex types in the battle library meant this was harder to work with, and issues often crept into the scripts.
To resolve the issue with Lua, we decided to write a simple new language for this, which combined Lua’s simple syntax with a static type system. This language, called Upsilon, along with its VS Code plugin, makes it very easy to write new effects for battling.
An example effect, specifically for the move Blizzard, can be found below:
Blizzard is a relatively simple move of course, and there exist many more complex moves (as well as many more simple moves).
There exist more of these specific trigger functions for specific individual effects, and it’s fairly easy to add more of these functions as we continue along.
We are currently working on writing all these effects and making sure they all behave as we’d expect them to, using many unit tests, and hope to get all of this done for you as fast as possible.
Are you interested in helping with this undertaking? We are still looking for enthusiastic experienced developers on our team, so apply now!
All reside, confined evermore, until stirred.