Brad Wardell's Blog


5 tips for Optimizing rendering in games

Published on Thursday, January 24, 2013 By Brad Wardell In PC Gaming

Historically, we've made space strategy games. And from a rendering point of view, space games are much easier to do.  There's no terrain and generally a lot less "stuff" to render.

When Stardock began work on the Elemental games (our fantasy strategy game world), we got a crash course in having to get a lot more disciplined in how we do our rendering.

Below is a short list of lessons we've learned that can be universally applied:

  1. The GPU is usually not the limiting factor. It's the CPU.
  2. Alpha checking is expensive. That is, it's worth spending some effort to intelligently label whether there's alpha blending in an object so that you're not making the GPU do the alpha testing on the fly. For example, we found that in Fallen Enchantress, a little spider web that appeared in a given tile would eat up 87% of the rendering time for the entire tile.
  3. In your shader code, it's especially important to find ways to exit out of any loops as early as you can. This is a good practice in general but you'd be surprised how easy it is to underestimate the performance impact it has.
  4. Anything that you paint on the screen that has to blend (on the fly) with other things is going to be expensive.  For example, our sunshine rays in Fallen Enchantress are more expensive to paint that all of the terrain combined.
  5. Get and become very familiar with performance tools like Vtune Amplifier and Intel GPA. They're worth it.

There are plenty of much more thorough guides out there, but often times, performance loss happens because of a handful of dumb/inexperienced design decisions made early on. 

Dealing with publishers is a lot like being in a prison shower

Published on Tuesday, January 22, 2013 By Brad Wardell In PC Gaming

If you haven’t read Chris Taylor’s interview with EuroGamer.net you absolutely should.

"There's multiple games that we got almost to the finish line on," Taylor revealed, reluctant to say more because of NDAs, which suggests this happened recently.

"We got a phone call from the publisher and they said, 'We're terminating.' And we're like, 'Yeah but we're only a month away from beta!' And they're like, 'Yeah we're still terminating.' And we're like, 'OK.' "

"One of these days - and it won't be from me - you guys will get leaked through some anonymous source..." he teased (I'm not entirely sure if he was joking). "And you can read a game development contract, and you will - it'll be like the Nazis when they opened up The Ark: all the flesh will melt all down your face."

There are publishers and there are studios.  A game publisher is essentially like a specialized loan shark. That is, they give you an “advance” on royalties that’s enough (but barely) to cover the cost of making the game in exchange for a 20% royalty. Before the studio sees a cent,  that advance has to be paid off.  Oh, and by the way, the publisher may cancel the project at any time leaving the studio holding the bag on unpaid development costs.  It’s a terrible business model for studios.

I went through a version of this myself.

Back in 1993, I signed a contract with Advanced Idea Machines. I wrote a game, from my dorm room, called Galactic Civilizations for OS/2.  They took my game, put it in a box, shipped it to stores and made millions. Me? I didn’t get a cent. They gamed the bankruptcy system (it was a 1 game publisher, I was naïve back then) and I got nothing.

So then, in 1995, we wrote (we as in me and an artist) wrote Galactic Civilizations 2 for OS/2. This time, we published it ourselves and sent it over to Micro Central who in turn distributed it to stores.  It made millions again. But us? Nope. Micro Central didn’t pay us. They filed bankruptcy as well (see a pattern)?

Ok, so we move to Windows and in 2003 we write Galactic Civilizations for Windows and we sign on with Strategy First to publish it. Again, it makes millions. And us? Wait for it…..wait…for it…That’s right….bankrupcty again.  And thus, Impulse was born. Digital distribution would save us.  Because Galactic Civilizations II (and the e-sales of galciv 1) belonged to us and we could make a living on it finally.  It was a tiny loophole in our agreement – Stardock could digitally distribute Galactic Civilizations for Windows. Imagine if GPG had had those rights on Supreme Commander.

Historically, getting paid for your work has been a real challenge. The more leverage your partner has over you, the less willing they are.  Our European publisher of Demigod, at once point, claimed to have not sold a single copy of the game and hence, owed no royalties.  The statistical odds of getting paid for something is relative to the amount of leverage they have on you.

When we worked on Demigod with GPG, I remember visiting them and thinking they had a pretty good gig going. It was like “Man, this shower room is huge! The water is so hot.” and Chris say “Oh, just you wait.” and I turn around and a bunch of guys enter the room. “Who are those guys? I wonder if we’ll be friends..”

This is why Stardock self-publishes. I already know I have a pretty mouth. I don’t need a publisher to whisper it to me. Winking smile

Elemental:Fallen Enchantress v1.2 released!

Published on Tuesday, January 22, 2013 By Brad Wardell In Press Releases (FE)

FEiconStardock has released version 1.2 of its popular fantasy strategy game, Fallen Enchantress. 

Version 1.2 boasts dozens of updates, enhancements and fixes including:

  • Significant AI strategy updates based on strategies employed by players
  • Spawned resources (like iron, gold, wheat) are more common but seeded further away from starting locations
  • Powerful monsters have been adjusted to be less common in habitable areas but more common in the barren lands between factions
  • Default number of players increased based on map size
  • Lots of UI and gameplay fixes based on player reports and feedback

The full change log can be found here.

Fallen Enchantress is a strategy game set in the world of Elemental. In it, the player takes on the role of a powerful sorcerer who must build a kingdom (or empire) from the ground up. The world itself, however, is already inhabited by creatures of all levels of power who will not willingly give up their domain. Up against the player are other kingdoms and empires who have their own dreams of power. 

Fallen Enchantress has received nearly universally favorable reviews from the major gaming publications such as Game Informer, The Escapist, Gaming Nexus, IGN, PC PowerPlay, Gamespot and elsewhere.

It can be purchased directly at www.fallenenchantress.com or at third party digital retailers including Steam, Impulse, and Gamers Gate.

Screenshots:

image

Build cities, expand your kingdom across the world.

 

image

Train armies and take battle to your enemies

 

image

Design your own units based on what resources and wealth you have available to you

Some thoughts on Gas Powered Games

Published on Saturday, January 19, 2013 By Brad Wardell In PC Gaming

imageI recently wrote this as a response but I thought it deserved its own post.

If you haven’t heard, Gas Powered Games led by its CEO Chris Taylor, have a Kickstarter project up for a new game called Wildlman.  He recently updated it to make it clear that the Kickstarter project is do or die for his studio and in preparation to see which way things go, he has laid off most of the staff (most of whom can be recalled if the Kickstarter project is successful).

Let me tell you a little bit about Gas Powered Games and Chris Taylor.

Chris Taylor is one of the best people I've ever met. Let me tell you about the man I know and why he deserves everyone's support.

Chris Taylor has run Gas Powered Games in a way that most people claim they wish companies were run.  He has always run GPG as a compassionate person who cares deeply about each person he works with.  

It’s not just a studio. It’s a company that was founded by people who have seen the cut-throat ways of the game industry and decided to do things differently. They’ve made some great games over the years – Dungeon Siege. Supreme Commander and yes, Demigod to name 3.

One of the things most people don't know about GPG is that one of the biggest challenges they've had is that for every game project you hear about there's often a project that got canceled that you didn't hear about.  That is, big publisher X contracts studio Y to make a game and half way through there's some re-org at the publisher and they kill the game.  So what does the studio do with all those extra people?  MOST studios would just lay those people off.  Not Chris Taylor. He would go to heroic lengths to try to keep everyone he could. He'd find some other project for them to work on even if it meant he would personally suffer financially to do it.  He really cares about providing a stable environment for his people. He puts them first over his own interests.

I've seen people online (wrongly) claim that GPG has struggled because of game X or game Y. That's that even remotely the truth.  The truth is that their struggles have come from the games you've never heard of that got canceled by a major publisher leaving GPG holding the bag.  It's the plight of many studios and it's why there are so few of them left.  The fact that GPG has been so successful for the past decade is a testament to Chris Taylor and his management team's skill.  

Chris Taylor is universally admired and respected in our industry because he's an avatar of what our industry *could* be if we treated our employees, our partners and our customers better.  It's easy to stand on the outside and come up with "Well, they did A, B and C!" without realizing that behind the scenes, he was having to choose between terrible terrible options.

I hope GPG is able to keep going. It's non-trivial to put together the kind of talent that Chris has put together over the years. It would be a huge loss to our industry as a whole. 

If you want to learn more about their Kickstarter project, go here.

So anyway, we were talking and…

Published on Wednesday, January 16, 2013 By Brad Wardell In Elemental Dev Journals

Here’s a weird thing.  Stardock turns 20 this year.  That’s 20 years since I incorporated it back when I was in college.  My mom was the one pushing me. She was afraid I’d get sued by someone. I told her that was crazy. No one would ever sue us.  Cough.

I was playing FTL and if you don’t already have this game, you really should get it.  It’s a reminder that a great game can be made by just a handful of people.  It serves as a great exhibit for our internal game projects to exclaim “It’s about the game mechanics!”

We’re going to be announcing a lot of new game projects this year.  The first one will undoubtedly be the upcoming expansion pack / DLC (what do you call these things nowadays anyway) for Elemental: Fallen Enchantress.  The theme of it is to evolve the overall game design of Fallen Enchantress to help bring the role playing elements closer to the civilization building elements.  Sometimes, FE feels like it’s trying to be multiple games at the same time and as such, never fully develops a single overarching theme.  That’s what the expansion is being designed to address. 

Speaking of Fallen Enchantress, we’re hoping v1.2 comes out next week.  There’s a lot of AI updates in it and a lot of usability fixes (path finding got a lot of love).  That should (no promises) get out there next week.

Pick 5 THINGS for FE 1.3

Published on Saturday, January 12, 2013 By Brad Wardell In Fallen Enchantress

With v1.2 just about ready to go out, it's time to think about v1.3.

Before people start making feature requests, I would like to emphasize what I'd like v1.3 to be about: Playability glitches.

A playability glitch is hard to really classify. It's not a crash. It's some feature that doesn't work as you'd expect or as you would assume was intended. And if you play a game for hundreds of hours, they become maddening.

So what I would like to use this post for is to ask the regulars here to post five (and only five so that people have to put some thought into what really bugs them) things you'd like to see us "fix" about Fallen Enchantress.

I'll post my 5 later in the thread but I don't want to bias things with my own pet peeves.

!!! Update !!!

We read through this thread carefully and tried to implement as many of these things as possible.  Here are a few of the things that got special attention for 1.3 which should be going into internal beta soon:

  • Pathfinding.  You should notice that when you have a unit in a city and tell him to go somewhere else that it'll get there.  Same for a lot of other pathfinding that seems wonky. I don't know if it's perfect but it should be better.
  • AI winning. This may turn out to be more controversial (or more to the point, we may have to nerf this as it may be a case of "be careful for what you wish for).  The AI is a lot better now at pursuing *victory* conditions.  The AI, overall, is substantially better and more interesting.
  • Pacing. This is a general issue that I saw people bring up in various forms. 
  • Greater city differentiation. Conclaves vs. Towns vs. Fortresses have had their benefits / penalties magnified.
  • More interesting map generation in terms of resources.
  • Tile selection. This is one that we'll have to see how well the fix works. It's a hit or miss thing (seems to be camera related). Some users have reported that selecting a tile doesn't always select the tile they think they're clicking on.
  • Diplomacy. A lot of people talked about this.  Now, there's only so much we can do in an update but basically the AI's behavior should be a lot less schizophrenic. 

That's not the only change in 1.3. There's the usual assortment of bug fixes and balance changes. But those the above are the things that got the most engineering hours.

So now what?

Published on Friday, January 11, 2013 By Brad Wardell In Business

I am having a bit of a conundrum. On the one hand, I’ve been promising my family to work fewer hours and managed to do that to a large extent over the last couple.  On the other hand, last year was such a good year and this year looks even better that it presents so many exciting and varied opportunities….if only there were more hours.

The accountants haven’t turned over the final numbers but broadly speaking, it appears our sales overall increased by about 3X over 2011, which, in itself, was a pretty good year.  This means lots of capital to invest in new ventures.

The temptation is to go back to the old habit of just working crazy hours.  But that’s not what we’re going to do. Instead, we’ve recruited some new people and promoted some internal people to take charge of some of these new opportunities.

Bailey falls through the ice

Published on Thursday, January 10, 2013 By Brad Wardell In Pets & Nature

image

This morning I brought my dog Bailey to work.  As I was talking on the phone while she scampered around, she went out on the “frozen” pond. Moments later, I heard a crash and looked up and saw that she had fallen in.  For a moment, she struggled to get out of the water back onto the ice but then slipped and fell further and got stuck under the ice.

Without thinking (and now I understand better how people end up getting themselves killed when this happens on lakes), I jumped into the pond, dragged her out and carried her out out. 

You can see in the photo above where I took a few steps onto the pond (left side), made the jump to break through and where Bailey had initially fallen (bottom most part of the broken ice). You can then see where she had gotten trapped under the ice (middle) and the pathway we cut through getting out (to the top).

Definitely the coldest I’ve ever been. Thankfully my coworkers drove back to my house and got me a new set of clothes since I was drenched up to my neck in smelly, frozen pond clothes.

IMG_2225

Bailey was none the worst for wear and was (seriously) ready to go back out on the ice. Crazy puppy.

FE AI test updates

Published on Monday, December 31, 2012 By Brad Wardell In Fallen Enchantress

For those of you interested in seeing in progress AI updates I've been working on over the holiday you can try the latest build here:

 

https://dl.dropbox.com/u/8051911/FE-119frog.zip

Just unzip the EXE into your FE directory.

The biggest changes should be on larger maps. However, be on the look out for longer turn times since I've had the AI do more analysis to try to make it smarter.