Fill out your e-mail address and click submit to join the positech games newsletter!

Deferred Rendering / lighting. Balls, maybe not

Filed under: programming cliffski 6:42 pm June 28, 2011

For a while I’ve been thinking about putting deferred lighting with normal maps into GTB. This was something I talked about briefly during the development of GSB but it never happened. it basically a way to ‘fake’ the 3D lighting effect with a 2D image, *if* you have the original 3D model the  2D image came from, and thus can make a ‘normal map’.

Here is what I mean:

http://experimentalized.blogspot.com/2010/07/2d-deferred-normal-lighting.html

This stuff is definitely not my area of expertise, and to confound the problem, all of the tutorials and explanations of the effect seems to concentrate on XNA or doing it with actual 3D scenes, whereas mine is a 2D engine.

Plus, it seems that it doesn’t do what i wanted it to, which is to take a lightmap full of various light sources (image the whole scene, with just the ‘light’ rendered onto it), and convert that into realistic looking shadows on 2D sprites. it appears to be a single-light source only solution, involving pixel shaders. Bah.

As I type this, I wonder out loud if bump maps are the answer to my problem? It’s not a disaster if there isn’t a solution, as GSB looked fairly pretty, but I’d like to take things up a level with GTB. There is only so far you can go with 2D top-down view rendered stuff, but I’d like to be the prettiest, shiniest 2D game of it’s type, if at all possible. The other effect I tried once but wimped out of was those distortion-map effects where you get a sphere that distorts the pixels accross it, and thus get a ‘shockwave-air-blast’ style effect. I think Call of Duty 4 used it a lot. I ran into ‘tearing’ and other bugs and eventually abandoned it in a strop :D

Anyone got any tips for fairly awesome 2D top-down effects in games?

(The minute I have my logo finished I’ll talk about GTB)

 

Opened the fridge: Achievement unlocked!

Filed under: Uncategorized cliffski 10:09 pm June 26, 2011

I quite like achievements in games, but have you noticed how they, and general ‘gamification’ is now showing up everywhere, including really silly places?
I posted a question for the first time recently on stackoverflow, a site where coders ask and answer questions. I asked ONE question, and got 6 replies. For this, my account unlocked what seemed like a dozen ‘badges’ and ‘achievements’ I think I got some ‘reputation’ and probably other crap too. Meh…

I notice project wonderful is doing the same thing. As an advertiser, I can unlock ‘achievements’ there too.

Sorry but this is bullshit. I like earning super-duper-medals when I’m pretending to be space captain cliffski or slaying dragons, but when I pick advertising or debug my code I don’t need to be treated like I’m playing pokemon. It’s just silly. I’m sure it *works*, and makes busienss sense, but I still find it a bit weird.

What’s the strangest place you’ve encountered points, achievements and gamification lately? Does it bug you?

Tankfest 2011 Pictures

Filed under: Uncategorized cliffski 8:53 pm June 25, 2011

So today I spent half the day at TANKFEST, at the tank museum at Bovington, England. It was very TANKy, to put it mildly. I was amused to notice signs pointing to ‘tank museum and monkeyland’. lets just hope there is never a security breach at monkeyland, because they will be heavily armoured primates, that’s for sure.

TankFest is where you get to see old tanks (like the churchill) and new ones (challenger) charging about on a tank-race-track, as well as go fondle them up close. The best bit for me was probably the WW2 re-enactment guys who were there in force, very WW2-geeky of me, I know. Let the tank-porn commence:

This is the As90 artillery system(above). I climbed inside it and had a chat to the dude manning it. I was curious because it’s the thing that makes my windows rattle when they test it on salisbury plain. Grrrr. It can fire 3 rounds before the first hits the ground, and then scarper quickly before the enemy fires back.

This sums up the day really. people dressed as German soldiers, and kids climbing on a WW2 tank. Kids these days have no respect for history. Bah grumble, ‘get off my tank’ etc…

 

I don’t remember the exact number, but this is one of those US half tracks with the rear-mounted anti-aircraft guns that can massacre ground troops. Quite speedy too.

For reasons that escape me, I was drawn to the area with German soldiers in trenches. They had a little mock-trench standoff re-enactment between the Germans and the Russians.

Some of our plucky desert rats showing the lesser nations just how many guns we can stack in neat little formations. OH YES.

For undisclosed reasons I was drawn to trying to get some ‘top view’ photos of the tanks. Here are some of the ones parked outside. Inside, there are about a hundred trillion tanks. It’s a HUGE museum.

Is that a T-34? I think so. Anyway, it was the only Russian WW2 tank in the outside display. They had some other, MUCH BIGGER ones inside. I still vote for the Jagdpanther and the Tiger as my favorite tanks. I think I’ve convinced my better-half that having a ‘favorite tank’ is normal for a man of my age.

The unthinkable? GSB micro-transactions? or…?

Filed under: business,gratuitous space battles cliffski 4:00 pm June 24, 2011

I had plans to do another GSB expansion pack, with a new race, much like the Nomads.

And then….

GTB has basically taken over. Combine it with ShowMeTheGames (which isn’t getting enough attention as it is) plus lots of home-life related building-stuff, and I just am not getting enough sleep. But I do have

  • Lots of GSB players
  • An artist willing to make new GSB ships.

I like to maintain control of stuff, so farming out DLC production to someone else is probably a ‘no’ right now. The thing is, the time taken to make new damage textures, new weapons, balance them, and do the whole package would be a bit of a nightmare.

So I was thinking, especially on this day that Team Fortress 2 goes ‘Free To Play’, that maybe micro-transactions are the future, and I should just leap into the market for them with GSB. I could get new ship hulls made, and designed, and have them sold as mini-DLC. Of course, the problem there is that there are minimum credit-card fees that I get charged, so anything below $4 is basically a disaster in terms of profit, making the whole thing unviable.

So I am scratching my chin thinking how viable it is to just do a bunch of extra base-race ships for GSB and sell them as a $4 mini-DLC booster pack. New federation, alliance, rebel and empire ships, by the original artist. That would take fairly minimal work, compared to the design of a whole new race. But would it make any sense? would there be a market for it?

Would you pay $4 for a bunch of new ships? I know a lot of people would not be interested, but there don’t have to be thousands of people for it to break even.

Amazon, Google checkout, and the letter T.

Filed under: business,GAME FOUR cliffski 10:17 am June 23, 2011

Something great has happened in the world of online payment providers. OK, it’s not up there with the discovery of fire, but BMTMicro, who handle the majority of my direct sales, have added amazon payments and google checkout to the payment options at last. I’m not too excited by google checkout (who here actually has an account?) but amazon is a different story.

Here in the UK, at least, amazon is VERY popular (although their tax-dodging behavior irritates me no-end) so a LOT of people already have an amazon account. What this means is that:

a) People who are lazy, and can’t be bothered to find their credit/debit card can buy my games just by remembering their amazon password. yay for frictionless selling!

b) People who are terrified of buying online can buy my games without ever trusting any payment data at all to a third party (even an established, safe one like BMTMicro).

I see both of these developments as steps along the road to easier sales, and encouraging people to buy direct now and then. Hurrah. AFAIK only BMT Micro support this option right now.

In other news…. I am having name-change thoughts AGAIN. Originally game 4 was called LB, then I changed it to OTT, then GTB. Now I might change it from GTB to GTB, where the letter T means something else. It means registering yet another domain, and getting a logo re-done, but I suspect it might be worth it. Oh the nail-biting angst….

Not long until I actually show some footage / screens/ etc

Potential game buyers and their attention spans

Filed under: game design cliffski 9:52 pm June 18, 2011

There is something very tricky about selling games through demos. The problem is, the complexity of interaction required for the full experience.

Take a fairly complex strategy game, like Gratuitous Space Battles. To really appreciate what the game offers, you need to experience the visual excitement of a big battle, preferably two different ones to show the variety of ships, fleets, backdrops and visual effects. You need to experience the way the honor system works, and the shop section where you unlock new modules. You need to see the design screen, and put ships together, try out the deployment screen with the different ships orders, and you need to see the variety of missions to choose from. Plus you need a brief bit of challenge play to see the online integration, and if we are talking all the DLC, you need a run through of campaign maps, campaign repairs etc…
To explain how to do all of this in the game takes AGES, and you only really learn it by doing it. Lets call the time taken to experience brief elements of all of this time ‘T’.

Now lets take a movie, such as…oh I dunno… Enemy At The Gates. This film has a bit of character background (Vassili as a child), it has high drama (the crossing of the river) it has the characters of Khrushchev, Tania, the rivalry with Danilov over Tania, the death of Koulikov, the betrayal of Sacha…etc blah blah.

The difference is, that we don’t need to ‘learn’ how to experience any of that. A 3 second clip of stuka divebombers… CHECK, a 3 second love scene clip CHECK… and we can jump from one to the other no problem. This means that the time taken to experience brief elements of all this is T2. I think T2 is maybe T/10
Where it all gores wrong, is generally peoples attention span is A, and T > A > T2.

What a geeky way of saying it’s easier to sell a movie than a game :D But what I’m getting at is that the very NATURE of games (interaction) means that it’s much harder to provide an effective demo. (although to be fair, books have the same problem)

And this is what I’m worried about with my next game (GTB). It’s actually got a ‘sort-of-backstory’, and to explain the mood and the style of the game will take more than 30 seconds. Gratuitous Space Battles was pretty much summed up in it’s title, and this one won’t be. So I muse nervously on how to hold peoples attention while I explain the background to the game.
The mechanics of the game are pretty simple by comparison. I’m just taking an existing genre, flipping it, scaling it up, and setting it against an original backstory.

Plus lots of stuff blows up and it should look nice, in a GSB kinda way :D

Awesome Gratuitous space battles mod

Filed under: gratuitous space battles cliffski 8:05 pm June 15, 2011

Check this out, it’s just great :D It’s a big, heavy duty mod for GSB:

The full forum thread for the mod is here:

http://positech.co.uk/forums/phpBB3/viewtopic.php?f=23&p=48689#p48671

basically it adds BIGGER ships (dreadnoughts) to the game, which is awesome, and something that any hardcore GSB player should probably take the time to check out. I love this sort of stuff happening to the game, especially now that I’m 100% in next game mode, and don’t have time to tweak GSB or add anything new right now. It is effectively new, fresh and free content for newcomers to the game, and all done by GSB players without any input from me.

It does seem that modding is less widespread than it used to be. Maybe big budget PC games are too hard to mod now, or maybe the developers and less supportive? who knows. It certainly reminds me that I need to ensure I make time to make my next game just as moddable as GSB is.

Possibly no work can get done this thursday / friday. My home office is getting a much-needed new roof, and I will be laptop bound for that time. I hope it doesn’t rain when the roof is half-off :(

 

Optimising my ‘dumb’ textures

Filed under: GAME FOUR,programming cliffski 5:34 pm June 13, 2011

I have this class in my code called ‘smart texture’. I’ve had it for several games now. It basically lets me tell a sprite to use “gun.dds”, and it transparently converts that to the LPDIRECT3DTEXTURE9  and doesn’t mention it. It keeps ‘gun.dds’ in memory, and if I ever lose the screen (alt+tab), and need to rebuild stuff, it will replace the invalid surface pointer the next time it gets drawn with a fresh copy.

MAGIC.

Trouble is, that means keeping a list of every smart texture, so that I don’t miss any when recovering from alt+tab. That’s easy, but I ended up using texturedsprites (with a built-in smart texture) everywhere, and thus the list, for a full battle could be 20,000 textures long.

F**k.

So here I am, effectively keeping a record of me trying to fix this…

It’s 5.35PM Sunday. The wonders of aqtime show me that when I ditch the current level and load in a new one, I am killing off about 8,000 smart textures. Every one is going through it’s destructor and removing itself from the smart textured list. This sucks. I need this to be faster. First instinct is to speed up the destructor, but obviously that’s treating the symptom, not the cause. The real problem is 8,000 smart textures. That isn’t so smart, when 2,000 of them are probably pointing to the exact SAME surface in directx… I need to rethink this system, and NOT break any other code…

I *do* have a system called GUI_TextureCache which does some ‘fixed’ storing of textures I use all the time, like UI stuff, buttons etc. This is obviously a similar task to what I want to do here, in that I need a dynamic dumping ground for commonly used textures pointers. I’m concluding that the cleanest way to handle a fix would be within my SmartTexture itself. it can do some clever caching, and then nobody will ever know any code changed!

Realisation that this means I still keep all these smart textures knocking about, with their ‘gun.dds’ strings. That offends me, as a programmer, but tbh, even ‘longcomplextexturefilename.dds’ is only 30 characters, so with 2,000 units I’m wasting 60k here. Big deal.

Right, so the plan is when I call SmartTexture::SetTexture(“gun.dds”) it may, or may not add itself to a list of textures that would need rebuilding, based on if its already in the list.

Problem: I can’t do that, because it means checking the whole list every time I call SetTexture(). That might even be *slower*. However, my current ‘SetTexture’ goes through a list to grab the pointer, how slow is that? It looks like currently its about half as much time as all those smarttexture destructors, so it might be a win. Plus my SetTexture() stuff uses a MRU caching system which could make ti super fast when loading in 100 identical units…

5.50PM Actually realising I’ll need a totally new class to handle this. it needs to be done a different way, not with existing smart textures. Balls. Surely it can be done? Hold on.. Surely its just a matter of indirection. The purpose of a smart texture is to hold a surface pointer it can rebuild if needed, but it doesn’t have to hold a direct link. It could actually hold an indirect link.  One more piece of pointer indirection is trivial. I just add a new CLoadedTexture class that handles rebuilds, and the smarttextures can point at those, meaning no need to keep a list of them at all, as their pointers never go invalid or need rebuilding.

6.25PM everything coded except the actual rebuild() calls for alt+tab. I’ll comment the errors out for a quick test… GAH, it crashes immediately. fixed easily enoguh, and the code RUNS! hurrah, but it doesn’t seem AMAZINGLY faster,. Quick! to aqtime! what the hell… it’s slower?…

6.35OM. Hah! looking at it backwards, it’s about 75% faster. how much time does that knock off loading in a new level now? 5.28 seconds down to 2.1 seconds. That’s pretty good. I’ll code in the rebuilding stuff and give it a quick test…

6.50PM Alt+tab doesnt work, I get just a black window, but that may be something else. I’ve checked in my current code, and am investigating alt+tab issues now. It looks like the restore code hasn’t worked on this new game at all yet. I consider my (dumb) smart texture code fixed :D

 

Show Me The Games bundle last day etc…

Filed under: showmethegames cliffski 10:00 am June 12, 2011

The SMTG bundle runs out tonight at midnight. If you missed the earlier blog post, then I suggest just going here:

http://www.showmethegames.com/bundle1.php

And checking it out. It’s five hgh quality indie games, on a sort-of-strategy theme, than are bundled together for $28.50.

On the topic of SMTG, that brings me to the question of the sites future. I’m really please that SMTG is up and running, that it gets some traffic, that it looks nice, and that it has the support of so many developers.

That’s the good side.

The bad side is that the site earns $0, and actually costs some bandwidth, plus also the site takes time to develop further. Frankly, I don’t have the time to dedicate enough effort to constantly add content, and I can’t afford to hire a full time (or even decent part-time)  site manager to handle it. I like to have total control over stuff, so I’m not looking for a volunteer, I prefer to pay people and then tell them what to do :D

So although SMTG works very well, and definitely drives sales to developers etc, I’m unsure what will happen to it next. I’ll continue to add new games that I think are really awesome, and I hope to find some time to add features and improve upon it over time, but it’s not going to grow like Steam or even Moddb, because of lack of time. Maybe when my next game has shipped I’ll get a lot more free time and spend a few months on it, but I already have to find time for top-secret-side-project #1 as it is… Ho hum.

AQTime

Filed under: GAME FOUR,programming cliffski 12:47 pm June 10, 2011

Yesterady I bought AQTime. It’s $600. That ain’t cheap. It’s profiling software, so basically its something that helps me write faster code. I’ve used it before, and it’s extremely good. I hope I can make my new game faster and smaller-memory-footprint than GSB by using it.

Already I’ve found out that some code that I thought was fast (searchlights) is in fact scarily slow. What’s more, I know the exact lines of code that cause the problem and it’s likely easily fixed. yay!

Plus fog of war code is done and dusted. Double yay.

I hope to have some interesting screenshots to show off in a few weeks. I’ve done the flashy graphics stuff before the gameplay balancing and level design, which means early screenshots of GTB will look nicer than the frankly awful early GSB ones :D

Also… there was a fox in the field opposite the house yesterday. It seemed to be just prowling about, midday, in the sun. Who needs springwatch when you have a fox? :D

Next Page »