Saturday, July 28, 2012

Geometry editor

Geometry editor

Blender is an amazing piece of open-source software. Maybe because I'm a total amateur at 3D modeling, Blender does everything and much more than I can imagine needing for 3D content creation. It does meshes, armature (skeletal) animation, skinning, sculpting, lighting and a ton of other things I don't even comprehend yet.

I'm not much of an artist, so Blender will be mostly useful for map editing and tweaking and adjusting things for testing and so forth. This is ok, though, because, as I said previously, I want as much of the content as possible to be procedurally generated anyway.

For content exchange between Blender and the engine, I'm starting with COLLADA because it provides way more descriptiveness than I need, and it's an open standard which has native support in both Blender and the rendering engine. The downside is that all of that textual XML syntax has the potential to become huge very quickly for even simple objects, so if things begin to bog down, I can begin considering a binary converter and file compression.

The only drawback to Blender that I can find is that it doesn't export physics or custom properties to COLLADA, so my next coding goal is to develop a patch for Blender to add those capabilities. I just completed my initial build of the Blender source, so now I can begin tinkering...

Friday, July 27, 2012

The renderer

Renderer

I really don't want to spend the time to write my own renderer from scratch, especially if there are ready made ones for free. There is a considerable amount of code involved in just reading and decoding the file formats involved for textures, shaders, armatures, meshes, and keyframes and that's before you even begin to think about transformations and animation before finally sending the vector arrays to the rendering hardware.

I considered two renderers; OGRE 3D and Irrlicht, and I'm still not sure which to stick to. Both have free and open licenses permitting modification and redistribution.

OGRE

On the plus side, OGRE has a lot of features and a large development community. On the downside, I noticed several glitches in the demo applications under Windows. Also, the COLLADA support does not appear to be included in the main source distribution and must be compiled as a contributed plugin. I'm still learning about OpenGL, so I don't fully understand this, but it appears to say that the GL renderer performs thousands of redundant operations because it does not sort state changes well. I'm not sure how Irrlicht compares in this regard, though.

Irrlicht

Irrlicht is leaner on features, but the code is exceptionally clean and compact. It builds with no external dependencies, and the initialization and render loop code fits on a single page. COLLADA support is integral, so, out of the box, you can add a single line of code to the Hello World app, and immediately load scenes exported from Blender. Also, the demo apps seem very neat and polished, without any odd quirks.

If I were attempting to develop a conventional game, I would probably go with OGRE. However, I have so much customization in mind that I would probably be better served with the simplicity of Irrlicht. Since I'm going to have to make so many changes either way, Irrlicht means there's less code to rewrite.

Thursday, July 26, 2012

Tools

I have had a rough idea of what I want to accomplish for a while, and I have been trying out various tools. I'm kind of excited to get back into software, as I've been away from it for so long that even C++ has changed.

Build Environment

Visual C++ Express (2010) has come a long way over the years, thanks primarily to competition from freeware and open-source products. For a free Microsoft product, it's high praise to say that it can compete with gcc for basic Cxx functionality. The build system supports parallelism, which is nice when building huge source trees. Lots of developers are using cmake as their metabuild system, and it can usually spit out convenient VC++E-compatible project files.

Compared to the commercial versions of Visual C++, the Express version is mostly missing MS-specific resource editors, GUI designers, and some libraries, such as MFC. And you can't install or use IDE plugins or extensions. I noticed, recently, that the OpenMP headers are not available for Express, which is disappointing since I haven't tried OpenMP and it looks nifty. Aside from these sorts of things, much of the remaining stuff which is missing is available separately in free Microsoft SDKs, including the Windows 7.1 SDK. It automatically integrates itself into Express enabling the x64 Platform and the 7.1 Toolchain (project properties), which together enable building for 64-bit Windows.

There may be some other drawbacks, like missing optimization options, but I'm less sure of that. In any case, I run Windows for the sake of support and compatibility, and since I've decided to be stuck with Windows, I had might as well develop under their environment in order to keep things simple. If I had a suitable spare machine, I would rather develop under Linux purely for the vast library of free development tools, but I simply haven't the hardware. This shouldn't be a big deal so long as code is kept neat and portable.

Friday, July 20, 2012

Basics

So, to summarize, here are the major design objectives I've thus far succeeded in covering in ten or fifty thousand words or less.

  • Procedurally generated terrain/world
  • MMO-scale environment
  • Action-oriented, deeply emergent interactivity
  • Resource collection and world-building
  • High automation through NPC populations

What about building? This is one of the features I want to emphasize most, and is the one I found most deficient in other games. This may also be the most difficult to design well. I want players to engineer buildings, cities, weapons, and vehicles from basic primitives. I want to have an elaborate material system, almost like a simplified periodic table, where different materials have certain properties which make them suitable for different components. Maybe Scandium is especially suitable for building long-range sensors and Explodium is best for building ordnance, and so on.

And this brings me to the subject of NPCs. I want research to be a big deal. I want for each player to have a certain view on the material system which is dictated by research progress. So, maybe a player with minimal research investment perceives diminished stats throughout the material table, but if he has put a lot of study into one particular element, then its effective tensile strength, or energy level, or whatever metric is closer to the material's ideal. So, this goes a little further than the traditional technology tree, where the things you are unlocking are usually entire items, or something similarly qualitative. In contrast, I want a player's numeric stats to influence, primarily, the quality and stats of intermediate components, which he can then combine according to his imagination and preferences. So, here, switching the discussion to emergent behavior mode: I want the larger effect of this system to be that players will say things like "Bob -- I mean, the Tau Federation -- is known for making the absolute best quality pistols due to his choice of materials and skill level, but if you want a really powerful engine, go to so and so. Oh, wait, for that excursion, you will want fuel efficiency so talk to Bill", and so on.

As I write this out, I find myself switching back and forth between two levels of thinking. I know what I want the game experience to feel like, and this is sort of the big-picture perspective. But I want that environment to be "real", in the sense that it emerges from the rules of the game. For example, most games will have tons and tons of static objects thrown in to make the game seem more "real". I detest that. The objects are static. There's stuff like fake cars that you can't drive and they only serve to establish that the game is a prop-strewn movie set which, at least to me, detracts from realism rather than contributing to it.

And, so, going back to NPCs, I want the underlying need for resource collection, research, and production to drive the player's desire to build cities. And I want those cities to have skyscrapers and mass transit. And I want the gameplay to exhibit crescendos and critical mass points where the balance or play dynamic tips or changes direction. How to accomplish this remains a somewhat open question, but I have some ideas.

Wednesday, July 18, 2012

Huh?

It's only very tangentially game-related, but I had to post this

This story concludes that, because biologists had to employ math skills to decipher dolphin echolocation signals, this must be the same methods which dolphins employ, ergo dolphins are "math geniuses". Right or wrong (my money is on "wrong"), it's a ridiculous conclusion to draw based on the reasoning provided. This is like saying that because I can catch a thrown ball, I'm a "genius" at inverse kinematics. Actually, there's a part of my brain which is wired to perform the equivalent operations, but damned if I'm aware of how. I can think of many other similarly absurd analogies. Guess what? Did you know that my brain automatically derives the depth of objects by continuously analyzing the differences between the two 2-D images projected onto my retinas? It's true, but it doesn't make me some sort of trig prodigy. Sometimes I wonder if people write stuff like this out of ignorance, or simply from an abundance of slow news days.

Massive?

So, now comes the time to think about what I want to accomplish. What sort of game do I want? Features, objectives, scope, and so on. I want the geographic breadth and procedurally-generated expanses of Dwarf Fortress or Civilization. I want the 3D and real-time interactivity of an FPS game. And I want to support the player counts of an MMO. So far, this sounds a lot like Minecraft, but I want to go much further than that.

Minecraft is fun as a sort of multiplayer sandbox, though it lacks any well-defined goals. Most people play to compete with others for mining and exploration and construction, and I think that this is a wonderful step in the right general direction.

Alternately, going by the standard MMO formula, we would design an expansive game world by hand, we would hard-code tons of quests, liberally sprinkling in wilds and monster-spawners to occupy (waste?) players' time while they power-level between quests. It's standard, but it's awful for several reasons. First of all, the player's actions have no substantial persistence in the world. He might have stats, and skills, and an inventory, but this is generally pretty much it. Of the character stats, character level is all-important, and this is the ultimate objective and time-sink of the entire game, this being the second thing that I find brutally boring about MMOs. It's still linear. You're either running quests, which a programmer scripted for you in advance, and which have probably been completed in identical fashion by a thousand people before you, or you are wandering around in the forest bonking wolves for XP so that you can then resume pursuing linear pre-scripted quests. The only real fun, is what I call the pub effect. People don't go to bars to drink; they can do that at home. Instead, it's a pretext to get out of the house and socialize with other people. And that's fine if it's what you want, but I can think of better ways to do it than logging onto an MMO. I want the game itself to be fun independently of whether I have a dozen human friends from real life in my party. Worst of all, though, you pay your monthly fee, and then what is the game's fundamental commodity? Your time. You have to invest tons of your real-life time, which the game converts into its internal commodity, in the form of experience points. So, in a way, your score is a representation not of skill or achievement, but of how much of your life you've wasted. I would rather design a game that has tons of automation, so that at the end of my day, I log in after dinner and issue orders, and queue up actions, or draw up designs or floor plans, and then I have tons of subordinate NPCs who do everything in the background unless I really have the desire to be logged in for some important event or other. This goes against standard MMO design, where sheer concurrent login count is treated as some sort of benchmark, which, in turn, is no surprise if you envision your game as some sort of hangout for nerds who can't make it at the dance club -- but I would rather go beyond that.

Sunday, July 15, 2012

Games

Lately, my favorite game has been Dwarf Fortress. I think it's because it comes, essentially, from the Sid Meier school of thought. Sid Meier says, and I paraphrase, that a game should impress you not with what it can do, but with what you can do with it. And likewise, that is exactly what was so great about Civilization III. There was no scripted story. Which is not to say that there was no story at all. On the contrary, the gameplay was full of suspense, adventure and drama. There was no need for the game to proceed on rails, along a script, because the game was designed in such a way that the story emerged naturally from the players' interaction in the game world. And I think that this is what embodies good game design. Unfortunately, this is the complete opposite of the dominant paradigm in the design-by-assembly-line industry as it is, especially in the action genre where it seems as if the same game is repackaged with new graphics and resold to the public over and over again.

I've been playing Battlefield 3 as well, and was surprised to find that I like it better than I expected. Mostly for two things. Most of the weapons in the game are quite effective so long as they are played to their strengths, which adds an element of strategy. Further, I also liked that all of the guns are ballistic. I like that there is some skill and anticipation required in order to hit anything. If I wanted to score purely by point-and-click, I would simply play a web-based game, or somewhat less sarcastically, I might say "Quake" instead. Not that Quake was a bad game by any means, it's just been done to death.

Moreover, though, I have certain standard complaints which are applicable to almost every action game I have ever played. The gameplay design is ADD-centric, which ruins most of the threads of battlefield drama which could otherwise emerge from the premise.

"Cover me!" "What for? You'll just respawn twenty yards away in five seconds anyway".

"This convoy must arrive intact within five minutes!" "What convoy? The gameplay revolves entirely around shooting stuff, and it has no notion of supply lines"

And so on. The whole of gameplay basically boils down to an elaborate variation on laser tag. Don't get me wrong. I was a huge fan of Action Quake II, a Quake II mod of which the better known Counter-Strike was a direct descendant. AQ2 was very much within the twitchy action mold. But it was done well. All players would spawn with a standard load of default equipment which was inaccurate and not particularly powerful. Scattered throughout the level, there would be a fixed number of powerful unique items of which each player could only carry a few of their choice. And so everyone would fight over their chosen favorite super-items in a sort of dynamic king-of-the-hill. When you finally obtained the loadout you desired, there was suddenly great pressure to survive because you didn't want to lose your advantage and have to go hunt down your items again. At the same time, everyone who wants your stuff is now simultaneously charging after you. To add to the tension, the scoring system was unique, in that there was a multiplier in play, which increased if you stayed alive, and reset if you died. So, in addition, for surviving, you were rewarded with exponential points. All this would have the ultimate effect of producing action-movie-like action/suspense sequences which emerged not from a script, but from the basic rules of the game, this being the stated goal of the designers. And this takes us full circle to the earlier Civ III example, and we see that the same concepts apply to both action and strategy games.

In contrast, we find that most game companies are content to recycle the same tired game mechanic over and over again, only dressed up in ever more elaborate shaders, textures, and high-poly models. They change the artwork, they change the title, and voila, it's a sequel. This is a shame, because even though everyone can appreciate impressive visuals, gameplay matters. The success of Minecraft, in particular, proves this. Minecraft, despite its lo-fi 8-bit visual motif, with its cubic layout, where even the sun is square, seems to succeed largely on the basis of simply being different. Indeed, I think Minecraft illustrates a market which is starved for novelty. More generally, we can consider pretty much the entire constellation of MMOs which often lag generations behind the visual cutting edge, as evidence that gamers will happily trade eyecandy for interactivity and depth of play. Not that I would consider the average MMO to be nearly as engaging as it could be. If I really liked any existing MMO, I would probably be playing it instead of thinking about writing my own game.

For lack of a better name...

... and owing to insomnia; a blog.

I spent most of the previous decade writing user interfaces and network code for a decrepit business system. I've wanted to do a computer game for as long as I've had a computer, and now that I have some downtime, I may yet get serious about it. I'm hoping that having the blog will help in that I can use it to sort of obligate myself to stick to the project long enough to make some progress.

It isn't a trivial undertaking, and for a computer programmer, I'm kind of poor at math. I like it, but it doesn't like me. Or at least it didn't until I had something of an epiphany a few years ago, and I realized that I could do proofs. Then, it suddenly made sense to me in a way that it hadn't before.

I have had a particular game design rolling around in the back of my mind for maybe twenty years. More of a theme than a design really. I have a certain idea of what a 3D action game should be like, and I have never seen it done quite the way that I would like. It helps a little that technology today is far advanced from what it was two decades ago. I constantly find myself looking at existing games and thinking "No. This would be great if it had been done this other way", and I think this so often that it suggests to me that I have enough ideas from which to make something original.