Roboverse!

This is a submission for the Alibaba Cloud Challenge: Build a Web Game.* What I Built RoboVerse is an innovative 3D robot-themed web game that combines creative building mechanics with strategic battle gameplay. Players can design their own unique robots through an intuitive customization system, selecting different heads, bodies, arms, and legs - each affecting the robot's capabilities in battle. This was my introduction to vibecoding, letting copilot do most of the work. Demo https://roboverse.humanless.app/ Codebase Alibaba Cloud Services Implementation Originally designed to run on ECS using an autoscaling group, I shifted the architecture to instead use SAE in an effort to optimize costs, based on the understanding that I didn't need instances running all the time as users would be inconsistent. All architecture is implemented via IAC using terraform, so that it's easy stand-up in another account as needed. Some challenges I had included activating each individual service before I was able to use it via terraform, but the support staff was very quick to help me resolve any issues. I had a little trouble with getting my custom domain to work with the CDN because of some built in blacklisting they have, and also because Cloudflare offers up edge tls for free, but only if you use it as a proxy and not a straight cname dns. This made things a little wonky with domain validation for the CDN, and I didn't want to have to pay for https traffic through the CDN, so I had to do a couple steps to resolve that. SAE System Components Content Delivery Network (CDN) Global distribution of static assets Reduced latency for textures, models and scripts Optimized caching policies for different file types HTTPS and HTTP/2 support Serverless App Engine (SAE) Auto-scaling Node.js applications Built-in load balancing Zero infrastructure management Pay-per-use model Object Storage Service (OSS) Game assets storage Player save data Origin server for CDN ApsaraDB RDS (MySQL) Player profiles Leaderboard data Game statistics Container Registry Application container images Automated deployment pipeline Security Components RAM for access control VPC security groups SSL/TLS encryption SAE Monthly Cost Estimation (100 Active Users) Based on Alibaba Cloud pricing in US West 1 region (Silicon Valley): Serverless App Engine vCPU usage: $25.20/month (0.5 vCPU × 720 hours) Memory usage: $12.60/month (1GB × 720 hours) Request processing: ~$8/month ApsaraDB RDS (MySQL) RDS.MySQL.s1.small: $34.50/month Storage (20GB): $2.76/month Object Storage Storage (estimated 50GB): $1.15/month Requests and bandwidth: ~$3/month Container Registry Basic instance: Free Storage: ~$1/month Data Transfer Internal: Free Internet outbound: ~$10/month Total Estimated Monthly Cost: $98.21 Note: This represents approximately 29% cost savings compared to the ECS-based architecture. Costs may vary based on actual usage patterns, data transfer, and storage needs. The serverless model ensures you only pay for actual resource consumption. Cost Optimization Tips Use reserved instances for the base ECS instance to save 30% Implement proper caching to reduce database load Configure auto-scaling thresholds carefully Use OSS lifecycle rules to manage storage costs Monitor and optimize data transfer patterns Game Development Highlights Interactive 3D robot building and customization Real-time robot battles with physics Cloud-based save system using Alibaba Cloud OSS Global leaderboards powered by ApsaraDB Preloading of sound assets from CDN Scalability using Serverless App Engine (SAE) Created by Kevin Heidt @kevin_heidt_d73c1752454fb

Apr 21, 2025 - 17:51
 0
Roboverse!

This is a submission for the Alibaba Cloud Challenge: Build a Web Game.*

What I Built

RoboVerse is an innovative 3D robot-themed web game that combines creative building mechanics with strategic battle gameplay. Players can design their own unique robots through an intuitive customization system, selecting different heads, bodies, arms, and legs - each affecting the robot's capabilities in battle.

This was my introduction to vibecoding, letting copilot do most of the work.

Demo

https://roboverse.humanless.app/
Codebase

Alibaba Cloud Services Implementation

Originally designed to run on ECS using an autoscaling group, I shifted the architecture to instead use SAE in an effort to optimize costs, based on the understanding that I didn't need instances running all the time as users would be inconsistent. All architecture is implemented via IAC using terraform, so that it's easy stand-up in another account as needed. Some challenges I had included activating each individual service before I was able to use it via terraform, but the support staff was very quick to help me resolve any issues. I had a little trouble with getting my custom domain to work with the CDN because of some built in blacklisting they have, and also because Cloudflare offers up edge tls for free, but only if you use it as a proxy and not a straight cname dns. This made things a little wonky with domain validation for the CDN, and I didn't want to have to pay for https traffic through the CDN, so I had to do a couple steps to resolve that.

SAE Cloud arch diagram

SAE System Components

  1. Content Delivery Network (CDN)

    • Global distribution of static assets
    • Reduced latency for textures, models and scripts
    • Optimized caching policies for different file types
    • HTTPS and HTTP/2 support
  2. Serverless App Engine (SAE)

    • Auto-scaling Node.js applications
    • Built-in load balancing
    • Zero infrastructure management
    • Pay-per-use model
  3. Object Storage Service (OSS)

    • Game assets storage
    • Player save data
    • Origin server for CDN
  4. ApsaraDB RDS (MySQL)

    • Player profiles
    • Leaderboard data
    • Game statistics
  5. Container Registry

    • Application container images
    • Automated deployment pipeline
  6. Security Components

    • RAM for access control
    • VPC security groups
    • SSL/TLS encryption

SAE Monthly Cost Estimation (100 Active Users)

Based on Alibaba Cloud pricing in US West 1 region (Silicon Valley):

  1. Serverless App Engine

    • vCPU usage: $25.20/month (0.5 vCPU × 720 hours)
    • Memory usage: $12.60/month (1GB × 720 hours)
    • Request processing: ~$8/month
  2. ApsaraDB RDS (MySQL)

    • RDS.MySQL.s1.small: $34.50/month
    • Storage (20GB): $2.76/month
  3. Object Storage

    • Storage (estimated 50GB): $1.15/month
    • Requests and bandwidth: ~$3/month
  4. Container Registry

    • Basic instance: Free
    • Storage: ~$1/month
  5. Data Transfer

    • Internal: Free
    • Internet outbound: ~$10/month

Total Estimated Monthly Cost: $98.21

Note: This represents approximately 29% cost savings compared to the ECS-based architecture. Costs may vary based on actual usage patterns, data transfer, and storage needs. The serverless model ensures you only pay for actual resource consumption.

Cost Optimization Tips

  1. Use reserved instances for the base ECS instance to save 30%
  2. Implement proper caching to reduce database load
  3. Configure auto-scaling thresholds carefully
  4. Use OSS lifecycle rules to manage storage costs
  5. Monitor and optimize data transfer patterns

Original cloud arch diagram

Game Development Highlights

  • Interactive 3D robot building and customization
  • Real-time robot battles with physics
  • Cloud-based save system using Alibaba Cloud OSS
  • Global leaderboards powered by ApsaraDB
  • Preloading of sound assets from CDN
  • Scalability using Serverless App Engine (SAE)

screenshot of game

screenshot of game

screenshot of game

screenshot of game

Created by Kevin Heidt @kevin_heidt_d73c1752454fb