Lisp programmers are a small group. According to the TIOBE index, Lisp currently sits at #32 on their ranking of programming language popularity. (Common Lisp specifically is somewhere between 51 and 100.) You can certainly imagine that Lisp game programmers are an even smaller group. And then when you consider non-trivial games, the games made by teams, the ones that are significant enough in scope to potentially fund the studio building them… well, I don’t think it’s much of a leap to say that you can probably count the number of those games on one hand.
Suffice it to say that not a whole lot has been written on the art of developing games in Lisp, relative to other languages. As a leader of one of the aforementioned five-or-fewer teams building a sizeable Lisp game (Common Lisp, in our case), I want to contribute to that collective knowledge base. But first, a caveat: It would be premature to consider either (defun games ()), as a studio, or myself, personally, as any kind of “authoritative voice” in the Lisp game community. Spycursion is the first game that we as a studio are producing, and it hasn’t even been funded yet. (Hint hint, Kickstarter, Feb. 26, hint hint!) And although I was a hobbyist Common Lisp developer for about seven years before starting work on Spycursion last year, there’s still a lot about this language I don’t know, and there are certainly people who could write better/faster Lisp game code than me… I’m just the only one who was insane enough to start this project. 😉 We also recently picked up another developer (he hasn’t introduced himself yet, but he will) whose opinions may differ from mine. Taken altogether, what I’m trying to say is: I’m not a guru. I’m just one guy trying to find his way on this bizarre-yet-beautiful landscape, just like everyone else!
Aaaanyway, Lisp games. The first thing you should know, before you go tell all your friends “Hey, they wrote Spycursion in Lisp, let’s create our Overwatch/Pokemon/Dark Souls cross-over in Lisp, too!” is that Spycursion is weird. The game itself is weird, its architecture is weird, its developers are weird… Point is, we’re working with some parameters that make Lisp not only suitable for Spycursion, but perhaps even the ideal language for it. Your Overwatch/Pokemon/Dark Souls cross-over may not fit the bill. (Or it may. I’ll let you know after we release Game #2.) It’s also important to remember that Spycursion has a client and a server component, both of which are written in CL. This was not always the case for the client; I’ll share that story in a minute. But let’s talk about the server first.
As we’ve mentioned before, Spycursion has its own programming language. You may have read about how domain-specific languages (DSL’s) in Lisp are grand, how they’ll make your coffee for you, blah blah blah. In my experience, a lot of the conversation about this can get pretty academic, but here’s a summary of what happens when you compile and run a Slang program in the world of Spycursion:
1. Compilation: The server parses your program (assuming it is syntactically correct) and creates a tree of Lisp forms from it.
2. Runtime: Some contextualization happens with that tree of Lisp forms, and then it is evaluated within the context of an in-game device.
3. (Optional): If the program needs to communicate with another program on another in-game device, via in-game network, then some magic happens to determine where that program is, and runs it, too.
This is of course a lot more complicated than I’m making it sound, but it’s still far less complicated than in probably most, if not all, other mainstream languages. Lisp allows you, as a player, to run your own code within someone else’s online game. (And yes, we do run security checks on your code before we parse it. We’re not n00bs, thankyouverymuch.) This is not merely simulated. There are plenty of places within Spycursion where we “cheat” to make things easier on ourselves — hey, we’re an indie, cut us some slack — but Slang is not one of those places. Just thinking about trying to do all of this in C++ gives me an icky feeling. (I eagerly await the e-mail from someone telling me how you can do it in C++, if you just jump through these 27 hoops…)
So, yes, Lisp is awesome as a game server, but I have a feeling that’s not what most of you are here for. You want to know why we’re using Lisp for the Spycursion client, and how you can write your own amazing thing in Lisp too, and clearly the answers are
because I’m insane and you should stop listening to me because it’s fun, dadgum it, and by being a masochist early adopter and maybe having a fairly simple game, graphically. Sarcasm aside, these questions deserve longer answers:
Why Lisp (for the client)? Okay, story time. Long, long ago, when the Spycursion server was just Slang and a WebSocket interface and not much else, I set about creating a text-only testing client. I did this in Python, figuring it would be relatively quick and easy, which it was. At this point I’d not completely decided on how the client would be implemented, but I reasoned that, despite Python not being my best language, it would be easy to find developers for — so I could handle doing all the server-side Lisp as long as I had someone else dedicated to the client.
But there was a problem: Writing in Python just wasn’t fun. Some of you may not understand this, but it’s a phenomenon I’ve heard about before — once you get “spoiled” by Lisp, you have trouble getting motivated to code in any other “lesser” language. This was before we existed as a studio, when I was doing this project entirely by myself, so I didn’t have anyone else to shove the Python work off to, but I knew it was important to get something visual produced so that I could begin to show people (not simply tell them) what Spycursion was about.
So I chucked the Python client, rewrote the thing in CL, and around that time, started getting ideas of what I felt this fledgling studio could be. In my opinion, the reasons “nobody programs in Lisp” mostly boil down to, well… because “nobody programs in Lisp.” The community is small, so there are few tools available, so the community doesn’t grow because people don’t use Lisp for major projects due to a lack of tools. This is even more true for Lisp games specifically, but I believe that this chicken-and-egg problem can be helped by creating a well-known game in Lisp, if only to point to it as a success and prove that it can be done. Additionally, by open-sourcing the client code (which we’ve not done yet, mostly due to legal questions that need answering), we show new and aspiring Lispers how it can be done. Again, to avoid getting ahead of ourselves — this thing could still fail, perhaps in spectacular fashion. But at least if it does, you’ll get a front-row seat. 😉 And I guarantee you that it won’t be because of the programming language we chose.
Why do you think it will work? As I mentioned before, Spycursion is weird. There are very experienced people within the Lisp community who think that Lisp, in its current state, is not ready for serious game programming. I have no basis on which to disagree with them, but I do think it depends on the type of game you’re creating. Spycursion has several things going for it that make it different from what you might imagine as a “typical game,” especially a AAA game:
- There’s no twitch action. An ill-timed garbage collection isn’t going to be the difference between life and death. As of yet, we’ve made no attempt to customize GC or really push for low-level performance in ways that might be challenging to do in Lisp. We might, at some point, but I’m guessing we won’t even need to.
- Much of the tricky stuff is offloaded to the server. Don’t underestimate the advantage of having a server (read: one single platform, of your choice) running parts of your game. That means fewer shared library headaches and fewer client performance woes — assuming you do everything asynchronously — for starters. (Oh, but please don’t be that developer who forces a network connection for your single-player game. That’s just rude.)
- We don’t need to build for consoles. Ever tried to run Lisp on the Switch? I haven’t… and I don’t want to.
- Physics? We don’t need no stinkin’ physics. Or at least no physics that can’t be calculated based solely on what I remember from 9th grade Geometry.
- We keep graphics simple. I don’t really know how to quantify that, but the game is meant to be played 3rd-person, from a distanced zoom level. (We let you zoom in, but I wouldn’t necessarily recommend it.) The assets will be relatively low-poly and there will be relatively few of them. Note that “simple” does not mean ugly. We’re aiming to make it all look good while still putting most of our effort into gameplay — graphics are one of the places we “cheat.” You’ll be able to judge how we’re doing once we finish the Kickstarter trailer.
Put all of the above together, and you get a picture of a fairly minimalistic game client that really gets out of the way and lets you enjoy playing. (Or at least that’s the picture I hope you get!) And to be clear, I am not saying that fancier, AAA-level games can’t be made with Lisp. I’m saying I really don’t know, but this is our attempt to get as close as we can with the resources we have.
How are you doing it? I would say “pain, sweat, and toil,” but that kind of describes all game development, so…
- CEPL. CEPL is an abstraction layer around OpenGL which has been a joy to work with, once I figured out how. (Tip: See the author’s video stream, it’s great.) Its goal seems to be to make OpenGL lispy and fun to work with, and I really think it has achieved that. Spycursion uses CEPL extensively, and while I’m sure we’re doing some things suboptimally, performance has been fine so far. We’re also using cepl.sdl2 which brings in cl-sdl2.
- QTools. QTools is a lispy wrapper around Qt 4. Most games probably won’t want the heft of Qt, but our device UI actually needs something a bit more featureful, so it’s worth mentioning. We have run into some build problems with QTools, particularly on Linux. Add in that there doesn’t seem to be a Qt5 update on the horizon, and we may well end up switching away from it (to what, I can’t say yet). But it’s currently working well, for what we need it for.
- Other libraries
And that’s it! Lisp game development isn’t for everyone, but I stand by my assertion that it can be done, and done well, given the right game — and perhaps the right amount of patience.
- Use CEPL. Or one of the engines, if they fit. Or maybe both.
- Yes, you should do it, even if you fail. That’s how the community grows.
- Be prepared to write a lot of stuff yourself. This is not necessarily a bad thing. It’s fun!
- Except skeletal animation. Don’t write that yourself.
- Support our Kickstarter starting on February 26th!
Over the last several days, you may have noticed a handful of cryptic messages being posted to our website and various social media presences. We don’t know who (or what) is behind these strange postings, but rest assured we are working as quickly as possible to solve the mystery.
Additionally, we noticed some kind of analysis tool posted on this website. As of now, its purpose is unknown, but it seems to be looking for a 32-character string of hex characters (0-9 and A-F). For example, a string like this: 46b6726a8a327e007d41d9f603bae95d.
At the time of this writing, we’ve discovered eight of these strange messages and ciphers, but will let you know if we learn of more.
Can I speak freely for a minute? Marketing your own game sucks. It especially sucks when you’re an indie studio, and it sucks even more when your game is shaping up to be as ambitious as Spycursion. The last thing we want to do is promise features that end up being outside the scope of what our Kickstarter revenue will allow. And yet, I believe that for Spycursion to reach its full potential, our fans and supporters (that’s you!) have to understand what that potential is.
So, rather than the overly conservative details we’ve been putting out, in this post I’d like to give you a glimpse inside my mind (careful, it’s a scary place) at the other end of the spectrum — the level 100 version of Spycursion. Please, treat this post not as information, but as inspiration. If you just want to know what Spycursion will look like when it launches, you probably want to skip this one.
In addition to the core details we’ve already mentioned…
- Simulated economic, business, and political systems, centered around technology and security.
- Market fluctuations, of stocks and cryptocurrencies, based on player activity, missions, and random world events.
- Run your own corporation, by yourself or with other players. Do business legally or illegally, but don’t get caught!
- If you do, you’ll go to prison and have to break out, or convince someone on the outside to break you out.
- Alternatively, you could just blackmail a politician to get the laws changed in your favor…
- … or hack the laws themselves, which are implemented as smart contracts…
- … or become a politician yourself, if you’re famous enough.
- Spycraft like in the movies (and hopefully better).
- Need to follow someone? Hack their phone and watch their GPS…
- … or do it indirectly by hacking security cameras in the area…
- … or do it the old-fashioned way and hire informants.
- Got a tough corporate target to crack? Try buying a phone, filling it with malware, and mailing it to the company to attack their Wi-Fi.
- Drones. Because of course.
- Need to follow someone? Hack their phone and watch their GPS…
- Learn the ins and outs of software security.
- Open-source Slang software can be audited by players for security holes…
- … but even proprietary software can be fuzzed.
- Security holes can be found as random world events, in which case they’ll be publicized.
- Or they can be found by another player, in which case, they can do what they please…
- Be careful with software you find out in the game world. You never know what kind of backdoors it might contain.
- Open-source Slang software can be audited by players for security holes…
As we’ve mentioned before, our ability to level Spycursion up to 100 depends entirely on you. If you’d like to help with that, please start by joining our mailing list! You should see a subscription form at the bottom of this post.
Take a look at the following screenshot:
This is an aerial view of a city from an early development build of Spycursion. (In other words, the details may change, but this is the general aesthetic.) It represents one city, out of several cities that will make up the urban game world of Spycursion. We plan to scale the number of these cities based on player base and story needs, but will probably start with five or six.
Each city will vary a bit in size and what it contains; we aren’t ready to show the building interiors yet, but our goal is that every building you see will be explorable — nothing that’s just “filler.” Among some of the purposes these buildings might serve in the game:
- Internet cafe
- Electronics store
- Corporate office
- Police station
- Your apartment!
- Others we’d like to keep secret… for now.
Your game character will roam this world, making mayhem, stealing secrets, avoiding the law… and remember, this is only Spycursion’s “physical” world. We’ve barely gotten started on showing you the digital one!
In this post we’re going to discuss one of Spycursion’s core features, an in-game programming language called Slang. By “core” I don’t necessarily mean a feature that players will interact with all the time (though I’m sure some will), but a feature that is literally a core part of the game. Spycursion contains thousands of different electronic devices — servers, laptops, phones, etc. — and, to some extent, all of them run on Slang. In fact, the Slang language was the very first code we wrote, which should give you an idea of how central it is to the game.
From a language design perspective, Slang has two main goals: Ease of use/learning, and the ability to obfuscate. The first goal is self-explanatory — it should be beginner-friendly. Here’s a simple program:
name = sys.args[ 0 ] sys.print( 'Hello, ' name '!' )
As you might be able to guess, this program simply takes one argument, a name, and prints out a hello message. You might run this on the command line with “./hello Scott” and the program would print “Hello, Scott!” The code could even be shortened to one line instead of two:
sys.print( 'Hello, ' sys.args[ 0 ] '!' )
We hope that Slang’s syntax is easy to pick up, even for players who have never written code before. But experienced programmers will want to do a lot more than say hello to themselves, which brings us to Slang’s second design goal…
coin_flip() = sys.rand( 1 ) fun heads_or_tails ( ) if ( coin_flip() == 0 ) sys.print( 'Heads' ) else sys.print( 'Tails' ) fi nuf i = 0 while ( i < 10 ) heads_or_tails() i = i + 1 done
You might think that the above code snippet is the equivalent of flipping a coin ten times… but you would be wrong! Its practical result is to flip a coin once and print that same result ten times. That’s because in this example
coin_flip() is a variable, not a function.
There are plenty more
nasty clever obfuscation tricks you can do with Slang. Virtually any string can be used as a symbol name, and symbols are delimited only by white space. Using the above example again, this means that
i<10 would have a very different meaning from
i < 10.
Why does this obfuscation matter? Remember that Spycursion is meant to be a game of… well, spies. Spies sometimes use Trojan horses — gifts, ostensibly well-meant, with a hidden nefarious purpose. And what better Trojan horse, in the digital age, than some piece of open-source software? “It’s safe, I promise! And you have the source, so you can even review the code yourself!”
Slang is still evolving, and will likely continue to evolve even after Spycursion is released. But for now, we’d love to have your feedback. How are we doing on our design goals of ease-of-learning and obfuscation? Beginners: Did this post make sense to you? Are you excited to learn more about Slang and/or Spycursion? Non-beginners: What would you like to see from Slang? Please get in touch!
What is the internet? It’s billions of devices, all running their own operating system and software, networked together, “speakng” to one another. This networking works because the devices all “speak” in common protocols, some of which you’ve probably heard of: IP, TCP, HTTP, etc.
Spycursion’s own version of the internet is similar. It contains thousands of different electronic devices — servers, laptops, phones, etc. All of these devices are connected, and most of them can be located and/or hacked (with varying levels of difficulty) by players.
Notice the word “located” above. Just like in the real world, Spycursion’s internet is a big place. If you’re on a mission to steal data from someone’s laptop, you could go about that in two ways: You could access it physically, or you could hack it remotely. The latter method is obviously safer, but you would need to know its IP address (its “home” on the internet), which you wouldn’t necessarily have at first. That’s where tagging comes in — identifying the device, out in the game world, and getting its IP address, so that you can hack it remotely from the safety of your own apartment. Very spy-like indeed.
We’ll explain more about the hacking and security mechanics in a future post, but in a nutshell, what you’ll need to do to hack a target over the internet is scan it for vulnerabilities — gather information on what software is running on it — and then deploy exploits against the vulnerable software. You can create these exploits yourself, using the in-game programming language called Slang (another future blog post), or you can purchase them, find them in a secret location, or steal them from an unsuspecting victim.
The miniature internet in Spycursion has a lot of similarities with that of the real world — and being a video game, of course, you are free to wreak mayhem all over it without consequence. Your game character, however, may end up making a lot of enemies…
Hi, I’m Scott.
I’m the founder of (defun games ()), lead developer on Spycursion, and an all-around nice guy (sometimes). I’m also the guy who wrote those last two blog posts… and then seemingly disappeared for more than six months. I’d like to apologize to our loyal fans — all three of them — for that long absence; a lot has happened since our last update! But before I get to that, let’s start at the beginning.
It’s early in the morning on some idle Tuesday in June of 2017, and I can’t sleep. Haven’t slept all night, in fact, not for lack of trying — because my brain has ideas, dadgum it, and this time it is steadfastly refusing to let them go. The ideas swirling around concern a video game, the likes of which I’ve never seen, but would love to play. This imaginary game centers around hacking, but it’s the real kind, not the Hollywood kind. And it’s multiplayer, so players can learn from and play with and betray each other. And there are corporations, and an economic system, and a programming language, and blackmailing of politicians, and, and, and…
And the ideas just keep coming, until my then-girlfriend/now-wife wakes up so I can blather to her about all of this. She, in her fresh-eyed wisdom, tells me to take notes. Those notes, the child of sleep deprivation and a night full of eureka moments, would later morph into the game design document for Spycursion.
Having been an IT guy in a past life, I started Spycursion’s development with the pieces that came most naturally to me, meaning the backend… or, in other words, the logical parts that nobody outside of other game developers will see and are completely useless for proving that a game actually exists. (So if you were ever confused about the lack of screenshots, you now have an explanation.) In hindsight, this was a mistake, but we’ve been trying to fix it. Here are a few recent screenshots, for the curious:
Truth be told, the journey to this point hasn’t been easy. Since November, teammates have come and gone, we made multiple significant code rewrites, we redesigned our website, and, oh yeah, I got married. (It turns out that planning a wedding is just a little bit of a distraction from writing code.) And yet, in the judgment of this possibly slightly insane author, it’s all going remarkably well. We recently recruited a community manager, whose name is Dan. I’ll let Dan introduce himself later, but he’s going to help put more content out there so our three loyal fans don’t get upset.
I’ve never been one for thinking small; it’s a blessing and a curse. Spycursion isn’t small, either. (Obviously, or it would be done by now and we would’ve sold about eight copies on Steam.) But what it is, I believe, is unique — the best combination of indie creativity with AAA quality… or at least B+ quality. And because we’re a small team making a big game, we need your help to make it real. The time will come when we launch a Kickstarter campaign and ask for your support. For now, though, we ask for your support in three other ways:
- Subscribe to our mailing list. You see those little forms in the sidebar and footer? They’re nice, aren’t they? They’re also our metric for when to start crowdfunding. The more subscribers we get, the sooner we can launch.
- Spread the word. Want Spycursion to succeed? Great, so do we! Tell all your friends that you want to play it with them. We’ve got some social media links in the footer, if that’s your thing.
- Join our team! Our most pressing need (as of July 2018) is for another developer or two, but if you think you can contribute in other ways, drop us a line.
Thank you, sincerely, for being a (prospective?) fan, and my apologies again for the radio silence. We at (defun games ()) are dedicated to making sure that your patience pays off.
It’s now the year 2032. In the recent past, a major cyberwar decimated much of the global internet infrastructure. What remains of it has largely been seized by pre-existing power players. Many countries have shunned the global internet and attempted to close their electronic borders (with varying degrees of success), while governments in general have lost much of their power in favor of corporations, loosely-tied criminal and vigilante groups, and even skilled individuals. In a world where information is more valuable than gold (but maybe not Bitcoin), “Spy” may now be the world’s top-paying job title.
Disclaimer: Spycursion is an ambitious game in early development. We present to you this information as a vision for how it will unfold. That said, some features may not be in the game when it launches. We will add these missing features — or completely new features — in later updates, depending on what players ask for!
As a Spycursion player, your objectives will be… whatever you want! It will be a sandbox game, where you can play several roles, which may influence your abilities and bonuses/penalties:
- Federal Agent: De-anonymize and track down criminals, contribute to the global order.
- Developer: Create/sell software for other players… perhaps with backdoors.
- Tycoon: Make money by any means necessary (typically business/politics) — but you’d better keep your hands clean!
- Hacktivist: Hack for a cause; expose corruption and create an open internet.
- Braggart: Hack for reputation; it’s all about fame!
- Mercenary: Take jobs for money, from whoever pays the most.
At the core of the game is basically a mini-Internet — simulated devices of all sorts, running software written in an in-game programming language called Slang (short for “Spy Lang”). Some of said software is open-source, some of it is proprietary… nearly all of it has security holes just waiting for you to exploit and/or patch! You’ll start off with access to a handful of basic public services (search engine, news, webmail, etc.), and as you explore, you’ll discover other public and private services run by other players or NPC’s.
Over time, various events will occur which will encourage (or force!) you to take some action. Bounties will be placed on well-known criminals, making them a target of other players and feds alike. Cryptocurrencies will rise and fall in value, influencing and influenced by the in-game economy. Software security holes will be publicized, encouraging hackers and putting corporations on the defensive.
Unlike most other hacking games, there’s a very “out in the world” element to Spycursion. Wi-fi hacking, phone hacking, and even shoulder-surfing and eavesdropping are all fair game. Missions will vary in design from the simple (“Trace the sender of an e-mail”) to the complex (“Steal a file from an air-gapped computer in a high-security facility”). Some can be performed from the relative safety of your character’s home, while others will require you to travel to another location, possibly risking the wrath of airport security.
Spycursion will also contain a single-player campaign, in which you will explore the history behind the cyberwar and discover just how the world came to be this way.
Yes, the Spycursion client will be open source! Don’t like that UI screenshot you see up there? No problem; just break out your favorite editor and sculpt it to your whims. Or build your own client from the ground up using our API! The choice is yours, and in Spycursion, many more choices will be, too. We greatly look forward to sharing more about this game. Stay tuned!
Waiting in the security line at the Atlanta airport gives a person plenty of time to think about their life choices. As you shuffle forward at a glacial pace, you wonder if it’s really a good idea to become even more entangled with the enigmatic information brokers known only as Big Data. The first two missions for them were relatively painless, not to mention lucrative. But something about this one feels… off. In theory, it’s a simple real-world mission:
- Fly to Chicago.
- Hang out at Starbucks.
- Wait for the target to show up.
- Hack her phone.
- Don’t get caught.
Well, as simple as real-world missions can ever be. It’s always risky doing an op out in the open, in full view of any cameras or shoulder-surfers. Traveling for an op is even riskier, but hey, whatever pays for that new rig you’ve been eyeing.
“Photo ID, please.” The TSA agent is staring at you impatiently.
“Oh, right, sorry. Here you go.”
A sudden chill runs up your spine. This is your first time flying with a fake ID. Such measures became necessary after a rival spy de-anonymized and “leaked” you (read: framed you) to the feds, officially making you a wanted criminal. The shop that sold you the ID claims to be good, and they are well-reviewed, but still…
“Thanks, enjoy your flight.”
Whew, that’s a relief. You shamble through the rest of the line, and the ever-present privacy violations that are the TSA’s body scanners, without incident. Past security and relatively safe for the moment, your thoughts return to the mission at hand. Though they keep their cards close to their chest, Big Data has never been known for recklessness. If they ask for information, it’s because someone else is willing to pay well more than the costs of obtaining it. Still, to your knowledge, they don’t have much of a presence in Chicago, and no one gave you any information at all about who your target actually is, other than a basic physical description (redhead, 5’6″, mid-40’s) and the location of her favorite coffee shop.
And then there was the mission listing itself: High-paying, at the top of the list. Normally those missions are snagged within a few minutes by the swarms of risk-tolerant idiots who want to make a name for themselves, but this one sat for multiple days before you conjured up the courage to click “Accept.” It’s almost as if — a lump forms in your throat as the pieces come together — someone intended you to take this mission.
“Hello, 22.214.171.124,” a chilling voice spouts your home IP address from behind you. You whirl around to spot the perpetrator, a redhead, about 5’6″, in her mid-40’s…
“We need to talk.”
Spycursion, our first game in early development, is what we’re referring to as a “subterfuge MMO.” It combines in-depth realistic hacking with an overworld map allowing you to move from place to place (think wardriving), in a massively multiplayer sandbox which will let you team up with other players, attack them… or do both simultaneously! Watch this space for more on Spycursion. It’s got a number of very innovative features that we think you’re going to love.