Author Archive

Synchronous AJAX

March 6th, 2017 Comments off

Calling all userscript developers: synchronous ajax (on the main thread) is bad, news at 11. We will soon trial blocking the use of jQuery’s async: false on the public beta and eventually live worlds. If you use this legacy feature, please rewrite your userscripts so all ajax calls are asynchronous.

Converting synchronous code

No ajax calls need to be synchronous. The easiest way to convert synchronous code to asynchronous code is to use ES2015’s promises and ES2017’s async functions, now supported by Chrome, Opera, Firefox 52, Safari 10.1 and soon Edge (currently insiders only). These two functions perform the same task:

var currentlyUpdatingLogs = false;
async function updateLogs() {
    if (currentlyUpdatingLogs)
        throw "Don't read the logs twice at the same time!";
    currentlyUpdatingLogs = true;
    var newLogs = [];
    for (var pageNum = 1; existUnreadLogs(newLogs); pageNum++) {
        Array.prototype.push.apply(newLogs, await getPageOfLogsAsync(pageNum));
    var logs = getSeenLogs();
    Array.prototype.unshift.apply(logs, newLogs);
    currentlyUpdatingLogs = false;
function updateLogs() {
    var newLogs = [];
    for (var pageNum = 1; existUnreadLogs(newLogs); pageNum++) {
        Array.prototype.push.apply(newLogs, getPageOfLogsSync(pageNum));
    var logs = getSeenLogs();
    Array.prototype.unshift.apply(logs, newLogs);

Can you spot the difference? Aside from a guard to avoid the function being called again mid-execution while idly waiting for a http request, there are only two:

  • The function declaration has the keyword ‘async’ inserted before it.
  • The call to get a page of logs has the keyword ‘await’ inserted before it.

There is generally very little refactoring required. You can see a demo of this function here. It’s also possible to emulate async functions by using generators, which are supported in more browsers. There is an example of this in the TW Best Friends userscript here.

Thanks in advance for doing your part to keep The West fast and responsive for our players 🙂

Categories: Uncategorized Tags:

And the Lord gave unto Moses two tablets…

November 30th, 2016 4 comments

Facebook users, rejoice, for this is not a drill: in Version 2.47 we will introduce a number of usability improvements for tablet and smartphone users. Using the latest advances in web technology, we hope to make the game work smoothly with both mouse and touch input. The game will continue to work best on large screens (such as those of the Surface Pro and larger iPad Pro model) but even phone users will reap some benefits from our latest push.

The West ? Scrollbars

  • Mobile browsers will now load the game at our minimum supported resolution of 1024px instead of the default 980px, avoiding a horizontal scrollbar at 100% zoom.
  • Ever noticed a vertical scrollbar after opening your inventory? Poof – it’s gone too!

Window Management

  • The quest tracker/notepad will now be minimised by default if your browser is 1024 scaled pixels wide or less. Additionally, the default position will be saved locally instead of syncing to the server, so the window won’t start off in the Never Never if you login using a computer with a narrower screen.
  • Windows will be repositioned more rationally when the screen changes size, for example when an onscreen keyboard appears.
  • In supporting browsers (see below), windows can be repositioned by dragging their title bar with one finger.

Safari is the New IE

Internet Safari Explorer logo

The artistic work of Jacob Rossi.

Unfortunately, some of the best changes I’ve saved for last are reserved for users of Microsoft Edge, Chrome 55 for Desktop/Android, Opera 42 for Desktop/Android and eventually Firefox for Desktop/Android. The notable omission is Apple Safari and all derived iOS browsers. In 2007, with the release of the original iPhone, Apple heavily invested in the mobile web. Since then, a number of forces have caused Safari to drop from leader to laggard:

  1. Apple has a vested interest in promoting its own App Store over the web, where it takes a 30% cut of all app revenue.
  2. Safari no longer shares its core engine with Chrome and can’t ride on its coattails with joint development.
  3. All iOS users are monopolised into using Safari’s core engine, Webkit, harming competition and innovation.

Pointer Events, the World Wide Web Consortium specification that drives our touch and stylus support, are not supported by Safari for now. We hope we can fill this gap in the future but please understand that, like with Internet Explorer, this is not always possible in a timely fashion.

Other Touch Support

  • In the pre-battle screen, your fort starting position and target can be adjusted by dragging them with one finger.
  • On devices with a screen width of at least 1366 scaled pixels, the map can be dragged with one finger.

That’s All, For Now…

We hope you enjoy testing these changes on the public beta! If the update is well received we would like to go further and implement additional tweaks for mobile browsers. The suggestions on our radar at the moment include allowing full screen mode as well as improvements to pinning the game to the home screen. Please let us know if you have any others!

Categories: Uncategorized Tags:

It’s the Final Countdown ??

September 3rd, 2016 5 comments

After several months and two test phases on the Polish servers it is almost time to release our changes to fort battles. Thanks to everyone who took part in the testing! It is impossible to please all players of every language but your feedback has helped guide us to a solution we believe will be a solid improvement upon the current situation.

With the next update we plan to implement a minimalist suite of changes from our testing. Compared to the version currently on Polish servers, we will leave the fort battle map’s original sector bonuses almost completely unchanged. Furthermore, defenders will no longer receive an inverse bonus from the flag penalty; instead they will merely receive no penalty from these sectors. Additionally we will slightly reduce the new worker class bonus. This leaves the final balancing changes as:

  • Stamina and hiding for attackers and defenders respectively are swapped with hiding and setting traps.
  • The flag and surrounding sectors provide no penalty to defenders.
  • The flag has a penalty of -10 and the surrounding sectors -5, halved from before.
  • Aiming and dodging add x0.5 to attack and defend values instead of x0.4.
  • Harambe is lost but never forgotten.
  • Workers receive an overall 20% bonus to their attack and defend values instead of 30% from sector bonuses only.

Of course no changes are ever really final. We will continue to monitor their performance over the coming weeks and apply any tweaks as necessary. At present evaluation, the changes satisfy our original criteria except for one element, reducing the likelihood that a battle reaches 55 rounds. That is something we may address in a future balancing initiative targeting damage and resistance calculation but for now we look forward to seeing some hard fought contests between attackers and defenders.

Categories: Fort battles Tags:

Make fort battles great again!

June 6th, 2016 6 comments

After a long stint on the beta servers, last week we finally released our fort battle changes to the Polish servers. The results were very pleasing: defenders once more resembled a well drilled force instead of WW1 conscripts waiting to go “over the top” and workers loudly roared. But as we wave goodbye to the era of fort ownership transferring more easily than the common cold, it is difficult to part with killing all defenders being the preferred method of attacker victory. While the suspense of capturing and holding the flag can lead to some of the most exciting battles, nothing beats the satisfaction of sending your enemies for a nice long sleep. Of course this trade-off is through necessity — if it’s possible to wipe all defenders then capturing the flag is mere child’s play — but what if we could change that?

The core balance behind fort battles is quite simple. The defenders receive aiming and dodging advantages via sector bonuses while the attackers receive numerical and line-of-sight advantages for an even fight. To shift the midpoint of this balance, merely adjust team sizes and/or the fort’s sector bonuses. As you know, this balance breaks down completely once the attackers pierce any section of the fort; defenders are forced to huddle around the flag allowing the attackers to seize the towers and walls. Prevention has been the prescribed cure to date, strengthening the walls to avoid the scenario in the first place, but clearly that also makes the defenders harder to kill. A new approach is needed.

The flag is providing the pictured defender with a bonus instead of a penalty.

A well fortified defender ready for battle. An attacker standing here would be penalised -20 instead.

After a little brainstorming we devised a simple change to make the flag more defensible: invert the aiming and dodging penalties of the negative sectors into bonuses for defenders. (The attackers continue to receive a penalty as normal.) This significantly slows the cascade of defenders being funneled towards the flag only to be killed almost immediately. It also provides leeway to reduce other building bonuses without adversely affecting overall team balance, as requested by our Polish testers. Of course, it is not our intention to add a fifth tower to the centre of the map, so the bonus/penalty to aiming will be lowered substantially to prevent sniping out the gate while the bonus/penalty to dodging remains high.

Besides making for happy Polish players, reducing the sector bonuses of buildings should improve our other metrics. Consider:

  • Reducing the dodging chances of 9 defenders shot at by 50+ attackers has a greater impact than reducing the aiming chances of 9 defenders who can only fire 9 shots collectively per round. This decreases the likelihood a battle will reach 55 rounds.
  • Decreasing sector bonuses increases the relative importance of player skills, which are in competition with health. This encourages players to diversify their skill points.
  • Reducing the effectiveness of the defenders means fewer attackers are required for a balanced fight. This allows us to bring the maximum attacker to defender ratio closer to 1:1.

Despite that, of course, these priorities are secondary and the overall team balance comes first. We cannot allow the defenders to continue to get steamrolled every battle 😉

Categories: Fort battles Tags:

O Come, All Ye Fortful

December 1st, 2015 16 comments

Now that we have released our third suite of changes to duelling, it is time to turn our attention elsewhere. For now our focus remains on fixing bugs, however the next major project is clear: adjustments to the fort battle formula! We plan to focus on five priorities here:

  1. Improve the balance between attackers and defenders.
  2. Improve the balance between all four classes.
  3. Maintain or decrease the chance of battles reaching fifty five rounds.
  4. Decrease the importance of health.
  5. Bring the maximum attacker to defender ratio closer to 1:1.

For this we wish to bring back an old approach from a couple of years ago. The attackers currently enjoy a significant advantage because by placing attribute points in strength, they gain points in both health and their strongest aiming/dodging/resistance skill. Clearly this is unfair for the defenders, who must choose between the two. It also leads to weird flow on effects in battle strategies, which increases the importance of duellers (sniping through the gate) and decreases the effectiveness of workers (not mounting fortifications). Simply removing this advantage should, at least in theory, reverse the series of unfortunate events. With that in mind, we intend to swap the following skills:

  • The attackers will use hiding instead of stamina.
  • The defenders will use setting traps instead of hiding.

These two changes will mean health and leadership become the lone fort skills in their respective attributes, while mobility and dexterity each contain two fort skills. We anticipate this will mean a decrease in the attacking team’s average health and therefore the length of battles. It would also increase the desirable attacker to defender ratio for a balanced battle from about 1:1 back closer to 1.2:1, although likely not quite as high as before. Hopefully the better team will be joyful and triumphant and not always the largest.

Of course, any major changes will undergo significant testing before they reach your local worlds. We are also mindful of avoiding disruption to the fort battle championships. However, in the meanwhile we’d love to know your thoughts!

Categories: Fort battles Tags:

Duelling Changes: FAQ

August 24th, 2015 5 comments

G’day g’day… this thing still works, right?

Over the past few weeks you’ve been eagerly peppering your local community managers with plenty of questions and feedback about the most recent duelling changes released on the public beta. Words always sound better straight from the horse’s mouth, so I’ve compiled a list of frequently asked questions from a developer’s perspective.

How did resistance calculations change?

As in the previous change to the duelling formula, the impact of the secondary resistance skill was adjusted. (That is, reflex against melee duellers and toughness against ranged duellers.) In the 2008 formula, the secondary skill added 50% of its value to the calculations, which was reduced to 25% in the 2011 formula. We leave it to you and your trusty Wyatt Earp Colt Buntlines to estimate the new midpoint for yourselves.

How did the stance bonuses change?

Selecting the correct dodging position no longer attracts a 50% upfront chance of the shot missing entirely. Of course, you will continue to receive a significant percentage bonus to your dodging skill.

How did the other duelling calculations change?

Most of the other changes are inline with the 2008 duelling formula. The internal workings have never been discovered and I’m not about to change that, but most notably look out for less of an emphasis on aiming and dodging in favour of appearance and tactics.

Resistance skills were originally overpowered, won’t they become so again?

This problem has been carefully considered, so the answer is no, provided our estimates are in the ballpark. The previous change to the duelling formula saw melee-resist duellers swing from grossly overpowered to somewhat underpowered. Since we expect many of the other changes to favour ranged duellers, we feel it is appropriate to give resistance duellers a bit of an initial boost. We will make further adjustments as necessary.

Charisma builds were overpowered too, what about those?

That’s debatable. Charisma builds gained popularity amongst soldiers because they play to the strengths of their class bonus, effectively reducing losses while offline, when you cannot actively adapt to your challengers’ weaknesses. (As you know, zero motivation duellers are especially focused on minimising losses; it’s not as critical to experience duellers.) There was no real problem to speak of in other contexts. As the past few years have demonstrated, massively weakening appearance and tactics to address this issue was a mistake, eliminating fundamental diversity in skillsets and tactics. It would be foolish to conflate class and duel balancing a second time.

Okay then, how did you account for soldiers?

So far we haven’t but it’s an issue we’re actively monitoring. Most duellers pick the soldier class because it has always been the only class that provides an in-duel advantage. (The dueller class has had additional convenience bonuses added over the years, though, to account for this.) It would be possible to decrease its effect from 50% to, say, 20%. However, we don’t intend to do so lightly and therefore no changes are being even trialled for now.

When will the formula changes be released?

When we are satisfied they are an improvement for both game design and community popularity!

Are more changes to zero motivation duelling planned?

No, not at the moment. We believe we have addressed almost every reason for zero motivation duelling, shifting the advantages and conveniences in favour of experience duelling. In doing so, we have done our job: providing the mechanisms and mechanics to promote a fun game for everyone. We can’t rule out any further tweaks and adjustments for the rest of time but it wouldn’t be an RPG if we tied strings to the limbs of every player.

That’s all folks! Chuck us a comment if there is something you’d like us to write about 🙂

Categories: Duels Tags: