Published on

Devlog #44 - AWS

Play Now at https://fantasyonline2.com/!

For issues related to Patreon please DM me directly on Patreon.
For bugs in the game or website please post to #bugs on Discord.

https://discord.gg/fantasyonline2

Configuring an AWS RDS MySQL 5.7 db.t3.micro for use with FO2 took a lot of time! I was not expecting that. The main problem is that it wouldn't let me run commands that require the SUPER privilege like CREATE TRIGGER. I had to figure out these DB instance parameter group settings to allow for setting this one property log_bin_trust_function_creators. These MySQL instances are really secure jeez.

After that I was able to upload a recent backup of the FO2 database to our test EC2 instance and from there import it into the MySQL instance. I also had to set up an RDS Proxy in order for the website and game servers to have external access the the database.

Oh and now AWS says MySQL 5.7 will not be supported soon. Ok time to upgrade that to MySQL 8.0. Crosses fingers... Oh and then I got to learn about VPC route tables. AWS has endless settings.

Now we have fancy charts to monitor performance. Wooo!

We now also have automatic daily backups that go back 35 days, storage that will automatically grow when we cross 20GB of data, deletion protection, and lots of other neat AWS RDS stuff. This was definitely the right thing to do.

Next I decided to start setting up the production server on AWS EC2. Thankfully Smartfoxserver is Java and can run on any CPU as AWS ARM machines are generally much less expensive to run than a x86_64 machine. Smartfoxserver doesn't have an ARM release but all I had to make the x86_64 version work was to point it to use the native Ubuntu 22 Java JRE (Java Runtime Environment). 

FO2 game servers need vCPUs and RAM the most as they only write small logs to disk. For that reason I decided to go with Amazon's C7g instances.

https://aws.amazon.com/ec2/instance-types/c7g/

"Amazon Elastic Compute Cloud (Amazon EC2) C7g instances, powered by the latest generation AWS Graviton3 processors, provide the best price performance in Amazon EC2 for compute-intensive workloads."

So the server you're playing on is running 4 Amazon ARM vCPUs. Neat. I had to do a bit of configuring to get the game process setup as an Ubuntu daemon/service but once that was done everything just worked. 

I even made an "image" of the game server so I can spin up new servers with just a click or programmatically in the future. This is so much nicer that 10 years ago when I was dealing with one large XEON server that was running everything.

Perhaps one of the coolest features of AWS EC2 instances is that you can change the instance type at any time. Need more RAM, just add it. Need more vCPUs just add them. This is going to be great for when we launch on Kongregate in July.

After running the new EC2 game server for a few days, AWS had some suggestions. Since we're a small community right now we don't need the c7g.xlarge and can save 50% by downscaling to c7g.large. So cool. The only problem is every time you switch instance types it gives the instance a new IP. I guess I'll have to move domains to AWS eventually to have that update automatically.

Later on when I'm completely sure the c7g instance type is the perfect fit for FO2 then I'll be purchasing an AWS savings plan. 

https://docs.aws.amazon.com/en_us/savingsplans/latest/userguide/what-is-savings-plans.html

As you can see it can drastically reduce costs for game servers. I'll be purchasing 1 year instead of 3 as c8g, c9g, c10g, etc will happen over that time and I'd rather keep upgrading the vCPUs every year!

Patch Notes #29 - Starforged Crafting

Patch Notes #30 - Cave of Despair and AWS

The last two patches have had a little bit of content and a lot of behind the scenes work.  Cave of Despair is the first of the old maps that actually has layers to it. 

Look at the great crab etchings! Cavemen liked crabs too.

I have a big email from Perseus loaded with art so I'll be working on getting that fun out this upcoming week. Mobs, quests, gem items, bug fixes are all on the menu. We'll also be getting collision in MC and a public teleport to CoD so you can run around and see the sights before the mobs arrive. T1 armor art is currently being worked on as well.

Should T1 have xp and levels? hmmm

See you next patch notes!

Have Fun & Keep Gaming!