The next chapter for Niantic’s Pokémon Go involves borrowing another popular element from the game series’s main installments: battling. The new trainer battles feature has been a long time coming. It was first teased with the game’s announcement more than three years ago, and it’s taken the company quite a while to get it in working shape. Niantic released some new details about the feature last week on Twitter, but at a recent press event in San Francisco, the developer broke down exactly how the new battle system will work when it launches globally later this month.

Essentially, trainer battles will be quick, roughly four-minute bouts between you and another player using three pokémon each, with the opportunity to switch between the three mid-battle. A short timer determines how often you can rotate those fighters. The other big factor will be the new leagues, with the choice between the great, ultra, or master leagues that determine how powerful the creatures you use can be, which are measured by the combat power (CP) rating.

Trainer Battles will feature two teams of three pokémon each facing off

Niantic says you’ll be able to earn up to three rewards per day by battling other human trainers, and you can also use battles to progress toward in-game medals and train your pokémon to become stronger. One of the rarest rewards from battling will be the elusive Sinnoh Stone item, which can be used to evolve certain monsters into more powerful versions from the fourth generation of Pokémon games, support for which was added back in October. There will also be a training mode you can use freely throughout the day to practice and continue powering up your pokémon with no restrictions.

One big catch is that you’ll need to be physically in the same location as another person to battle them. Like with trading, gym battles, and the many other social and outdoor aspects of the game, trainer battles will require you to physically talk to the person you want to fight against. The way this restriction is imposed is by requiring that another person’s battle code is physically scanned. Only then can a league tier be chosen, ideally through verbal agreement, and an invite sent. (Niantic is careful to stress that battle codes can’t be digitally copied or scanned from a photo.)

The battles will involve similar mechanics to raid battles, in which a series of taps initiates your basic attack and fills up your charge attack meter. Niantic is adding a new element here where you can unlock a second charge attack and choose between them, with energy being drained from a shared meter.

Like in the main Pokémon games, type effectiveness — like a fire attack working better against a grass-type pokémon — is designed to be a huge factor, and it can swing battles in one direction rather quickly. It should also be noted that these are not turn-based battles like what most Pokémon fans might expect, but real-time ones. The few exceptions there are for brief pauses in the fight for charge attack animations and defensive shield items for blocking those charge attacks.

There is one workaround for remote battling that Niantic designed specifically for close friends and family. Unlike trading, which is a rather passive transaction, Niantic wants battling to be something you can do to stay in touch and engage with others, even over long distances. So if you’re an Ultra or Best Friend with another player, a designation that says you’ve been friends with that person for either 30 or 90 days, you’ll be able to initiate a remote battle.

You’ll only be able to remote battle over the internet with close friends

Niantic says that when the feature launches sometime before the end of the year, it will start with players who are at the max level of 40. But as it brings more server infrastructure online to handle the load, battles will be brought to lower-level players incrementally, and Niantic doesn’t expect the rollout to take too long unless it hits some serious snags. Like with trading, Niantic is restricting the battling feature to users 13 years of age and older, which is in line with restrictions for nearly every game, social network, and similar online product due to the US’s online child privacy protections.

It’s easy to see the huge potential battling has for Pokémon Go. Niantic isn’t designing it at launch to be an ultra-competitive game mode, but the franchise contains a lot of built-in lore that could be used to make battling a core pillar. Niantic could launch a tournament series as seen in the anime, and it could also go so far as to have Elite Four standings, a fixture of the games in which the four best trainers from a fiction region are crowned and compete to keep their titles.

Niantic has no immediate plans to launch an official tournament series, the company says, and it’s going to gather player feedback before it decides to do anything formal. But because there is the existing Community Days events and the annual Go Fest gathering, Niantic says it’s “very much looking to seeing how trainers organize in the real world and create tournaments of their own within their local communities.”