# Running a MOBA Game on Virtual Machines

## Background Information

MOBA (Multiplayer Online Battle Arena) is based on the game scene of the arena, which is a multiplayer online real-time strategy game with the characteristics of real-time combat and high requirements for latency. Therefore, the deployment of most battle environments needs to be close to players and require mutual communication among different regions worldwide.

In the process of global coverage for real-time battle games like MOBA, an architecture is adopted that consists of edge battle nodes for edge coverage and core nodes for central deployment. The edge battle nodes are responsible for real-time interaction during user battles, while the core nodes handle functions such as game user authentication, login, and recharge.

By using Zenlayer's virtual machines, edge battle nodes can be quickly deployed near the user side within a global scope, and they can scale and expand elastically according to user volume and business scale.

<img src="/files/7jtYMrPiHm5vGrczB4nt" alt="A Demo of MOBA Game Deploying" class="gitbook-drawing">

## Prerequisites

* For this demo, we will be using Zenlayer virtual machine. Assume you deploy your central node on the public cloud - AWS, and deploy your battle nodes on Zenlayer cloud in Hong Kong (HKG), San Paulo (SAO) and Frankfurt (FRA).
* See [**Virtual Machine Creation**](/welcome/virtual-machine/get-started/virtual-machine-instance/create-an-instance.md) for the basic steps for deployment. The specific configurations are as follows.

## Instance Configuration

First, create your virtual machines on [**zenConsole**](https://console.zenlayer.com/).

### **Pricing Model**

For the long-term used nodes, here is battle node HKG, choose the cost-effective subscription pricing model; for the elastic battle node FRA, choose the flexible pay-as-you-go pricing model.

<div align="left"><figure><img src="/files/SUnSkYUHd2LYdQ02ZGnK" alt="" width="375"><figcaption><p>Pricing Model</p></figcaption></figure></div>

### Instance Model

To achieve a better gaming experience, you're recommended to choose the general-purpose model or the high-performance model of 8 cores vCPU and 32 GB RAM.

<div align="left"><figure><img src="/files/R9h4EKUCRhdVyF7XDSti" alt=""><figcaption><p>Instance Model</p></figcaption></figure></div>

### Instance Image

Choose a stable and game-friendly image. Typically, Windows operating systems are the most commonly used choice due to their wide compatibility and support. Make sure to install the latest operating system updates and drivers on the virtual machine to ensure optimal performance and compatibility. You can also [**create your own image**](/welcome/virtual-machine/get-started/virtual-machine-instance/create-an-image.md).

<div align="left"><figure><img src="/files/OgmOa9oe7cgJhG8A0MXw" alt=""><figcaption><p>Instance Image</p></figcaption></figure></div>

### Instance Storage

You're recommended to configure a 200 GB system disk. If you need more storage space, add additional data disks.

<div align="left"><figure><img src="/files/OhqH5riGIYVgLayBGXOY" alt=""><figcaption><p>Instance Storage</p></figcaption></figure></div>

### Result

Here we get three virtual machines.

<div align="left"><figure><img src="/files/8ymLeYe9aLOqqjWadMtD" alt=""><figcaption></figcaption></figure></div>

## Network Planning

Ensure a stable connection between the virtual machine and the network, and configure appropriate network settings.

See [**AWS documentation**](https://aws.amazon.com/solutions/games/?nc=sn\&loc=1\&dn=ga) for how to deploy your game on public cloud.

Connect your central node and battle nodes via public network. You can configure the [**security group**](/welcome/virtual-machine/get-started/network-and-security/create-a-security-group.md) to control inbound and outbound traffic for the instance. This can help protect the virtual machine from potential security threats.

## Summary

Please note that the best practices for setting up a MOBA virtual machine gaming environment may vary depending on the specific game and virtualization environment. Understanding the requirements of the game and the specific settings of the virtualization software will help you build an environment that suits your needs.


---

# Agent Instructions: 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:

```
GET https://docs.console.zenlayer.com/welcome/virtual-machine/best-practice/running-a-moba-game-on-virtual-machines.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
