Categories
computer games massively multiplayer networking programming system architecture

Some Myths of Writing Networked Multiplayer Games

Networked games use the internet, and the difficulties of making these games evolve on Internet Time, which means that the articles people wrote as recently as a year ago on how to make a networked or multiplayer game are already out of date. Most of the literature is more than 5 years old, and some as much as 10 years old – hopelessly out of date in the modern world of internet and online gaming.

Anyway, to get you thinking (I’m not providing definite answers here, but just some stuff to make you think about more carefully about how you’re doing your networking), here are some common rules that perhaps no longer apply the way they used to:

Categories
alternate reality games games design games industry

How to become an ARG designer (Design a game to cure cancer)

(ARG as in Alternate Reality Game, of course…)

http://www.letschangethegame.org/

A new ARG project from Adrian and Dan, in aid of Cancer Research UK. Great to hear they’ve got this off the ground, it looks like it’s going to be fantastic. But it could also become the biggest event in helping new ARG designers a chance to get their feet wet since the start of Unfiction and ARGN:

People always used to ask me
how they could become ARG designers, and I would always say that they
should try and gain experience – but with such a small field, the
only way to do that is through grassroots games. While people might
have plenty of time to volunteer, grassroots games still cost *some*
money which people often can’t spare. This is a way to give lots of
people experience in thinking about game design, and one team the
opportunity to make a really significant game. — Adrian Hon, Six to Start

Categories
games design massively multiplayer networking programming

8 things to avoid when building an MMOG server

A few years ago, I wrote an article for Develop magazine – “10 MMOs you don’t want to do”.

Here’s 8 things you really shouldn’t do but that might seem like a good idea if you’ve never made an MMOG before.

All these are examples of things that have been done on real MMO projects, usually MMORPGs.

  1. use off-the-shelf middleware from the enterprise industry. It’s designed for completely different usage-patterns and cannot cope with MMO style usage. Equally, initially distrust anything from traditional Big Iron companies.
  2. think that Grid Computing will somehow magically solve the problems. It won’t (c.f. previous point).
  3. aim to code the server in a scripting language. You *can* run some scripts embedded in the server, but not the server itself – but even that can screw you when you’re trying to run thousands of scripts at once
  4. assume that front-end load-balancing will solve any problems. It won’t, all it does is increase the efficiency of your cluster by a small amount. And it usually won’t provide you with failover, because most game designs will end up kicking you from your server if it dies, so the failover never gets used at that level.
  5. ignore performance testing until mid-way through the project. If performance tests at 10% of the way through production say it’s slow, that means you’re in deep trouble – it does NOT mean that “we’ll come back and optimize it later”. Optimizing netcode and server code is NOT like traditional single-threaded local-only optimization: many of the things you’re dealing with (like LANs, and TCP/IP stacks) run orders of magnitude too slowly, so your optimization comes from imaginative system-architecture, not from optimizing small chunks of code at a time.
  6. ignore billing concerns in your core game design. Non-free MMOG’s are entirely about billing, which means that you have to design it in, and build it in to the tech design from an early stage. Retrospectively adding billing hooks and billing information to existing server codebases is often about as easy and effective as retrospectively making your code secure. Just don’t go there.
  7. hire an academic who specializes in networking, especially a PhD student (this gets done quite often). All this means is that they’ve obsessed with a very narrow slice of the many many problems, and generally they won’t know WTF to do about the rest of the problems. That’s no better than just promoting a general programmer to become “the new Server specialist”
  8. innovate on both technology AND game design at the same time. Either do a traditional MMO so you can re-use all the existing common wisdom for design, and get to market (or at least a stable GDD) fast, and use the slack that buys you to focus on better tech, or use the most boring tech you can think of (instance lots; do lowest-hanging-fruit in your tech design) and innovate on the gameplay

I reserve the right to come back and edit this to make it ten once I’ve had more sleep and can remember two more :)…

Categories
amusing computer games conferences photos web 2.0

Sulka gets Angry…

Sulka Haro’s keynote at AGDC07. What happens when a Lead Designer gets heckled, and things turn nasty…

Categories
facebook web 2.0

Internet as Platform – Marc Andreessen is wrong?

“Often wrong, never in doubt” is the tagline on Marc Andreessen’s blog. With a recent post of his, on the “three kinds of platforms you meet on the internet”, I think the first part of that tagline is ringing true :P – Marc is talking nonsense with his claims that “[a Level 3 platform is] much better for the developer [than a Level 2 one]”

It’s great that he’s trying to “disentangle and examine the topic of Internet Platform”, but … seriously, there are good analyses and bad analyses, and this one rings jarringly false to me.

To save you reading the whole thing initially, here’s Andrew Chen’s summary:

The fastest summary:

* A Level 1 platform’s apps run elsewhere, and call into the platform via a web services API to draw on data and services — this is how Flickr does it.

* A Level 2 platform’s apps run elsewhere, but inject functionality into the platform via a plug-in API — this is how Facebook does it. Most likely, a Level 2 platform’s apps also call into the platform via a web services API to draw on data and services.

* A Level 3 platform’s apps run inside the platform itself — the platform provides the “runtime environment” within which the app’s code runs.

And which companies are working on Level 3 platforms, other than Marc’s Ning?

* Salesforce.com

* SecondLife

* Amazon (through AWS)

* Akamai

Which is fine, but I need to add Marc’s statement that

I call these Internet platform models “levels”, because as you go from Level 1 to Level 2 to Level 3, as I will explain, each kind of platform is harder to build, but much better for the developer. Further, as I will also explain, each level typically supersets the levels below.

  1. Are they monotonically harder to build?
    • Yes
  2. Do they typically superset the levels below?
    • Yes
  3. Are they “much better for the developer”?
    • Hell no

Marc has written a very programmer-centric post here. He’s identified that, technically speaking, the different classes of platform are “bigger” than each other and obey a transitive, non-commutative, superset relationship. Natural consequences of that are the first two items I hilight in his claims above.

But he’s then made the mistake of conflating this with *entirely unsubstantiated* business concepts of “better”. As the developer of one of these “level 3” platforms he contends are “best”, it’s no wonder that he wants to believe that it is a *logical* conclusion that the business advantage comes forth just as the technical conclusions are logically sound. But wanting to believing a thing doesn’t make it true. And whilst I genuinely believe he could have provided a decent argument that makes it true *for his business*, I think it’s not only an illogical claim, but actually false, in the general case.

Specifically, I would like to know how a level 3 is “better for the developer” than a level 2?

And I’m sorry, but I’m going to stop calling them “levels”; they are only levels in a programming sense, not in a business sense, and to name them that way implies something is globally true that only applies to one aspect of them.

Going from class 2 to class 3, you:

  1. have to do more work
  2. pay more in ongoing costs
  3. provide no appreciable benefit to any user who is also a competent developer

To give an example of a valid way of making the “3 beats 2” argument work is that you could argue that if your target-market is people who can’t write code at all then the third point above is irrelevant, and that actually you ARE adding value.

But for all the other users – and, let’s be fair here, Marc chooses *Facebook* as one of his examples of class TWO, not three; Facebook, where pretty much any idiot can (and does) write a facebook app within a matter of days or hours – point three above means you aren’t adding any value at all by moving to class 3.

Hosting is incredibly cheap these days, and developing basic functionality is incredibly easy – as mentioned, look at the proliferation of non-programmers and what they’ve done on FB. Reducing the dev cost and hosting cost over and above a level 2 platform seems to have very little actual point to it.

And, worst of all, with a level 3 platform, you make it into an “all-or-nothing” proposal, completely about-face from what has driven the proliferation of Web 2.0. You create a walled-garden of proprietaryness, where every user is dependent upon your ongoing existence. Facebook expressly does not do this.

Even when people use your service because they have no choice but to limit themselves to your walled-garden, you will scare away vast swathes of the best users because they will be rightly suspicious that yours is a proprietary platform that they cannot exist without.

I would rather contend that class 2 apps are the best of all. Why? Because:

If I develop an FB app, and FB disappears tomorrow, I can still run my app all over the web with almost literally no changes to code.

On the other hand (and I know many examples of where this has prevented people from using SL, even though LL have taken many steps to blur this and insulate people from the problem, including open-sourcing pretty much everything)

If I develop something in SL, and Linden implodes tomorrow … I lose my entire ability to conduct business.

I think it’s telling that even in Marc’s post it’s clear he was struggling to find examples of class 3 platforms. I think it’s disingenuous to even put SL in that category, since it is (as noted) moving so strongly and rapidly towards being something different – they’re even talking about allowing anyone to run the servers themselves. If they’re a poster-child for level 3 being “much better for the developer”, then why are they running full-tilt for becoming something that would only fit in his level 2?

Categories
facebook java tutorials

Ten tips and tricks for writing Facebook Apps

(Only a couple of these are java-specific, but this is a.k.a.: “How to make Facebook Apps using Java – part 3”)

(I assume you’ve already had a look at part 1 and part 2? They’re more beginner-oriented)

Bugs, Misconceptions, and Subtle Features

Interfacing with Facebook’s servers is pretty hard, considering how seemingly trivial the interface is. Obviously the almost total lack of documentation is mostly to blame for this, but some of it is just common bugs that have yet to be fixed.

So, here’s ten things I’ve found whilst fiddling with the API, and some of the nicer features that may not be immediately obvious even if you do read the docs provided by FB (you should go read all of them, but … there’s some bad organization and layout, so it can be a chore reading the mega-long HTML pages, with many of the API features having just blanks for description fields :( ).

Categories
agile programming system architecture

Source code is the best form of documentation (not)

No, it’s not, it’s really not. In fact, source code is probably the worst form of documentation, it fails in most of the roles that documentation is actually required to fulfil (see bottom of this post for a shortlist).

But something else is…

Categories
computer games mmog links networking system architecture

Thousands of Clients per Server (Game Programming Gems 4)

…was my section in the fourth GPG book from Charles River Media. And, sadly, although I tried to put some resources up on the web, a series of unfortunate events led to that all disappearing.

But now … they’re back! (and I’ll be adding more followup stuff in the coming weeks/months)

Categories
computer games conferences games industry web 2.0

AGDC 2007: report for Web 2.0 + Games meetup

The informal meetup for Web 2.0 and Games at AGDC turned out a lot more popular than I’d expected. Looks like we need to make this an official thing next time:
agdc2007-meet-1.JPG

Categories
conferences games design networking system architecture web 2.0

Austin GDC talk: Caching for Web 2.0

UPDATE: short, complete, 42-slide version now available from the CMP website – https://www.cmpevents.com/sessions/GD/S5762i1.ppt

…but if you want the 144-slide version (!), see below. No extra content.

Categories
computer games games design games industry web 2.0

RPG Vault – Online Worlds Roundtable #15

Inteviewed for RPG Vault’s latest Online Worlds Roundtable – http://rpgvault.ign.com/articles/817/817490p3.html

“Web 2.0 businesses compete directly with the games industry on multiple levels, and anyone who doesn’t spot that and act accordingly will suffer. If your game doesn’t embrace – or deliberately and carefully reject – Web 2.0, you’ll that your users have created the space you *didn’t*, and someone else is monetizing it. And they’re probably making more revenue than YOU are from providing the core service in the first place!” – Adam Martin

Categories
maintenance

Dear Technorati…

…please claim my blog. Here is my Technorati Profile

Categories
computer games entity systems games design massively multiplayer networking system architecture

Entity Systems are the future of MMOG development – Part 1

A few years ago, entity systems (or component systems) were a hot topic. In particular, Scott Bilas gave a great GDC talk (http://scottbilas.com/files/2002/gdc_san_jose/game_objects_slides.pdf – updated link thanks to @junkdogAP) on using them in the development of Dungeon Siege. The main advantages to entity systems were:

  • No programmer required for designers to modify game logic
  • Circumvents the “impossible” problem of hard-coding all entity relationships at start of project
  • Allows for easy implementation of game-design ideas that cross-cut traditional OOP objects
  • Much faster compile/test/debug cycles
  • Much more agile way to develop code
Categories
facebook web 2.0

The secret to making successful web 2.0 startups?

The entire switch here is to think of these websites not as collections of features or products, but rather manufactured experiences that are designed to be compelling wastes of peoples’ time ;-) — Andrew Chen

http://andrewchen.typepad.com/andrew_chens_blog/2007/08/reward-schedule.html

Categories
conferences security

How to really secure WordPress for a remote blog

EDIT: downloading the nice plugin recommended in this post will now break your blog if you’re using WordPress 2.5 – the wordpress authors have made some incompatible changes. But it’s OK – bengreen has fixed the plugin, and made a new version available (read here for some very basic information on what will break and idiot-proof instructions on how to fix it)

I had a nasty shock when I realised that wordpress by default has no security at all. Anyone in your office who doesn’t like you and has a basic knowledge of using google can potentially steal your admin password and take complete control of your blog. This is, really, pretty mind-blowingly stupid – I love wordpress, but “no HTTPS support out-of-the-box” is frankly irresponsible, especially for a product used by so very many people across the world. The only good part is that AFAICS on a quick glance there’s no easy way of taking control of the entire webserver if you’re the wordpress admin (plugins still have to be manually uploaded, so you’d need separate access to the server to manage that).

What follows is a discussion of how to fix this, along with links to step-by-step guides that worked well, and an extra note on how to complete the process without doing the “login once insecurely” that all the guides tell you to do at the end.

Categories
conferences games design games industry web 2.0

AGDC 2007: Web 2.0 + Games meetup

I’m talking at Austin GDC on “Caching for Web 2.0”, and I’ll be having a small dig at the games industry and the obsession some people have with “game 1.0/2.0/3.0” on the side, but I’d really like to meet up with anyone interested in how best we can capitalize on the lessons from Web 2.0.

I think the vast majority of people in games still don’t “get it” when it comes to understanding web 2.0, and are going to make some really stupid egg-on-face mistakes and miss a few more big opportunities. But’s that just my opinion… :)

What’s yours?

UPDATE:
Venue: Halcyon
Time: 19:00
Day: Wednesday 5th

UPDATE 2: a couple of photos here

Categories
computer games games industry networking

How to Become a Great Network Programmer

An article I wrote for Gamasutra’s Game Career Guide:

Part 1 – What to study
Part 2 – Practice and Experience

…hopefully this will be useful to some of the many people interested in network programming but not sure where to start.

Also, you might want to have a look at my post on Career Progression for Games Programmers

Categories
facebook java tutorials

How to Make Facebook Apps Using Java – part 2

In the first part, I covered a very high-level, idiot-guide to getting started with writing a Facebook app in java. This part will cover the details of how to architect your own code for basic Facebook authentication, and include code samples you can use to get up and running more quickly. It will also explain in more detail precisely how Facebook’s servers interact with your code, and what you can expect (and what their servers expect of you!).

NB: if the quoted source code is unreadable because it disappears off the edge of the screen, select it and copy/paste (or view source of the page to see it). The most useful stuff is put together into one class you can download here – source code for FacebookLoginServlet.java.

Categories
games industry

Computer Games Industry Careers – Programmers

I’ve been in the games industry for some years now, and one of the things I find slightly annoying is that there’s very little discussion of “career progression”, and that what little there is typically focusses on “how to get your first job in the industry”.

Career Charts

Many years ago, I used to work at IBM’s R&D labs, and discovered that they had whole tables of “possible career paths” that you could download internally and consult when trying to decide what to do with yourself. They pressed hard on everyone to take some time out every 3-6 months to evaluate how their personal career was progressing, think about what they wanted to be doing in the future, and decide what long-term decisions they should be making in the present and near-future to help them get there.

The emphasis was on the individual, and of taking control of (and responsibility for!) your own future. The guides were there to help you find out what a potential future boss would expect of you if you wanted to apply for a job years in the future – when you’re a junior programmer, you may have no idea what a senior manager is supposed to do. No problem – except if you wanted to become one, in which case you wouldn’t know what to concentrate on learning for the next 10 years.

Big companies in the games industry, like EA, certainly do a similar thing internally. But I’ve so far failed to find any decent external, public, guides. So, for the benefit of anyone else who’s ever wondered what they should be doing to further their games-industry career, I’m going to start publishing my own take on this. I’d really really like input and feedback from other people, although there are big problems with conflicting definitions e.g. of what, exactly, a “development director” is. But at least I can start…

Chart 1: Programmers

Typical career progression for Programmers

This is a basic chart showing the main flow of career progression for programmers.

The most important thing to point out is that it only shows internal progression – later posts will show how you can easily move sideways from some of these positions into different disciplines, especially Design and Production. But I’ll be covering each core discipline in it’s “plain” form first, and showing the links between them later.

Programmer levels

Junior – recent graduates and/or people with no games industry experience and not enough years of hard-core C++ coding to jump straight to the Programmer level. Note that most Juniors pick up some specialism – not enough to become an expert, but enough that later they can re-specialise in that role as a Senior.

Programmer (normal) – anyone who’s passed their apprenticeship as a junior, typically with 1-3 years of experience programming on games projects, and credited on 1-2 published titles.

Senior – a programmer who has decided to specialize in an area of programming, becoming an “expert” over and above a normal programmer. Usually someone who chose to avoid a managerial position – although note that on larger teams most Senior’s end up managing Juniors in their area of expertise. However, the management is mostly mentoring, as opposed to Lead’s who do much more project-management-esque roles. Seniors typically start off as a Junior in the same area of expertise, and refine their skills and gain lots more experience whilst a normal Programmer.

Lead – a programmer who manages a team of programmers. There are two types of Lead: the mentoring lead who still programs day to day, who is an expert programmer who could have been a Senior, and the project-managing lead who hardly ever programs (if at all) and spends more time arranging the workload for all the other programmers and helping out the Project Manager(s) / Producer(s) with scheduling and delivery. Both types act primarily as go-between, interfacing between the entire programming team and the rest of the world (design team, art team, and producer). Most Leads are experimenting to see how much they like project management, and may switch to being a Producer or Project Manager later on.

Technical Director – ultra-experienced / skilled experts, usually troubleshooters floating amongst all dev teams, or attached to a particularly large team. They take on all the non-direct-programming tasks that require substantial technical expertise. This often means a big role in hiring, solving long-term problems, and architecting large systems for complex games.

Development Director – this one’s very vague, because more than any other Programming role there’s huge variety in the actual responsibilities of this role from company to company. I’m defining it here as “the person who is in overall charge of all direct creation of all games: programming, art, and design”. Their role is entirely strategic – they may be a skilled technical person (there are many other routes to this role – see upcoming charts in future posts), but they delegate ALL technical issues to their one or more Technical Directors. However, they typically make the final decision on anything affecting the development process or the overall studio and how it develops.

Next … Design (probably. Or maybe Production…)

Categories
facebook java tutorials

How to Make Facebook Apps Using Java – part 1

I wrote a game last weekend, for Facebook. Writing the entire multiplayer persistent game took a day and a half; getting it to integrate with Facebook is taking several days. Mostly, the problem is that Facebook hasn’t – yet – provided user-guide documentation, and there are plenty of bugs in their system. Without docs, you have to guess whether a “nothing happens” is due to your mistaken guesswork, a bug in FB, or … a bug in your own code. That’s fine, but it takes time, lots of time.

Google kept giving me zero hits for any of the problems, or even any java-focussed docs (just one link to a FAQ on an issue that seems to be a bug that was fixed a while ago. That’s all). So, as I solve the various problems that come up, I’m writing about them.

Platform

First thing to be clear about: if you want to write FB apps using java, you’ll be using Enterprise Edition (J2EE). The way FB works *requires* you to provide a webserver for your app. Whilst its true that java can run in the web browser, that’s a completely different way of using java – for this, you’re going to have to find a server, and install J2EE (it’s the same as standard java, just has lots of extra libraries, only a few of which you’ll need to use).

Facebook Apps: how they work

This diagram shows a very simplistic summary of the different URL’s you are asked for when registering a Facebook application, or are used when serving an App. Note that FBML is served entirely internally in the FB server, it does NOT make a request to your web server.

NB: this image got deleted in the server crash last month; WordPress is rather badly designed with images, and doesnt save them. But it’s been stolen and copied widely all over the web, so you can probably find it relatively easily
Basic explanation of facebook servers

First step: Registering your Facebook Application

Assuming you can find yourself a webserver/J2EE server to run your app on, and have a domain name for it (or the hosting provider gives you a default domain-name – you don’t HAVE to buy one just for your app), the first thing to do is register the app with Facebook. This just reserves the name of your app, and gets you the login details you’ll need before you can do ANY testing or development.

This process is actually nicely documented (and is also very simple – although the huge scary forms they ask you to fill in are very poorly explained, there’s a only a few fields you actually *need* to fill in). Don’t follow the list of things on that page literally, see the differences below that you want to make.

For the URL’s you need to fill-in, you’ll be making a servlet for each. So, work out the URL for each of the servlets (depends on how you setup your J2EE server), and have them ready to give to FB.

So, to summarise:

  1. Create a Facebook account if you don’t have one, and login
  2. Add the “Developer” app to your account (link is here)
  3. Go to your Home page on FB
  4. Click on the Developer app in the sidebar to go to the main centre for all your Developer activity
  5. Make a new application, and fill in the form it presents you with (make sure you do at least:
    1. App name
    2. Callback URL (see the example app)
    3. Canvas page (see the example app)
    4. iFrame (not FBML)
    5. Post-add URL (see the example app)
  6. Save the api-key and the session-key that it now displays for the newly-created app – you’ll need them to do any coding

First test: Can Facebook display your Application?

Create the various servlets on your server (callback, postadd, and canvas) and make each of them return basic HTML that just says “callback servlet”, “postadd servlet”, or “canvas servlet”).

Open a new browser window, and type in the canvas page URL from FB, something like: http://apps.facebook.com/yourApplicationName

You might be asked some security stuff by FB, but once you’ve got past that you should then see a Facebook page with the navbars etc, but just a big empty space in the middle with the test “callback servlet”. If so, congratulations, you’ve got your app basically working. Now comes all the hard stuff…

If not, first check that your servlet is even working, by copy/pasting the callback URL from your FB application setttings (click Edit Settings to re-load the form you submitted) into a browser window, and seeing if you can get the page. You’ve probably got a typo in the URL you gave FB. If the “callback servlet” text doesn’t come up on its own, without all the FB stuff, then your J2EE server is misconfigured or broken. Time for you to go find some Tomcat / jBoss / etc tutorials and get your J2EE working…

Part two…

Now you can move on to part 2 of this series, covering the details of how to authenticate with Facebook and start doing interesting work, including sample source code.