Best service for using a unity instance to immediately simulate the results of a game

0

Thanks for taking the time to help me out!

Overview:

I am developing a battle simulation game where players setup their battle board and face off against each other. I am looking for a server hosting solution that would be most cost efficient given the games needs.

Game Requirements:

Players have their battle configuration setup before entering a match and there is no client interaction with the server while the battle is resolving. We plan on having a lambda request find another players board configuration to face off against. Because of this, a constant websocket connection and an active opponent is not required. Instead, the server can simulate the game, collecting a series of data modification records that it will communicate in a single message to the client so the client can visualize the resolution.

Our server needs to be a Unity instance.

Hosting options I know about:

I have worked with GameLift before, which has been great but expensive. Because a websocket connection with the client is not required, this GameLift seems like overkill.

Is it possible for a Lambda request to boot up a unity instance, simulate the match (simulation takes around 0.2 seconds), then take the match result from the unity instance and sends it to the client?

If not, maybe it would be best to have a single EC2 server or GameLift instance responsible for generating all games for a given region.

Or is there another option that would be cheaper than GameLift instances for each client that requests a match resolution?

Thanks in advance for any advice!

1 Answer
2
Accepted Answer

Based on the requirements and context you've provided, it seems you're looking for a cost-efficient, scalable server solution to handle battle simulations in your game without the need for persistent connections or real-time interactions. Here are a few options and considerations:

AWS Lambda with Container Images:

AWS Lambda now supports container images, which means you can package and deploy your Unity application as a container image. However, you'll need to consider the cold start time, especially if your container is large. You mentioned that the simulation takes around 0.2 seconds, which is well within Lambda's execution time limits.

ECS (Elastic Container Service) or EKS (Elastic Kubernetes Service) with Fargate:

If containerizing your Unity instance is feasible, ECS or EKS with Fargate allows you to run containers without having to manage servers or clusters. Like Lambda, you pay for what you use, and Fargate scales the compute capacity to match your workload.

ECS/EKS with Spot Capacity:

ECS/EKS with Spot Capacity leverages unused EC2 capacity at discounted rates. It combines the management convenience of ECS/EKS for containerized applications with the savings of Spot Instances. The service ensures automatic scaling and integration with AWS services, offering a seamless environment for deployment and management. This solution is ideal if your workload is designed to manage occasional disruptions effectively.

Batch Processing with AWS Batch:

If the matches can be processed in batches (i.e., not necessarily in real-time), AWS Batch could be a good solution. It efficiently runs hundreds to thousands of computing jobs across a range of AWS compute services, including AWS Lambda and ECS.

GameLift FleetIQ:

If you prefer GameLift for its features but find it expensive, consider GameLift FleetIQ. It's a solution for managing game servers on cheaper EC2 Spot Instances, potentially offering the best of both worlds.

Hybrid Approach:

You might also consider a hybrid approach where you use Lambda for lighter, less frequent tasks, and have an EC2 instance (or ECS/EKS with Fargate) for more demanding, continuous tasks.

If this has answered your question or was helpful, accepting the answer would be greatly appreciated. Thank you!

profile picture
EXPERT
answered 2 months ago
profile picture
EXPERT
reviewed a month ago
profile pictureAWS
EXPERT
reviewed 2 months ago
  • This is great! Thank you

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions