Metamorphosis

No comments

At some point in the relatively near future, Windows RT and the new Windows Store may reach a critical tipping point. When that moment arrives, it is going to trigger the final stages of a transformation which has been taking place inside Microsoft for about 5 years now.

The Productivity Caterpillar

a caterpillar

Microsoft makes money when people want to use PCs to be productive – to literally produce things. Office and other business software are the largest portion of Microsoft’s profits with the Windows division coming in at a close 2nd.

And that model will continue to be valid because there will always be people and corporations where productivity is the focus and the goal, but in the consumer market that model is diminishing.

Consumers (as their name implies) consume. They might produce an email or a blog post now and then but you don’t need a special piece of business software to do that. As such, consumers have always been free to choose any OS they want; but decades of ubiquitous Windows dominance made Windows and the PC the only affordable solution for either paradigm; regardless as to whether you were looking to produce or consume, you had a Windows PC.

The post-PC revolution is what you get when consumers (who do not need the complexity or overhead of a productivity environment) are given a choice: you can either continue to consume at your desk with a keyboard and a mouse and a big monitor connected to a box sitting under that desk, or… you can carry this sleek little device around. As it so happens Apple is really, really good at making sleek little devices you can carry around. Which is not surprising when you consider they had a lot of practice in doing exactly that. Ironically because Microsoft was so dominant in the PC market, Apple had to find something else to do in order to make money: so how about iPods? People loved iPods. And the iPod led to the iPod Touch, and the iPod touch led to the iPhone, and the iPhone led to the post-PC revolution where consumers now had a sleek little device they could carry around capable of doing most if not all of the consumption they were doing on the PC. If you’re a consumer, an iPhone or an iPad isn’t just a luxury/vanity device, it’s a desktop replacement.

So about 5 years ago Microsoft realized that, when it comes to consumers, they were living in a trap of their own design. They looked at their next Windows Mobile offering “Photon” and knew it would never compete with the iPhone. Windows RT was still a long way away, so they rummaged through their R&D drawer, grabbed XNA and a half-baked Silverlight 2.0 – two things sitting around not doing much for the company – and got to work on “Windows Phone System 7″.

The Windows Phone Chrysalis

a chrysalisAt first, it didn’t seem like Microsoft was bothering to react to the post-PC era at all. The only visible signs of life from outside the company was an inexplicably breakneck pace at which Silverlight iterations were coming out. Developers targeting the plugin could barely get an app out the door before a new version of Silverlght would show up with a whole bunch of new features. And, in hindsight, we notice a parallel between the release of Windows Phone 7 and this very, very long period of sudden, abrupt silence on the Silverlight front. Eventually, finally, Silverilght 5 was released, and to no surprise it would be the last version of Silverlight. It’s usefulness to the company was over.

Windows Phone 7 would be a an emergency stop-gap measure to at least appear relevant in the post-PC market. Microsoft was sticking their foot in the door and buying time. It turns out they had been up to something which they finally revealed at BUILD 2011:

Windows RT

a butterflyWindows RT would not support Silveright or XNA. Windows RT had it’s own Windows Store and would not support the Windows Phone Marketplace. Windows RT was a new set of Microsoft guts with it’s own development stack. The Windows DNA had been totally rearranged. This metamorphosis was almost complete at BUILD, and this brings us close to that event-horizon moment that will occur once Windows RT and the Windows Store reaches that critical level of adoption.

Microsoft is in a delicate position right now because they are eager to shed the Silverlight & XNA Windows Phone chrysalis they’ve been incubating inside of. They’re ready to come out of the shell and try their new Windows RT wings. However, Microsoft’s erratic behavior during the past few years has shaken developer confidence quite a bit. And consumer confidence in Microsoft has never been particularly high to begin with. If Microsoft were to simply shut off the Windows Phone 7.X environment they risk serious blowback from yet another “reboot”, shattering what little faith anyone has left.

But once (and if) they can get a critical level of users on Windows RT and a sufficient number of apps in the Microsoft Store, they can completely cut ties with a survivable amount of political fallout. If they jump the gun and cut these ties too soon, they’ll never make it. They need to be cautious now – Windows Phone 8 could have been a pure RT device that only accessed the Windows Store, but with just a few thousand apps it wasn’t politically feasible to downgrade users from a Marketplace with 100k apps to one with 20k. They wisely chose to retain the Silverlight/XNA/Windows Phone Marketplace for at least 1 more generation.

But once they feel confident enough in the adoption of Windows RT, that confidence will trigger the remaining stages of Microsoft’s transformation. In order to “fly”, they must:

  1. Shut down the Windows Phone Marketplace. Windows Phone Marketplace Apps not ported to the Windows Store will simply vanish.
  2. Make Windows Phone, in effect, a 4″ Windows RT tablet utilizing the Windows Store.
  3. Get Xbox running Windows RT with no XNA support and no backward-compatibility with Xbox Live Indie Games. Instead, all developers – indie and corporate alike – can publish apps to the Windows Store for not only Xbox but any and all ecosystem devices.

The end goal is to have all desktops, laptops, phones, tablets and consoles running the same OS and accessing the same Marketplace. This enables a new, agile update strategy to the entire ecosystem, it streamlines their software pipeline and it offers software solutions to both consumers and the enterprise. But in order to pull it off Microsoft must eliminate XNA, Silverlight, the Windows Phone Marketplace and Xbox Live Indie Games. This is already happening, but the proverbial event horizon – the point of no return where the remainder of this process will happen very quickly – will not begin until the Windows Store accumulates enough apps (whatever that number may be) and Windows RT has enough adoption to justify moving forward with it.

Hedge Your Bets

poker chipsI’ve halted Arsanth development for the current Windows Phone platform. I’ll likely continue Arsanth as an HTML5 app instead, potentially with a node.js backend. I’m not doing this because I think Microsoft is doomed – but I also don’t think they’re a sure thing. I can’t control or predict whether Microsoft will win or lose.

HTML5 has the advantage of running anywhere, in addition to the ability of running natively on desktops, laptops, tablets, phones and probably Xbox in Microsoft’s inevitable future ecosystem.

It is also my hope that Google and Apple will follow suit and treat HTML5 as a native language on their respective platforms. Ivory Tower perhaps, but not entirely out of the question. Live Tiles are nice and all, but HTML5 as a native language is an actual innovation the other players I hope will copy. Personally, I find the need to learn Java or Objective-C a barrier to entry into the Android and iOS markets. I have a limited amount of time to dive deep into new platforms, and HTML5 seems to be the best balance for me between app development, career, and the inherent stability in avoiding Microsof’s next proprietary stack.

Personally I think HTML5 is the best way to hedge one’s development bets for the ultimately unknowable, but reasonably predictable future. The reasonably predictable future is that Apple will continue to make pretty good products and retain a relgious following, Android will continue to activate a bajillion devices a day, and Microsoft will probably never be the cool device everyone wants; but, you never know. When Xbox entered the console market, Sony was an unstoppable force shattering console sales records. The Playstation was sitting on Nintendo’s cracked skull, feasting on Sega’s corpse. Xbox was the laughable 98lb weakling, but they stuck to it and became a reasonably valid player. Microsoft might end up winning a good deal of market share in spite of their terminal lack of consumer savvy.

I don’t know whether Microsoft is going to fail or thrive in the post-PC era. It’s hard to say until they’ve got a cohesive WinRT ecosystem up and running and matured with Xbox and desktops and tablets and phones all sharing the same DNA. No one’s actually done that yet – at least not to the extent Microsoft can potentially do it, from consoles to mobile to desktop, no one else has that spectrum. But whether that will be something consumers have to have is yet to be seen.

What I am pretty sure of is that there is writing on the wall for the current Windows Phone platform & Marketplace. They’re temporary measures and a dead end. It’s all about the Windows RT ecosystem and if it fails, I’ll be no worse off for having written an app or three in HTML5.

Some graphic / UI concepts have crept a little too far into the base library (e.g., a Sprite class… which frankly doesn’t belong in the base lib). Doing a little Memorial Day separation of concerns.

That is all!

The roguelike genre is fond of procedural generation, and Arsanth is no exception.

The most obvious advantage of procedural generation is the ability to leverage tiny data sources into very large amounts of useful information. An Arsanth world map, for example, is several megabytes of information generated from a few tiny noise functions.

The last Vision post described how crafting in Arsanth strives for a less abstract experience. Rather than click-to-combine items, you follow Templates to shape & assemble raw materials into useful objects. For UI & conceptual convenience, these things you create do appear in your inventory as “items”, but underneath that veneer is a compound assemblage of raw materials, and not actually a single item. Swords, potions, scrolls – even mobs, NPCs and your character are an assemblage of raw materials. There is scarcely little in the game that is not an assemblage of raw materials.

But being a less abstract game means more than just crafting with Templates. It also means that if something gets hot, it burns. It means that if something gets cold, it freezes. And if something boils, it vaporizes into a gas. Part of the less abstract game Vision means a less abstract environment.

Consider this classic game mechanic:

The floor is lava!

 Lava burns you!

Often in games where the lava is deadly, the campfires and torches are harmless. This is because lava damage is a special condition attached only to lava, and rarely is there such a thing as actual “heat” in a game.

In Arsanth, lava will continue to burn you, although it will be done through a less abstract mechanic. Exposing materials to something hot like lava simply increases the temperature of the materials. Arsanth contains no specific or particular rule stating that lava burns your character – but if the material being exposed to lava happens to be your body, your body temperature will quickly rise beyond it’s ignition point, and you will very likely combust. But neither you nor lava is particularly special: lava or any sufficiently hot source will boil potions, ignite scrolls and melt weapons.

Arsanth has physical laws woven into it. These physical laws are modeled after the real world.

100 years ago (…in the real world) scientists began discovering atomic physics, leading us to this primitive concept of the atom:

H

A structural pattern was discovered: valence shells accommodate a limited number of electrons. Different values yield different configurations from which entirely different substances are formed:

The interesting thing about elements is that they are the basis of a form of procedural generation! Literally everything in the known universe – galaxies, stars, planets, cats, pistachio ice cream – an infinite amount of variety is all made from a small handful of around 100 elements.

In a way, we’re seeing a very large amount of useful information (the known universe) being leveraged from a tiny amount of data (~100 elements). Much in the same way a noise function can be used to generate vast stretches of terrain, an atomic function can be used to generate a vast variety of substances.

A classic example of this leverage is H2O. If the known universe were an app, it would not need to be distributed with a definition for “water”. There is no “water” element in the source code of the universe; only the components Hydrogen and Oxygen, and rules by which they can combine.

Arsanth is like a pocket universe. It will be distributed with elements: fundamental building blocks of matter, and rules by which they can be combined. It will be not only be possible, but you will be expected to create substances that I cannot predict, and were not distributed with the game.

Implementing chemistry in a video game is challenging, because chemistry is absurdly complex. Covalent and ionic bonds, Van Der Waals forces, electrons existing in probability clouds, and a million other things I don’t even know about.  I spent a fair amount of time researching real chemistry, since I didn’t know much about it – and then, ways to reduce this hopelessly nuanced and complex system into a reasonable puzzle mechanic. Something easy to use, hopefully easy to understand, and most importantly, something fun.

Arsanth doesn’t attempt to emulate chemistry as we know it; it isn’t meant as an education tool to teach or promote actual chemistry. It doesn’t have any parity with real chemistry at all. You can’t literally combine Hydrogen and Oxygen to make water in Arsanth, because Hydrogen and Oxygen may not necessarily exist. Arsanth also has different, much simpler chemical physics than the real world. Chemistry in Arsanth is just a puzzle mini-game. But it’s not insignificant; everything is made of something, so chemistry in Arsanth has a dramatic impact on gameplay.

In the next Vision post we’ll take a deeper dive into elements, compounds and the chemistry mini-game.

Crafting in most games usually involves some form of “combine-container” model, where pretty useless items are consumed in exchange for useful ones. No interface epitomizes the concept of a combine-container crafting better than Minecraft:

Minecraft iron sword crafting sequence

Minecraft Crafting Table

Ingredients go in, item comes out.

This crafting model dominates the RPG genre to the point where we expect an RPG to be littered with miscellaneous items we can’t wear, wield or eat. Wolf pelts, turtle shells, ingots, gems, fangs, claws, feathers – crafting ingredients. If the game features crafting, they will exist.

The other thing we’ve come to expect is limited access to the system. Not just in rare ingredients, but logistically, the combine-containers are often stationary devices that must be traveled to. And even then, most games also segregate devices into “forge” and “alchemy bench”, each offering a limited scope of opportunity to exchange ingredients for items.

This system works really well, but I’ve played so much of it over the years that I want to explore something different.

Crafting in Arsanth will share some similarities with traditional crafting, but it attempts to make several changes.

Crafting in Arsanth is less abstract. There are no crafting recipes, no forge, and far fewer obvious crafting ingredients. Crafting a sword is less like supplying items to a forge, and more like crafting a sword. Instead of using a recipe to combine arbitrary widgets into an unrelated item, in Arsanth you will literally wield and wear the things you have made.

In place of a recipe, Arsanth uses something called a Template.

This is a screenshot of the editor app I use to create Templates for Arsanth. Here we’re defining a sword Template.

A Template is like a schematic for an item. It abstractly describes how an item is put together. It reveals the basic parts an item so that your character understands how to build one.

Templates are kind of like combine-containers – they are permanent fixtures of the game like a forge or an alchemy bench. But they are also somewhat meta; you do not have to travel somewhere to access the sword Template, your character either knows it, or it doesn’t. Templates are more like a theoretical mold. Your character uses the knowledge of a Template, in conjunction with raw materials, to construct an object. When each required part of the Template has been assigned a valid material, a sword made from those materials is produced.

Here’s another crafting input / output diagram, this time showing the input / output of a sword Template:

The output of a Template is a different result set from that of a forge. A forge is a multi-purpose container that can produce many different, specific items.  A Template does not produce anything. It grants your player the knowledge he/she/it needs to construct a sword out of whatever materials you choose. Once your character knows a Template, the ability to produce a very diverse array of swords becomes immediately available.

Items you make by following Templates are literally the sum of their parts. Raw materials like Copper and Iron have innate properties in Arsanth. When you assemble an item from these raw materials, the properties of the materials transfers to the item.  If you re-assemble your sword using different materials, your sword changes to reflect the new materials.

Discovering or learning a new Template in Arsanth is akin to learning a new recipe in traditional crafting: a Template and a recipe both enable you to make a new item. But while a recipe is directly mapped to 1 specific item, Templates are mapped to an unfinished item base where you specify what the item will be made of by assigning inventory items to Template parts. Being able to change what the item is made of, and thus change its properties, provides an open-ended crafting experience with more creative control.

To make things a little more interesting, each part of a Template has some game rules attached to it. As you follow a Template, a 4-point validation is run against each part you construct:

Each Template part has a specific Volume. Bigger Template parts require more material to fill, smaller parts require less.
Each Template part has a list of allowable Phases of matter. This means there are rules about whether a template part accepts a Gas, a Liquid or a Solid.
Everything in Arsanth is associated with a primitive shape: Either an Ellipse, Rectangle, Triangle (and maybe Arc). Each Template part has a required Shape. You can change the shape of source material by reducing its Volume.
Each Template part has an Aspect Tier. This means that not only must a Template part and a source material be of the same Shape, but they must also have approximately the same Aspect ratio. You don’t need to worry about calculating this as the game is aware of and rounds the aspect to one of 3 tiers, and so it becomes just another piece of the crafting puzzle. You can change the aspect tier of your source material by reducing its Volume.

So that’s a crash-course in Arsanth crafting. Instead of a system where you combine widgets into items, The Vision is a system of literal assembly where we get to decide how a sword is made. This truly is the foundation upon which the entire game is based, because it not only applies to swords but also NPCs, mobs, trees, harvest nodes – even you. All primary objects in the game are defined by a Template. Everything is either homogeneously or heterogeneously made of materials and can be run through this system of Template part assembly and disassembly.

This is half of the crafting system. In the next Vision post, we’ll look at materials: elements & compounds, the other half of Arsanth’s crafting system.

Server crash!

No comments

There is a Windows 2008 R2 server here that hosts a lot of stuff (like Arsanth design documents and, well… everything) and it crashed Friday due to a power outage. When the server came back up, it seriously started acting exactly like this. It “worked”, but so slowly as to be unusable. Very strange behavior! Also, one of the RAID arrays degraded.

The slowness turned out to be a RAM issue and the RAID was rebuilt, and so the server is now fully recovered with a new UPS and backup strategy on order. Thankfully, nothing was lost apart from a couple days time. What surprised me is that it took 21 hours for the server to rebuild a 1.5TB RAID array. I had no idea anything in this day and age could still take that long, especially on a 8-core 2.33GHz Xeon server with SATA II drives. But apparently this is kind of an expected amount of time for a large drive rebuild.

Setting up a secondary Active Directory controller today, then it’s back to normal development days tomorrow. It has not been fun!

 

Arsanth!

2 comments
Arsanth

Poster concept

Spent the past couple days cleaning up the UI / page transitions and added the ability to resume a saved game.

The app starts with the obvious option to play a new game of Arsanth,

Arsanth Windows Phone Roguelike

So you tap New Game and begin adventuring about the world of Arsanth,

Arsanth Windows Phone Roguelike

And as with any Windows Phone app, one of the hardware navigation buttons will inevitably be pressed. When that happens, Arsanth saves the state of your current game and adds a Resume Game tile to the menu:

Arsanth Windows Phone Roguelike

You can now either tap the Resume Game tile to resume the game you see pictured on that tile, or tap the New Game button to start another game.

Multiple games are supported, so you can have different games going for whatever reason you like. The Resume Game tiles are placed in a vertically scrolling column:

Arsanth Windows Phone Roguelike

The binary serialization in Arsanth is very efficient, so games save and load in a just second or two (most of which is just page transition effect time). So far the thumbnail image displayed on the Resume Game tile is the biggest piece of save game data.

These Resume Game tiles will also eventually display the name and level of your character, and you will be able to pin them to the Start screen as a deep-link that takes you directly into the saved game, bypassing the menu screen.

Arsanth - Day

Arsanth - Day

Arsanth - Evening

Arsanth - Evening

Arsanth - Night

Arsanth - Night

Just implemented a day/night cycle test. This biome just happens to have pretty good visibility. In some biomes it will be downright impossible to see anything at night. Unless of course you find a solution to that problem.

Fixed a bug in FoV today.

LET ME TELL YOU ALL ABOUT IT

There’s actually been this bug in the Field of View calculator for quite some time and I’ve been dreading it, because there’s  maths & slope functions and stuff in there that I honestly don’t remember. But somewhere in there, a disgusting math issue lurked.

I decided to make this problem go away today. The FoV is a ray-caster, so it needs to calculate slopes out from the center of you and see what it hits. To that end the FoV calculator needs to plot various slopes away from you & various objects that block your FoV.

Now, if you’re standing at {255, 0} and it looks NorthEast, the FoV calculator assumes, quite rationally, that it needs to check the Tile at {256, -1}

2D Cartesian vectors

Expectation

The problem with that assumption is that some Maps wrap around upon themselves. On such maps, there is no “-1″ to be found on either axis. If you’re standing at {255, 0} on a Map that wraps, and you look NE, you’re actually looking at {0, 255}…

Wrapping coordinates

Reality

All this comes as news to the FoV calculator, which was always taught to take tile coordinates at face value. So while near/on the borders of wrapping Maps, you’d more often than not achieve a  gigantic beam of epic FoV spanning the width/height of the entire Map. Which was quite the performance killer, and could easily crash the app entirely when playing on a genuinely massive Map.

So this little gem has been on the TODO list for several months and I’m more than glad to see it finally gone!

Added a great deal of serialization functionality today. The code is now free of “fake it until this part of the serialization works fully”, as serialization now works fully.

Ready for a new development branch, and there’s so much to work on I’m not even sure what I’ll start on next…

  • Inventory (picking things up / dropping things on the ground)
  • Elements & Compounds
  • Spawning mobs
  • Spawning resources
  • Dungeons
  • Towns
  • Combat
  • Effects
  • Cliffs!
  • Abilities
  • AI

The feature list is practically endless right now!