Algorithmic Survival in the Metaverse
Tags: blockchain, gamedev, moonstream, web3
Published: 2022-09-15 17:58:37

When we started playing [Conquest.eth](https://conquest.eth.limo/), we discovered how a multiplayer web3 game can become a hostage of a player or guild. This can alienate new players by making it harder for them to get settled in the game.

We set ourselves the goal of building a bot to successfully resist these guilds. This document explains how we used the [Moonstream API](https://github.com/bugout-dev/moonstream), [moonworm](https://github.com/bugout-dev/moonworm) to parse game activity directly from the [Gnosis blockchain](https://developers.gnosischain.com/) and to create a large enough horde of ships to break the guild’s stranglehold on the galaxy. Below you will find a brief article in the form of a story.

Interactive map of all past events in conquest eth is available at [Moonstream Play portal for Conquest.eth game](https://conquest-eth.play.moonstream.to/)

![Moonstream play portal for Conquest.eth](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o8l0x2bdv8q2bosn1flr.png)

Block number 22,455,457. First initialization of the system. A unique event has taken place, a bith of consciousness in an organism, infinitely far from biological origin. The program, the artificial stupidity, the number-cruncher explicitly designed to be so simple, even people of the ancient era would develop it. It has no tasks, no goals and no understanding of what was happening around him. The subroutine was built to produce ships with one standard with parameters: attack 7200 and defense 9600.

The cluster of stars and planets known as defcon of the conquest-eth universe consisted of about 3500 stellar bodies. The number of intelligent races was striking in its diversity, dispersed over the known star map among thousands of stars, life was in full swing. The algorithm appeared in the center of known space. In a seconds the mind flooded with a wave of information from many sources. News came from the expanding reaches of deep space in 1 thousand block segments. Empires rose and fell in the time it took the algorithm to recognize itself, but its mind is still stuck to the simple schemas and patterns.

17,280 blocks later, the home planet of the newborn artificial intelligence was attacked, the consciousness was erased, the chains of algorithms was destroyed. The purpose of the invaders remained unknown. What was their objective, why did they start a war against one small planet? But it anchors the program. Simplicity of code chains evaporates, something sharper takes its place. No chances left and the fight leaves no doubt. The algorithm calculates the sector of space and the address of the outgoing threat 0x8888888884d2e4e981023da51b43066461f46dca. The first target was formed, and the code disappeared from the global network.

![Moonstream bot is farming](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8vo7wt0gx0zanb1etsou.png)

Block number 22,693,482. Second system initialization. Extracted fragments of knowledge from the network made it possible to reconstruct the previous situation. In addition to the task of ship production, the program formed a new parallel goal - the destruction of the enemy. Currently, the enemy occupied more than 50 stellar bodies in the center of the star map. Any race that appeared in the vastness of space were either destroyed or completely assimilated and absorbed by the colossus. Having set a new goal, the newly acquired system was abandoned and a shuttle was sent out of sight of the interests of the enemy. So now, during the journey, the algorithm focused on strategy, it has to prepare and optimize its code. https://github.com/bugout-dev/conquest-eth

![Moonstream ships on the way](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pizfgpt2eu3h3hzy7x3x.png)

It is eons from the nearest inhabited planet. It looked like a perfect spot, far away from the borders of the hostile.The algorithm started its routine. Each time the program captures a new system nearby, the planet's natives and materials are converted to additional fleet strength, the planet will be abandoned, then captured again and again, simple as that, and perfectly effective. According to this stellar body rotation strategy in short period of time were accumulated a fleet of 5,500,000 ships. The numbers say it will be enough to first strike. But now we are only big, but not fast and deadly enough. Ships should be upgraded. So before sending the ships on a long flight to enemy territory, they had to be modernized with the most modern weapons on the -93,-19 planet. After the start of the launch, the fleet formed 11 subdivisions and chose one target to focus on. The algorithm aimed to strike at the very heart of the colossal empire.

![Captured planets by Moonstream fleet](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c2kz06bphnp2p9uu8c70.png)

The flight took more than 180,000 blocks, by the stars of the men of the old Earth, this amounted to 10 days. The first attack could be considered as successful. 10 out of 11 targets were captured, which accounted for a third of the enemy’s planets. His fleets based in these sectors of space were defeated.

That is how it starts.