Game Design, Programming and running a one-man games business…

Gratuitous Space Battles 2 is in beta at last… RIGHT NOW

Oh god the fear…game launches are terrifying. And this isn’t release day it’s beta day but still…let this trailer do some of the talking…

So yup, GSB2 is now taking pre-orders direct from my site, and this gives you access to the beta. You can grab it right now from here:

http://www.gratuitousspacebattles2.com/

Note that this is a proper beta, not some super-early-access proof of concept thing where most of it doesn’t work. In other words, most stuff works! it’s playable. Hopefully its fun! It’s PC-only and English only for now, but that will change come-release. There will of course be bugs, and myriad balance issues. And I will be adding some extra voiceover and a few other bits and pieces. But hopefully this is something you can play and enjoy right now. You get a download link, an online serial (for challenges, if you want to use them), and a steam code for its eventual steam release (the code obviously isn’t working yet).

PLEASE tell people you know about it, this is really appreciated. If you are a member of the press, please check your inbox, and if you don’t hear from us today please email me at cliff At positech etc… and I will put you in touch with *my people*. Yeah that’s right, cliffski got people now :D.

And of course, we have forums that you can go chat on and offer feedback and suggestions, criticism, maybe even some praise for things you like? and ask questions about stuff. You can log in to my forums with google or twitter or facebook, or manually sign up for an account. We also have a facebook page.

Holy cow I’m nervous. I actually feel sick.

Gratuitous Space Battles 2, the brand new ship classes…

So if you have played the original Gratuitous Space Battles game, you will remember that there were three classes (or crudely put: ‘sizes’) of ship in the game. They were cruisers, frigates and fighters. In simple terms, cruisers were the big damage-dealing and damage-soaking tanks, frigates were the smaller, faster raiders, and fighters were tiny things that zipped about and sneakily shot through enemy shields at very close range, plus enjoyed some aesthetically pleasing dog-fighting with enemy fighters. This was pretty simple and obvious, but it didn’t lead to enough variety, and thus we have doubled the number of ship sizes/classes this time round. So here they are, and here is what they do…

Fighters

Same as before, the small fast little one-lifeform dogfight ships, that can also carry some small missiles and do damage to enemy frigates & destroyers, but not much else. The big changes in GSB2 are that these ships (and this also applies to gunships) need to be brought to the battle aboard a carrier, and need to refuel now and then. (depending on how big the fuel tanks are you fit to them of course :D)

Gunships.

blog_gunships

These are new. basically big fighters, more power, more hull slots, able to mount two weapons at a pinch rather than one, so consequently they can also pack enough armor to survive one or two shots and still make it back for repairs, unlike many of the smaller, cheaper fighters.

Frigates

These are quite deliberately targeted to be raiders this time round. They are faster, and more geared towards attack. They are vulnerable to fighters. Ideally deployed in a nice big formation and told to keep moving to leverage their speed and avoid getting hammered by the slow-tracking cruiser & dreadnought guns.

Destroyers

blog_destroyerss

These are support-ships, that you will generally find escorting or in formation with a cruiser or dreadnought. They are roughly the same size as frigates, and share some of the same module choices. They have special ability modules such as shield support beams, propulsion support, and defensive systems such as point defense and guidance scramblers. These don’t generally attack they enemy, they defend your bigger ships against attack.

Cruisers

The main line-of-battle ships. these do the majority of the damage, blasting enemy cruisers and frigates to bits with serious weaponry and decent defenses, meaning they will last a good time into the battle, even in the middle of things. They have the capability to act as carriers, and have some of the big, scary weapons. Cruisers can also take on enemy dreadnoughts, and actually share quite a few module choices with them.

Dreadnoughts

blog_dns

The ultimate ship. This is the ship that a fleet is built around, and you are unlikely to have many of them deployed at once. Expensive, big, very slow, and capable of carrying the biggest weapons available. Like cruisers, they are vulnerable to missiles and fighters, and rely on an escorting group of destroyers to defend them from enemies while they deliver the killer blow. Ideally suited as carriers, that stay at the rear of the battle, refueling and repairing endless squads of fighters. Losing a dreadnought in battle can be a disaster.

I think this variety is going to add a lot to the game. Right now it’s not, I have to admit, as balanced as it could be, but that will be something endlessly debated and tweaked during beta. I’d like there to be really distinctive roles for each class and that is going to mean a lot of restricting modules to one type or another, and maybe adding a bunch of new ones. If you don’t want to wait until all thats sorted out, and want to get your tentacles dirty with the beta, we are taking pre-orders and giving out beta copies to people who pre-order starting this friday… So keep an eye on this blog, or our facebook page.

A preview of space ship design in Gratuitous Space Battles 2

So we are only a few days away from the GSB2 beta (oh yes), and I thought I’d write up a little preview about the basics of spaceship design in the game…

As you probably know Gratuitous Space Battles 2 is a game about ship design and fleet design, not really a typical real-time strategy game where you give individual instructions during a battle. As a result, what really matters is your ability to perfect a decent spaceship design, one which is efficient and effective in battle. This is harder than it sounds. In GSB2, like the original game, you select a ship ‘hull’ from a list of presets, and then equip it with modules that contains engines, weapons, defenses and other abilities…

design1

The trick is balancing all the different attributes of a ship to get the right mix. Basically everything you select has a cost, a weight, and probably both a crew and power requirement (plus many more attributes specific to that type of module). Cost means you will be able to afford more or less of these ships in any given fleet. Heavier modules make a heavier ship, which makes them slower (which is countered by more engines…). The last two requirements (crew & power) are often the two you spend time fussing over.

crew

Each hull in GSB2 (unlike the original game) comes with some power generation and crew supplied, but you are likely to need to add to that with extra modules. There are power and crew modules in various sizes, but getting the exact balance right, where you have enough of both, but are not wasting capacity on surplus power (wasted) or surplus crew capacity (again…wasted) can be tricky. This also leads to a lot of head scratching and chin-rubbing. You *could* add another engine, but if the engine needs more power and that demands another powerplant, then actually will the heavier weight reduce the ships speed enough to mean that the extra ‘marginal’ engine wasn’t worth it? There are a LOT of trade offs, and ship design is an art.

icon_strip

As well as those variables, there are also lots more, such as range, damage and tracking speed for weapons, fire interval, salvo size, fighter capacity for carrier bays and many many more. Thankfully, the game does try to make comparing it all a bit easier than it sounds, as you can click on any variable associated with a ship module and it launches a handy list to show you how it compares against other modules for that particular attribute:

compare

This is just scratching the surface, because the choice of ship hull also affects how things turn out. Some are relatively cheap, some expensive, and many of them have bonuses (or penalties) to cost, power requirements, armor, and so on. There is no ‘best’ hull for each class, it really depends what you will be using it for? A tank, a sniper, a support ship, an anti-fighter platform? a raider?

This is a BIG part of the game. Part of the fun is fighting and winning a battle, and then working out how to do it with a cheaper ship. Every point you don’t spend on fleet cost gets transformed into ‘honor’ if you win the battle. If you beat your honor record for a mission, you earn the difference, so you can keep re-fighting a single scenario with a more and more cleverly balanced fleet to score as many points as possible.

…and of course, once you earn that honor there is the decision to make as where to spend it on the research screen. On a new hull? new weapons? new shields or engines? Or shall we be gratuitous and just spend it on a nice new decorative fin for one of our ships? :D

research

If you like watching huge at space battles AND the idea of studying starship blueprints to work out whether you can make your space cruiser more deadly for less cost you will be in heaven :D.

Gratuitous Space Battles 2 is still in development, although pre-orders & beta are coming at the end of this week… Tell your friends! (and warn your enemies…)

Preparing for Gratuitous Space Battles 2 beta (and pre-orders…)

logo

Gratuitous Space Battles 2 is approaching pre-orders + beta. You know the sort of thing by now. The game isn’t finished but you can pre-order now and get immediate access to the beta. Steam early access made it popular. So why not put the game into Early Access? basically this isn’t an early-access kind of beta. It’s a proper ‘we think it’s more or less done’ beta, like betas used to be back in the old days. It’s pretty much content complete (a few more extra graphics & voiceover await). It’s definitely feature complete. It’s definitely playable. it has been optimized a lot, and bug tested a lot. It’s essentially what my idea of a beta is, which is a finished game, with some rough edges, and maybe some compatibility issues. There are a few big things not done, namely translations and ports. The beta will be PC only, and English only. I plan on a Windows/Mac/Linux  and English/French/German/Spanish (maybe more) release when the game actually gets released on steam, Humble Store, GoG.

screnn1

So the beta will be direct-sales only, and will get you a download link & online challenge game serial (no DRM, don’t worry), and a steam key that will be useless until release.

So thats all the warnings and caveats. What will you get? You will get a VERY explodey, lasery, space-battley smorgasbord of laser-death and gratuitous zappyness that makes the battle at the start of the last star wars film look like an episode of Blakes Seven. I’ve kind of gone a bit overboard of the graphical shininess this time. I might have overdone the lens flares a bit, and the particles, and the everything else. And yup, the multi monitor stuff works fine in the beta.

wide

Gameplay wise, it’s Gratuitous Space Battles, but with more ship classes (hello dreadnoughts, destroyers and gunships) and better formation orders, better targeting AI, and *drumroll*… You get to design the ships yourself from components, so they look exactly how you want them. This is I suspect…a bit of a killer feature. It is VERY cool, to design a whole fleet of spaceships then watch them blow up your friends fleet.

So yup, it should be a lot of fun. It’s tons better than GSB1. I can’t believe how GSB1 looks and feels and plays now, this new version is basically laughing at it, like kirk laughed at khans superior intelligence.

Anyway…stay tuned. beta SOON.

Draw list sorting and concurrency issues

Background: I use directx9 to develop Gratuitous Space Battles 2 using my own engine.

I’ve been doing my best to reduce the number of draw calls per frame for complex scenes in GSB2. Basically I have a lot of stuff with different textures and render states, and they are being drawn from front to back rather than z-buffer sorted (for reasons concerning sprites & high quality alpha blended edges).  What this means is, when you have 16 identical laser beam turrets, you may not be able to draw them as a single batch, because in-between them you might be drawing other stuff. As a result you get 16 draws instead of one. Ouch. That causes driver slowdown, directx slowdown, and inefficiency on the GPU, which prefers big batches.

Of course you can immediately see that it would be fine to go through the draw list (one of several actually, for composition reasons), and spot all those cases where you have 2 or more turrets (or any sprite) that use the same texture and which do NOT have anything in between them that overlaps the first one, and grab that second turret and draw it ‘early’ with the other one. And in fact, that works just fine. suddenly lots of draw calls get optimized away! (the green ones) In this case out  1,159 draw calls 713 get optimized away into batches.

megabatchedThere is an immediate problem though. This is extremely slow, even with every optimization trick in the book. Assume you have a list of 1,000 objects to draw (not inconceivable for big battles). In the worst case situation, that means comparing object 1 to 999 different others and doing a bounds check. Then object 2 gets compared to 998, then 3 to 997, and so on. That is a LOT of function calls (inlineable I know…), and a lot of bounding box comparisons, and a lot of texture comparisons (only a pointer compare, but I need to extract that texture pointer from each renderable object, and at 500,000 de-references per frame even that adds up.

Now granted this is all total worst case. Some of those 1,000 objects aren’t batchable, some of them *will* quit early as something overlaps, and when I do batch future ones with early ones, those future ones themselves don’t need to be checked as they have been optimized away.

The trouble is, after profiling, it is still about 70% slower for the CPU to do this, than not do it. The big problem here is that I’m making stuff light for the GPU, heavy on the CPU. Is that a good idea? maybe… But as it happens, if I assumed a dual core (or better) PC, it doesn’t matter because it is FREE. I have other threads just sat there. If I find a slot in my main loop between building the draw list and having to actually render from it, I can multi-thread that new slower batching code and actually have the whole app run faster, thanks to less draw calls later on. The Visual C++ concurrency profiler shows it works: (Click to enlarge)

visual_c++_concurrency_game

Previously I’d have gone through and built up the draw list (thats the blue), then done some particle drawing preparation(green), then batched my draw calls (purple) and then drawn everything (yellow). Because the particle stuff actually gets put into a different list, I can mess around with my slow batching in a new thread while the main thread prepares particle stuff. Hence the purple bar is now on a new thread and works alongside the main one. As it happens I also have 2 more threads doing some particle emitter stuff at the same time as well, so briefly I’m at 100% utilization on 4 threads, possibly 4 cores (other processes such as the music streaming/driver might be on one of them).

So in a sense, yay! faster code, but what a nightmare to measure. It depends on scene complexity, relative CPU/GPU speed, number of cores and god knows what else. However it is worth remembering that sometimes slower code will make your game run faster, it just depends where that slow code runs.