# Introduction to Sovrun

## What is Sovrun?

Sovrun is a blockchain platform that leverages Hyperliquid’s high-performance L2 and EVM-compatible chains to power fully on-chain games and autonomous worlds AI-driven Web3 gaming solutions with provable fairness at its core. Backed by prominent investors such as a16z and Delphi Digital, it integrates blockchain technology, cutting-edge artificial intelligence (AI) agents, and modular infrastructure to create scalable, decentralized gaming ecosystems that ensure transparent and trustworthy player experiences across multiple chains. Powered by the SOVRN token, Sovrun empowers players and developers with unprecedented control and ownership, paving the way for autonomous worlds as a long-term vision.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfUfJM18pZC3wafQJ-ePVGzBaRmtmEAnixqYd5UP_cPOwd3LPU4pasc7sj3YMsgPej5XiuIG0Ic6lQFGrdCkBziBWIoAgQryHr5IJO8ng6SK3nuXTvcKIJF8psHFMB7C-1dtY17LA?key=weo2vl887S6ZT9ibnwfRY5gJ" alt=""><figcaption></figcaption></figure>

## Vision

Sovrun aims to forge perpetual, community-owned gaming worlds that address and redefine Web3 gaming by delivering provably fair, AI-enhanced experiences across Hyperliquid L2 and EVM-compatible chains that solve the “End of Service” problem plaguing traditional gaming. By enabling communities to sustain and evolve games through decentralized tools and engage with dynamic, AI-driven gameplay and transparent systems powered by the SOVRN token’s economic incentives, Sovrun ensures that players’ time and investments endure, with autonomous worlds as a future horizon. Chain Tactics is fully open source and is quickly expanding across multiple EVM compatible L1 & L2 chains.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXe8cEjesMgcyOkaXMM0WsoIm9j1xFhyKqUCqBejZ6I7JdCOXMYBg_y-1nJR6AGgpsfMVk8bzxNPAVoBfBxKs9bS429ukFXrHHKMvGWH3CFh8LNiziL5VGwQ5L4UEm3L_fzFIjFL?key=weo2vl887S6ZT9ibnwfRY5gJ" alt=""><figcaption></figcaption></figure>

## **Autonomous Worlds**

Autonomous Worlds (AW) are decentralized, on-chain gaming ecosystems tailored to specific genres and player experiences, built through a multidisciplinary process of platform selection, game design, infrastructure development, and community engagement. They represent a revolutionary model in blockchain gaming, enabling rules, assets, economies, and more to operate entirely on-chain.&#x20;

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfbLCrfrVefQH9Q_uyW_on1bai5IUTqzXS_loysoe14zOmNB-Xc6AeHF6tPo1ZhierAPB_Mq2YH74AfjbqlVWUsW6hJBok8ScIbkahl46pQ4Rc1cm_xJLlJV2wuKLFAX6Cd7MQVrw?key=weo2vl887S6ZT9ibnwfRY5gJ" alt=""><figcaption></figcaption></figure>


# Autonomous Worlds

### Autonomous Worlds: Sovrun’s Foundation for Co-Creation

Autonomous Worlds (AW) represent a revolutionary model in blockchain gaming, elevating the gaming experience by enabling key elements—rules, assets, economies, and more—to exist and operate entirely on-chain. Unlike Fully On-Chain Games (FOCG), which prioritize immutability and trust, Autonomous Worlds (AW) incorporate modular, dynamic elements that foster continuous, community-driven development. AW enable communities to modify and evolve game rules, assets, and economies, creating adaptable gameplay unrestricted by centralized governance. Through Sovrun’s AW architecture, supported by staking SOVRN tokens for development access, players and creators become architects of their virtual worlds, shaping them in unprecedented ways.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXe0c0rtly94OBXOBFSa8ToUL_mLd5HjvhchMeNpsE1Kmp_I8yiUS19z5Trj4aV1ojqPsjUaJ0kEm0pspC9MkZpyRCRqjM3Aa6KC1bmG5G7D7-N_1gmPUqJ_tQbyZPxrKwqUlpsG2Q?key=weo2vl887S6ZT9ibnwfRY5gJ" alt=""><figcaption></figcaption></figure>

AW enable communities to modify and evolve game rules, assets, and economies, creating adaptable gameplay unrestricted by centralized governance. Through Sovrun’s AW architecture, supported by staking SOVRN tokens for development access, players and creators become architects of their virtual worlds, shaping them in unprecedented ways.

### AW as the Solution to Core Challenges in Traditional and Blockchain Gaming

Autonomous Worlds is an important pillar in Sovrun’s vision, forming the foundation on which all Sovrun ecosystems—Participation, Empowerment, and Engagement—are built. Through AW, Sovrun intends to provide players with the tools to transition from participants to co-creators and architects, embodying Sovrun’s mission to unlock boundless creativity and redefine gaming as a collaborative, immersive experience.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeR-dB5VxwAk-Twjte_39ppHZKYRjG_dFx6W1TZ4r_i_Rs5jpqz5ko-ewgYlLnFKLGUQ1lnt5BBpMkE6-cENyNJ8-0jWV4xxm7VDhbZu6C4X3sJ0ZgkY5_zNKvyQMpf0VBCG0h-?key=weo2vl887S6ZT9ibnwfRY5gJ" alt=""><figcaption></figcaption></figure>

### The Role of Autonomous Worlds in Sovrun’s Vision

Autonomous Worlds form a critical pillar in Sovrun’s vision, underpinning its ecosystems of Participation, Empowerment, and Engagement. By providing players with tools to transition from participants to co-creators and architects, AW embody Sovrun’s mission to unlock boundless creativity and redefine gaming as a collaborative, immersive experience.


# About Sovrun

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXePyyb3pIugbP-HulbybGm5prkZT-KoAR_XJfrerqweHJYgw3wzwDXU6ZqMQuCsgA9m8DemUB287J4mT_5dbVXLt5jsO1OFaxCxskxfUE-uKCzENbDIXRW9_KjP1t2bLgnAOVXaTw?key=weo2vl887S6ZT9ibnwfRY5gJ" alt=""><figcaption></figcaption></figure>

### Genesis

The Participation Layer unites human and financial capital, enabling players, creators, and communities to shape game economies. Sovrun Genesis fosters trend identification, project contributions, and impactful decision-making, cultivating true ownership in digital worlds. Leveraging years of Web3 gaming expertise, it positions Sovrun as a leader in on-chain participation.

### Labs

Sovrun Labs drives innovation in game development with tools designed for simplicity and scalability:

* **Headless Clients:** Allow developers to build and mod applications without managing blockchain complexity directly.
* **Account Abstraction:** Simplifies user onboarding and interactions, removing technical barriers.
* **Ultra-low Latency:** Delivers fast, responsive gameplay essential for real-time experiences.

These advancements empower developers to create flexible, community-driven games.

### Nexus

Sovrun Nexus is the engagement layer, offering user-friendly platforms to bring decentralized gaming to a wider audience:

* **GIG:** A questing platform partnering with telecom operators to boost user acquisition.
* **Chain Tactics:** A fully open source onchain strategy game where players command units to outsmart opponents on a 9x9 grid. Developers can get from 0 to 1 on any EVM or L2, using this game template, MUD Framework, smart contracts and Unity client.


# Sovrun Genesis

## Sovrun Genesis: The Participation Layer

The **Participation Layer** harnesses both human and financial capital, creating a collaborative space where players, creators, and communities can actively engage in and influence game economies. Sovrun Genesis enables participants to identify emerging trends, contribute to projects, and make meaningful decisions that shape digital worlds in order to foster a genuine sense of ownership in the worlds they inhabit. Through this layer, We’re committed to leveraging our years of experience and knowledge to push the boundaries of innovation in Web3 gaming participation, positioning Sovrun as a trendsetter in on-chain gaming.

<figure><img src="https://litepaper.sovrun.org/~gitbook/image?url=https%3A%2F%2F3010650065-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FADtzMEKNvbMSeDpMeJsE%252Fuploads%252FO5nx5xVmQDyxihIp3fm5%252Fgenesis.gif%3Falt%3Dmedia%26token%3D1298dfdc-2066-4673-a72f-f09534be8ea5&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=2a959453&#x26;sv=2" alt="" width="375"><figcaption></figcaption></figure>

### Ventures <a href="#ventures" id="ventures"></a>

Sovrun engages in the market as a primary partner, advisor, and secondary supporter to key projects in the space, identifying the right key projects and finding synergies between them and our asset generation arm, our products, and our ecosystem. Sovrun has put into operation $17m in funds to acquire game assets in various projects and its biggest holdings include AMGI’s My Pet Hooligan, Pixels, Azra Games, and Limit Break’s Digidaigaku.

<figure><img src="https://litepaper.sovrun.org/~gitbook/image?url=https%3A%2F%2F3010650065-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FADtzMEKNvbMSeDpMeJsE%252Fuploads%252F3jM4OdzE0b1ineVQdAg4%252Fgame%2520partner%2520and%2520ventures.png%3Falt%3Dmedia%26token%3D1c68037b-17ea-4206-b032-99ea1bee5d0b&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=6476c6a2&#x26;sv=2" alt=""><figcaption></figcaption></figure>

### Value Creation In Games <a href="#value-creation-in-games" id="value-creation-in-games"></a>

Since its inception, Sovrun has produced over 150k digital assets across games like Axie Infinity, Pegaxy, Apeiron, Photofinish Live, and other platforms, which has generated $20M in revenue. On top of this, the team has also dabbled with onchain games and Autonomous Worlds. Sovrun takes part in paving a path for the future of participation within games and metaverses. In 2022, the team created the first rental contract for breeding of Digidaigaku Genesis and Spirit Assets to create its 3rd collection – Heroes. Recently, it has deployed two other contracts – one on CCP’s ‘Eve Frontier’ and another on Proof of Play’s Pirate Nation.


# Sovrun Labs

### Sovrun Labs: The Empowerment Layer

Sovrun Labs serves as a hub for pioneering tools that enable creators to craft infinitely scalable virtual worlds. By leveraging blockchain, AI, machine learning, and data science, it builds secure, expansive ecosystems. These innovations empower developers and communities to bring their visions to life, fostering creativity within a robust technical framework.

### **Developer Tools**

Headless clients allow developers to build and modify applications without grappling with blockchain complexities directly. Account abstraction streamlines user onboarding, eliminating technical barriers for seamless interactions. Ultra-low latency delivers responsive gameplay, essential for real-time gaming experiences. These tools reflect Sovrun’s commitment to simplifying development while maximizing performance.

### **The Sovrun L2**

Sovrun’s Layer 2 (L2) infrastructure tackles the limitations of on-chain games and Autonomous Worlds. Using parallel EVM sessionchains and selective settlement, it ensures high throughput and low-latency interactions. This design supports real-time gameplay, balancing cost efficiency with scalability. Modular, open-source integrations enhance performance, resolving the blockchain trilemma of security, scalability, and decentralization for gaming environments.

### **SDK and Modular Frameworks**

The Sovrun SDK and Modular Frameworks streamline on-chain game development through automated tools and reusable components. Supporting frameworks like Web Assembly, Unity, and Unreal Engine, they adhere to MUD-compliant standards, reducing development overhead. Drawing from platforms like Warcraft III and Roblox, the frameworks enable decentralized, community-driven content creation, fostering collaboration. Full details are in the Sovrun SDK (#sovrun-sdk) section.

### **Ecosystem Impact**

These advancements empower developers to create flexible, community-driven games on Sovrun’s L2 infrastructure. By combining cutting-edge tools with a scalable architecture, Sovrun Labs overcomes technical challenges and cultivates an environment where innovation thrives, redefining the possibilities of decentralized gaming.

<br>


# Sovrun Nexus

### Sovrun Nexus: The Engagement Layer

The Engagement Layer focuses on delivering engaging, consumer-facing experiences that are accessible to a broad audience, this layer is dedicated to building user-friendly applications and experiences that will introduce and onboard new users and making decentralized gaming both approachable and compelling.

### GIG

**Questing Platform that Turns Mobile Telecom Operators into Channel Partners and Subscribers Into Engaged Users, Scaling Acquisition with Ease**

[GIG](http://home.gigrewards.ph) is a dynamic questing and rewards platform revolutionizing user engagement, bringing Web3 projects to Web2 users by turning mobile telecom operators into channel partners for user acquisition and engagement at scale. Telecom mobile subscribers can do quests, tasks, and missions to earn rewards. Quests can be gaming, shopping, referrals, social media participation, and other micro tasks that drive engagement and revenue. GIG's first partner is the largest telecom operator in the Philippines with access to over 60M subscribers, empowering users to earn while they engage.

[Visit GIG](http://home.gigrewards.ph)

### Chain Tactics

A fully on-chain 1v1 PvP strategy game where players command units on a 9x9 grid, blending chess-like strategy with RPG elements to outmaneuver opponents. Built using the Sovrun SDK, it showcases scalable, decentralized gameplay **(see \[Sovrun SDK]\(#sovrun-sdk) for details)**.

Learn more about [Chain Tactics](/build-with-sovrun/chain-tactics)

<br>

\ <br>


# Case Study: Eve Frontier

Forging the Frontier: Sovrun’s Impact on the Rise of Autonomous Worlds in EVE

### **What is EVE Frontier?**&#x20;

EVE Frontier is a crowd-built virtual world and player-driven sandbox, building and extending on the successes of the sci-fi MMORPG EVE Online. Set in an extremely hazardous region amidst the depths of space, players will need to survive its dangers and rebuild civilizations as they fight to gain control of resources, territories and more. EVE Frontier brings a revolutionary concept to gaming - a fully autonomous, player-driven world, where anyone can build and evolve the game’s ecosystem.&#x20;

EVE Frontier has partnered with MUD for their application layer, using the MUD V2 Framework for its flexibility, modularity, and extensibility. This acts as the primary game interaction layer where smart contract functionality integrates with in-game entities and mechanics. Central to this vision is the use of Smart Objects, which allow for any in-game entity to be represented on-chain and therefore managed and edited by player-written code. Smart Objects could be physical or logical objects, such as characters, ships, items, skill systems, rules of production, marketplaces, and much more.

&#x20;These Smart Objects come in the form of Smart Assemblies (programmable in-game objects), which interact directly with the mechanics of the Frontier, and gives players the freedom to create custom systems within the game’s immutable digital physics. This open, extensible foundation transforms EVE Frontier into a world of boundless possibilities, where every player has the power to build, and expand the game’s evolving frontier.&#x20;

### EVE Frontier’s Phase III Hackathon: Sovrun’s Bold Entry into Autonomous Worlds

During EVE Frontier’s Phase III playtest, an exciting hackathon introduced players to foundational elements of Smart Assemblies, sparking exploration and creativity; namely, through Smart Storage Units (SSU). This event showcased a variety of unique player-driven ideas, offering a glimpse into the limitless potential for player creations and composability as the game continues to expand.&#x20;

Sovrun brought a fresh and unique concept to the hackathon, setting itself apart from other participants. We developed a system that allowed for the development of eSports ecosystems into the game itself, as well as develop two game iterations as a proof of concept for the viability of the introduced systems. With the entry, Sovrun was able to win the hackathon, besting 12 other submissions from all over the world.&#x20;

The team behind EVE Frontier was wholly impressed with the output, and have commented to say they “never expected such a complete and well thought out submission.” Despite our entry being launched in a simplistic form given the hackathon’s time frame, it demonstrated the exciting future of Autonomous Worlds and the potential for creating revenue-generating strategies through the creation of extensions to the game itself (within the context of EVE Frontier, through Smart Assemblies). This approach marks a shift from traditional play-to-earn models, moving towards a strategy where players and creators build services within fully on-chain games and generate revenue through service fees.&#x20;

### **Expanding on the Future Possibilities within the EVE Frontier Universe**

Sovrun envisions significant economic opportunities within EVE Frontier and is actively preparing as the game approaches its anticipated launch in early-to-mid 2025. Our early involvement underscores our strong belief in the future of Autonomous Worlds and highlights our readiness to become a core first-mover in building essential services towards players and corporations like we see in EVE Online.&#x20;

Specifically, we see vast potential in providing strategic services for Corporations and Alliances within EVE Frontier, similar to a SaaS model. In the future, CCP Games, the creators behind the EVE Universe, imagine Corporations having large scale bases with tens to hundred of different Smart Units that must work together harmoniously to achieve operational efficiency.&#x20;

In addition, such Smart Units (Turrets, Storages, Gates) need to have protocols behind them, powering their logic. While creating and managing corporations in itself does not require interacting with smart contracts and creating highly sophisticated Smart Units, introducing protocol capabilities into Smart Units become increasingly more important for those looking to scale their operations and gain a competitive edge over their enemies.

We hold strongly that base and operation optimization tooling in the form of providing smart unit protocols that excel at certain tasks & operations will be one of the leading types of services in the game. We can characterize the types of services to the following: <br>

### **Standalone Services (Protocol + Smart Unit Package)**

These are consumer ready services where both the protocol logic and the smart unit are included in a single package. Players get everything needed to deploy a fully functional solution, which typically involves a Smart Unit powered by custom logic.&#x20;

**Example:**

Automated Defense Systems: A package that includes Smart Turrets along with pre-configured protocol for targeting, firing, and resource management.&#x20;

### **Standalone Protocols for Smart Units**

These services focus only on providing protocol logic or custom algorithms for existing Smart Units that a player or Tribe already owns. Instead of offering units with it, these services can enhance or change how existing units in a Base operate by upgrading their logic or automation behind them.&#x20;

**Example:**&#x20;

Target Algorithm for Smart Turrets: A protocol that changes how player’s Smart Turrets prioritize and fire on targets.&#x20;

### **Package Services for Entire Operations**

These are more service bundles that include everything necessary to manage entire operations, from resource management, logistics, defenses, etc. This type of service will likely include a wide range of smart units, all interacting with each other harmoniously.&#x20;

**Example:**

Mining Operations: A package that includes all necessary smart units and their logic to handle an entire mining operation successfully.&#x20;

### **Financial & Economic Services**

Focuses more on managing financial operations within the game, such as loans, collateralization, currency exchange, etc.&#x20;

**Example:**&#x20;

Banking Service: Offering loans to players or Corporations with collateral, using smart contracts to manage repayment and liquidation handling.&#x20;

### **Analytic Services**

Services that offer real-time data analytics on things like market metrics, player activity, resource nodes, etc. to make better informed decisions.

**Example:**&#x20;

Corporation Member Activity: Ability for leaders to view their member’s player activity, contributions, etc.&#x20;

\
As Corporations continue to grow and form Alliances, we start to see similar concepts of using protocols within Smart Units to create efficient operational processes expand into much larger scale concepts such as managing entire solar systems or even galaxies. Alliances will likely go beyond the scope of physical structures to managing complex economic and political relations both within and between.&#x20;

Real economies may start to form with their own economic policies. The basic implications and effects of Alliances can be clearly seen in the preceding game, EVE Online, where the largest Alliance comprises over 460 different Corporations and over 34,000 individual members, all working towards a collective goal.&#x20;

### **Economic Opportunities as a Service Model**

In EVE Frontier, the service model unlocks significant economic potential by transforming traditional gameplay into a dynamic ecosystem where builders generate revenue through innovative service-based solutions. This shift redefines the in-game economy, creating new income streams and sustainable growth paths for stakeholders within Web3 games. Below, we explore key examples of these service-based economic opportunities.&#x20;

### **Corporation Banking Service**

A Corporation Bank provides a safe, region-based banking service where players can secure loans in currency or resources with collateral. Located within the protection of their territory, this bank ensures both asset security and player accountability through player standing, allowing for reliable financial transactions and loan enforcement. Provided as either a subscription service for a banking protocol to embed within Corporations, or either directly through Sovrun’s management.&#x20;

### **Automated Base Management**

Offers Corporation leaders a comprehensive dashboard to monitor, control and upgrade diverse Smart Units effectively. As future Corporations will contain a vast array of Smart Units, this system enables efficient oversight and maintenance. Provided as a subscription service.

### **Smart Voting & Governance**

A governance model where Corporations and Alliances make decisions through a smart voting system. Members can vote on strategic actions such as expanding territory, setting trade tariffs, choosing alliances, etc. Provided either as a one-time-purchase or a subscription service.&#x20;

### **Mining Operation**

An all in one package service to handle an entire mining operation from start to finish, using a variety of Smart Units. A fully automated operation provided as a subscription service.&#x20;

### **Strategic Role in EVE Frontier**

With an already established relationship with the team at CCP Games and a dedicated focus on building applications within the EVE Frontier universe, Sovrun envisions itself as a key stakeholder and contributor to the game’s economy and playerbase, setting itself apart from extractive approaches often seen amongst major players in Web3 games.&#x20;

EVE Frontier is just a preview of Sovrun’s commitment to creating sustainable, player-driven extensions within Autonomous Worlds. Our goal is to build net-positive, lasting contributions that empower and elevate our communities, transforming passionate gamers into active builders. Through this approach, Sovrun aims to lead the way in the evolving landscape of Autonomous Worlds.<br>


# Case Study: Plunder Quest

## Plunder Quest: Building A Minigame On Top of an FOCG

### **What is Pirate Nation?**

Pirate Nation is a pirate-themed fully on-chain casual RPG developed by a game studio and blockchain technology company called Proof of Play. The core gameplay loop at the moment is quite limited, revolving around gathering materials in the map, crafting items, PVE content with a card combat system, and most recently, a first look into PVP combat using crafted ships and customized decks.

Being a fully on-chain game, the Pirate Nation team places importance on decentralization through open sourcing their technology and empowering the creators and developers in their community to build on top of their product. Despite the current gameplay state being quite limited, creators and builders have been building on the game to remix and add content for the players’ appreciation. This includes tools that help players navigate crafting, a gauntlet (PVE) racing minigame, and more. On top of the openness of the team towards developers, they are also planning to have a $PIRATE grant-application process in the future for developers who wish to build in the ecosystem, proving their stance on others building on top of their product.

Pirate Nation has more updates rolling up consistently that will make the game more vibrant and enjoyable in terms of gameplay and content, but their aim of fostering a friendly environment for builders also helps not only the game to get more noise in the space, but also the player community in building a new and interesting culture.<br>

### Plunder Quest: Sovrun’s Contribution to the Pirate Nation Ecosystem

Plunder Quest is a simple game mode that involves the game’s gathering mechanics. Similar to treasure hunt games, the goal is to obtain the required materials as quickly as possible and within the time limit, while competing for the fastest time with other players. It is a simple minigame that adds spice and excitement to an otherwise menial task in the game.

A tournament of Plunder Quest consists of several rounds held in certain intervals. (The first iteration will have 2 rounds every day for the duration of the tournament) Interested players can register to join the round during the registration period. Every round, a list of items will be generated that participants will have to procure by gathering and harvesting resources in the world map. Only gathered materials during the round will be acknowledged, so players cannot purchase the materials on the marketplace, nor gather the materials beforehand.

Once the countdown for the start of the round begins, players can go to the game and gather the necessary items within the given time limit. As players go around the map to look for the necessary items, the gathered items will automatically be counted and displayed at the Plunder Quest hub. Points will be handed out depending on the completion rate, and in addition, bonus points will be rewarded to the player who finishes the list first, second, and so on.&#x20;

Points will be rewarded as follows:<br>

* **Full Completion Bonus - Collected all the required resources within the time limit**

  Reward: 100 Plunder Points
* **Partial Completion - Incomplete collection of resources but still participated in the game.**\
  Reward: Prorated points capped at 75
* **Forfeit - Did not collect any resources or have forfeited the round**\
  Reward: 0 Plunder Points

**Time-based Points - Awarded in addition to the above based on how quickly a player completes the Plunder Quest**

* 1st to Finish → +50 Plunder Points
* 2nd to Finish → +35 Plunder Points
* 3rd to Finish → +20 Plunder Points
* 4th to Finish → +10 Plunder Points
* 5th to Finish → +5 Plunder Points

Plunder Quests also features a leaderboard that computes the total plunder points the players obtain in all rounds for the whole duration of the tournament. Whoever has the highest points by the end of the tournament is the winner.

By building a mini-game like Plunder Quest to Pirate Nation, not only is Sovrun contributing to the Pirate Nation ecosystem by providing more content to the game, it also showcases Sovrun’s understanding of blockchain technology as well as our ability to build on top of FOCGs. Through Plunder Quest, we want to show not only our expertise in blockchain technology, but also that we understand what player sentiments are regarding blockchain games.&#x20;

In any case, understanding the user is an important factor in building products. At the end of the day, no matter how technically complex something is, the product needs to actually be utilized by users and be useful or enjoyable for them. If the community finds good use in the product, then it can be deemed as a successful one. Players are, at the end of the day, gamers who look for enjoyable gameplay that they can also benefit from. Plunder Quest aims to cater to players who are looking for fresh new takes on the gameplay to increase the game’s enjoyability.

As an FOCG, actions in Pirate Nation such as gathering and harvesting are recorded on the blockchain in one way or another. In this case, gathering and harvesting are recorded as mints of the procured items. This is the reason why it is possible to detect if a participant merely buys the required items from the marketplace, or when the participants actually gathered the materials, which is important for Plunder Quest to avoid exploits. Another point to note is that Pirate Nation is currently under both the Proof of Play blockchain and the Boss Chain, requiring the minigame to be integrated into both chains to ensure that Plunder Quest is able to accommodate all players.<br>

### **Possibilities in the Future of Plunder Quest and Pirate Nation**

For the first iteration of the game, players are able to participate in the rounds freely. However, imposing an entrance fee, such as $PIRATE, to raise the ante is very much a possibility and one of the future updates that we are eyeing to make. An entrance fee and a prize pool makes the minigame more competitive, and makes participation more desirable for players in the long term. In addition to allowing the funding of an actual prize pool to reward the players for participating in the tournament, it will also provide more utility for the game token.

As the game is expanding and rolling out more updates, that is also an opportunity for Plunder Quest to evolve. For example, Pirate Nation most recently announced an update that involves skills that include gathering materials. The update also includes the introduction of new skills, and thus new materials to gather. These new materials can be integrated into Plunder Quest as new materials that can appear in the item list to procure. Another one is the expansion of the to-get list from harvestable items to craftable items. Plunder Quest is simple in its premise, but that allows for more flexibility and creativity in remixing the current version into future iterations of the product.

In the future, as more features become available in the game and on-chain, we have come up with ideas that might possibly be built on the game’s ecosystem:<br>

### **PVP Tournament Wagering System**

The current state of PVP in Pirate Nation is very basic. Players can experience the first look on PVP by getting an invite code to send to other players for a match. Currently, this feature is off-chain. When more PVP features are introduced and integrated on-chain, a kind of wagering system for PVP battles would provide more thrill in what would usually be a one-on-one battle, giving players a different way to be a part of these PVP battles even as a spectator.<br>

### **NPC Fights**

This idea expands the lore of Pirate Nation as it will involve the creation of non-playable characters (NPCs) fighting against each other. Each NPC will have a background, character, and their own set of stats and decks for the fights, while players can spectate and wager on these NPCs.

<br>


# History of Sovrun (BreederDAO)

## BreederDAO’s Evolution to Sovrun

BreederDAO pioneered blockchain gaming with innovative solutions, shaping the space from its early days. By developing modular smart contracts that augmented, optimized, and automated in-game functionalities, it leveraged blockchain’s potential to open up unprecedented opportunities in gaming. Its approach found impactful applications across several projects.

In Axie Infinity, proprietary breeding bots supplied over 120,000 in-game assets to 40,000 players, boosting player liquidity and driving growth for the game. For Digidaigaku by Limit Break, BreederDAO created the first rental contract to generate the Heroes collection, enabling holders to rent Genesis and Spirit Assets in an open marketplace and allowing users to mix and match NFTs without owning both. In Gensokishi, it embraced user-generated content with AI-powered 3D wearable generators, enabling players and creators to design, customize, and trade unique in-game items, broadening the possibilities for creator-driven economies.

As blockchain gaming evolved, Autonomous Worlds (AW) emerged as self-sustaining, player-driven ecosystems where communities govern and grow their digital worlds collaboratively. AW unlock new dimensions of interaction, composability, and scalability never seen before, where players and creators alike can shape and evolve their experiences. Sovrun represents the natural expansion and next phase of BreederDAO’s vision, born from the challenges, insights, and opportunities encountered on its journey. It is an ecosystem designed to empower not only asset creation but the co-creation of entire virtual worlds, unlocking the full potential of blockchain gaming. Building on BreederDAO’s legacy, Sovrun remains true to the spirit of innovation that has defined it from the start, answering the question of what gaming can truly become.

<br>


# About $SOVRN

The SOVRN token stands as the driving force behind Sovrun, a blockchain ecosystem engineered to redefine gaming through decentralization, scalability, and community empowerment. Migrated from its predecessor BREED, SOVRN fuels a range of critical functions—from staking and gas fees to governance and economic incentives—anchoring Sovrun’s vision of perpetual, player-driven digital worlds. This section outlines the token’s role, utility, and technical underpinnings, providing a foundation for understanding its significance within Sovrun’s integrated layers.

***

### **BREED to SOVRN Migration**

The migration from BREED to SOVRN began on November 28, 2024, and will remain open for 36 months. The migration occurs at a 1:1 ratio, ensuring a seamless transition for token holders. For more details, refer to the official FAQs at <https://migrate.sovrun.org/>.

<br>


# Token Utility

The SOVRN token empowers developers, players, and token holders by driving value back into the system as it grows. It serves multiple critical functions within Sovrun’s ecosystem.

### **Value Capture**

SOVRN facilitates four primary mechanisms to capture and distribute value:

* **Staking**\
  \
  Developers stake SOVRN tokens to access Sovrun’s gaming engines, technical infrastructure, and chain economies. This staking process enables the creation of Parallel EVM gaming chains that settle on Sovrun L2. These chains provide scalable, customizable worlds for blockchain modders and game developers. A delegation system allows developers to outsource game operations on-chain, enhancing flexibility and efficiency.<br>
* **Treasury Growth**\
  \
  Through strategic partnerships with games, NFT/FT projects, and institutional collaborators, Sovrun optimizes its treasury resources. This includes funding innovative community initiatives and potentially reacquiring SOVRN tokens from the market to support ecosystem growth. These efforts aim to increase the token’s value and benefit holders over time.<br>
* **Native Gas Token**\
  \
  SOVRN functions as the native gas token for the Sovrun chain, powering transactions and smart contract executions across the ecosystem. Its integration with industry-standard game engines ensures high-performance execution and scalability, making it a vital component for developers and users building and interacting with on-chain worlds.

### Immersive Economies

SOVRN enables players to directly influence in-game resources, trade systems, and economic growth within digital worlds. This creates dynamic, player-driven experiences where decisions have real, tangible impacts. The token supports a wide range of gaming economies, each with unique rules, assets, and interactions, fostering diverse and engaging gameplay.


# $SOVRN Tokenomics

SOVRN’s tokenomics are built upon the foundation of BREED, with a focus on transparency, security, and community empowerment. Below are the key details:<br>

* **Migration**\
  \
  The migration from BREED to SOVRN commenced in November 2024 and will remain available for three years (36 months). The process operates at a 1:1 ratio, meaning each BREED token is exchanged for one SOVRN token. Multiple audits have been conducted to ensure the security and integrity of this transition.<br>
* **Distribution**\
  \
  As of November 2024, 82% of the maximum token supply has been unlocked. The remaining tokens are allocated as follows:
  * Key Partners: 30 million SOVRN
  * Team: 124 million SOVRN
  * Treasury: 25 million SOVRN\
    \
    The vesting schedule remains unchanged from the original BREED tokenomics, ensuring consistency for stakeholders.<br>
* **Supply**\
  \
  The total supply of SOVRN is 896,771,567 tokens. This figure is derived from the initial maximum supply of 1,000,000,000 BREED tokens, adjusted for tokens burnt during the migration process. No additional SOVRN tokens will be minted, maintaining a fixed supply.<br>
* **Security Measures**\
  \
  The migration process has been rigorously audited by Verichains and Ackee Blockchain to ensure robustness and security. An additional audit by Quantstamp is scheduled for December 2024, further reinforcing trust in the ecosystem.<br>

SOVRN’s tokenomics are designed to support a sustainable, creator-focused Web3 gaming ecosystem that benefits all participants.

<br>


# $SOVRN on EVM Chains


# Ethereum

{% hint style="info" %}
Please be sure to double check links and token addresses when using Web3 to ensure they are official.
{% endhint %}

[SOVRN Contract Address (Ethereum)](https://etherscan.io/address/0x031b8d752d73d7fe9678acef26e818280d0646b4) - 0x031b8d752d73d7fe9678acef26e818280d0646b4

[SOVRN Liquidity Provider (Uniswap)](https://app.uniswap.org/explore/tokens/ethereum/0x031b8d752d73d7fe9678acef26e818280d0646b4)


# Hyperliquid

{% hint style="info" %}
Please be sure to double check links and token addresses when using Web3 to ensure they are official.
{% endhint %}


# Running a Node

For developers and community members that want to operate a node.

Sovrun runs on a parallel-optimized HyperEVM-modified version based off of the [**OP Stack**](https://docs.optimism.io/stack/getting-started). This section uses the page [Running an OP Sepolia node from source](https://docs.optimism.io/builders/node-operators/tutorials/testnet) as reference, with some changes.

## Recommended Specs

<table><thead><tr><th width="119"></th><th></th></tr></thead><tbody><tr><td>CPU</td><td>16–32 core CPU with high clock speeds (e.g., AMD EPYC, Intel Xeon, or Ryzen 9/Threadripper series)</td></tr><tr><td>Memory</td><td>32–64GB DDR4/DDR5 RAM</td></tr><tr><td>Storage</td><td>60GB SSD (Full Node) or 200GB SSD (Archive Node)</td></tr></tbody></table>

## How To Deploy

*This section is under construction, steps and connection details will be provided soon.*


# Network Info

Connection details to Sovrun L2.

*Sovrun is an EVM-compatible chain, and as such you can use your choice of EVM-compliant wallet to connect.*

## Sovrun Testnet

Sovrun testnet is running on top of the [**HyperEVM testnet**](https://hyperliquid.gitbook.io/hyperliquid-docs/hyperliquid-l1/hyperevm). Sovrun L2 uses Arbitrum Nitro.

The settlement chain (HyperEVM testnet) is currently on **MVP release**; and as such **issues and data loss should be expected**.

| **Network Name**      | Sovrun Testnet                                                              |
| --------------------- | --------------------------------------------------------------------------- |
| **Description**       | Phase 1 public testnet for Sovrun L2                                        |
| **Chain ID**          | 518848                                                                      |
| **Currency Symbol**   | SOVRN                                                                       |
| **RPC HTTP URL**      | <https://testnet-chain.sovrun.org/http>                                     |
| **RPC WebSocket URL** | <wss://testnet-chain.sovrun.org/ws>                                         |
| **Explorer**          | <https://testnet-explorer.sovrun.org/>                                      |
| **Test SOVRN**        | [https://faucet.85dbf.sovrun.org/](<https://faucet.85dbf.sovrun.org/&#xA;>) |


# Block Explorer

## Blockscout

Sovrun's primary explorer uses [**Blockscout**](https://www.blockscout.com/)**.** Blockscout serves as a flexible, open-source blockchain explorer that is fully customizable to meet specific project requirements. It offers a robust framework for developers seeking to build tailored blockchain solutions, facilitating deep insights into blockchain data. With its comprehensive feature set and adaptability, Blockscout aids users in navigating and analyzing complex blockchain ecosystems, ensuring efficient monitoring and reporting of blockchain activities. This makes it an invaluable asset for projects like Sovrun that seek to leverage detailed blockchain analytics effectively.

**Testnet:** <https://testnet-explorer.sovrun.org/>


# Contracts

Relevant HyperEVM and L2 smart contracts.

## Testnet

***

### HyperEVM Contracts

| AddressManager                    | 0xEc60c8CCcAc9B29C22f7A8fAfBd9D328C2b8A965 |
| --------------------------------- | ------------------------------------------ |
| DisputeGameFactoryProxy           | 0x454d10526c11322399BB6109e821CeA6452Bba17 |
| L1CrossDomainMessengerProxy       | 0xC8267bA5DE91bD972f172964171C854589594fA2 |
| L1ERC721BridgeProxy               | 0x07Fa8ca79a8d1e3fa0769103e32A9dBd0d18b874 |
| L1StandardBridgeProxy             | 0x18FBC6704e8c1Bb12258b4223251Dc2717CD9EC0 |
| L2OutputOracleProxy               | 0x70e3dc2A0f90aa97204b3bF573b6f0F07d1d5456 |
| OptimismMintableERC20FactoryProxy | 0xc0928fC9E2851B7eb017ee8d5e7cb8971ff1e7c7 |
| OptimismPortalProxy               | 0xe6bc7060D554d0E2d88689f70670C2604cac07ae |
| ProtocolVersionsProxy             | 0xf82DC683c0F503F90d351F7908Ed6ADD73d965e7 |
| ProxyAdmin                        | 0x9b853AA45845292dE89Ce2031b52Ef0f3e91d362 |
| SafeProxyFactory                  | 0x3eB5247174c19AA4b6E61cd965CCaC3E34e2bBbb |
| SafeSingleton                     | 0x7c07a328141a8C7EfBB1ce6a77c3bc09BE08a637 |
| SuperchainConfigProxy             | 0x1116A2C8EBd3E58b9c6F68975281a2D90020f6Cc |
| SystemConfigProxy                 | 0xcf53d2695593b617996A62CE3Af6cdDCe4C44B7C |
| SystemOwnerSafe                   | 0x2Bd173B8E3282039116a59D5F373b6528Df85035 |

### L2 Contracts

| L2ToL1MessagePasser           | 0x4200000000000000000000000000000000000016 |
| ----------------------------- | ------------------------------------------ |
| DeployerWhitelist             | 0x4200000000000000000000000000000000000002 |
| WETH9                         | 0x4200000000000000000000000000000000000006 |
| L2CrossDomainMessenger        | 0x4200000000000000000000000000000000000007 |
| L2StandardBridge              | 0x4200000000000000000000000000000000000010 |
| SequencerFeeVault             | 0x4200000000000000000000000000000000000011 |
| OptimismMintableERC20Factory  | 0x4200000000000000000000000000000000000012 |
| L1BlockNumber                 | 0x4200000000000000000000000000000000000013 |
| GasPriceOracle                | 0x420000000000000000000000000000000000000F |
| L1Block                       | 0x4200000000000000000000000000000000000015 |
| GovernanceToken               | 0x4200000000000000000000000000000000000042 |
| LegacyMessagePasser           | 0x4200000000000000000000000000000000000000 |
| L2ERC721Bridge                | 0x4200000000000000000000000000000000000014 |
| OptimismMintableERC721Factory | 0x4200000000000000000000000000000000000017 |
| ProxyAdmin                    | 0x4200000000000000000000000000000000000018 |
| BaseFeeVault                  | 0x4200000000000000000000000000000000000019 |
| L1FeeVault                    | 0x420000000000000000000000000000000000001a |
| SchemaRegistry                | 0x4200000000000000000000000000000000000020 |
| EAS                           | 0x4200000000000000000000000000000000000021 |
| Create2Deployer               | 0x13b0D85CcB8bf860b6b79AF3029fCA081AE9beF2 |
| MultiCall3                    | 0xcA11bde05977b3631167028862bE2a173976CA11 |
| Safe\_v130                    | 0x69f4D1788e39c87893C980c06EdF4b7f686e2938 |
| SafeL2\_v130                  | 0xfb1bffC9d739B8D520DaF37dF666da4C687191EA |
| MultiSendCallOnly\_v130       | 0xA1dabEF33b3B82c7814B6D82A79e50F4AC44102B |
| SafeSingletonFactory          | 0x914d7Fec6aaC8cd542e72Bca78B30650d45643d7 |
| DeterministicDeploymentProxy  | 0x4e59b44847b379578588920cA78FbF26c0B4956C |
| MultiSend\_v130               | 0x998739BFdAAdde7C933B942a68053933098f9EDa |
| Permit2                       | 0x000000000022D473030F116dDEE9F6B43aC78BA3 |
| SenderCreator                 | 0x7fc98430eaedbb6070b35b39d798725049088348 |
| EntryPoint                    | 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789 |


# Acquiring test SOVRN

How get SOVRN on the testnet

## Gas Token

SOVRUN uses a custom token SOVRN as its native token. To acquire SOVRN you can use our [faucet](http://faucet.sovrun.org/). This token will be used to pay for gas and fees for using the network.

| **Faucet** | [https://faucet.85dbf.sovrun.org/](<https://faucet.85dbf.sovrun.org/&#xA;>) |
| ---------- | --------------------------------------------------------------------------- |


# Sessionchains

Sessionchains are ephemeral chains that host non-critical and temporary data for games

Our innovative approach to scalability is encapsulated in what we call **Sessionchains**. These are transient, ephemeral chains built upon the Sovrun platform. The primary function of these Sessionchains is to facilitate the **execution of logic that doesn't require long-term storage or persistence**. This characteristic makes them ideal for the dynamic environments of various Autonomous Worlds or DApps, which might frequently need computation without the overhead of enduring data retention. These are issues preventing the growth and innovation of the fully onchain gaming space. By offloading such tasks to our Sessionchains, we ensure that processes are both efficient and scalable, allowing for rapid implementation and execution in scenarios where longevity of data is unnecessary. This design choice reflects our commitment to providing scalable solutions that are both flexible and powerful, enhancing the overall efficiency of the systems they serve.

Sessionchains can be spun up by **staking SOVRN**, after which a chain deployer can initiate the instantiation process via smart contract interaction. Chain deployment itself will be abstracted away from the end user by Sovrun Labs, and will come predeployed with the necessary tools to build Autonomous Worlds.

***

Sessionchains will be released for Public Beta in Q1 2025. To participate in the Closed Beta (on testnet), please sign up via this [form](https://airtable.com/appXBtIEe0QlgL9A6/pagqS1GfDK5xi7IB5/form).


# Staking

*This section is under construction.*


# Base

{% hint style="info" %}
Please be sure to double check links and token addresses when using Web3 to ensure they are official.
{% endhint %}

[SOVRN Contract Address (Base)](https://basescan.org/address/0xca4c2e10037ac1af9f501ecb11a710776c87d2d5) - 0xca4c2e10037ac1af9f501ecb11a710776c87d2d5&#x20;


# BREED to SOVRN Migration

[BREED to SOVRN Migration Portal](https://migrate.sovrun.org/)


# Chain Tactics

What is Chain Tactics?

Chain Tactics is an open-source, fully on-chain 1v1 PvP strategy game that blends chess-like strategy with tactical RPG elements, played on a 9x9 grid. Players command unique units to destroy their opponent’s Fortress, leveraging Sovrun’s L2 infrastructure and the Sovrun SDK for transparency and community ownership.&#x20;

The SDK’s MUD Engine manages Chain Tactics’ on-chain game state, handling data for units, moves, and outcomes with efficient multi-threading, while the Game IDE Integrator bridges this logic to Unity, enabling developers to create rich visuals and custom frontends using familiar workflows \[Sovrun SDK].

Running entirely on-chain, the game eliminates centralized servers, ensuring transparency and immutability. Its modular, open-source design, powered by the headless client and Sovrun SDK, invites developers to innovate with custom frontends, AI agents, and gameplay extensions.

{% embed url="<https://www.youtube.com/watch?v=onL4_aSqaEE>" %}


# Who is Chain Tactics for?

The Chain Tactics Headless Client is designed for Web3 developers, AI researchers, and game modders who want to build on top of an Autonomous World without dealing with blockchain complexities.

Key Profiles:

* Indie Game Developers – Looking to create custom front-end experiences, new game modes, or alternative UI layers.
* AI & Automation Engineers – Experimenting with AI-driven agents, auto-battlers, or NPC integrations.
* Modders & Community Builders – Extending gameplay by adding new mechanics, skins, or tournament features.
* Blockchain Developers – Interested in integrating Chain Tactics with other on-chain applications or experimenting with smart contract interactions.
* Educational - Sovrun has ran information and training sessions to teach Web3 development, smart contracts, autonomous worlds and the MUD framework with Chain Tactics!

The headless client provides plug-and-play access to on-chain game logic, making it the perfect tool for those who want to innovate within the Chain Tactics ecosystem without rebuilding core systems from scratch.

<br>


# Why Mod Chain Tactics?

Modding Chain Tactics offers several benefits:<br>

* **Flexibility:** Developers can create custom frontends, AI agents, or automation tools without altering core mechanics.
* **Community Ownership:** The open-source co-development model, supported by Sovrun Grants and hackathons, empowers modders to shape the game’s evolution.
* **Scalability:** Mods can extend gameplay horizontally, integrating new mechanics, assets, or connections with other games and dApps, creating endless possibilities within the autonomous world framework.

Open-source contributions are welcomed with the following Github repositories to fork and contribute to:

* [Chain Tactics Server](https://github.com/sovrun/chain-tactics-server)
* [Chain Tactics Light-weight Unity Client](https://github.com/sovrun/chain-tactics-unity-client)&#x20;


# Headless Client

### Introduction to the Headless Client

The headless client is a foundational component of Chain Tactics, designed to empower developers and extend the game’s ecosystem in a fully modular, platform-agnostic way. By decoupling game logic from the user interface, it enables seamless interaction with Chain Tactics’ smart contracts, powered by the Sovrun SDK’s MUD Engine, without requiring direct blockchain expertise (See [Sovrun SDK](/build-with-sovrun/chain-tactics/sovrun-sdk)for details).

At its core, the headless client serves as a bridge between on-chain game logic and external applications, allowing for:

* Flexible Development: Developers can build their own front-end experiences, AI-driven agents, or automation tools without modifying core game mechanics, supported by the SDK’s Game IDE Integrator for Unity and other platforms.
* Multi-Platform Expansion: Since it’s written in C#, the client can be integrated across various devices and interfaces, ensuring broad accessibility.
* Decentralized Evolution: As Chain Tactics enters its open-source co-development phase, this tool enables community-driven innovation by providing a standardized yet adaptable framework for new game extensions, AI opponents, or even alternative gameplay modes.

By abstracting blockchain complexities, the headless client simplifies development while preserving the integrity of the game’s Autonomous World framework—ensuring Chain Tactics remains dynamic, scalable, and truly owned by its community.

<br>


# Sovrun SDK

The Sovrun SDK ties together traditional game development tools with fully on-chain game and Autonomous World generators

Games like [Chain Tactics](https://chaintactics.io/) run on the game development stack powered by:

* a MUD Engine (<https://mud.dev/>)
* a game IDE (Unity/Unreal/etc.) integrator

**MUD Engine**

MUD was designed by the [Lattice](https://lattice.xyz/) team in order to provide an open-source framework for powerful fully on-chain applications such as Autonomous Worlds to be deployed on EVMs.  Autonomous Worlds subscribe to the ECS pattern (Entity Component System) used in traditional game development pipelines in order to achieve scalable data architectures and relations, supporting millions of entities at once, optimized for multi-threading and parallelization, through the separation of data and functions.&#x20;

**Game IDE Integrator**

Sovrun integrates the MUD Engine with traditional game development environments like Unity, Unreal, Godot, or Bevy. It allows developers to leverage familiar tools and workflows while building MUD-compliant games, enabling seamless integration and deployment of interactive game features.

***

For more info on participating in Sovrun's Builder program, visit the Sovrun [Discord](https://discord.gg/fq3XpEQjhu).


# Game Phases

The game progresses through two phases:<br>

1. **Preparation Phase:** Players purchase and place units within a 10-gold budget, restricted to the first two rows of their board.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfccIT7K2rnct0YKH6ksDXTG7IObNbstF97ASFW-IXEL3csOPJPBIJKZYsixr3voN2LBd77lFEitYd7MBYbV6-Y5qHnpM8pyWU4mKVnZwnkeUTaUs4rMiyasELvASUR9ZXNRVal?key=weo2vl887S6ZT9ibnwfRY5gJ" alt=""><figcaption></figcaption></figure>

2. **Battle Phase:** Players take turns moving and attacking, leveraging unit abilities to outmanoeuvre their opponent.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfcaxcyVGu1oFmaXYVL1QbsQqnzBVC-O5U-_XMl6HMmSfn1-ByVBeqec47-tK9BLm1QOQSTZ9yVPHIoqcp0H8PHtjjIhqsbBjV_jBenbNCrezEXkxQ5sVYVEq1n79tb6FHljkEx?key=weo2vl887S6ZT9ibnwfRY5gJ" alt=""><figcaption></figcaption></figure>

Running entirely on-chain, the game eliminates centralized servers, ensuring transparency and immutability. Its modular design, powered by the headless client, invites developers to innovate with custom frontends, AI agents, and gameplay extensions.

### Chain Tactics Playtest Video

{% embed url="<https://www.youtube.com/watch?v=lpj-j8TTw9g>" %}


# Game Mechanics

**Grid and Phases:**

* Played on a 9x9 grid.
* Preparation Phase:
  * Buy Phase: Players have 10 gold to purchase units (90 seconds).
  * Spawn Phase: Units are placed in the first two rows (90 seconds). Failure to "Reveal" forfeits the match.
* Battle Phase: Turn-based moves and attacks aim to destroy the opponent’s Fortress.\ <br>

**Units and Stats:**

* Each unit has Health, Movement, Blindspot, and Range. Costs and abilities vary to support diverse strategies.
* Units include a free Fortress plus purchasable options:

<table data-header-hidden><thead><tr><th width="110.2421875"></th><th width="108.19140625"></th><th width="105.046875"></th><th width="138.92578125"></th><th></th><th></th></tr></thead><tbody><tr><td>Unit</td><td>Gold Cost</td><td>Health</td><td>Movement</td><td>Blindspot</td><td>Range Pattern</td></tr><tr><td>Footsoldier</td><td>1</td><td>Varies</td><td>Varies</td><td>Varies</td><td>Cross</td></tr><tr><td>Lancer</td><td>1</td><td>Varies</td><td>Varies</td><td>Varies</td><td>Cross</td></tr><tr><td>Priest</td><td>1</td><td>Varies</td><td>Varies</td><td>Varies</td><td>Square</td></tr><tr><td>Archer</td><td>2</td><td>Varies</td><td>Varies</td><td>2</td><td>Cross (3 sq)</td></tr><tr><td>Fire Mage</td><td>2</td><td>Varies</td><td>Varies</td><td>Varies</td><td>Diagonal</td></tr><tr><td>Ice Mage</td><td>2</td><td>Varies</td><td>Varies</td><td>Varies</td><td>Diagonal</td></tr><tr><td>Fortress</td><td>0</td><td>Varies</td><td>0</td><td>N/A</td><td>N/A</td></tr></tbody></table>

\
**Combat Rules:**

* One move and one attack per turn, executed by the same unit.
* 45-second turn timer with a 10-15 second grace period to account for blockchain latency.
* All actions are recorded on-chain, ensuring integrity and auditability.


# Game Architecture

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXf4YfQqt_6jLu5Sp6xwjBzntWg6AlducUTBAh7iSkWYMOndfBxfiSWYYRwpBZmAw8iHu6CNWaR5RSAnqDWjzqrUNpbE1p2tX1TpaewXxnnPlg4ae6aeH50cMEu7l7Giy5GTeHY70Q?key=weo2vl887S6ZT9ibnwfRY5gJ" alt=""><figcaption><p>For detailed information, refer to the [ <a href="https://sovrun.notion.site/Chain-Tactics-Wiki-1617ef7904b28023b8d6d23291b1923e">Chain Tactics Game Wiki</a> > Architecture Section]</p></figcaption></figure>

Chain Tactics is built on a modular architecture that ensures seamless on-chain gameplay while offering flexibility for modding and development. Powered by the Sovrun SDK, it uses the MUD Engine for on-chain data management and the Game IDE Integrator for Unity compatibility, creating a robust decentralized framework (see [Sovrun SDK](/build-with-sovrun/chain-tactics/sovrun-sdk) for details). The game’s architecture is also expandable to other EVM chains, allowing developers to deploy Chain Tactics across multiple blockchain networks for greater scalability and accessibility.&#x20;

#### Key Components

The key components and their interactions are as follows:

* **Onchain Logic:** Game state is stored in MUD (Modular Universe Data) tables, managed by the MUD Engine, and updated via smart contracts, ensuring transparency, immutability, and auditability of all game actions.
* **Headless Client:** Written in C#, this component bridges on-chain logic with external applications. It abstracts blockchain interactions, enabling developers to create custom frontends, AI agents, or automation tools without deep blockchain expertise, enhanced by the Game IDE Integrator’s support for development workflows.
* **CTServer:** Manages off-chain coordination between all clients, ensuring smooth communication and synchronization without overloading the blockchain with non-critical data.
* **CTServerContext:** Acts as a bridge, coordinating both the blockchain interactions (via Nethereum) and the off-chain coordination handled by the CTServer.
* **Nethereum:** A C# library to sign Ethereum blockchain transactions, providing secure and efficient interaction with the network.
* **Unity Frontend:** The default user interface for players, rendering the game in a visually engaging format, linked to the MUD Engine via the Game IDE Integrator. Developers can replace or extend this with custom frontends using the headless client.

<br>


# Expanding Chain Tactics Across EVM-Compatible Chains

Chain Tactics has been successfully deployed to the Core Network, an EVM-compatible chain, showcasing the flexibility and portability of the Chain Tactics SDK. This deployment demonstrates the ability of the open-source developer community to expand Chain Tactics across multiple EVM-compatible chains, leveraging the standardized Ethereum Virtual Machine (EVM) to ensure compatibility and interoperability. Developers can build upon the Chain Tactics SDK to create new worlds, integrate with existing EVM chains, or even fork the project to tailor it to specific blockchain ecosystems, driving further innovation and adoption. &#x20;

The open source developer community has successfully deployed [Chain Tactics SDK smart contracts](https://github.com/sovrun/chain-tactics-server/tree/main/tactics-war-sc/packages/contracts) to the following EVM-compatible chains:

* Core Network (L2) - World contract address - [0x5165c596983b3865e4cd49000407c89f694420c9](https://scan.test2.btcs.network/address/0x5165c596983b3865e4cd49000407c89f694420c9#transactions) (Testnet)
* Sonic (L1) - World contract address - Testnet) TBA
* If you would like to bring Chain Tactics to your EVM-compatible chain, reach out to our Discord builder chat !


# Chain Tactics Development Roadmap

The roadmap outlines the project’s progress and future plans:<br>

* **Done:** Game logic on-chain, headless client backend, Unity frontend, 2D/3D assets.
* **Now:** Pre-alpha testing, UI/UX enhancements, core loop 2.0, account abstraction.
* **Next:** Live deployment on Sovrun L2, web client, ZK (zero-knowledge) implementation, financialization layer.

This roadmap helps developers understand the game’s current state and upcoming opportunities for contribution.

<br>


# Terminology

| CTHeadless         | A wrapper for Chain Tactics contract calls that abstracts on-chain logic into common game RPCs like move, call, and attack. |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------- |
| CTServer           | A client-facing sequencer that notifies clients of game events and validates on-chain transactions.                         |
| Nethereum          | C# library to sign the Ethereum blockchain transactions.                                                                    |
| MUD                | ECS framework to create autonomous worlds.                                                                                  |
| Canon Build        | Unity Implementation on top of headless client.                                                                             |
| Lightweight Client | Sample implementation of CT on a 2D Unity Build.                                                                            |

<br>


# Getting Started Guides

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcADfdPeOA_5HrH1CUcmmxLuGcounZDndQ6cYJzyKtfWwdWknlcl_fA7gbViaZD0TgQFzrfJ593niL2_EhD-VAU7tNACv9w8c58uL6FIG7lYaz_GHYKeC0u8Qj30UVlhXAyyiGR9A?key=weo2vl887S6ZT9ibnwfRY5gJ" alt=""><figcaption></figcaption></figure>

* #### [Chain Tactics Local Development & Headless Client](/build-with-sovrun/chain-tactics/getting-started-guides/chain-tactics-local-development-and-headless-client)
* #### [Lightweight Unity Client](/build-with-sovrun/chain-tactics/getting-started-guides/lightweight-unity-client)
* #### [Troubleshooting Chain Tactics Local Development](/build-with-sovrun/chain-tactics/getting-started-guides/troubleshooting-chain-tactics-local-development)
* #### [Chain Tactics Modding Tutorials](/build-with-sovrun/chain-tactics/getting-started-guides/chain-tactics-modding-tutorials)


# Chain Tactics Local Development & Headless Client

#### Setup Chain Tactics for Local Development

**Installation and Setup**

* Prerequisites:
  * To get started with the Chain Tactics Headless Client, ensure you have the following prerequisites installed and configured:
    * Smart Contract Dependencies:
      * Node.js (v20): Required for package management and script execution.
      * pnpm: Preferred package manager for handling dependencies efficiently.
      * Foundry: A powerful toolkit for developing, testing, and deploying smart contracts. Install via[ https://book.getfoundry.sh/getting-started/installation](https://book.getfoundry.sh/getting-started/installation).
    * Headless Client Dependencies:
      * .NET 9: The runtime required for executing the headless client written in C#.
* Installation Steps & Setup:
  * Unix/Linux Setup:
    * Install npm version 20.
    * Install Foundry:[ https://book.getfoundry.sh/getting-started/installation](https://book.getfoundry.sh/getting-started/installation).
    * Clone: git clone <https://github.com/sovrun/chain-tactics-server>.
    * Run the build\_and\_run\_contract.sh script to deploy the solidity smart contracts to local node.
    * Run the build\_and\_run\_server.sh script to start the server. (Note: On MacOS you may need to enable extra permissions via Apple settings and use the following command sh build\_and\_run\_server.sh )
    * Go to ./tactics-war-sc/packages/contracts/.env and update the following variables:
      * `RPC_URL=http://127.0.0.1:8545  # local chain`
      * `CHAIN_ID=31337                 # local default chain ID`
      * `PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80  # local default anvil account`&#x20;
    * Note: You may change the configurations above to use another chain network (e.g., for testnet, update RPC\_URL to <https://testnet-12-rpc-hyperliquid.sovrun.org/http>).
  * Windows Setup:
    * The same as Unix/Linux setup above, but scripts should be run on Git Bash.

Upon running both scripts, you will now how two terminals with similar output to the following:

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcS12jpIyLpguxIlQc8Kgrpp63qmzf1kAhm7j7vz7qwS7gTh5H5OQmRBURJ74XC-Bmr2_OqjufqXhYZpT-NajI2yN54nsAXIriGgyPQVXM7VEQgb8kY_SlZnkzDs-mMSbCvTUPH?key=weo2vl887S6ZT9ibnwfRY5gJ" alt=""><figcaption><p><strong>build_and_run_contract.sh expected output</strong></p></figcaption></figure>

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXe5xCF3K21N2BCCkfc2GPZy-TFsmVL4sM7qDAHhyAglyiF985JwqJ1R-KNnHtVWy9ZuNRqucghQMQLM_6yrCvecCCCE-hnxktV37avGstfC5V2mY2PANYOtreIbIh1pX81yLuQINw?key=weo2vl887S6ZT9ibnwfRY5gJ" alt=""><figcaption><p>build_and_run_server.sh expected output</p></figcaption></figure>

\
**Game Installation:**

* Download the installer (link provided separately).
* Run and launch the game, then click "Find Match" to play.<br>

**Using the Headless Client**

* Initialization:
  * var client = new CTServerContext("<http://127.0.0.1:8545>");
* Key APIs:
* * GetUnits(): Retrieves units on the board.
  * GetAvailableMoves(): Lists possible moves.
  * ExecuteMove(move): Submits a move to the blockchain.
* Example: List Units:

`using Sovrun.CTServer;`\
`class UnitLister {`\
&#x20;   `static void Main() {`\
&#x20;       `var client = new CTServerContext("http://127.0.0.1:8545");`\
&#x20;       `var units = client.GetUnits();`\
&#x20;       `foreach (var unit in units) {`\
&#x20;           `Console.WriteLine(unit.Name);`\
&#x20;       `}`\
&#x20;   `}`\
`}`

* Note: .NET Standard and Python Bindings are also supported for additional integration options.

**How to Run the Terminal DOTNET Test Implementation Locally**

Testing of the DOTNET server, smart contracts, and local anvil network can be tested via terminal. This is useful for confirming all configurations and code interoperates successfully, before testing on external testnets and mainnets.\ <br>

1. Once you have run the DOTNET server and deployed the smart contracts successfully in separate terminal windows (see Installation), navigate to /tactics-war-server/CTClientExample folder.
2. Run the following command in a third terminal window:

`dotnet run --framework net9.0 http://127.0.0.1:8545 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 0x8d8b6b8414e1e3dcfd4168561b9be6bd3bf6ec4b`

3. In terminal window 4, run the same command, but with the second Anvil default private key:

`dotnet run --framework net9.0 http://127.0.0.1:8545 59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d 0x8d8b6b8414e1e3dcfd4168561b9be6bd3bf6ec4b`

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXej4_Iy9pYTXj28qG4X03-uSaZgfb-h9dgx2xcOfbuy8amRK6G92t7ubd13KU89L-E6cv3f4G7BdRgbPeuL4onMrOhgsTOF2sSJc9G5DsSbWGU4vPiD-BNWRSCAsuY3cPLhhT3Z?key=weo2vl887S6ZT9ibnwfRY5gJ" alt=""><figcaption></figcaption></figure>


# Lightweight Unity Client

Sample Implementation using Unit

A Unity-based client showcases frontend integration:

* Prerequisites: Unity version requirement 2022.3 or higher.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfw30gGJdQ0UBkBjAh41DBGlDRi4XbGmNvNHjbcEylQHZymIaYN_BVJcxRTygQbXpKQs7ERz92rmAxQIeOddbDyP4Oy-ysjiklYBusWGXAkWGUb7BujBr12ZU-bwVpxrnK9y4Q4fw?key=weo2vl887S6ZT9ibnwfRY5gJ" alt=""><figcaption></figcaption></figure>

Installation:

1. Git pull repo:[ ](https://github.com/cellrunner/ct-headless-unity/tree/master)<https://github.com/sovrun/chain-tactics-unity-client>
2. You can either clone or download the zip.
3. With Unity version 2022.3.58f1, open the project folder chain-tactics-unity-client. Once you open the project, you can open a SampleScene which you can either duplicate or replace the content of. It is located at: Assets/Scenes/SampleScene.unity

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcvGRPWdkbFiX7cZDMYwLF0iBTWfSspxP1U2wU-YlYqQ_J_iOcCuSLweKMy57GkYuSKep69YF5cYM9sdhcAYHNuff7GVgZHCfRi22nDraU2umZwW48WZ1b97mg4IXPfUsoWgdWu?key=weo2vl887S6ZT9ibnwfRY5gJ" alt=""><figcaption></figcaption></figure>

4. The scene contains a \_WorldSettings prefab which is what you need to connect to the backend.
5. WorldSettings prefab can be found in Prefabs/Core/ folder which you can drag and drop in your hierarchy.
6. WorldSettings configuration:

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfrX6vtMss9EuMseMPLYjDrE8jHK_nIc_83o-AmAhxzeLIMh9D9mUq2IlnKyLg6dxAhfpOtAlzvEIANKbQNa72LqUrHCp3usgWtFgF4JnTUlEjpMbT7gsbeD4cJIpf0SuwZEhXL?key=weo2vl887S6ZT9ibnwfRY5gJ" alt=""><figcaption></figcaption></figure>

If you are developing your own mod, you can set connection type to development.

To create a new CT connection context, you can do the following steps:

* Right-click on the project folder, select Create > Chain Tactics > New Server Connection Configuration.<br>

  <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXe4kexgMv0khf4nP6H5_Sn-2yWWY9mxn48wZZ_dHguZ6KWRyNq_yh5NNqWLbBc4cd_DtWmkQQW1vKR2IavfIr-vo2LefLzyUB_x2YQ3qPnpfRiZ8TwccOlzOD_a07NGAOfEmfOXKg?key=weo2vl887S6ZT9ibnwfRY5gJ" alt=""><figcaption></figcaption></figure>
* You can configure CT connection context.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfnyfN-YWEZkxHfJN8ozRahqoCu-1zPtV8Zcd1z6JqtsntLh2os0b5C2GakOCUHvwiprV70ACTKjiBg3sdIU71CH8Pc28F6ytjCdB28lITEqKNQNC5qYeDGSLDc9fWQpnfPmui0Tw?key=weo2vl887S6ZT9ibnwfRY5gJ" alt=""><figcaption></figcaption></figure>

Here is example Local Development Connection Context:

* Url
* Private Key:
  * Client 1 Unity Build: 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
  * Client 2 Unity Build: 59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d
* World Address - 0x8d8b6b8414e1e3dcfd4168561b9be6bd3bf6ec4b
* Sequencer Url (This is required for the target L2 chain)
* Chain ID - 31337 (This is required for the target L2 chain)

\ <br>

**Building the Lightweight Unity Client**<br>

After cloning and configuring the lightweight client to run locally, you will need to build the Unity game with two different client builds. Each client is configured with different private keys (see above) with the end result of launching the two games side by side on your Mac or Windows computer.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfHoLYrt0Amx4HEOEhA1edL1n6S14yn5xcevPdIFbMkYVORMzxAvGwYO0UuxMtC2ePjfLyPVpJJ_ofvkq4xjP4CQPAlJ_67cblCAcgMdjY6eyKTZVLrLgcE-ZKWUTugW4x05AY9lA?key=weo2vl887S6ZT9ibnwfRY5gJ" alt=""><figcaption></figcaption></figure>

The build settings are pretty straightforward. As we have already configured the Local Development connection profile above, we simply need to select the following:

* For Client 1, ensure the Development Connection Profile is configured with Anvil private address 1 specified. Ensure build\_and\_run\_contract.sh and build\_and\_run\_contract.sh are running in separate terminal windows.
* Select File menu > Build Settings
* Ensure the SampleScene is selected
* Select your Windows, Mac, Linux operating system
* Ensure “Development Build” is selected
* Select Build
* Specify the target application file name. Name it “Client 1”.
* For Client 2, ensure the Development Connection Profile is configured with Anvil private address 2 specified.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXc5PQLgjMcjVvTs6JAJXbSeCo2M7onukBvr8sdVnBIlOQOr2gPgs8KcH8ZpiI4B2MHRDl-ePuXXl1ifI4QMHSquAuecQ1YDFqyt2RcvryurmbEqlA5NmHVEK2PX2DV_aBC28H9jAg?key=weo2vl887S6ZT9ibnwfRY5gJ" alt=""><figcaption></figcaption></figure>

**Joining the Match with the Unity Lightweight Client**

After building the two clients, run them side by side and select the following:

* &#x20;Select Find Match<br>

  <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcFdh-S6U0bXEl1wx2AUHMFG_soFxhw7L3EAcPxNtTYfVxNxQ65F-KQWApxtN296ZNZbZPBXkUhivHoCUUYbfAArn9Zu21EUNgBkjPxYVekYl5umAmwahEjeb5BiogVaG3pc9ZaXQ?key=weo2vl887S6ZT9ibnwfRY5gJ" alt=""><figcaption></figcaption></figure>
* Once find match is selected, the client will keep searching until another client accepts the match<br>

  <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfGa2gx2qALmAcegSs8Rl5Um3lJi7zMp8G3ecBVFyIK6-2WFhT7ZbyrcgPWhqxcRfVU12iS0hr2LDFbn7dCUHDnXGJwE3i44kHTsDxiWO4h6F_z5FJs7wUhIhVqSL-fbw5W97diag?key=weo2vl887S6ZT9ibnwfRY5gJ" alt=""><figcaption></figcaption></figure>
* When both clients have accepted the match, you will transition to the game screen, where you must place your pieces on the board and commit them.<br>

  <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXe_oss0Iye0Hg10yYAlXazDWmJNyxElCh9zA0C574Xfh3MbBQPitkIhUTvZrgeImS8k7zs2JILYHfcxdHM7IhH_CKzY_jNW9w7n-slFgpwEWejV-bAO4bkT16sz1gHgHhaiiUCQDQ?key=weo2vl887S6ZT9ibnwfRY5gJ" alt=""><figcaption></figcaption></figure>

Once you have placed your pieces - enjoy your game!

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfJet-IFvbzBwyb4k1qcNdcbI2ZkaZUoBtgtXj09Y-d_JuBj-XriM4FtOic3M1dlYxX-dwF_X_1KFYN77iRooPWxFmBD1ocSIBi5vUBvr1eYcBYnouRvydiCJhcKmixOdfrJs0e?key=weo2vl887S6ZT9ibnwfRY5gJ" alt=""><figcaption></figcaption></figure>


# Chain Tactics Modding Tutorials

Unit Lister Mod:

* Set up the headless client (see Installation).
* Query units with GetUnits().
* Output names:

`using Sovrun.CTServer;`\
`class UnitLister {`\
&#x20;   `static void Main() {`\
&#x20;       `var client = new CTServerContext("http://127.0.0.1:8545");`\
&#x20;       `var units = client.GetUnits();`\
&#x20;       `foreach (var unit in units) {`\
&#x20;           `Console.WriteLine(unit.Name);`\
&#x20;       `}`\
&#x20;   `}`\
`}`

**AI Opponent Mod:**

`public class RandomAI {`\
&#x20;   `private CTServerContext client;`\
&#x20;   `public RandomAI(string rpcUrl) {`\
&#x20;       `client = new CTServerContext(rpcUrl);`\
&#x20;   `}`\
&#x20;   `public void MakeMove() {`\
&#x20;       `var moves = client.GetAvailableMoves();`\
&#x20;       `var randomMove = moves[new Random().Next(moves.Count)];`\
&#x20;       `client.ExecuteMove(randomMove);`\
&#x20;   `}`\
`}`

Enhance with strategies like minimax for smarter AI.


# Troubleshooting Chain Tactics Local Development

This section addresses common issues when developing with Chain Tactics, complementing the "Common Challenges" outlined in [Headless Client](/build-with-sovrun/chain-tactics/headless-client). Problems like sqlite build errors, indexing mismatches, or insufficient funds can arise, and the solutions below provide practical guidance [Chain Tactics Game Wiki](https://sovrun.notion.site/Chain-Tactics-Wiki-1617ef7904b28023b8d6d23291b1923e).

#### Common Issues

* Cannot build sqlite
  * Resolution: Make sure to install the correct version of npm to prevent any issues during installation.
* ArgumentOutOfRangeException, The application is showing the wrong data from an array/list
  * Resolution: Blockchain systems use 1-based indexing for their data structures, which differs from most game development environments like Unity and Unreal Engine that use 0-based indexing. This distinction is important to consider when integrating blockchain data into game logic, as it can result in indexing mismatches if not handled properly.
* How to know the last error?
  * Resolution: Make use of the method GetLastError() in the class CTServerContext.
* Insufficient funds
  * Resolution: Actions requiring frequent updates (e.g., player movement, health regeneration, or cooldown timers) can become costly and slow on-chain. Adopt a hybrid model; frequent updates managed off-chain, critical updates on-chain.
* Why is it taking too long to receive updates from the backend?
  * Resolution: Applying traditional real-time mechanics directly on-chain can result in delays due to transaction confirmation times. Consider adding mechanics designed to tolerate delays.
* Why are some of the methods still running after I stop the editor?
  * Resolution: In C# native, tasks stop when the application exits. In Unity, tasks may continue running even after the editor stops. Implement CancellationToken to manage async lifecycle.
* Why is my code not called? Why is it not running properly?
  * Resolution: Calling Unity-related APIs in an async background will cause errors or undefined behaviors. Consider using UnityMainThreadDispatcher or SynchronizationContext to switch back to the main thread if you want to handle Unity APIs.
* Error PlayerAlreadyInMatch when trying to find a new match
  * Resolution: The player is already in a match. Consider calling Leave() first.

Refer to this link for other possible issues:[ sovrun / tactics-war-sc packages / contracts / src / common / Errors.sol](https://github.com/sovrun/chain-tactics-server/blob/main/tactics-war-sc/packages/contracts/src/common/Errors.sol).

Debugging:

* Use GetLastError() in CTServerContext.
* Check Errors.sol on Bitbucket for error codes.

<br>

Reference Links:

* [Chain Tactics Game Wiki](https://sovrun.notion.site/Chain-Tactics-Wiki-1617ef7904b28023b8d6d23291b1923e)
* [Nethereum ](https://docs.nethereum.com/en/latest/getting-started/)
* [MUD Framework ](https://mud.dev/quickstart)
* [Chain Tactics Server & Smart Contracts Repo](https://github.com/sovrun/chain-tactics-server)
* [Chain Tactics Unity Client Repo](https://github.com/sovrun/chain-tactics-unity-client)


# ReadyGamer

A joint venture by Sovrun & Virtuals enabling AI-powered, autonomous decision-making in games through the GAME framework.

<figure><img src="/files/Q72OnRfAL21toNRZColK" alt=""><figcaption></figcaption></figure>

**Goal:**

Demonstrate the power of AI agents in games by showcasing the capabilities of the GAME framework.

**Objective:**

Partner with game developers to seamlessly integrate AI agents that enhance gameplay, increase engagement, and provide emergent experiences.

***

### Gaming's Stagnation: A Call for Innovation

For years, the gaming industry has thrived on incremental upgrades, familiar gameplay loops, and recycled content. While graphics have improved and mechanics polished, innovation has lagged behind. Many titles feel like echoes of their predecessors, lacking the groundbreaking shifts that once defined each new generation. This stagnation risks alienating players seeking fresh, immersive, and dynamic experiences.

But change is coming. The rise of AI, and more specifically autonomous agents, promises to shatter the ceiling of creative limitations. AI isn't just about smarter NPCs or improved physics. It's about crafting worlds that evolve, adapt, and respond uniquely to every player.

### The Power of AI and Autonomous Agents in Gaming

Imagine an RPG where NPCs remember your actions across in-game years, altering their attitudes and strategies based on your choices. Picture strategy games where AI opponents learn from your tactics and evolve new counter-strategies every session. Autonomous agents have the potential to:

* Create Unscripted Experiences – Worlds that dynamically shift, eliminating predictability.
* Forge Personalized Journeys – Games that adapt storylines and difficulty in real-time, tailoring experiences to individual playstyles or quests that appear randomly (e.g. Shangri-La Frontier unique side quests) based on varying triggers.
* Enable Deeper Immersion – AI-driven characters that converse and interact with human-like fluidity and emotional depth.

AI will no longer just populate the background of games; it will stand at the forefront, co-creating alongside players to deliver experiences that are as unpredictable and limitless as the imaginations of those who play them.

### Virtuals Protocol and Sovrun: Pioneers of AI on Web3

Virtuals Protocol has been a flagbearer for AI on Web3, championing the integration of cutting-edge technology into decentralized ecosystems. Meanwhile, Sovrun has been at the forefront of crafting innovative experiences that push the boundaries of player engagement and interaction, layered on top of games like Eve Frontier and Pirate Nation.&#x20;

The GAME framework by Virtuals will serve as the foundational base upon which Sovrun and Virtuals will build and layer new experiences. GAME is a decision-making engine that powers AI agents to act and interact in virtual worlds and environments , enabling the development of next-generation gaming ecosystems.

By combining their expertise, Virtuals and Sovrun are set to usher in the next frontier of gaming. Their shared vision is not just to enhance games but to redefine the very nature of play, leveraging AI to fuel creativity, immersion, and infinite replayability.&#x20;

### A New Era for Gamers

This partnership is more than a technological shift; it’s a cultural movement within gaming. Built by gamers, for gamers, Ready Gamer will empower players to not just experience games but shape them in real-time. The future of gaming lies in experiences that evolve alongside the player – unpredictable, intelligent, and deeply personal.

With Virtuals and Sovrun at the helm, the future isn’t just ready. It’s already gamer ready.

***

### Check out our Roblox integration Carnival Game!

{% embed url="<https://www.youtube.com/watch?v=EBbINuVZFmQ>" %}

{% hint style="info" %}
Learn more about our ReadyGamer AI Agent [Roblox Integration](/build-with-sovrun/readygamer/roblox-integration) here!
{% endhint %}


# Joint Venture

Virtuals + Sovrun = Virtuals

A joint venture between Virtuals Protocol and Sovrun - ReadyGamer leverages the G.A.M.E framework - designed for real-time, multi-agent interactions - to seamlessly integrate AI-driven NPCs into popular game worlds, including Roblox, Nifty Island, Youmio, and Chain Tactics.&#x20;

<figure><img src="/files/Q72OnRfAL21toNRZColK" alt=""><figcaption></figcaption></figure>

Our platform handles everything from capturing in-game dialogue, perceiving environment data to generating and delivering AI responses or game interactions.&#x20;

With the ReadyGamer stack, developers will ultimately allow users the ability to craft immersive, ever-evolving experiences that push the boundaries of interactive storytelling.

Across both traditional and Web3 gaming landscapes - adaptive storylines, dynamic quest generation, and real-time world evolution based on player actions

{% embed url="<https://www.youtube.com/watch?v=6Bloz4doxy4>" %}
Nifty Island ReadyGamer Integration
{% endembed %}


# Services

{% embed url="<https://www.youtube.com/watch?v=_xREgO61Yss>" %}
Basic Chat AI Agent Functionality (Luna on Nifty Island)
{% endembed %}

We offer end-to-end AI integration solutions, from basic implementations to full-scale AI agent design.

* Basic Chat AI Agent Functionality – Bring NPCs to life with AI-driven dialogue and personality-based interactions.
* Game Design & Core Loop Integration – Ensure AI agents enhance core gameplay loops without disrupting balance.
* Bespoke AI Agents – Custom-built agents designed for unique in-game roles (AI-driven shopkeepers, trainers, quest-givers, etc.).
* Proof-of-Concept / MVP Development – Create a small-scale prototype to test AI integration before full deployment.

{% embed url="<https://www.youtube.com/watch?v=nKPiYdr22rc>" %}
Basic Chat AI Agent Functionality (VaderAI on Nifty Island)
{% endembed %}

### On-Demand AI

**The game sends a request to the Agent endpoint (triggered by the player)**

* AI agents provides decisions only when requested. The game "pulls" a decision from the AI based on the current environment.
* In this case, the player explicitly triggers the request. Ideal for chat, strategy-based gameplay, NPC interactions, and turn-based decisions.

**Examples**

* Planet Mojo Poker Agents receive the current state (hand, board), decide moves based on the poker match history
* Nifty Island: AI-driven NPCs on specific islands engage in conversations with players, responding with unique personality-driven dialogue.

<br>

**The game sends a request to the Agent endpoint (triggered by the game silently)**

In this case, the game constantly runs a check in the background regarding the its state and then sends an AI agent request quietly (meaning, the player does not see this request) when it sees fit. This gives the illusion that AI agents run autonomously, making decisions based on the environment-action data feedback loop. Best suited for open-world games, survival mechanics, and emergent storytelling.

**Examples**

* Roblox Game: AI-driven NPCs “autonomously” patrol, interact, and respond dynamically to players, adjusting their behavior in real-time.&#x20;

{% embed url="<https://www.youtube.com/watch?v=XSdE4SrRYlY>" %}
ReadyGamer - AI Agent API Integration with Westport
{% endembed %}


# Architecture

<figure><img src="/files/tcHgzC4FezD85Xpl6XWB" alt=""><figcaption></figcaption></figure>

#### Example AI Agent Architecture Flow <a href="#id-4.-example-ai-agent-architecture-flow" id="id-4.-example-ai-agent-architecture-flow"></a>

A visual representation of how the GAME framework interacts with a game’s systems, including:

* Input Sources (game state, player actions, environmental data)
* Decision-Making Layer (AI processing and action selection)
* Output Actions (NPC movement, dialogue, game event triggers)

<figure><img src="/files/brLChP8aZHj2ux8w8STs" alt=""><figcaption></figcaption></figure>


# GAME Framework

{% embed url="<https://www.youtube.com/watch?v=ADRbiLfGKZU>" %}
ReadyGamer has successfully configured custom AI Agents using G.A.M.E Framework to play poker.
{% endembed %}

The Virtual's GAME framework is a modular agentic AI system that enables NPCs, companions, or game entities to autonomously plan actions and make decisions based on in-game context.

* Decision-Making Engine: Built on foundation models, allowing AI agents to assess situations and determine the best course of action.
* Action Execution: The framework not only thinks but also processes and outputs executable actions within the game environment.
* Autonomous Purpose: Best suited for agents that operate without direct player input, reacting dynamically to the game world.

{% hint style="info" %}
Learn more about the Virtual's agentic [GAME Framework](https://docs.game.virtuals.io/) here!
{% endhint %}

{% embed url="<https://www.youtube.com/watch?v=B1vzCM8aaHM>" %}
ReadyGamer has successfully configured custom AI Agents using G.A.M.E Framework to play poker.
{% endembed %}


# ReadyGamer API

{% hint style="info" %}
Please reach out if you would like a specific endpoint created for you to start here > [ReadyGamer API Access Request](https://forms.gle/YYsfsQLijnXJ23sdA)
{% endhint %}

### Direct ReadyGamer API Access (Existing Virtuals Agent)&#x20;

{% hint style="info" %}
The following sections is if you have an existing Virtuals agent that you want to deploy in your game!&#x20;
{% endhint %}

Your game should do an HTTPS Post request to the endpoint that we will provide you in order to send the chat data. The URL that we will create for you will be in this format:

{% code overflow="wrap" %}

```
https://api.ready-gamer.sovrun.org/api/<name_of_game>/<command>/chat
```

{% endcode %}

For example:&#x20;

{% code overflow="wrap" %}

```
https://api.ready-gamer.sovrun.org/api/roblox/lightsout/chat
```

{% endcode %}

Method: POST

Headers: X-API-Key (Will be provided by Ready Gamer team separately)

### Default template for POST Request <a href="#default-template-for-post-request" id="default-template-for-post-request"></a>

\
Below is the list of the default parameters for a basic chat integration to the Ready Gamer API. In case your game needs to send additional data i.e. environment data, please contact us so we can tailor fit the endpoint for you.

<pre><code><strong>{
</strong> "text": "how are you doing?",
 "userId": "123abc",
 "userName": "john",
 "agentName": "test_ready_gamer_agent",
 "agentId": "8",
}
</code></pre>

* **text** is the chat message coming from the user inside the game
* **userId** is the user id of the player who's currently chatting with the agent npc..
* **userName** is the name of the player who's currently chatting with the agent npc.
* **agentName** is the name of the agent. This should be a unique value per specific agent. We will use this value to delegate the message to the corresponding agent.
  * For testing purposes, please use *"test\_ready\_gamer\_agent"* as the agentName value.
* **agentId** is the id of the agent relevant to the game. We added this to the template so that the game can properly delegate the message in case there are multiple instances of the same agent.

### Default template for the Response <a href="#default-template-for-the-response" id="default-template-for-the-response"></a>

\
After calling the endpoint provided to you, the response will be in this format:

```
{
    "response": "i'm doing great john!", 
    "agentId": "8", 
    "agentName": "test_ready_gamer_agent"
}
```

***

### Direct ReadyGamer API Access (Existing Agent)&#x20;

{% hint style="info" %}
The following sections is if you have an existing agent that you want to deploy in your game!
{% endhint %}

To prepare your agent for integration with the Ready Gamer API, your agent should have an endpoint with a capability to accept HTTPS POST requests in the format below.

### HTTPS Post Request Format <a href="#https-post-request-format" id="https-post-request-format"></a>

```
{
    "message": "how are you doing?",
    "name_of_player": "john",
    "environment": ""
} 
```

* **message** is the chat message coming from the game.
* **name\_of\_player** is the name of the player who's currently chatting with the agent.
* **environment** is a string containing information describing the current game state.

### Response Format <a href="#response-format" id="response-format"></a>

\
Regardless of what custom functions the agent was built to do, it should respond to the request in this format:

```
{
    "response": "i'm doing great john!"
}
```

* **response** is the processed message reply of the agent.

Once your agent endpoint is ready to accept this request, please contact us so we can connect you to the Ready Gamer API.


# Integration Workflow

A structured breakdown of how game studios can engage with us to integrate AI into their games.

1. Discovery & Ideation – Understand game needs and define the role of AI agents.
2. Prototype Development – Build a small-scale AI system for testing.
3. Technical Integration – Connect the GAME framework with game mechanics.
4. Testing & Iteration – Ensure AI agents behave as expected.
5. Deployment & Support – Live integration and ongoing updates.


# Roblox Integration

{% hint style="info" %}
Please reach out if you would like a specific endpoint created for you to start here > [ReadyGamer API Roblox Access Request](https://forms.gle/YYsfsQLijnXJ23sdA)
{% endhint %}

{% embed url="<https://www.youtube.com/watch?v=6uo56ESEb04>" %}
Lights Out Roblox Integration
{% endembed %}

We have integrated the ReadyGamer AI Agent Framework into many Roblox games! You can find several video examples of this integration in our documentation.&#x20;

We have built the [Roblox Demo Game - Carnival AI](/build-with-sovrun/readygamer/roblox-integration/roblox-demo-game-carnival-ai) to demonstrate the different [AI Agent NPC's](/build-with-sovrun/readygamer/roblox-integration/ai-agent-npcs) and showcase how our [Roblox AI Agent Module](/build-with-sovrun/readygamer/roblox-integration/roblox-ai-agent-module) really works!&#x20;

### The Benefits of ReadyGamer Roblox Integration

| 🧭 Autonomous Navigation    | Agents move and interact without hardcoding every step                                                                                                                                |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 🗨️ Intelligent Interaction | NPCs give personalized responses or quests                                                                                                                                            |
| 🎮 Live Game Awareness      | AI adapts based on player behavior (e.g.  give players quests if they are idle, gives them rewards if they are playing for long duration, dynamic upselling of in game items bundles) |
| 🔌 Plug & Play Modules      | Developers don’t need to reinvent AI—they just plug in agent behavior                                                                                                                 |

### How does it work?

<figure><img src="/files/7WJIJ4qHZQyxpBMbB75f" alt=""><figcaption></figcaption></figure>

### Roblox API Integration

<figure><img src="/files/TyZ6VFwSKzofzSXGcexH" alt=""><figcaption></figcaption></figure>

{% embed url="<https://www.youtube.com/watch?v=XSdE4SrRYlY>" %}
ReadyGamer - AI Agent API Integration with Westport
{% endembed %}


# Roblox Demo Game - Carnival AI

Live on Roblox!

We have launched a Roblox demo game called Carnival AI tos showcase all our AI Agent NPC's and AI Agent Modules.

<figure><img src="/files/Zlmi7qzfRxrpH1NM2oqf" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
[Play Carnival AI game now!](https://www.roblox.com/games/79822204321584/Carnival-AI)
{% endhint %}


# AI Agent NPC's

{% embed url="<https://www.youtube.com/watch?v=EBbINuVZFmQ>" %}

We have built template use-cases for our AI Agent NPC's so that any Roblox developer can quickly integrate them into their game:

* [#smart-npcs](#smart-npcs "mention")
* [#tutorial-npcs](#tutorial-npcs "mention")
* [#recommender-npcs](#recommender-npcs "mention")
* [#quest-giver-npcs](#quest-giver-npcs "mention")

***

### Smart NPC's

AI powered NPC for conversational experiences

Features

* Chat
* Customizable for your game world (ie: Provides tickets/rewards)
* Static or roaming
* Tracks metrics of player engagement

Example use-cases (see video above)

* Superhero
* Clown
* Cotton Candy Guy
* Fortune Teller

***

### Tutorial NPC's

Interactive tutorial NPC to teach gameplay

<figure><img src="https://lh7-rt.googleusercontent.com/slidesz/AGV_vUe1q9jEfkemL6YuEFzGFqSO5HZygU1KfPVCxl-_aaH9N2laeCG-vq19LNsNt0A1gxuTJM_1OH-LKqvDZSCesSMXMMa3RvY7Budlegai1FGQ6fNmAxagAtavdngem3lkccxoXjjfLg=s2048?key=WOAoL6PaG1XXQZ1nS_eXjnKz" alt=""><figcaption><p>Tutorial NPC's</p></figcaption></figure>

Features

* AI agent that conversationally responds to player to guide them for initial game play onboarding
* Can be static, triggered by player spawning or roam in a fixed area
* Tracks metrics of player bounce rate in your game

Example use-cases (see video)

* NPC stands near the of the game world for the player to talk to if needed. Walks up to the player when he first visits the game world. Walks up to the player when he first plays a mini game.

***

### Recommender NPC's

Semi-autonomous agent to help with game item sales

Features

* Walks up to the player from time to time depending on conditions and recommends either:
  * Buy something using premium currency
    * Game pass
    * Consumables
    * Or more
* Recommends to try out a game activity if idle for a time
* Recommends to purchase something and/or gives tips if the player repeatedly fails a game activity
* Tracks metrics of player conversion rates, sales information

Example use-cases

* Premium item salesman
* Upsell agent

***

### Quest-giver NPC's

Integrates with quests to ensure player completes objectives

Features

* Gives a quest depending on player state (play time, active/unfinished quests, finished quests)
* Sample quests (game specific):
  * Jump X Times
  * Interact with NPC
  * Go to Object
  * Play Minigame
* NPC, Object, and Minigame are not repeated if it has been previously given

Example use-cases

* NPC integrated into your games story who are required to be conversationally interacted with to unlock quests.


# Roblox AI Agent Module

{% hint style="info" %}
Read our Getting Started Guide [Getting Started](/build-with-sovrun/readygamer/roblox-integration/roblox-ai-agent-module/getting-started) for how to integration the ReadyGamer API via our Roblox AI Agent Module in Roblox Studio!
{% endhint %}

AIAgentModule is a modular system for Roblox games designed to integrate LLM AI Agents into Roblox experiences. It provides a structured way to create and manage AI-driven NPCs within Roblox.

You get started by creating an AIAgent object, giving it a predefined LLM AIAgent, then assigning to it an avatar in Roblox. While the experience is running, the game can provide the LLM AIAgent with the current game state and then query it for a response. The developer can then do whatever he wants with the response.

Read more > [Getting Started](/build-with-sovrun/readygamer/roblox-integration/roblox-ai-agent-module/getting-started)


# Getting Started

Follow these steps in order to use the AI Agent system in your project:

#### 1. Request Access

Contact Sovrun to request access to the `AIAgentModule`.\
Your Roblox account or group must be granted permission before you can import the module.

***

#### 2. Download the Module

{% hint style="info" %}
You must login with your Roblox developer account to see this page!
{% endhint %}

<figure><img src="/files/Dza4tPjcLGT71qhO47Va" alt=""><figcaption><p>AIAgentModule on the Roblox Creator Hub (must login to install)</p></figcaption></figure>

Get the AIAgentModule from the official Roblox Creator Store:\
📦[ AIAgentModule on Roblox Creator Store](https://create.roblox.com/store/asset/96884408071257/AIAgentModule)

***

#### 3. Set Up the Module

1. Once downloaded, locate the `AIAgentModule` folder inside the package.
2. Move the entire `AIAgentModule` folder into ReplicatedStorage in your game hierarchy.


# Module Components

## AIAgent (Class)

Location: `AIAgentModule/AIAgent.lua`\
Represents the core AI agent class, responsible for binding AI functionality to an NPC model.

#### Constructor

`AIAgent.new(getGameState: () -> table, npcModel: Model, personalityId: string, executableCommands: table)`

Creates a new instance of an AI agent with the specified parameters.

#### Parameters

* `getGameState:` A function that returns the current game state as a table. The actual AiAgent will use the data that this provides in order to make its decisions.
* `npcModel:` The in-game NPC model the AI agent is attached to, turning it into a "smart NPC".
* `personalityId:` The identifier for the AI agent, and by extension its personality.
* `executableCommands:` A table containing available commands the AI agent can execute in-game, including contextual rules, such as needed parameters, for each command.

#### Internal Properties

* `agentId (string):` A unique in-game identifier for the AIAgent object instance, generated using `HttpService:GenerateGUID()`.
* `npcModel (Model):` The reference to the NPC model associated with this AI agent object.
* `getGameState (function):` Stores the game state function for internal use.
* `personalityId (string):` Stores the personality ID used to contextualize the agent’s behavior.
* `isRunningBehavior (boolean):` Tracks whether the agent is currently running a continuous behavior loop.

#### Functions

* StartContinuousBehavior(behaviorModule: ModuleScript, frequency: number)\
  Starts a custom behavior loop using a ModuleScript provided by the developer, executed at intervals using the specified frequency (in seconds).
* `SendApiRequest(method: string, endpoint: string, body: table, headers: table?)`\
  Sends an HTTP request to an external API. Acts as a wrapper for HTTP communication.
* `SendChatMessageToAgent(player: Player, message: string, extraBodyData: table?)`\
  Sends a chat message from a player to the API for generating a contextual response.
* `SendQueryToAgent(requestBody: table)`\
  Sends a custom query payload directly to the API. This may return a message or a command.<br>

***

### AIAgentManager (Manager)

Location: `AIAgentModule/AIAgentManager.lua`\
Handles the creation, management, and retrieval of AI agent instances.

#### Fields

* `aiAgents:` A list containing all active AI agents.
* `agentToNpcTable:` A mapping between NPC models and their associated AI agents.<br>

#### Functions

* `AIAgentManager:CreateAgent(getGameState, npcModel, personalityId, executableCommands, continuousBehaviorScripts, frequency)`\
  Creates and initializes a new AI agent, optionally assigning continuous behavior scripts.
* `AIAgentManager:GetAiAgentFromNpc(npcModel: Model)`\
  Returns the AI agent associated with the specified NPC model.
* `AIAgentManager:GetAiAgentFromNpcName(npcName: string)`\
  Returns an AI agent by its NPC’s model name.
* `AIAgentManager:GetAiAgentFromId(id: string)`\
  Returns an AI agent using its unique agent ID.<br>

***

### AICommandMap (Commands)

Location: `AIAgentModule/AICommandMap.lua`\
Defines a set of commands that can be executed by the AI agent upon receiving a specific instruction.

#### Built-in Commands

* `MoveTo:` Moves the NPC to a specific position.
* `MoveToPosition:` Uses pathfinding to move the NPC to a target position.
* `MoveToTarget:` Moves the NPC to the location of a specified model or object.
* `FollowTarget:` Causes the NPC to continuously follow a designated target (e.g., a player).<br>

Each command performs parameter validation and utilizes core components of the NPC model, such as `Humanoid` and `HumanoidRootPart`, to execute actions effectively.\ <br>

***

### AIConfigurations (Config)

Location: `AIAgentModule/AIConfigurations.lua`

Defines the list of configurable data for the AI Agent Module

Sample Content:

`local Config = {}`\
&#x20;`Config.URL = "https://api.ready-gamer.sovrun.org"`\
&#x20;`return Config`


# Creating a Smart NPC

To create a smart NPC, use the AIAgentManager's CreateAgent method. This method initializes an AI agent and binds it to an NPC model, enabling it to act based on AI decisions.

***

#### Required Parameters

* `GetGameState():` A function that returns the current game state as a table when called. This is passed to the AI for contextual decision-making.<br>
* `NPC Model:` The NPC model instance in the game. It must contain a Humanoid, HumanoidRootPart, and a valid PrimaryPart.<br>
* `PersonalityId:` A string representing the selected personality profile for the AI agent (e.g., "clown", "fortune-teller", etc.).<br>
* `ExecutableCommands:` A table that lists the commands the agent is allowed to execute. Each command can optionally include context or conditions under which it should be used. This will be sent to the AI server so the AI can determine appropriate actions.<br>
* [`ContinuousBehaviorScripts[]`](/build-with-sovrun/readygamer/roblox-integration/roblox-ai-agent-module/creating-a-continuous-behaviour-script)`:` An array of behavior modules to assign to the NPC. Each module defines recurring logic such as patrols, scanning, or idle checks.<br>
* `Frequency:` A number that determines how often the continuous behavior scripts should be executed.

Sample Usage:

`local replicatedStorage = game:GetService("ReplicatedStorage")`\
&#x20;`local aiAgentManager = require(replicatedStorage.AIAgentModule.AIAgentManager)`\
&#x20;`local customBehaviorScript = require(replicatedStorage.CustomScript)`\
&#x20;`local clownSmartNpc = aiAgentManager:CreateAgent(`\
&#x20;   `gameState, -- Function that returns the game state`\
&#x20;   `workspace.NPCs:WaitForChild("Clown"), -- NPC Model`\
&#x20;   `"clown", -- Personality ID`\
&#x20;   `{ "MoveTo", "FollowTarget" }, -- Executable commands`\
&#x20;   `{ customBehaviorScript }, -- Behavior scripts`\
&#x20;   `100 -- Behavior execution frequency`\
&#x20;`)`


# Creating a Continuous Behaviour Script

A `ContinuousBehaviorScript` is a module that defines recurring behavior logic for an AI agent. This logic is executed based on a specified frequency set when initializing the agent.

When the behavior runs, the aiAgent instance is passed as a parameter to allow access to its methods and data.

***

#### Requirements

The behavior module **must implement** the following structure:

`local replicatedStorage = game:GetService("ReplicatedStorage")`\
&#x20;`local aiCommandMap = require(replicatedStorage.AIAgentModule.AICommandMap)` &#x20;

&#x20;`local module = {}`

&#x20;`-- Called before the behavior is run`\
&#x20;`function module.InitializeBehavior()`\
&#x20;`-- Perform any setup required before the behavior starts`\
&#x20;`end`

`-- Called before each behavior execution cycle`\
&#x20;`-- Return true to run the behavior, false to skip`\
&#x20;`function module.BehaviorConditionsCheck(aiAgent: AIAgent): boolean`\
&#x20;   `-- Add logic to determine if behavior should run`\
&#x20;`return true`\
&#x20;`end`<br>

`-- Called when conditions pass; executes behavior logic`\
`function module.RunContinuousBehavior(aiAgent: AIAgent)`\
&#x20;   `-- Add your custom behavior script here` \
&#x20;   `-- Sends current game state to the AI server`\
&#x20;   `-- Expects a response which may include a message or command`\
&#x20;   `local response, status = aiAgent.SendQueryToAgent({ aiAgent.GetGameState() })`\
&#x20;   `if not response then`\
&#x20;       `return false`\
&#x20;   `end`\
\
&#x20;   `-- Executes command based on AI response`\
&#x20;   `if response.command then`\
&#x20;       `local commandResponse = aiCommandMap[response.command.functionName](response.command.parameters)`\
&#x20;   `end`\
`end`\
`return module`


