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

Update on shadowhand! potions!

Shadowhand continues to make awesome progress. We are close to releasing the games steam page for ‘coming soon’ and wishlist adds, which is a bit of a milestone. The trailer is nearly done and the launch is in sight. If you haven’t heard me talk about it before, shadowhand is a game developed by Grey Alien Games and published by me! Its an interesting card-game/rpg/story based game that has no real direct comparison. Its very polished and very addictive. Here is Jake talking about the latest developments in the game:

Its hard to know how best to describe the game, I would say ‘darkest dungeon meets solitaire with steroids on’.  I like it (and think its a good bet to publish) precisely because its no hard to describe, and thus is likely an experienced most gamers have not had. Its going to be really interesting to see what people think of it.

Both me and Jake will be at GDC next week. if you are a youtuber or twitch streamer and want a demo, just leave a comment or email me at cliff AT positech dot co dot uk. Also obviously we are always keen to talk to bloggers and journalists about Shadowhand and Production Line. Plus we are British, so you can offload all your political angst on us while we nod sagely and understand :D.

Hopefully new Production Line patch tonight or tomorrow morning…

Random ups and downs of releasing games

I really don’t get how indies put so much time and effort into their first game. The ones who get into debt amaze me even more. the ones who mortgage/sell their house scare the crap out of me. Don’t do this.
I’ve made lots of games, here is how they went:

  • Asteroid Miner: Meh…sold a few hundred copies, was exciting to see it in a box.
  • Starship Tycoon…sold a few hundred copies, also some retail deals, tempted to quit day job… and does! That was a mistake!
  • Rocky Racers… mediocre flop.
  • Kombat kars… mediocre flop.
  • Planetary Defense…not bad considering development time was super short (a few months).
  • Kudos…surprise hit. did really well. 3rd party publishing deals that paid actual royalties!
  • Kudos 2… even better. Seriously good sales. hit $20k in one month. unbelievable.
  • Democracy…not bad, not enough to quit job, but really not bad.
  • Democracy 2: Really good, enough to quit job. *quits job AGAIN*. pays off mortgage.
  • Gratuitous Space Battles: OMG teh fountain of money. Buys new house.
  • Gratuitous Tank Battles. Meh: pretty good, but nowhere near as good as GSB.
  • Democracy 3: LOLLERSKATES. Orders brand new car & stupidly expensive laptop. Starts flying business class. Eventually buys stupidly flash electric car.
  • GSB2: Yikes, that didn’t go down well. Ouch. what did I do wrong?
  • Democracy 3:Africa. Fuck. Americans REALLY don’t care about Africa then? Barely breaks even.
  • Production Line: LOL. Almost physically crushed by stampede of pre-orders.

My point is…holy crap you never know what will happen next. Your next game could flop, it could be huge. I *really* think that GSB2 is underappreciated and am surprised it flopped. I’m still amazed at how many people like political strategy games. YOU NEVER KNOW. So be cautious, and experiment a bit. if I’d bet my house on Asteroid Miner, I’d be renting a bedsit whilst still working in IT support trying to pay off debts. I’ve never borrowed money to make a game, I’ve never remortgaged, I’ve never worked for more than 18 months on a single game before putting it on sale.

That might be a bit clinical and unromantic, but its worked for me. Your life is not a feel-good Hollywood movie starring Tom Cruise. Don’t get stuck in confirmation bias. Many indie games fail. Some fail HARD.

New blog video, Production Line 1.07 and onwards…

Wow its been a BUSY week, like crazy busy. I released build 1.07 for Production Line, and started on 1.08. The price went up to $11 today, and I also started laying out a list of coming soon stuff in the forums here. There has been a steady (and accelerating) growth in daily pre-orders for the game. 4,000 sales seems ages ago now, and I’m struggling to keep up with all the feedback. Anyway…here is the new blog video.

I shouldn’t really be surprised, but the pace with which people have got around to building REALLY BIG factories is kinda amazing. This meant I needed to do some optimisation for those cases, often totally revising my idea of how big I should make certain fixed size buffers. (640k is enough for everybody!). I know some programmers might say ‘but dude…variable sized data structures. Yup, know all about them, but they can be SLOW. Try comparing the performance of a list or vector and an array one day… its HUGE. What I tend to do is have fixed arrays of oft-used objects, and allocate extra arrays if I start to run out, meaning rare one-off frame skips, but silky smooth performance most of the time.

My day is just now a blur of checking email;, then twitter, then facebook messages, then reddit posts, then forum posts, then forum messages, and then going through my bug list and my features todo list until its time to sleep or blow off steam in Battlefield One. However…just in case you thought that made me sound lazy, don’t forget we are also publishing another game (Shadowhand) which is coming soon. Here is Jakes latest video about the game:

Before long it will be GDC, and before that I’ve agreed to speak at TWO(!!!) events, which means…holy crap. I should stop typing and get on with it.. I will leave you with the exciting changelist for Production Line build 1.07:

[version alpha  1.07]
1) Major performance optimization for large factories.
2) Much faster vehicle rendering when zoomed out.
3) Fixed bug where very high car output resulted in no market price for a car being low enough.
4) Fixed the 'No room to TrashLowPriorityResource from stockpile' bug.
5) Fixed the 'Route Pending!' bug.
6) Possible fix for corrupt efficiency graph.
7) Fixed bug where manufacturing slots showed as not connected to a stockpile until the first resources arrived.
8) Added game-clock to top right menu.
9) Quitting the new car design dialog now gives a unique default name and price to the design.
10) Fixed bug where the warning notices on cars would persist until they encountered an empty conveyor belt.
11) Fixed bug where right clicking on research screen could delete items in the factory.
12) When a car is unable to move to the next (connected) slot, the message now tells the player which requirement is not met.
13) Background sound FX in R&D screen reduced in volume.
14) Fixed bug where some conveyor belt placements resulted in multiple placement sounds on top of each other.
15) Fixes to the layout of some R&D and slot menu items.
16) The warning and error notices in the factory now shrink to icons when zoomed right out.
17) As a temporary quick balance measure, only 4 valves are needed for engines now!
18) Fixed bug where supply stockpiles would not always fill correctly.

 

Anatomy of a bug fix

I thought it might be interesting to just brain dump my thoughts as I do them for a Production Line bug.

The bug is an error message which I get triggering thus:

GERROR(“No room to TrashLowPriorityResource from stockpile”);

Which is handy, as I know exactly WHAT is happening, and where in the code. Thats 95% of the work done already. Amen to asserts! I know that inside the function SIM_ResourceStockpile::TrashLowPriorityResource(), I am not able to actually do what the function needs to do. So firstly what does this function do anyway? I can’t remember… Thankfully there is a comment:

//if we find a resource not needed by current task, destroy it (only one)

Which is pretty handy. So this is a stockpile at a production task (working on a vehicle) and it needs room for a new resource presumably. The code goes through all of the objects currently in the stockpile to check we really need them. here is the code:

    iter it;
    for (it = Objects.begin(); it != Objects.end(); ++it)
    {
        SIM_ResourceObject* pobject = *it;

        //is this object needed?
        bool bneeded = false;
        SIM_ProductionTask::iter rit;
        for (int c = 0; c < SIM_ProductionSlot::MAX_RESOURCE_QUANTITIES; c++)
        {
            SIM_ResourceQuantity req = PSlot->CurrentResources[c];
            if (req.Quantity <= 0)
            {
                continue;
            }
            if (req.PResource == pobject->GetResource())
            {
                if (GetQuantity(req.PResource) > req.Quantity)
                {
                    bneeded = false;
                }
                else
                {
                    bneeded = true;
                }
            }
        }
        if (!bneeded)
        {
            RemoveObject(pobject->GetResource());
            return;
        }
    }

Thats the first half of the function, it then tries to do a simialr thing with requests, rather thanm objects. However I think I see an issue already. That GetQuantity() is checking the total quantity, not for this single object. Nope…thjat makes sense. I guess I really need to trigger the error and step through it, so time to fire up a save game from a player and run it in *slooooow* debug mode. Ok… an immediate crash from a save game..where we have 16 requests and no objects. So there seems to be a bug in the latter code:

    //ok we need to destroy a request instead of a current object.
    reqit qit;

    for (qit = Requests.begin(); qit != Requests.end(); qit++)
    {
        SIM_ResourceRequest* preq = *qit;
        //is this object needed?
        bool bneeded = false;
        for (int c = 0; c < SIM_ProductionSlot::MAX_RESOURCE_QUANTITIES; c++)
        {
            SIM_ResourceQuantity req = PSlot->CurrentResources[c];
            if (req.Quantity <= 0)
            {
                continue;
            }
            if (req.PResource == preq->PObject->GetResource())
            {
                //sure we ordered it, but do we actually have enough for this task, when com,bining requests with objects?
                int stock_and_ordered = GetStockAndOrdered(req.PResource);
                if (stock_and_ordered >= req.Quantity)
                {
                    Requests.remove(preq);
                    preq->PObject->Trash();
                    return;
                }
                bneeded = true;
            }
        }
        if (!bneeded)
        {
            Requests.remove(preq);
            preq->PObject->Trash();
            return;
        }
    }

So what could be wrong here? Ok…well hang on a darned minute. This code is just saying ‘do we really need resources of this type right now???’ rather than ‘do we need ALL of these right now?’  which is more of a problem. We are clearly somehow ‘over-ordering’. The slot in question is ‘fit trunk’. presumably it only needs trunks… They do all indeed appear to be the same type. 4 are ‘intransit’ the rest are queued up at some resource importer or a supply stockpile or component stockpile somewhere.

So the ‘solution’ is easy. First kill off (delete) a request that is not in transit yet, to make room, or if that is not possible, kill one that actually is in transit. This then frees up the required place in our stockpile. But hold on? this is just patching over the wound? how on earth did this happen? The calling code is requesting new resources, when clearly 16 are already on the way! in fact its requesting a servo…

AHAHAHAHA!

what a beautiful bug. The player obviously upgraded to a powered tailgate, which means a servo is needed for every trunk, and yet 16 trunks were already on order. Error! error! I have special code that handles when an upgrade makes an existing resource requirement obsolete (climate control replaces aircon), but not code to handle this case, where additional stuff is needed. This is FINE, I can implement the above mentioned code without worrying how it happened.

That actually wasn’t too bad at all :D

Shadowhand’s designer will be at GDC

Jake Birkett, one of the developers behind Shadowhand is going to be at GDC this year, shortly before the final (yay!) release of the game. If you haven’t already heard about it, check out the website or read the announcement on Jakes blog:

http://greyaliengames.com/blog/going-to-gdc-want-to-try-shadowhand/

Its a very interesting game, because its a sort of RPG/Card game/Visual Novel mashup with cool characters and a very interesting combat mechanic. I think it will appeal to casual card game players and Darkest-Dungeon lovers alike.

I’ll also be there, wearing a REALLY BRIGHT jacket, and pretending to be networking.