Month: May 2017

Awesome Game: Screeps!

I’m here to briefly rave about this game I’ve been playing called Screeps. This real-time MMO AI programming strategy game has managed to get me to spend the last 4 hours writing and tinkering with my own game AI, code, which is deploayed into a substantial persistent universe populated with every other player in semi-competition. A brilliant concept, made by these dudes in Russia.

It’s the best experience I’ve ever had playing around with JavaScript (which, I’ve actually been wanting to work with again for my next project… the last one having been a simple WinJS app back in the WIndows 8 days…). and like software development, a highly satisfying experience when things just work, and an agonizingly annoying one when things don’t work. But whatever your JavaScript skills are today, this game will make you better. (The “CPU” and “memory” quota limitations imposed by the game encourages efficient code.)

Out of my time with this game, I hope to practice development patterns for autonomous agents and to start working with swarm AI behaviors. And of course, as a side benefit, practice JavaScript, which I’ll be using with node.js in a future project! At some point, I hope to apply some of what i learn here in practice in the real world, possibly as we develop drones for defensive purposes.

Now, onto the game…

Simple interface, but insane freedom

The game itself features a simple 2D GUI that can be run in a window or from the Screeps website, where it renders in a browser. You can actually view the world without being a member, but to participate in the persistent universe, there is a paid subscription of around $8 / month (I haven’t decided if I’m going to continue after the first month). It’s cheap though, and as long as it provides me entertainment, I’ll continue to play. The game in the browser scales incredibly well – I even managed to get it loaded on my phone, though the touchscreen didn’t lend to a good experience.

Since you don’t control the units via the GUI, but rather, through code, the bulk of your time is going to be spend in the IDE, tinkering around with your unit and colony behaviors via Javascript code. Finally putting my Game AI programming concepts to use!

I’m pretty proud of my little colony so far; it’s like managing my own colony of ants. Brings back old memories of playing SimAnt as a kid.

The competitive aspect is perhaps the coolest part; very evident even within our own group of “novice” players that there those which are more engaged than others. While their code isn’t visible to you, being an open world MMO RTS, you can see every other player and room. For a few of the more advanced empires, I’ve been trying to reverse engineer useful behavior algorithms to see how to create a general purpose empire expansion code base. AI programming indeed!

Procedurally-generated rooms, mostly. Some substantially better than others. Each symbol denotes a different player’s territory. Because We’re in the “green” novice zone, the massive empires looming just outside can’t touch us. Yet…

I’ve always loved learning with an objective, and the framework of this game is an excellent way to focus on logic. The survival element encourages experimentation, and though I’m still early in the game, I decided to break the peace and send out a few of my “defender” units. You’re competing with every other player in real-time–basically your code vs. theirs, so I figured that I’d want to hone my little empire’s abilities to eventually advance beyond it’s “novice” borders. I went into the nearest player’s base and annihilated their walls, workers, resource storage, and “spawn” (which is where new units are created). This leaves the control point to slowly decay, until my own colony units area able to take over.

Attack!

Such slaughter is the cold work of empire building, though, it looks like, to survive, I’m going to need to know how to fight and grow beyond my own box.

AS for the scale of the game’s persistent univserse, so far, it is massive. The below screenshot is just a tiny segment of the scroll-able space, so it’s a huge amount of virtual territory, though of course, it would have to be, since it includes every other player in this single instance. I can’t tell how much further it will scale though, since right now, the game seems to crawl at around 5-10 seconds / tick. They’ve shared their infrastructure details, which is actually a fascinating read, though, perhaps, they could do something to speed the game up, maybe 2-3x.

My “empire” is but a tiny colony among a massive ocean of empires. Better get coding..

Great game. I will post more about it as I play further! 🙂

 

SoundRemote for Android Wear Launched!

I got my Moto 360 smartwatch in April of 2015, and since then, I’ve been pondering what kind of apps I’d want to make, for education, fun, and profit. Today, I’m releasing my first: SoundRemote, a simple Android Phone/Wear app combo that lets you remotely trigger sounds from your watch to play on your phone.

I got the idea while I playing animal sounds from my phone to mess with my cat, Sherman. He’s an indoor house cat, so I try to provide environmental enrichment to keep him (and myself) entertained. At the first hint of another cat’s meows, his ears would perk up and start roaming around looking for the source, even trying to dig under the sheets if the phone was hidden under them.

With this phenomenon in mind, I wanted to create a way to trigger multiple sounds remotely. And I figured — this could be a cool Wear app, and started in earnest to learn the Wear SDK and media frameworks. A few months of intermittent work later, SoundRemote is now published on the Google Play Store!

SoundRemote is my first Wearable app and second Android app generally (after the poorly-named, but still useful Life Counter). Though it took much longer than expected — for a total of perhaps a solid week of work over the course of a few months — I’m quite satisfied at the outcome with v0.1.

The app is pretty straightforward — you pick a few sounds from your phone’s Notifications directory, which can then be played directly on the phone or triggered via the companion Wearable app on the watch.

This being version 0.1, it isn’t the most pretty, but it does everything I need, and perhaps some more. Hope someone else finds it useful as well.

Per usual, I’ve uploaded the source code to Github for the world’s enjoyment. For v0.2, I hope to have two way-syncing of names between the phone and watch, and maybe prettify it a bit more. Both P2s, so it may be a while… 😛

In the meantime, happy cat-pranking!