Category Archives: Programming

April Technical Status Update

It’s April! There is a Technical Status Update. You know the drill.

{ read this article }

Posted in Clockwork Empires, Programming | Tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
23 Comments

CPU and GPU Run-time Profiling in Simulation Land

[Warning: This is a very technical post.]

It’s not easy writing a complicated simulation. There are lots of complex, interconnected moving parts to worry about and when something goes wrong, it can be hard to figure out where that small, broken thing is in the midst of a larger picture. We recently discovered that the game was running… unreasonably slowly, shall we say? My desktop was getting 15 FPS, and it wasn’t clear what the problem was. On Chris Whitman’s machine, which uses a slightly different graphics card than my computer, our FPS was in single digits. I don’t like optimizing too early – as Donald Knuth pointed out famously, “premature optimization is the root of all evil” – but something was going on. Finally, sick and tired of the problems, I decided to get some answers.

There were three solutions for profiling that we looked at: Intel’s VTune, what we might call a ‘classical’ profiler which you can download a 30-day trial of from their website, and Telemetry, a different sort of profiler made by RAD Game Tools (specifically by Brian Hook, who you might know from such games as Quake 3.) RAD Game Tools also provided us with a 30-day trial of Telemetry, and this gave me an interesting opportunity to compare two profilers. Finally, we tried our luck with NVidia’s GPU Perfstudio to see if we could figure out what was happening on the graphics card.

Three profilers. One slow down. Who cracked the mystery? Find out below.

These actually have nothing to do with what Nicholas is doing but It Was Decided that the post needed some more visual accompaniment. Think of it as a tenuous thematic connection.

{ read this article }

Posted in Clockwork Empires, Programming | Tagged , , , , , , , , , , ,
19 Comments

Hooray for Scripting! (And Other Things We Did In The Past Two Weeks)

Way back in December, we had just implemented a bunch of the character logic for going through the world and doing things using our Finite State Machine model and utility functions. What we discovered was that writing the code for the FSMs themselves was, to put it frankly, a huge pain. Additionally, non-C++ programming members of the development team could not easily add new items and new behaviours to items (mines, buildings, trees, and the like.) Micah J Best, at the end of December, decided that we should use scripting to wrap some of the complexity and hide it from the end user, while simultaneously letting our development team create new objects and FSMs without requiring a programmer to go thrashing about in the codebase. I said, “Fine. Show me a proof of concept and then we’ll talk.”

Fundamentally, Gaslamp’s programming team operates based on spite. If somebody says “oh, well, we’ll never get that done in time”, or “oh, well, it’s too impractical”, somebody usually says “no, it well isn’t” and will jump to the bait. (I did this recently with a pipe system test.) Saying “Well, show me a proof of concept and we’ll talk” is equivalent to putting a red cape in front of a bull.

Over the holidays, Micah found himself stuck in Quebec. With nothing but inlaws, a language barrier, two laptops (one of which was destroyed by a cat), a turkey stuffed with poutine, and spite, he put together the first build of what is our new scripting system. It does, indeed, encapsulate all our programming decisions and is fairly powerful and flexible. We took apart all the character code we wrote in December, ported it to the new scripting system, and have now started using it to implement new things in game. It’s very powerful and, after some back-and-forth, I’m quite happy with how it’s turned out. We’re still fixing bugs and fine tuning how it all comes together, but let’s see how it all works…

{ read this article }

Posted in Clockwork Empires, Programming | Tagged , , , , , , , , , , , , , , , , ,
19 Comments

Technology Status Update

It’s been awhile since we checked in with the programming side of things. I put out a call this morning asking “what would people like me to talk about?” Interestingly, the main thing was the UI, and how we’d make it Not Awful. We’re not talking about the context-sensitive UI because we haven’t worked out all the details yet, but we’re working on it. Instead, let’s talk about the general state of programming.

So what have we been up to over in Programmer Town?

{ read this article }

Posted in Clockwork Empires, Game Design, Programming | Tagged , , , , , , , , , , , ,
26 Comments

Choices, choices.

Once again, we are back to knife-fighting in the pit. This is the traditional game design approach at Gaslamp Games; we fight to defend our ideas, using oversized weapons and our bare hands. Recently, however, somebody has been seen fashioning a rudimentary lathe – a troubling development that will either upset the balance of power or be absolutely useless.

So what have we been fighting about? Well, all sorts of things. Today, let’s talk about the AI. The AI Cabal – Nicholas, Chris Whitman, and myself – have been hashing things out, and what we have is a data-driven, XML-based monstrosity that is sure to please everybody. The whole goal of Clockwork Empires’ AI is to provide characters in the game (currently referred to, in-engine, as Citizens, although this is not something that makes David happy; after all, we are a monarchy) with unique, rational, and relatable behaviours. The plan is to start simply, and add layers of complexity to the game until the goals and aspirations of characters appear to the player naturally and gracefully.

{ read this article }

Posted in Clockwork Empires, Game Design, Programming | Tagged , , , , , , ,
18 Comments

Evolution of a 3D Engine

One of the major reasons behind announcing Clockwork Empires – as I think I mentioned before – is that we want to talk about what we’re doing. We want to keep you in the loop, and we want you to feel happy, informed, and involved. Accordingly, we’ll be posting lots of work in progress stuff. Again, this is a work in progress and will not (and does not, even!) represent what we’ll be shipping in a year and a half; this is a catalogue of the journey, but not the destination. However, it’s a pretty interesting journey.

Yesterday’s moment of excitement was discovering that all our characters were too small, and occupied one sixth of a “game tile” rather than one quarter of a tile. Queue massive re-export. Ah, well. These things happen in game development, and we deal with them and we move on; the key thing is to try to make sure that it doesn’t happen again.

So, let’s not talk about that. Let’s look at some screenshots. Because we’re vicious and evil, we’re not going to show you up-to-date screenshots; instead, we’re going to show you things from the cutting room floor. Way back when we started Clockwork Empires, we put a screenshot button in the game so that we could easily take pictures of our work for analysis, sharing with friends, putting up on the blog, whatever. Because we did this so early, we have an interesting collection of archival footage. So here’s some stuff for anybody interested in seeing how you pull an engine together.

To get you in the mood, here is a construction animation:

{ read this article }

Posted in Clockwork Empires, Programming | Tagged , , , ,
17 Comments

Clockwork Empires: Alright, Now What?

We’re back from Penny Arcade Expo! This was our first year as an exhibitor; while previous years have been reasonably epic (most notably for me, at least, was 2010, which was the year I crashed a panel with Steve Jackson), this year blew them all away. We got to meet a bunch of you, we got to hand out 100 Stuffed Diggle Menaces,  and we got to see the Hat of Bergstrom. We also had a few good times with some members of the remote team who don’t normally work at the Vancouver office, most notably Chris Triolo and Ryan C. Gordon, who just happened to be in town that day. I got a Valve tour! Daniel was on a panel! We went to Notch’s party! The list goes on and on…

Now we’re back, the question becomes: now what do we do?

The main thing that PAX impressed upon me was just how much work we have to do between now and next year on Clockwork Empires. Next year, we want to be showing this game, and we want it to be in a presentable state. That’s fine. We have a long, rather hard road ahead of us, and we’ll get there, but the question is… what do we do until then?

So here’s the plan. We’re an independent studio that is really not beholden to anybody but ourselves. We want you to know what’s going on and how we’re progressing; we want you to get excited for Clockwork Empires, and we want you to let us know how you think we’re doing. We’re going to open things up as much as we can, and we’re going to write while we do so. We hope you’ll like it. We’ll try to be honest, and we’ll try to let you know the good news as well as the bad news. You’ll be getting posts from me on the programming stuff, David on the art side of things, Daniel on AI (and maybe ranting about “business stuff”), and all of us on game design.

Let the great Developing begin, er continue! To that end, here is random art. What do you folks want to hear about?

Clockwork Empires serves the needs of all, from the clothing needs of growing alternative religions to the logistical infrastructure required to maintain a respectable zeppelin fleet in these challenging times.

Posted in Clockwork Empires, Game Design, Gaslamp, Programming | Tagged , , , , , , , , , , ,
28 Comments

The April Madness

Turns out when you’re writing a renderer for a game, and the renderer isn’t finished, it’s hard to come up with really awesome stuff to show people about the game you’re making. This is essentially what we’re waiting on before we blow the lid off of everything on Project Odin. We want to be in a position where we can show you what we’re working on, get your feedback, ask you about things you’d like to see in the game, and answer any questions you might have.

Mr. Triolo is currently contemplating how one might animate a chicken

There is a lot of concept art floating around on our repos that we’re trying to use to give you guys an idea of the fact that a lot of work is being done right now, not just in art but in the code as well.  We’re having to do a lot of “architecture” programming before we can start putting the game together on top of it; the main reason for this is that Odin is multiplayer, and multiplayer games just work differently.  We are taking the opportunity to do some optimization to ensure that the game takes advantage of all these newfangled “cores” we hear about in the computer stores these days as well.  Again, if you have your toes in the programming world, you know that this can be tricky.  (If you don’t but you are curious, check out this educational wikipedia article on race conditions!  If you don’t like circuit theory, feel free to skip that.)

We are also taking some time to actually get organized.  The game is going to take more than a year to get done (not six like the last one!  maybe two though) and one of the biggest issues with making a thing that takes as long as games do is that it’s difficult to keep all the important stuff in your head when you haven’t thought about it in a while.  We were guilty of a lot of this on our first (failed) project, and we were guilty of more of it on Dredmor.  I’m sure it will happen for Odin as well, but my job over the last two weeks has been getting us set up with a way of managing our project stuff so that we can be as organized as possible with as little effort as possible.  (For those of you who are interested, we’re using Atlassian, and it seems pretty awesome so far.)  I’m also starting to understand why so many indies make all their games, start to finish, in a month.

Coming soon: some Dredmor news pertaining to toys, the Steam Workshop, and some new content!

A potential terrain style that we have since scrapped for technical reasons (orange didn't test well)

Posted in Games, Gaslamp, Programming | Tagged , , , , , , , , ,
19 Comments