So… PAX is coming up. I have never been. I will go one year, maybe. I don’t fly a lot due to some insignificant concerns. Anyway…Positech sort of has a ‘presence’ there this year because a game we are publishing (Political Animals) is in the ‘minibooth’ bit of the Indie Megabooth.

If you are at PAX, you will be able to see (and play!) political animals on Sunday and Monday (4th-5th). It is worth your time. We don’t publish many games (PA will be our fourth published game, the others being Redshirt, Big Pharma and Shadowhand), but we get a LOT of pitches (roughly one a day) and the games are mostly forgettable. We don’t publish clones, generic games, or games without an interesting twist. Political Animals meets all of our criteria. Its a political strategy game like our own Democracy, but nothing like it in terms of gameplay. It is an election game, rather than a government game, it has a cute and funny design, and it focuses on corruption more than any other political game I am aware of. Plus the characters in it are awesome.

The team also has serious pedigree. I first met Ryan (in fact the only time so far!) at a game show where we was helping to man the Prison Architect booth, as he is the art genius behind the style that helped sell ten trillion copies of that game. As a result, Political Animals has a fantastic style to it. The only problem is both games are abbreviated PA. Bah.

Anyway, its an election year in the US (and also was in the Philippines, where PA is being developed), and a great time to be making a game on the shadier side of politics. Modern politics in the US and UK and Philippines makes Democracy 3 look like some idealistic dreamworld born out of a posh school debating society. I am hoping PA gets the attention it deserves, but as ever, this is increasingly tough. There are an insane number of indie games, and only so many press. maybe even fewer press.

So…

This is what Ryan looks like:

ryan

He will look more tired and jetlagged when you see him. Go talk to him, ask him about the game, and try the game. PAX is all about player feedback, so if it sucks, we want to know. if its confusing, we want to know, if its AMAZING, we want to know. Do try and find time to give it a try. Like I say, its only on the Sunday and the Monday.

Also…other devs, and press types. Invite Ryan to things. he is a nice guy, he is a great guy to interview! he will be able to tell you hilarious anecdotes about prison architect! (or make some up). He probably has things to say about Philippines politics! He is someone you should have at all your cool indie parties. He is @RyanSumo on twitter.

Ryan & co will also be at EGX in London, but if you are US press, this is your ONLY opportunity to interview the makers of the best political strategy game coming out before the election. Go do it!

 

Drawing a LOT of sprites

August 29, 2016 | Filed under: programming

I’m doing early work on my next game, a completely new IP. I’ll be announcing it in a few months. Anyway… it involves drawing a big world with a LOT of objects in it. tens of thousands on screen probably. Drawing 10,000 objects in 2D is not as simple as you think.

If you are a non coder, or someone who only ever uses middleware, you might think ‘the new video cards can draw 10,000,000 polys per frame, what’s the problem? and indeed there is *no problem* if you want to set a single texture and then splat 5 million sprites on the screen that show it. Thats one (well…probably several) draw call, one render state, one texture. Even really old video cards like that.

The problem is when you have a lot of different textures and want to swap between them, because for engine-related reasons, you need to draw stuff in a specific order. In a 3D world, you can use a Z-buffer and draw out of order, but with 2D objects with some soft aliased edges, that looks BAD. The good old fashioned painters-algorithm is your friend. The problem is, if you draw back to front and the sprite textures needed go A B A B A B, you are kinda fucked…that means a lot of texture changes, and in directx9 (which I use for compatibility reasons), texture changes mean separate draw calls, which stalls the video cards, and is sloooowwwww.

Relevant video from GSB2:

So what are the workarounds?

Texture atlases. This is the obvious one. Stick A & B in the same texture, and you are laughing, suddenly stuff is a LOT quicker. This only solves the texture issue, not drawing to different render targets, but you can defer those draws anyway and do them separately (GSB 2 does this). Texture atlases are an obvious ‘win’ even if they only halve the texture changes. The problems here are that you either need to know what textures will follow each other and pre-compile texture atlases (something I’m trying right now), or you need to dynamically create texture atlases based on recent drawing, and effectively use an off-screen render target as a texture ‘cache’. I tried this recently…and it was actually slower :(

Dirty-rects. Basically draw the whole scene once, and save it in an offscreen buffer, and use it as your background, a single quad blaps the whole screen, and you only draw stuff that has changed / is animating. This, as I recall was used by sim city 4. The only problem is that scrolling really causes hell.

Intelligent grouping. The painters algorithm is only really needed where stuff overlaps. if I draw a tile, then draw a sprite on top of it, I need the tile first, but there is no reason why I can’t draw all the tiles first, then the contents. That means I can then sort the tiles by texture and draw them in a handful of calls (or one, if the tiles all fit into an atlas). You can do this at pretty much any level, effectively drawing ‘out-of-order’ but with caveats. Again, GSB2 does this, with various objects, especially debris and asteroids. In fact it goes one stage further by scanning ahead with each draw call to see if some non conflicting later objects could be ‘collapsed’ into the current draw call.

Multi-threading and other speed boosts. If you have too many draw calls and things are too slow, then you can expand on the time available to make draw calls. Essentially you have two threads, one which prepares everything to be drawn, and the draw-call thread, which makes all your directx calls. This way they both run in parallel (also note that the directx runtime will be another thread, and the video card driver another one, so you have 2 threads less than you think. With a hyperthreaded 4 core chip, you have 8 truly simultaneous threads, so you give away 2, have 1 core thread, 1 render thread and 2 extra ‘worker threads’ spare. Because of my own disorganisation, I tend to have directx called from my main thread, which means I do the inverse. GSB2 did this, with all of the transformation stuff for the asteroids, debris and other bits and pieces handed to a bunch of threads while I was busy with other stuff, then returning to the main thread to present the draw calls. Less efficient, but way better than single threading.

Hybrids. All of the above techniques seem valid to me. Although I am currently fixated on pre-compiled texture atlases, I’ll definitely use multithreading and probably some of the others. With some parts of a game, a specific optimisation system may work well, and with others it could be useless. It really is specific to what you draw, and is why I prefer a hand crafted engine to a generic one.

My basic problem is that (without explaining what the game is), I have a small number of ‘components’ that make up a tiny scene on a tile. There will be a lot of components per tile, as I want a fairly ‘busy’ look, but rendering them all individually may be ‘too much’. What I may end up doing is pre-rendering each conceivable tile as an offline-step, to reduce the number of calls. I’d like that to be a last minute thing though, so I can keep editing what the scenes look like. IU also want sections of each tile to animate, or be editable and customizable, which means there is less scope to pre-render them.

It will make a lot more sense once I announce the game :D

Wow, it can take ages to make a video for youtube if this is not something you do all the time. Basically I tried it with OBS, then got REALLY poor video quality, then tried instead with sony video capture PLUS fraps PLUS audacity, and got horrible synch issues, then eventually got the quality raised on OBS enough to try again (with audacity) and finally got a video mix i was happy with. At least now I know *my* formula is Webcam and video game capture through OBS plus audio through audacity and manually synch later (otherwise the sound balance can be a pain.

Anyway behold…

Essentially that’s me going ‘hey look at all the lovely character customisation options in shadowhand…of which there are many and they are extremely cool. I may finally break free of factorio once shadowhand is ready for serious playtesting :D.

There are no comments yet

Thats probably the big thing for indie developers right now. Its about a week until Political Animals appears at PAX West, in the minibooth at the megabooth. Thats already 2 levels removed from being ‘at pax west’, and its not like there will be a shortage of stuff to grab peoples attention at PAX in general, and the wider world of gaming anyway.

Sure, we can email people who we know are going there to write about games and say ‘hey we have this cool game…’, but those people get a LOT of emails. If we lived in the USA, or better still, west coast USA near Seattle, we would have met a lot of the press people before/several times and our email *may* go to the top of the lsit…but probably not.

Which leaves 3 strategies:

  1. Dumb Luck. This is the strategy most indies go with. You never know which game will catch peoples eye. I see a LOT of indie side scrolling puzzle games…. I see a lot of amazing unity tech demos with a game wrapped vaguely around them. Hopefully as the ONLY political game at the show (we hope), and certainly the only one featuring ryans amazingly cute artwork… we should stand out, meaning we get coverage purely by being different. This could work. In this case, I’m saying the ‘smart move’ was to pick the right game early on, and give the team time to polish it and make it good
  2. Do something silly, crowd pleasing and hard to ignore. We could dress the team up as animals, or maybe hold a mock rally outside PAX, or commission a giant Donald Trump ice sculpture for our booth, or something like that. I think this sort of thing maybe *can* work, but there is a huge randomness factor involved, and it can seem kinda desperate. Also its drawing attention to you and your stunt, not the actual game.
  3. Splash the cash. The PAX booth thing is an experiment for me, I’ve never even been, so didn’t want to do a full non-megabooth setup without knowing how it would go, so the option to have a bigger or louder booth didn’t apply here. What I *could* do is to promote the game in the run up to the show, and hope that gives people name and logo-recognition as they walk by, encouraging them subconsciously to try the game. I may well go with this.

animal_group1

Frankly, the whole thing is kinda scary. I am pretty lucky, because I only have 2 fears here, and compared to other peoples fears, they are pretty mild.

The first fear is that the PAX appearance is a waste, the game flops, and people think I’m a crap publisher as a result.

The second fear is that as a result of the first, I lose money when the game is released, and feel like an idiot/failure.

The reason I say I’m lucky, is that fortunately, neither of these outcomes really has any real material effect on me, its all perception. I didn’t get into any debt for Political Animals, or Shadowhand, or my next game, so I’m not going to be cancelling a holiday, selling a car or downsizing my house if any/all of them fail. There are a LOT of indies with more at risk and more to lose than me who will bee pinningĀ  all their hopes on some internet celebrity loving their game at PAX.

But it still scares me. I like to win. I like to do well. I hate to lose, and I don’t like looking like a failure to other people. I’ll still be biting my nails checking twitter and hoping people try, and talk about Political Animals.

There are no comments yet