Wednesday, May 29, 2013

Anarchy in the Streets

Well, you finally did it.

You finally pushed San Paro too far.

Maybe it was that last rocket that sailed over your shoulder and into an SUV. Maybe it was the stray bullet from the PMG that you were firing out of the side of the car window. Maybe it was just the day-glow shirt you were wearing yesterday. Regardless of what it was, it looks like Anarchy has finally descended upon San Paro. We expect to restore order by the end of the week, but in the meantime we'll try and explain what's going on...

Transient Aberrations

We're going to be testing out Chaos Mode on the live game between May 30th and June 6th. This is a very early prototype for the mode that doesn't contain all the social features or game play elements from our finalized version, but we're finally ready to bring this to the game at large.

The first thing you'll notice once you join a Chaos District is that the contacts have gone - you can't run missions in Chaos Districts at the moment - and have been replaced by Shadow Strike Elites and Bloodrose Assassins. They serve as vendors while in Chaos Districts, just in case you realize that your LTL gun might not be up to the task in this brave new world. You'll also notice that you have a couple of counters at the top of your screen.

The number on your left is your Score for this life. The number on the right is your current survival time. The small numbers behind those ones are your high scores, which is a number that's tracked in perpetuity, so it won't reset even if you log out. Your job is to go out and hunt the opposite faction and get the highest score. You can see a list of how well everyone in the district is currently doing by pressing Tab and bringing up the Chaos Scoreboard.

Some of the prizes that will be available during the course of this event include two brand new titles for your character; one is awarded for killing 100 players during the event, and the other for staying alive for a total of ten minutes, which is way harder than it sounds! We've also added a new role just for this event! The Score Streak role rewards players for reaching certain score totals during a single life - if you score 500 points, you get 150 Joker Tickets. 1000 points will net you 350 Joker Tickets. And finally, a score of 1500 will get you a 10 day lease of the new Nekrova SSW Light Machine Gun!

This game mode will only be available to play for a week, so enjoy it while it lasts! Remember, this is just a test of this system as it is at the moment. We want to see how well it works and whether you guys like it or not, so don't hesitate to come on over to the APB Reloaded forums and tell us what you think.

Friday, May 24, 2013

Elective Spawning: Programmer Edition!

In our last post, we began talking about our new spawning system in a general overview kind of way. Today, we're going to expand a bit into the technical side of the exciting improvements we're making to the system. This is the first blog post to be written by a member of the programming team, in our continued effort to give you perspectives from all around the studio. Stuart is going to be giving you a taste of how he and the other programmers actually created the new spawning system. We're going over some basic stuff first for those of you who may not already know, so for all you smarty pants out there - bear with us for a few paragraphs until we get into the specifics.

The Basics

APB – and every computer program ever created – is comprised of two essential ingredients:
• Code, which is the list of instructions telling the computer what to do and when to do it, what decisions to make and how often to do things.
• Data, which is the set of information about the game world and every last detail within that world.
We write code, which works with this data to create the game, but the code and data are organised in a very specific way.
Everything in APB is an object. Programmers see everything in terms of objects. An object is a small, self-contained clump of code and data which interacts with other objects to make the game work.
The complexity of APB is formidable, but because everything is enclosed in its own object, I can focus intently on one small piece of APB at a time without worrying about anything else. APB has many thousands of objects, all working together to make the game work, so this is the only possible way to tackle this complexity.
Objects generally correspond to “things” in the game. Each character is an object, every vehicle and pedestrian, each stop light and fire hydrant - they are all objects. There are other objects in the game world which you won’t be able to see. Spawn zones are a good example, as they exist in the world at a particular location but are ultimately just areas of empty space. Yet more objects work entirely behind the scenes, such as those which calculate collisions or run missions.

Everything in APB is an Object

All the objects in APB are organised into a hierarchy depending on how they are to interact. The way in which objects relate to one another tells us what this hierarchy should be. There are two key ways in which a pair of objects can relate to one another:
“One object has another object.”
A spawn wave is a set of characters which will spawn at the same time. Everything in APB is an object, so naturally we created a new spawn wave object to represent this. Characters in a spawn wave will always be on the same team and indeed there is already a team object.
We say that a team object has a spawn wave object. This means that the spawn wave object is owned by the team object, and as such the team object will be responsible for creating new spawn wave objects and putting team members into spawn waves when they die.
The other way in which objects can relate is subtly - but fundamentally - different:
“One object is a type of another object.”
One feature of the new spawning system is the ability to spawn directly into a vehicle. Previously it was possible to spawn only using the spawn zones dotted around the district.
We use the general term of “spawn point” to describe spawn zones and vehicles; a spawn point is just a something you can spawn into, whatever that might be. We say that a spawn zone object is a type of spawn point, and also that a vehicle object is a type of spawn point object.
An important point to note here is that the new spawning system is designed to work with these generalized spawn points. It deliberately doesn’t worry about the specific details of what a spawn point is; it lets the spawn zones and vehicles themselves worry about the particulars. This means we could potentially extend the new spawning system to allow spawning using something else in the game, as long as it can be made into a type of spawn point. In fact, we wouldn’t actually need to change the spawning system itself, as it would carry on working with what it sees as “spawn points”.

The New System

After we decided to move ahead with a new spawning system, the first order of business was to figure out exactly what we were trying to achieve. Our designer wrote a 'Requirements' document, which gave a high-level overview of all the features needed for the new system. There are three main features:
  • Elective Spawning, where you choose where to spawn by clicking a spawn point on a map
  • Spawn Waves, where you are able to coordinate spawning with team mates
  • Vehicle Spawning, where you may spawn directly into a vehicle
Most of this information was given in the form of a timeline, which describes the series of events from the instant a character dies to their subsequent re-spawn, as seen below:
  1. The character dies and joins a spawn wave with other dead teammates.
  2. The death camera views the character’s rag doll.
  3. The elective spawning map is shown with a countdown. It is a map of the district which shows the set of spawn zones and vehicles chosen for the spawn wave. The best spawn point is already selected for the player.
  4. The player may click different spawn points. They will see which spawn points other members of the spawn wave are clicking, so they may conspire to spawn at the same location.
  5. A spawn point will be disabled if an enemy approaches. This can invalidate the player’s selection and they will need to choose a different spawn point.
  6. When the countdown reaches zero, the character will spawn at their chosen location. If their selection was invalidated and they did not choose another spawn point then a red countdown begins.
  7. If the player clicks a spawn point during the red countdown then they will spawn immediately.
  8. If the player still hasn’t choose a spawn point when the red countdown goes to zero, the character will spawn at a point chosen for them.
The document went into more detail about each stage, and included a mock-up of what the elective spawning map should look like:

An example of the spawn selection UI. As you can see, you are given 
information on where your team died and where they plan to re-spawn.

The Legend for the Elective Spawning Menu. 
NOTE: The enemy location visibility works in the same way as the 
radar - if they are driving or firing a weapon, they are always shown.

There were a series of meetings where the finer points of the requirements were discussed, and after these meetings a 'Design' document was written. This outlined the key strategies and decisions that needed to be made by a programmer when creating the new spawning system. The actual process of that creation is called the implementation.

Server vs Game Client

There are two sides to every coin, and APB is no exception. There is the game client itself (which you will be very familiar with), but there is also the server, which hosts the game world and allows you to play with and against other people.
A key question we had to ask ourselves was: which parts of the new spawning system will be added to the server, and which parts will be added to the game client? In other words, who is in charge of what?
The server acts as the ultimate authority of all things. It has complete knowledge of every aspect of the game world. As such, it would:
• Remove characters from the world when they die and add them again when they spawn.
• Create spawn waves and put characters into waves depending on when they died.
• Choose the best set of spawn zones from those scattered across the world.
• Add any vehicles which have the appropriate modifier.
• Validate the spawn point selections a player makes.
The game client doesn’t have any authority to make decisions which would affect other players. It only has a limited knowledge of the game world, knowing only about that which is directly relevant to the player. As such, it does much less than the server, which:
• Shows the elective spawning map.
• Handles the mouse input as the player selects spawn points.
This division of responsibility also showed us the sort of information which would need to be communicated back and forth between the server and game client. The server will need to send the set of spawn points it has chosen to each game client involved in the spawn wave, to allow the elective spawning map to display them. The client will need to send the player’s selection to the server, when they click on a spawn point.

Exceptions to Every Rule

The new spawning system must be able to handle edge cases. An edge case is a situation which is exceptional or out of the ordinary. We needed to take some time to imagine all these possible scenarios and think of the best way to deal with them. Here are some of the edge cases we came up with first:
• What happens if a vehicle is destroyed after you’ve selected it on the elective spawning map? Wrecked vehicles can’t be used for spawning.
• What happens if a mission ends when you are in the middle of elective spawning?
• What happens if you are kicked from a team while in the middle of elective spawning?
These won’t happen very often, but they still must be proactively accounted for and handled appropriately.
Edge cases can be time consuming and sometimes difficult to deal with, especially in testing. But we actually cheated a little to make testing of these edge cases easier - we altered the configuration of the new system so that it spent a full 60 seconds on the elective spawning map! This is nothing like the actual amount of time you will see the map for, but this gave us sufficient time to run through all the combinations we were interested in.

So, perhaps that’s given you a little bit of an insight into the life of a programmer at Reloaded.
Next time…

Friday, May 17, 2013

Things to do in San Paro when you're Dead

We all know that San Paro can be a pretty volatile place to live, but when you're dying and coming back within thirty seconds, death really is more of a speed bump than anything worth writing home about. We figured it'd be pretty great if you could pick where you re-spawn, so over the last couple of months we've been working on a feature called Elective Spawning, which lets you pick your spawn location. We spoke to APB Reloaded's Lead Designer, Qwentle for more information about this latest revolution in resurrection...

Current System

The spawn system in APB: Reloaded has long been a bone of contention for players. It doesn't garner a mention when it runs okay, but when it screws up it can lose you missions and cause massive frustration.

When you die, the current system grabs all the spawn zones in the district, then starts a process of elimination to find the best one for you. First, it removes everything too far away from your death location or teammate locations (we don't want players suiciding to teleport large distances). We then remove any objectives too close to enemies. Once we have this initial list of valid points, we run a formula to determine which of these is the 'best' for you. This weighs positively towards living teammates and objectives, and negatively against enemy players, your death location, and the death locations of teammates. The objective of this system is thus to get you as close to your teammates and objectives as possible, and at the same time far away from enemies and direct death locations.

This can fail in one of three ways. First of all, the system has to use direct distances when determining this, as it would be much too heavy on the server to determine likely foot patterns between the objectives / teammates and the hundreds of potential spawn zones (see below for every spawn zone in the game):

This can lead to situations where it picks a location that's best as the bird flies, but leaves you stranded behind a block or otherwise out of the way; for instance, the piers in Waterfront can be quite bad for this. Here's an image of Waterfront spawn points:

Secondly, there is a potential that the constraints fail to find any valid spawn zones (this mostly happens during large matches in edges of the map). In this case, the system will revert to the original spawn system, which will simply pick the nearest spawn zone out-with 70m of your death location. This fall-back system doesn't take enemy location into account, so may result in you spawning on an enemy. Finally, you can be in a situation where the current spawn zone is the best as far as the system is concerned, due to lots of live teammates nearby and objectives, but you keep dying and it sends you back to the same spot each time. Not ideal...

New System

We've been working on an Elective Spawning System which will allow players to choose where to spawn themselves. At its core, this uses the same set of rules that our current spawning system does, but instead of choosing the best one, it chooses the top five. We have also added an additional rule to remove spawn points close to chosen ones, so once it chooses the first spawn point, it won't pick the one beside it as well.

Now, when you die, you will be returned to a spawn map with a selection of spawn zones. The system still picks a favorite (and it will eventually spawn you here if you don't pick yourself), but if you feel that one of the others is better for you, you can use that instead. During the spawn time, you are free to change where you are about to spawn, and when the timer is up it will spawn you at your chosen point. In addition, you can see where any other dead teammates are about to spawn, allowing you to make tactical decisions about where you want to be.

There is one caveat here. If an enemy gets too close to one of your spawn zones, that spawn zone will be rendered invalid as long as they are close. Any players that have chosen that spawn zone will need to select another.

On top of this system, we have also added Spawn Waves. If you die shortly after a teammate, you will inherit his spawn timer and his choice of spawn points. This will especially help fights in public groups, where players often attack piecemeal. Now, if you all die close to each other, you'll spawn together, which will help increase group cohesion and provide more opportunities for teamwork.

Finally, we've added a fairly major feature to this new system, which is a modification for spawning within vehicles. Any group with these mods in their vehicle can choose to spawn directly into it instead of at one of the other spawn points, as long as the vehicle isn't too close to an enemy, on fire, and has available seats (and to avoid some exploiting, is within bounds). This is a huge change. It potentially opens the game up to be much more heavily based around player vehicles, and hunting them down / protecting them. As such, we need to open this functionality to everyone, so this modification will be unlocked to all players by default, and will also be available on the default starting vehicle.

Next Time

Next time we're going to ask StuartReloaded to explain a little more about the technical side of Elective Spawning. He programmed it and - well, you'll have to wait until next week because things are going to get in depth and they're going to get weird... Trust us, it's gonna be great.

Saturday, May 4, 2013

Songs of the City

We sat down with our very own in-house DJ, music producer, and audio engineer Farfletched for a Q&A session about the APB Reloaded Artist Program, and also to find out a little bit more about this most elusive of developers. The setting for this impromptu interview was Farfletched’s desk at the Edinburgh office of Reloaded Productions.

Can you tell us a little bit about yourself?

My first job in the games industry was with Rockstar North. I managed to bag five days of testing and ended up staying for a year and a half. I had prior knowledge of audio DAWS (going back as Scream Tracker, for those of you in the know) and was producing music at the time. I kind of latched onto the audio department and pitched as much material at them as I could. It was a really good learning experience. After Rockstar came Realtime Worlds. I fell into a QA role on APB: All Points Bulletin before becoming an associate audio engineer. When that ended, I got picked up by Reloaded Productions and hired as a Community Manager. When they realized that they 1) had no audio team, and 2) that I shouldn’t really be allowed near the forums, I became the sole audio engineer on APB Reloaded.

Any other claims to fame?

Mostly from DJ'ing and Producing. Through the years I’ve had the privilege of playing alongside some ridiculous acts: Tiesto, Pendulum, Faithless, Mylo, Underworld, Pete Tong. More recently I’ve released tracks on FUTURECOP! Compilations, and record labels alongside my idols. I’ve also done work on TV adverts and some neat indie iPad games.

What inspires you musically?

An extremely diverse set of places - often it's just an individual sound. I remember watching “The Running Man”, and there was a sound as a camera panned down over the first arena. As soon as I heard it, I knew I had to emulate it and expand upon it. Musically, The Labyrinth Soundtrack / Bowie in general, Giorgio Moroder, Harold Faltermeyer, Retro Chipsounds, and non-generic movie soundtracks like “The Life Aquatic”, “Explorers”, “Mad Max”, “Robocop” etc. I also have a mild case of Synesthesia (seeing notes as colors), so often I feel like making some “Green” that weird?

Can you tell us a little bit about some music you listen to outside of work?

I can do better - here's a YouTube playlist.

What’s the best concert you’ve ever been to?

At the height of the Trance scene I had some amazing nights in Ibiza, Paul Oakenfold at Amnesia spamming the ice/smoke machine. However, the best gig I have ever been to would probably have to be Green Day at the Barrowlands in Glasgow. Crazy crowd, and I spent most of the evening crowd-surfing to the front, being booted about a bit by security, and then I would run to the back and start all over again.

If you could have anyone make a song for APB, who would you have make that song?

A three-way collision between Kavinsky, David Bowie, and Haezer.

Can you tell us a little bit about the Artist Program? What inspired you to give this a try?

The Artist Program is something of an ongoing project at the moment. Player content is the heart of APB:R, and we’re always trying to find new ways to bring really cool player content into the game from our end. Speedball plays a bit part of this, for example. The Artist Program is one of those things that’s as old as time itself. Before we approached bigger bands and record labels, we wanted to try and open the game to bedroom producers and garage bands and give them a shot at the limelight. I’m glad we did, as some of the content we’ve received is nothing short of amazing. All chosen artists will get a mention on our Facebook page and have their tracks appear in the music player in APB Reloaded. It’s all about giving them publicity. Some of them will even get a bit of extra attention when they're chosen as a featured artist.

What exactly is a featured artist?

With each Artist Program update, we would choose one artist to be a “Featured Artist.” Aside from being featured on our Facebook page, the Featured Artist will get plastered on billboards around the game.

So, you’re turning APB:R into an advertisement for someone’s new album?

I don’t think it’s quite like that. It’ll help keep the backdrop of the game fresh, with billboards that get updated regularly. We got a really good reaction from people when we changed up the billboards to feature Mr. Bunnyface and Speedball.

How do you choose the featured artists?

The featured artists will simply be the artist with the best all-around track in each update. Whichever artist has the track that really shines in the game, along with fantastic quality and style, will be chosen as the featured artist.

Music in the background has always been a part of APB Reloaded. Do you create all the music in-game?

Yeah. All the new tracks that have appeared since Reloaded launched were produced by myself. Check out the new sounds at the Joker Store, Gaijin, Myst, Celestial, Rimbaud and Asylum. We’ve got a nice treat in store for people that remember that weird piano conservatory music from Asylum…

Is the Artist Program still taking submissions? What kind of music are you looking for?

Yeah, it’s still open! Give us all your music! All genres! Check out details here!

In a nutshell, all you need to do is submit your track as a Soundcloud link via email to You can only submit one track, but it must be a quality recording, and it must be a completely new creation (no copyright materials allowed). We accept all genres, but as you can imagine some styles have more chance than others…..Drum and Bass > Accordions , Metal > Boy Bands,  Electro House > Latin Ballroom.

If chosen, you will enter into a non-exclusive agreement with GamersFirst, which basically means that your track still belongs to you, but you are giving us permission to use the track in APB:R and affiliated products.

What’s your guilty pleasure track? (C’mon, we all really love Britney, so just admit it…)

Munamies – Pomppufilis (the hook at 28 secs in makes me smile EVERY time)
Also, I wouldn’t pass up a little bit of Perfume – Electro World (when no one is watching)

So there you have it. A little look into the mind of Farfletched. He's a pretty cool guy and someone that everyone should give their music to.