Though Dark Souls was released in 2011 and Dark Souls 3 is only a few months away, the community hasn’t moved on. Recently, someone created an AI for PvP combat to invade other players and totally wreck them. Meet...The King.
Here’s a trailer made by Pokashine.
Created by Dark Souls fan metal-crow, The King is the result of 10 months spent reverse engineering From Software’s hardcore action game.
“Only a few hundred, dedicated, and at this point extremely skilled, people remain who regularly PvP,” wrote metal-crow on reddit. “I don’t know how much longer the game has before the online audience becomes too low for random battles, but I wanted to give perhaps the greatest game ever made the send off it deserves. A sentinel, the final guardian of this game. Something that can surpass any human in a duel.”
metal-crow has released the source code, allowing other people to unleash other AIs into the world.
They’re also going to continue work on The King, trying to make it deadlier.
“There are plenty of bugs and imperfections in the AI, and it’ll likely be beaten,” they wrote.
If you’d like to know more about how metal-crow created this, there’s a deeper writeup in the game’s source code. Here’s an excerpt:
“In order to have the AI do anything, i needed to be able to feed it data about the game state. The simplest and most direct way of doing this is would be to have it watch various variables in the game code, such as the enemy’s x and y location, and then use that with the AI logic. However, since the game’s code isn’t open source, i needed to reverse engineer anything i wanted to use.
The first step i took was finding the basic variables i knew i needed, and were the easiest to find. By using a second computer, i could connect to myself and have a test enemy player i could work with. Using the program Cheat Engine, which is a powerful debugging and memory scanning software, i was able to quickly find the enemy’s x and y location variables, and a few other simple values. Running a pointerscan on these values and cross referencing these scans, i was able to find the executable base address that the game always used for to point to the enemy struct, and the pointer paths to the variables.”
Never change, Dark Souls fans.
You can reach the author of this post at firstname.lastname@example.org or on Twitter at @patrickklepek.