New Coding Paradigms

So I’ve recently been thinking that the whole idea of editing text files filled with code is outmoded. When I’m thinking about code, I certainly don’t think of it as a set of classes and functions laid out in a particular order. I think of it as a cloud of entities with properties and interactions flowing between them. Shouldn’t our experience of writing code reflect this?

We need to start rethinking our code-editing tools. A lot. Here is a simple example:
XML heatmaps

What else could we do? How about the ability to arbitrarily break off chunks of code and view them in parallel, even nesting this behavior to break long blocks of code into a string of chunks:
Nesting chunks

What if we let the flow of the documentation decide how a reader is introduced to the code base, instead of letting the flow of compiler-friendly source files decide it? Chunks of code are embedded within wiki-style documentation, and while you can follow the code back to its source, reading the documentation will eventually introduce you to the whole codebase in a human-friendly fashion.

The same code could even appear in multiple places (obviously updated when the source changes), and you could see all the places in the documentation where a particular chunk of code appears. This could bridge the gap between documentation and code; documentation will never grow stale, as updating code necessitates interaction with it. Similarly, updating documentation is the same process as writing code. When a standard changes or an SLA (service level agreement) is modified, the code changes too.

But why restrict ourselves to semi-linear, text-based documentation a la wikis? We tend to find UML diagrams extremely helpful for visualizing complex systems in code. What if we could build powerful, adaptable tools to translate between raw code, text-based documentation, and visual diagrams? Strictly binding them together might restrict you in the lowest levels of coding (much like, for example, using a high-level language restricts your ability to control memory allocation), but it opens up the new ability to make changes to a diagram and have most of the code rearrange and resolve itself before you. Then you step in to give a guiding hand, and adjust the text documentation, and voila! Best of all, this is more than a diagram-to-code tool; the diagram is a living thing. In fact, the diagrams, the documentation, and the codebase are synonymous. A change in one is a change in the others.

We’re getting to the point where it is much more useful to be able to dance across a codebase quickly than to be able to tweak and tune the minutiae of your code. Some allowances must be made for processing-intensive applications. Perhaps this system wouldn’t even be useful in those cases. But when you find yourself favoring adaptability and iteration speed over efficiency during development, and when you find yourself being hampered by the need to go between files, scroll through large swathes of code, or referring back and forth between code and documentation, maybe it’s time to rethink your coding paradigms.

Advertisements

Trapped between Eye Candy and Motivation

There’s this really big problem when it comes to working on games (or really any sort of project that lies at the intersection of engineering and design). It has nothing to do with programming or design or testing or art or sound or anything else like that.

The problem is staying motivated. This is especially bad when you are working alone, but it can even happen in groups of 2 or 3 people. Beyond that, you can always find motivation in the stuff that other people are doing, because it comes from outside of your personal drive and creativity. But in small groups or solo projects, the game becomes your baby, and then you get tired of your baby.

Sometimes this happens when you work so long on one subset of features that they sort of blur together and become the totality of the project to you. You quickly get tired of this smaller sub-problem (especially tweaking and tweaking and tweaking), then get tired of the game without realizing there is other interesting work to be done.

Or maybe you realize that there is a lot of stuff to do on the project, but you’ve been working on it so long without much visible or marked improvement that you begin to despair. Maybe the project will never flower, you think. Maybe your efforts will never be used to the full extent they were designed for.

Wherever this loss of motivation comes from, there is one piece of advice I heard that really helps me. It boils down to this: if you keep wishing your game was awesome, make it awesome. Add in that feature you keep thinking about, but keep putting off because there is more important framework-laying to do. Or take some time off and mess around with that one technical gimmick (shader, hardware stuff, multi-threading, proc-gen, or what have you). When you feel yourself losing motivation, give yourself permission to go off and get it back. Don’t soldier on, because your project will inevitably end up on the dump heap with all the other projects you abandoned.

The only problem is, everyone (including myself) always says that adding eye-candy and little trinkets to your project prematurely is a Bad Idea. If you make your game cool by adding eye-candy, the wisdom goes, then your game is no longer cool because of the gameplay (you know, the point of a game). Arguments about whether gameplay is important not-withstanding, if adding a few bits of visual indulgence saves your game from succumbing to ennui, then by all means, add the cool things!

Stop Wasting My Time

I haven’t written in a while here, but there’s nothing like a good, old-fashioned rant to get back into the swing of things.

I recently saw this article pop up on my Facebook feed. I have to say, it was very disappointing to read.

I mean, seriously? You’re going to waste my time with this bullshit? There are legitimate things to criticize about Christianity; this is not one of those. According to the fevered logic of the article, the fact that the Bible went through the process of translation, the Bible is made up. That’s basically what it comes down to.

To explain more thoroughly, researchers recently found a draft of a translation of some of the apocryphal books in English for the King James Bible. That’s it. So apparently the fact that God didn’t come down and tell scholars how to translate it into English means that the Bible isn’t the divine word of God. I guess it was written by a committee of Jews or something?

The hivemind has taken over at this point: every half-witted Internet denizen and his dog want to take jabs at religion, because it’s the hip thing to do. But this is just sad. This smells of a writer with an IQ of 90 and a looming deadline. This is like learning that Obama isn’t legally allowed to run for a third term in the 2016 election, then turning around and questioning why he was ever allowed to run for office in the first place in that case.

It’s a non-sequitur that is both hilarious and sad, and really says something about the state of the media and information dispersal in this day and age.

From Light

I haven’t posted in a while, in part because I’ve been busy with a lot of things. Maybe I’ll make posts about some of those other things at one point, but right now I just want to talk about From Light.

Logo for the game.

From Light is a game that I have had the pleasure and honor to help develop. It was originally created as a class project by two other students, but when it showed promise they decided to develop it further. Our team has now grown to 10 people, all (save one) students at USC.

The game is a 2D puzzle platformer based on long-exposure photography (holy hell have I said that line a lot). Basically, you can etch out light trails onto film using the stars in the sky, then jump on those trails to navigate the levels.

I mention that I’ve said the above line a lot because the game got accepted into the PAX 10 for PAX 2015, and I went up to Seattle last weekend with 3 other teammates to show the game off at the four-day gaming convention. This, you may have gathered, is completely and mindbogglingly awesome. I get to work on a game that is recognized and validated by real-world people! And truly, the reception of PAX was way more than I ever would have expected. People frickin’ loved the game!

 PAX 10 Logo  Photo of us at the booth.

And at PAX one of the things I heard again and again was that taking a game to completion, to the point where it could be shipped and sold as an actual game (y’know, for money), is an invaluable experience. Not only do you get a sellable game and a fantastic line on your resume, you also get all the experience involved in taking a game from 80% to 100%, and all the non-development business stuff involved in getting your game out to consumers. Needless to say, this convinced me that we should take From Light to completion. Before, I had been hesitant because as students it was unlikely we could put in the time to finish it fully. However, I am now willing to work harder than I have ever worked before to finish this game.

I’ll continue to post either here or on Gamasutra about development (both technical and non-technical posts), so make sure to look out for that.

In the meantime, if it strikes your fancy please “like” the game on Facebook, or follow us on Twitter, or just download the game from our website.

Pluto “Fans”

The recent fly-by of Pluto by the New Horizons spacecraft has reignited a debate that should have stayed buried forever. I’m not saying the IAU’s 2006 definition of planet wasn’t lacking, it’s just that this specific debate should have died and stayed dead.

Plutesters, hehehe.


The problem is that it is entirely unclear why we’re defining “planet” to begin with. Categorization of phenomena is supposed to help us organize them epistemologically. This is why we have a taxonomy of species. Any definition of space objects should be designed to help us classify and study them, not contrived for cultural reasons. We shouldn’t try to exclude KBO’s or other minor bodies because we don’t want to have 15 planets, and we shouldn’t try to include Pluto because we feel bad for it. The classifications we come up with should mirror our current understanding of how similar the bodies are. On the other hand, our precise definitions should produce the same results as our imprecise cultural definitions for well-known cases. As evidenced by the outrage caused by the IAU’s “exclusion of Pluto from planethood”, people don’t like changing how they think about things.

Images of Pluto and Charon.


Which brings us to the current debate. Fans of Pluto seem to be hinging their argument on the fact that Pluto is geologically active, and that it’s diameter is actually larger than that of Eris. Previously it was thought that Eris was both more massive (by 27%) and larger in diameter than Pluto (with the flyby of New Horizons, we now believe Pluto has the larger diameter). This is what moved the IAU to action in the first place; if Pluto is a planet, then so is Eris. There is no world in which we have 9 planets. We either have 8, or 10+.

Then you have Makemake, Haumea, Sedna, and Ceres. How do those fit in? It’s possible we would end up having far more than 15 planets, based on current predictions of KBO size distributions. This illuminates a fundamental problem: what is the use of a classification that includes both Sedna and Jupiter? These two bodies are so different that any category that includes both is operationally useless for science within our solar system. But continuing that logic, the Earth is also extremely dissimilar to Jupiter. The Earth is more similar to Pluto than it is to Jupiter. So having Earth and Jupiter in the same category but excluding Pluto also seems weird.

Unless we consider our definition of similarity. There are two ways to evaluate a body: intrinsic properties (mass, diameter, geological activity, etc), and extrinsic properties (orbit, nearby bodies, etc). One would be tempted to define a planet based on its intrinsic properties. After all, at one time Jupiter was still clearing its orbit, and in the future Pluto will eventually clear its orbit. Does it make sense for the same body to drop in and out of statehood. Well… yes. The fact that a human stops being a child at some point doesn’t make the category of “child” any less useful for a huge range of societal and cultural rules.

In fact, “intrinsic properties” is sort of a gray area. Rotation rate doesn’t really count, since tidal locking is common yet caused by extrinsic forces. Geological activity is also not necessarily intrinsic. Io has extreme internal activity caused by tidal heating. One can imagine the same for a planet close to its parent star. Composition can change as atmosphere is blown away by the parent star, and even mass and diameter can change through planetary collisions.

Regardless, defining a planet only on its intrinsic properties means that moons are now technically “planets”. “Moon” becomes a subcategory of “planet”. This is actually a great definition, but too radical to get accepted currently, so thus functionally useless.

So we must define a planet at least partially based on extrinsic properties. The rocky inner planets and the gaseous outer planets are similar in that they make up the VAST portion of the mass within their orbital region. Earth is 1.7 million times more massive than the rest of the stuff in its orbit. On the other hand, Pluto is 0.07 times the mass of the rest of the Kuiper Belt. Yeah, it makes up less than 10% of the Kuiper Belt. This is a pretty clear separation.

After that revelation, everything falls into place. We have large, orbit-clearing objects, and we have smaller objects that are still in hydrostatic equilibrium but are part of a larger belt of objects.



It turns out, this definition is already in place. For all the hub-bub about the IAU’s definition, most everybody agrees with the splitting of bodies via two parameters that measure likelihood of a body ejecting other bodies in its orbit (the Stern-Levison parameter Λ), and a body’s mass relative to the total mass of bodies in its orbit (planetary discriminant µ). The split occurs at a semi-arbitrary Λ=1 and µ=100.

What everybody is really arguing about is whether or not we get to call both types of bodies planets, or just the big ones.

Stern and Levison propose the terms überplanet and unterplanet, but I think major planet and minor planet is more adoptable.

Finally, just plain old “planet” should refer by default to major planets only, but can contextually refer to both classes in some cases.

Problem solved.

Language Gamification: Bullshit vs Bullshit

Gamification may be bullshit, but does that mean it might be just the tool to fight your own, personal brand of bullshit?

Screenshot of Duolingo

Learning foreign languages is hard. Really hard. Part of this has to do with complex neurological reasons, which can only be explained using words like neuroplasticity and monolinguals. Yes, some of the difficulty is hard-wired. But additionally, a part of you just doesn’t like learning foreign languages. It’s complicated and easy to forget, requires a lot of memorization, and you can still sound like an idiot after years of practice. Sometimes the linguistic variations are impossible to pronounce or hear, or the grammatical structures are completely foreign to your mental processes. So you make up bullshit: reasons to skip or skimp on practice, or give up altogether. Learning a foreign language is a constant battle against your lazier self.

Duolingo logo

But Duolingo, a site I’ve recently come to frequent, changes the game, so to speak. It gamifies the process of learning a foreign language, adding daily goals, streaks of meeting your daily goal, unlocking mechanics, currency and purchasing, and total progress towards fluency. Now, it’s not a particularly good way of learning a language. In fact, it’s terrible at teaching. But really, teaching isn’t the point of Duolingo. It’s just a way of defeating your bullshit by replacing it with a more benign type of bullshit.

Duolingo assigns tangible, meaningless progression to the real, intangible progress of learning a language. Without Duolingo as a external, concrete arbiter that says “Yes you are getting better”, learning a language can feel hopeless because no matter how much you master it, there are always more words to learn, faster sentences to parse, and structures you don’t understand. Now, the “percent fluency” that Duolingo feeds you doesn’t necessarily correspond to any real gains, but it affirms that the hard mental work you put in today actually paid off in some continuing educational journey. And that affirmation is what makes you come back the next day to learn more.

What Really Matters

In these days of turmoil after the undoubtedly historic decision in Obergefell v. Hodges, whether you agree or disagree with the decision, either on legal or on moral grounds, it is important to keep one thing in mind. As a citizen of the United States, you have implicitly given yourself over to the secular, democratic law of the land. Yes, you could spend time fighting a presumable majority on this issue. Honestly, this amounts to a minor change in what should be a secularized bureaucracy, as legal “marriage” extends to medical, employment, tax, housing, legal realms, which should all be free of the effects of one contentious moral system in a country that prides itself on freedom of religion and so forth. The legal ramifications of the decision may also be troubling to you.

However, none of this matters. Seriously. The best we can hope for is that this decision will put to bed another of the various debates that have been distracting us from the real problems. Global warming, unregulated AI advancements, nuclear proliferation. Extreme biochemical engineering. Massive overpopulation. Unregulated nanotechnology. Space exploration and expansion policy. There are a huge number of threats in the near future which have the potential to wipe human civilization clean off the map. We need to make efforts NOW to make our civilization resilient to threats, and set ourselves up for long-term survival. We need to stop squabbling over social policies that honestly don’t matter all that much, and focus on the huge number of never-before-faced global issues before it is too late.

After all, stopping everyone from being wiped out by grey goo is the first step in evangelism.

%d bloggers like this: