> For the complete documentation index, see [llms.txt](https://metaspacechain.gitbook.io/whitepaper/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://metaspacechain.gitbook.io/whitepaper/technology.md).

# Technology

MetaSpace’s tech stack is chosen to deliver the most seamless RPG gaming experience possible. The game integrates blockchain technology, time-tested game development tools, and a scalable backend infrastructure. This combination ensures fast performance, true asset ownership, and smooth multiplayer features even as thousands of players join together. Each element is chosen to work well together so the game feels responsive on mobile phones, as well as on other platforms in the future. We focused on tools that are reliable, fast, and easy to scale as the community grows. The aim is to never let players worry about lag, lost items, or complicated setups. The stack is designed to keep the game running smoothly while giving the user full control over purchases.

### Blockchain Integration: Smart Contracts on Polygon

MetaSpace's smart contracts are deployed on the Polygon chain. We picked Polygon for its speed and affordability, along with the robust security of the Ethereum core. Polygon is a Layer 2 blockchain built on top of Ethereum and is designed for faster transaction speeds, significantly lower gas fees, and improved scalability. This makes the chain ideal for gaming applications that demand real-time interaction and frequent micro-transactions. Thus, players can buy, sell, and stake NFTs in real-time without waiting long or paying high fees.&#x20;

All in-game assets, such as weapons, vehicles, and characters in MetaSpace, are minted as NFTs on Polygon. The NFT smart contracts manage ownership and transfer of all in-game assets. Smart contracts ensure full and absolute ownership of in-game assets. Once a user buys or earns an item, it is permanently theirs on the blockchain. Users can trade, sell, stake, or use it inside the game. No one can take it away or modify it, and anyone can verify ownership via a Polygon blockchain scanner. MetaSpace smart contracts are regularly audited to protect against new vulnerabilities.

**These are our most used smart contracts:**

| Contract Name                                                                                                    | Description                             |
| ---------------------------------------------------------------------------------------------------------------- | --------------------------------------- |
| [LordToken](https://polygonscan.com/address/0x32522357a30e2f5b685ee90014f63a47df1f9577#code):link:               | created $LORD                           |
| [MetalordToken](https://polygonscan.com/address/0xca082498a1de55c5d13c5af2b10ca5e1957349e6#code):link:           | created $MLD                            |
| [SwapContract](https://polygonscan.com/address/0x4d0d8ea029c9aee08e149eda4a484855f3e014ab):link:                 | functionality to swap $LORD for USDT    |
| [MetalordNFTManager](https://polygonscan.com/address/0x2f2616c9248c8be22132aac7cf728a3a698a2a13#code):link:      | mint and manage NFTs                    |
| [NFTStaking](https://polygonscan.com/address/0x03ba23db083b36af9ba6de92b76b2dfad96682a7#code):link:              | staking and unstaking NFTs              |
| [MLDStaking](https://polygonscan.com/address/0xe2d23f0cfc75c06d651f881c80145acb4d329dc3#code):link:              | staking and unstaking $MLD              |
| [MetaspaceNFTMarketplace](https://polygonscan.com/address/0x7ca5dce7a8886c023d37f383a2b8c219a287e0e5#code):link: | manages transactions in the marketplace |
| [Marketplace Relayer](https://polygonscan.com/address/0xf916a36bcb1e9bf3be77b02159dd33fe28586f0f):link:          | gas fee in the marketplace              |
| [LordRewardDistributor](https://polygonscan.com/address/0x58609e5fa639b3d365db3cf75de6bdce8fa8ec64#code):link:   | in-game $LORD distribution              |
| [CommunityAirdrop](https://polygonscan.com/address/0x1885b2a7ed05ffb637d38cfc8441c9e4072baf79#code):link:        | community airdrops                      |
| [Bulk Transfer](https://polygonscan.com/address/0x272fb8c846dd95f26be5902babb567c582a0f6e5#code):link:           | community rewards                       |
| [CommunityTreasury](https://polygonscan.com/address/0x42df1e97409b0b24ef3b84619caff9d1cb9ea175#code):link:       | community treasury                      |
| [PartnersTreasury](https://polygonscan.com/address/0x988fc8f0e63e47364635e18101ad2a990790284e#code):link:        | partner's treasury                      |
| [PartnersVesting](https://polygonscan.com/address/0x2647d5b7fafedb729e606edb6d2a354b0e92c9ef#code):link:         | partner's vesting schedule              |

### 3D Animation and Rendering

The MetaSpace game uses high-quality visuals and lifelike character movements.  All character work is done in Maya for high-precision rigging, skinning, and facial animation. We combine keyframe animation as the primary technique with motion capture to create realistic, smooth movements for combat, exploration, and storytelling. This produces natural character movements without sacrificing performance.&#x20;

To deliver rich visuals on mobile devices, we first create assets in great detail on mid-poly models and then bake all surface information onto optimized low-poly models. Texture compression is applied throughout the pipeline to reduce file sizes and memory usage further. This process ensures that every NFT asset, including weapons, vehicles, and characters, looks detailed in-game while loading quickly on players’ devices.\
\
We use baked lighting for consistent, high-quality illumination across environments with minimal real-time cost. Character animations are done at 30 FPS while polygon budgets are carefully controlled. NPCs are limited to 15,000 polygons and main characters to 20,000 polygons, delivering fine-detail visuals while maintaining excellent frame rates even during large multiplayer encounters.&#x20;

### Game Engine: Built on Unity

MetaSpace is built on the Unity game engine. We chose Unity because it is versatile and an industry standard for scalable mobile games. Unity powers numerous successful titles, including other established Web3 mobile games. Unity offers extensible tooling support, resulting in seamless Web3 integration via native plugins. This accelerates the development of wallets, NFTs, token rewards, and other features rather than coding everything from scratch.&#x20;

The project follows modern Unity best practices using Addressables for dynamic asset loading and Scriptable Objects for clean, data-driven design. Rendering is powered by the Universal Render Pipeline (URP) with custom shaders and post-processing effects to deliver rich visuals while maintaining excellent performance. Key optimizations include Occlusion Culling, GPU Instancing, and continuous analysis via Unity’s Profiler to ensure smooth frame rates across devices.&#x20;

The real-time multiplayer mode is powered by Photon, providing low-latency synchronization for avatars, combat, and events. Blockchain wallet connectivity is handled through Web3Auth, while the Nethereum plugin manages direct interactions with Polygon smart contracts. User progress and inventory are securely stored using Firebase, and Opsive tools power the story mode and character systems.&#x20;

### Backend Infrastructure

MetaSpace’s backend architecture is designed with low-latency hosting, real-time data synchronization, and comprehensive monitoring. The core servers and APIs are hosted on DigitalOcean. It’s a cloud platform that is known for its simplicity, cost-efficiency, and high-performance virtual machines. This gives us the freedom to scale quickly when player numbers suddenly rise. Thus, our servers can handle thousands of players with little or no lag. We use Web3Auth for player authentication during signup and login. This will allow users to instantly connect their social accounts or email without worrying about seed phrases or complex wallet setup.&#x20;

For dynamic features like live multiplayer sessions, leaderboards, and in-game events, we use Google Cloud's real-time database solutions. It’s a NoSQL database and offers sub-second query times, automatic synchronization across devices, and built-in security. This allows leaderboards to update instantly, and multiplayer matches go smoothly even with players from different countries.

System health and performance are monitored using Grafana, an open-source analytics platform integrated with our cloud infrastructure. Grafana provides customizable dashboards for metrics like server uptime, latency, and resource usage. Our team can spot and fix issues before players even notice them. The backend is designed to be reliable and supports a massive user base and real-time interaction. It ensures MetaSpace scales well as the community grows. We chose this stack for the backend because they offer the perfect mix of speed, reliability, and cost-effectiveness. The infrastructure is built to grow with the game for many years ahead.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://metaspacechain.gitbook.io/whitepaper/technology.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
