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

Venturing further into online bits

Today I didn’t write a single line of  C++, but did code a lot of php, which is the language I use for the online challenge management stuff in Gratuitous Space Battles.

On thursday I spent a lot of time blasting out the music from Star Trek : First Contact while I scrubbed out my chalk board and drew my vast plans for the future of GSB, or at least, the next DLC/expansion thing. After a lot of hand waving, I’m currently planning on a cunning meta-game style campaign that slots into some of the existing challenge data. It’s going to work a bit like spore, in that it becomes ‘massively singleplayer’, with other peoples content (in this case fleets) appearing in your game.

So far, so easy. That’s not a problem. The tricky bit turns out to be that although I let people mod the game (and that will continue), I can’t have a modded fleet turn up in someone elses game, because at worst, it could crash thinking “cannot find ‘bobsZapGun’ module…”

The solution, (which doesnt check for data changes as such, but does check for simple additions), is to write code which verifies that a players fleet only uses content that exists in the main game. To do that, php code was needed to crack open the binary challenge data and go through each ship hull and module name and check they really exist…

and to get THAT to work, I needed php code that would analyse all the data in the game and create a database of all the ‘valid’ entries, so that it can compare one with the other. That way if I do some module changes or new add-ons, I can just run some php and have the ‘valid data’ table automatically updated.

This is a lot of work in order to just get something totally under the hood and invisible working, which is code to ensure no modded content ends up in any one elses campaign, causing a crash. There is a ton of other work required. The good news is that a lot of this same code might be possibly leveraged at a later date to scan the high scores for modded content (and reject it) and could even remove the need to tag challenges with the add on packs manually as players do now. All fun and games….

In other news I just did a BLIND taste challenge and I *can* tell the difference between cadburys and morrisons chocolate buttons. (Cadburys taste smoother).


5 thoughts on Venturing further into online bits

  1. Cliff, two things — first, is there a way to tell the difference in the game’s UI between modded content and core content?

    Second, assuming that you already have the code to do that in a C or CPP executable, can you use that code to write a module that can be called on the server side? The PHP language is written in C, and you can write precompiled modules that can be included at runtime (the same way that apache includes the php parser) … or, alternately, you can just write an executable that can be compiled on your webserver that PHP calls via a command line, aka ‘exec’ call, along with parameters.

    Assuming that you already have the code written in the game to tell the difference between core content and modded content, you would be able to maintain ONE set of that code and just include it into your web server’s executable stack to validate challenges.

  2. unfortunately that code doesn’t exist anywhere until now. This was a deliberate plan to make the game easily moddable, with the assumption I’d never need to seperate out the modded content.
    It’s not that bad, its good for me to learn some php, because getting a stronger php code base allows me all sorts of options for cool online stuff.
    I still hate that you can’t do string += string, and you have to do string .= string. WTF?

  3. I think you should make like a conquest thing where there’s a huge universe map and players fight to capture tiles of various sizes. The larger the tile, the larger amount of points you can use in order to build a fleet to capture it.

    Each tile you own gives you +1 ‘dominion’ point per hour. (rename it as you will)

    Add in a cool alliance feature where players can band together to capture and hold large areas of territory and reinforce other players blocks.

    Build on the domination feature, having special cool unlocks, badges something for players who have a lot of ‘dominion’ points.

    Add onto this with different tiles offering different resources and custom alliance ships/ colours, and you have the basis for something huge.

Comments are currently closed.