Kan o' Words

Update #3 - Oct 2019

Design & Tech Update

Welcome to update #3 of the Kanoogi platform and Intergalactic Space Empire project.

It’s been a few months, so it was definitely time for another update. I got a gentle reminder to write another update, which I appreciate.

I will start off by saying, there has been quite a few changes. Some of them are reversals on my previous design, and though this isn’t something I ever think I’ll do, it just happens. I think it’s important to “pivot” as it were, it’s just important to me that these pivots are all within the realm of the original vision… but some do push the envelope a bit.

Before I dive into the details, I want to warn you right out of the gate, this is a big update. I will break this update into three sections, the first is a design update, then a technical update, and lastly, I’ll answer the questions that were sent in (most of which are in the order received). Someone suggested a forum or website where I post these publicly, which I agree is a good idea, so I’ll likely do that in the future.(ed. - I did!)

Design Update

In my original design, this was a game about spaceships, and for the most part still is, but I imagined that in future versions, I would add units (in the form of built structures) to the surface of asteroids. Well, I received a lot of feedback over the summer, and that feedback made me take a second look at that decision to wait, and I slowly got more excited about the idea of moving ahead into full ‘base building’. However, with these asteroid based units, I pretty much had to make the move from 2D to 3D. However, just because I decided to go 3D, doesn’t make this a crazy, over-the-top, AAA RTS game, as I still have to design within a somewhat minimalist set of constraints. For example, I can’t use a lot of textures, and there can’t be a lot of geometry either, so I had to come up with a system for compressing everything down to the smallest amount of data possible for transmission across the internet, and the units themselves will need to be highly stylized. I can go into that in a technical update, and in fairness, that system is still evolving, so it’s probably good to wait a bit before talking about that in detail. But back to the 3D decision, I have to tell you, I understand that I’m now in dangerous territory of delaying the game, and I accept that, but there are days when I have to ask myself if it was the right choice. What’s interesting is I was testing some very simple geometry on the surface of an enlarged asteroid, and at last count there were over 1100 units on it, but this made me think… can an entire game be played on a single, slightly bigger than usual asteroid? Hmmmm… interesting!

OK, so very quickly, let’s talk about asteroids. Besides the fact that I loved playing the original Atari Asteroids game that was released back in 1979, and besides the fact that I was very lucky to acquire an actual original arcade unit back in 2016 from a friend (and it runs great as it surpassed its 40th birthday… which is just absolutely crazy!), I had envisioned asteroids to just be a place to gather resources. So you took your mining ship, and you sort of got into a geosynchronous orbit, and mining lasers would slowly strip away the ore and presto, you had your solid mass for building new units. Well… this latest development has taken the asteroids from a resource component, and brought them onto the main stage. I gotta say, I really love this! I’ve also done a lot more reading and study of asteroids in our system, and the more I read, the better it gets. So now, when I think about the future of space combat, and the complexity of landing ships on large planets (of any sizable mass) and getting them back into space, I realized that asteroids are the perfect thing to support military bases… and the moon is perfect too (conspiracy theories anyone about the renewed race to set up bases on the moon?). In short, because I think it’s possible to talk for an hour about this, asteroids are kinda perfect for a space RTS, and I see this as a pretty important piece of the puzzle. OK, that’s asteroids.

The other big thing that is coming up, and maybe keeping me up, is the battle between keyboard/mouse and touchscreen. I’m solving for both at the same time, and though it’s not an insane amount of work, it’s fair to say, it’s not trivial UI design. The problem with it is this… there are 2.4 Billion mobile devices on the planet, and this is a phenomenon that is still growing. Conceivably there will come a day when almost everyone will have one, so let’s call that 6 Billion+ (excluding 1.5 Billion who are too young or too old to use them). These mobile devices keep getting more and more powerful, and as a part of that, we could see a decline in laptop and desktop systems, as well as traditional consoles. Now, I would say, that’s too bad, I will just focus on keyboard/mouse, but the problem with this is, every time… and I mean EVERY time, I’m out talking to a friend at lunch, I’ve got my iPhone out and giving a demo. The demo goes like this… I show them the game on my phone, and then I send them a link, and about 5 seconds later (we’re not on wifi) they have the game running on their phone. And every time I get a little jolt of excitement, like ya, that’s what I’m talking about… but it does come at a cost. So, my question for you is this: How important is it that the game support smart phones? You can just reply back to this email with your answer. And if you have opinions on asteroids, or 3D vs. 2D, or anything else I mentioned above, your thoughts and input are also welcome. Alrighty, that’s the design update for now.

Tech Update

This is the first “full on” technical update, so my guess is that it might not be as interesting to most as the design, but hey, it’s here, so you can read or skip, no worries at all. And though we often see the technical aspects of game development as being pretty standard these days, whether it’s a game built on Unreal, Unity or a custom engine, this project is quite a bit different.

Let’s dive in. In practical terms, IGSE runs in the cloud… or on a server in a datacenter. At present, I am running the game on the Google Cloud inside a VM that uses Debian Linux. I don’t do anything too fancy with the VM. I have experimented and deployed the game inside a Docker container, for day to day development, I prefer to work on the bare metal. Now, for terminology sake you could call the Game Server Instance (GSI) a server, but it’s important to distinguish between software components and hardware. Let’s walk through all the various systems and talk about what each one does.

Main Kanoogi Server - This server is what currently spins the Kanoogi logo and allows people to sign up for the beta. It runs in its own VM. Besides my whacky canvas logo screen, it’s mostly HTML (I whipped this up in a few days, so please don’t hate on it too much) (ed. - this has been replaced now with my new website).

Login Server - This server does a couple of important things. First, it allows players to login and pick the game they want to play, which then include authentication and authorization. Authentication is where I make sure that you are who you say you are, and then authorization is where I check to see if you have the permissions to access a particular system. This is all pretty standard stuff. Once a player has logged in and been through those systems, they get two keys to proceed with. The first key is the UUID for the game server and then second key which is authorization in the form of a session ID (also a UUID). Each player needs both of those to penetrate through the security systems and gain access to the GSI.

Game Server Manager - The GSM, which I also consider a proxy server, takes the two UUIDS and checks the database for the game, and re-authenticates the player to be playing on that specific game. In doing this, opens a connection to the GSI. This is written today in Node.js but could be written in almost anything. My feeling was to see if this would hold up under stress, but if it didn’t, replace it with Golang, or maybe even custom C code. I learn more and more about GCP (The Google Cloud Platform) every day, and feel more comfortable writing custom high performance interfaces. In game development, performance is pretty darn important, so I’ve always got my eye on it.

Google Cloud - The GCP is a huge part of this whole thing, but as the years have gone by, I’ve slowly been learning about Amazon’s AWS and Microsoft's Azure, and they’re all pretty awesome. Google apparently has the fastest backend, where packet transfer times are measured in microseconds (millionths of seconds) instead of milliseconds (thousandths of seconds). Google’s API is thought to be a little more difficult to work with, but I’ve never had a problem with it, and I like the no nonsense aspect to it.

GCP Load Balancers - Using the cloud means that load balancing is a snap. If everyone hits the servers at the same time, everything should work as usual, as more capacity is almost instantly available. This just applies to what is called the “front end”, but on the “back end” it’s a different story, and those servers need a system called, “Auto Scaling”.

GCP Autoscaling - Google’s auto scaling systems are completely configurable. When a criteria is met, more Virtual Machines are created to match the load (load can be CPU, memory and bandwidth to name the most common), but this actually takes time, so this autoscaling should pay attention to trends to bias the predictions based on past demands. Suffice to say, if things get crazy, the backend system, one way or the other, will scale up the number of VM’s to meet the demand. It’s worth noting, that auto scaling works in both directions, which is really important, because when demand drops, those VM’s need to shut down to save on operating costs.

GCP Security - The game runs in a browser, so I am using HTTPS, which is now a standard and is pretty must required today on most websites. I use 2048 bit SSL, which if you look at this encryption statistically, is insanely hard to break. I think banks take it a little further, but for a video game, this is plenty of security. Way easier hack with some phishing scheme than to hack this security directly. Anyone who is a security expert and wants to help me test the system, I welcome the support and help.

GCP Databases - I use two Google databases at present, the first is called Google Datastore, and the other is Google Storage. Google Datastore is a pretty slick indexable database that stores all those mission critical UUIDs. And for big data blobs like save games and scenario data, I use Google Storage.

Data Mirror System - This is is like my own personal Google Drive, where I run a Node.js server that copies those save game files around in the background. I currently save all the game data as a JSON file, which is pretty fluffy and .zip it all up before shoving it up to Google Storage. This service also pulls those same save game files back down, unpacks them, and puts them into the right folders for the game to use. This process is called Hydration and Rehydration by some industry people. This service also keep an eye on the GSI Monitoring system, and reports the health while also restarting it if it fails.

Monitor System - This GSI Monitor primarily makes sure there are enough GSIs running inside a particular VM (the auto-scaler does this job at a regional level). This monitor will start up any additionally needed GSI’s and shut down the unneeded ones, and will also shut down sick or unhealthy instances. It’s important to run as many GSIs on a VM as possible to keep server costs down.

GCP Health Checks - As you can imagine, anything can happen, and for any number of reasons, so it’s important to continuously monitor the health of these systems. The GSI Monitor does this on a VM level, but the Google Health Check system does this on a higher level. This system can simply shut down non-responsive VM’s or it can engage in a sophisticated auditing process where the VM needs to respond within a certain amount of time to let the Health check know it’s OK. Pretty cool stuff!

Wow, that was a lot of stuff, and we haven’t even talked about the client side of things, which includes WebSockets, Javascript and WebGL. We’ll have to save that for next time, but I will tell you, it’s not any less interesting than the cloud part of this, trust me on that!

If you made it through that technical section, let’s get to the last part of this, and answer a few of the questions that have been sent in. And sorry, these are old, but there’s quite a backlog, and I promise to get through them all!

Q & A

Question: Will this game have a story? How about music?

Chris - Those people who know me, and know my design history, know that I’m not really much of a story teller. But for this game, I'd like to try and change that, but I know that to do it right will take a lot of time and energy, and right now I’m focused pretty heavily on the tech to power the game and platform. What’s on the table right now is a gameplay mode that does not have a story, and then later, I want to follow up with a big single player campaign that has a big Intergalactic Space Empire story. As for music, I have a completely new idea and approach, which I will talk about in future updates. (and here’s a hint: We all know that hiring a single composer to create a single musical theme is cool, but it’s been done to death, so I want to push the boundaries and come up with a system that allows for composers to create music almost like a spotify system… damn, I think I just gave away the whole idea… lol!!).

Question: Is the “infinite desktop” idea you talked about years ago going to be a part of this Kanoogi system?

Chris - Great question and I'm glad you asked. At first I thought it would, but after I started to get into the project, I realized that I would not be able to use the work I did on the Infinite Desktop system. You see, that system is all based around a canvas rendering system, and Kanoogi is mostly in WebGL. It’s not to say that I wasn’t able to use the knowledge I gained, but in terms of code, I pretty much wrote the systems from the ground up.

Question: About the RTS game, will there be totally different asymmetric races like Starcraft or will they be similar, but with some differences like Supreme Commander?

Chris - In the first phase, all of the units are the same, and this is due mostly to the fact that I’m an indie developer, and not because of any particular design bias on my part to have only one faction. Because this game will evolve over time, I imagine that it will follow quite naturally that there will be new factions (I call races factions as it's a little nicer sounding) released in the future. That should actually make things interesting, and also allow players to provide some feedback on the core gameplay in the meantime. There is an important point that I almost forgot… at what we think of as Tech Level 3, the player can design and build their own units. So in a sense, the player actually creates their own faction, but only at this higher level. The modules that those units are built from are fairly standardized, whether it’s a weapon system, armor or energy storage module, etc.

Question: Will there be a campaign or is it skirmish only? Will there be a map editor?

Chris - The first phase, and definitely for the beta, I will release the skirmish only mode. It’s also planned to not only release a map editor in the future, but an entire game editor, effectively taking the concept of modding to the next level. And because it’s all in the cloud, imagine it will be like Google Docs… you can edit the game’s systems and it’s all automatically saved on the cloud. This alone makes this new system pretty revolutionary.

Question: Will the online nature of the game allow for bigger games? I would love to play an RTS that could include more than 8-10 armies without slowdown or lag.

Chris - Yes, absolutely. So one of the tests I want to conduct during the beta is a session where there are dozens of players all playing at once. And I also want to test a gameplay mode where players are free to come and go during the game. Lots of craziness is going to come from that. We need to free ourselves up from the constraints of RTS games of the past and look to the future of wild, crazy and experimental new modes of play!

Question: I am curious about the tradeoffs you mentioned and how they will be made smaller in the coming years.

Chris - First off, every year, the internals of the browser become more optimized for graphics, and we’ve seen this with WebGL 1.0, but WebGL 2.0 (which is almost adopted across all browsers) will take that further. Next up, WASM, which is an acronym for Web Assembly, is yet another huge step forward for performance. And there’s more advances that will come from more local storage which can cache assets and more system memory to use for building dynamic and fractally generated textures. I foresee a time that people won’t even blink when they are told the game runs in a browser.

Question: What’s your vision for background? - The rendering of the game - The gameplay itself : Real time strategy game? Similar to TA/SUPCOM/FA gameplay (thinking of resources management)?

Chris - The game takes place in space, and from a timeline perspective, it’s looking more and more like the years 2050 - 2150. This is where humans finally start fighting over planets, moons and asteroids in the solar system. The game is rendered in top-down 2D (which is fast becoming 3D like Total Annihilation), so call it 2.9D (this is a bit of a geeky label, as it’s almost 3D, but because the view is isometric, but I digress). And yes, the gameplay shares its roots with RTS, and though I started out trying to do some stuff that was really “out there”, its slowly kinda found more and more of a foundation in traditional RTS. This happened as I got feedback from friends that they just weren’t feeling it with my pure, somewhat avante garde, space RTS. And as a part of that foundational RTS gameplay, the resource model will be very familiar to those who played TA and SupCom.

Question: How many units can you manage simultaneously?

Chris - I have over 1100 units rendering on a single asteroid, so based on this (it’s highly efficient to build the game this way), there could easily be 10’s of thousands of structural units in the game at any time, especially when you start to consider multiple star systems (for larger games) and then beyond that, multiple galaxies… which is just ridiculous, but I did build the game to support that. It is important to differentiate between “built structures” as units and ships. Ships are more expensive, both on server resources and client resources (and when I say resources, I mean CPU and network bandwidth, memory isn’t a problem). For ships I think somewhere around 1000 in total is probably doable. What’s interesting is that these ships can get quite large, which the system handles just fine. In the future this number will just go up, so by the year 2025, let’s say, I wouldn’t be surprised if there were over 50,000 structural units and 5000 flying units in the game at any one time… in a browser!

Question: Are you going for a massive scale RTS?

Chris - Sadly I wasn’t initially, and then it got out of control, but at that point it was all just math and numbers, so that wasn’t a problem, but now that I’m getting into the specifics of gameplay, I needed to dial it back. That’s why the beta is going to be the skirmish mode, or what I am now calling… wait for it… Rock War (ed. - Ya, I renamed it again!). Rock War is the battle over the asteroids that are in a special system that is totally contrived for an RTS. I do have a model of our solar system, but it doesn’t lend itself as well for a nice, balanced RTS game (and we all know how important it is that things are balanced, otherwise there’s not much point in calling it a strategy game). So not to confuse, but this would be called IGSE: Rock War, as each gameplay mode needs its own specific name.

Question: Will this game feature a persistent universe that continues after you log off/go afk or will it be more traditional where you select/generate a "map" and play matches?

Chris - Yes, everything is persistent. It doesn’t matter if you are playing for an hour, or a week, everything runs in the cloud, so if you stop playing and everyone else keeps playing, then the game will keep running and you can join in at any time (and in 5 seconds or so). If you happen to be playing a single player PvE game, then the game pauses when you close your browser (or the browser times out which is often the case if you just shove your phone in your pocket, or switch away to another web page). This is something I really love about the architecture, as it makes playing so darn convenient!

Until next time...

Chris Taylor