CLOT Update

Since I’ve been busy waiting for Apple’s website to come up, I’ve been working on an overhaul to the CLOT framework. For those who don’t know, CLOT stands for “Custom Ladder or Tournament” and it’s a way for software engineers to create their own WarLight ladders or tournaments. Ladders and tournaments created by CLOT are very flexible, and can do all sorts of things that the built-in ladders and tournaments cannot. See the original blog post for examples of what it can do.

This overhaul was aimed at making CLOTs easier to test via a test mode, making the code simpler and easier to understand, making the app use fewer resources, and implementing many of the commonly needed features, such as hosting multiple tournaments from a single website or handling vote-to-end gracefully.

You can check out the code at github.com/FizzerWL/CLOT.

Test Mode

If you look in api.py, there’s a line that says TestMode = False. By changing this to True, you’ll enable test mode which allows you to test your app offline using fake data.

In test mode, the app won’t hit warlight.net APIs at all, and instead when the code tries to call an API, it will return fake data. This is useful while building your app since you can easily simulate players signing up and see how games get created with them. You can do things like simulate 500 players signing up to your tournament, which would be very time consuming to do by hand.

When you’ve got everything working perfectly, all you have to do is set TestMode back to False and release!

Easier to Understand

The code has been simplified. First, the Django framework was completely removed. Django is a large framework with lots of features, and CLOT hardly used any of them. It was just overkill for our needs.

Instead, it simply uses the webapp2 framework, which is built-in to Google App Engine (GAE) and it’s the same framework that the GAE tutorial walks you through learning. It’s a lightweight framework that’s very simple. It’s much easier to understand than Django.

CLOT was using Django for forms (making it easy to get input from the user). To replace this, I introduced WTForms which is also pretty lightweight and easy to use. CLOT only uses forms in a couple places, such as first-time setup, so you probably won’t need to mess with it much.

The data storage system was upgraded to use “ndb” in place of “db”. This is Google’s upgraded storage system which has a cleaner API and uses automatic caching when getting entities by key. Also, the GamePlayer table was removed for simplicity, and players are now just stored as a list in the Game table.

Uses Fewer Resources

CLOT now uses a caching layer that causes it to use drastically fewer calls to the database. The goal of this is to run a moderately popular CLOT on Google App Engine and not exceed the free quota. I ran a real-time ladder for seven hours, and it used less than 10% of the daily free database quota.

Implements Commonly-Needed Features

The base CLOT code now does a lot more for you. For example, it allows you to run multiple ladders or tournaments from the same website, whereas before you would have had to build that feature yourself. This involved adding a LOT table (Ladder or Tournament) and mapping all of the games to it.

The app now uses authentication instead of requiring players to copy/paste in their invite token. This allows players to securely add or remove themselves from the ladder/tournament.

If players decline a game or fail to join it before a configurable time limit, the app will now automatically delete the game and count it as a loss for the player who didn’t join or declined.

If players vote to end a game, it no longer breaks the ladder.

CLOT in WarLight 2.0

I’ve mentioned a few times that there are going to be some upgrades to the WarLight APIs once WarLight 2.0 launches. I’ll detail here what’s changing.

The membership rule on the CreateGame API (that CLOT uses), is that you can only use features in games that every player you’re inviting can use. This differs from creating games via the UI, where only the game creator needs access to the feature. For example, if you want to use rounding mode or low luck levels, all players in the game need to be a member, since only members can use rounding mode or low luck levels.

In 2.0, it’s possible for non-members to get access to these features, such as low luck levels or rounding mode. Therefore, when inviting players to a game, as long as they have access to those features, you can use them when inviting them via the API.

Technically, this requirement isn’t changing, it just requires expanding your view from a member/non-member to a more granular permission system. If you want to create a 0% luck CLOT, you need to require that everyone joining the CLOT has access to use 0% luck — it doesn’t matter whether they earned that by leveling up or by purchasing a membership.

When someone is joining your CLOT, you call the ValidateInviteToken API. Today, it just tells you if they’re a member or not. In 2.0, it will tell you exactly what they have access to, such as whether they can use 0% luck or alternative rounding modes.

This means that it will be possible to create CLOTs with non-members using all of the features that WarLight offers to non-members, it just might require that players achieve a certain level before they can join your CLOT.

Also, there’s another related change to the CreateGame API. Today, if you try to use a feature that someone doesn’t have access to, it simply reverts back to the default. For example, if you try to make a 0% luck game and a player doesn’t have access to it, it simply creates the game with 75% luck. In 2.0, it won’t do this, and instead will give you an error message if you use something without access.

This is better if you want to ensure that your settings are being used. You won’t have to worry about some games in your tournament using different settings than others. However, this also means you need to be more careful about letting in someone that doesn’t have access to a feature you need to use, otherwise you won’t be able to make the game. For this reason, you need to be sure and check their permissions before letting them join your CLOT.

Check out CLOT’s getting started guide, and feel free to let me know if you have any questions at fizzer@warlight.net!

Coming soon: Achievements and trophies!

WarLight 2.0 is coming! This blog post gives a sneak peek into one of the new features.

Achievements

I’m sure most of you know what achievements are from other games — these are little rewards you get for doing something good or notable.

Once WarLight 2.0 goes live, players will start earning achievements for various things throughout the entire game. For example, there’s an achievement for winning an FFA game with at least 10 opponents, and another for eliminating three or more opponents and winning a game in a single turn.

Achievements are another way of earning points. Achievements award points based on their difficulty – the more difficult the achievement, the more points you’ll get for getting it. However, most of your points will still come from winning ranked games/tournaments/ladders. Achievement points are just a bonus.

In addition to rewarding accomplishments, achievements also serve as a way to encourage new players to try out all of the features and mechanics that the game has available. For example, there’s an achievement for using an order priority card to kill a stack of enemy units that were attacking an undefended territory of yours on their first move, and another for sanctioning a player with more than ten times your income.

No achievements will require a membership to earn.

Trophies

Achievements are considered things that any player could just go out and do. Trophies, on the other hand, are for tasks that are rare, very difficult, or special in some way. For example, there’s a trophy for achieving rank #1 on the 1v1 Ladder, and another for playing WarLight while it was beta. Trophies are intended to be rare, and most players will probably never get one.

Unlike achievements, trophies don’t actually award points themselves, but they’re displayed prominently on player’s profiles. (Ranking #1 on the 1v1 Ladder would award plenty of points from the ladder, just not from the trophy itself.)

Secret

Like the leveling rewards, I’m not going to reveal a big list of all achievements that are in the game. They should be considered a secret at first. There’s a bunch of really fun ones that I’m holding myself back from revealing here.

Once they’ve all been discovered, they’ll be detailed on the wiki for all to see. Until then, please don’t post any big lists of achievements on the forum. Having achievements pop up as you play the game normally is more fun than treating it as a task list and working on each one in turn. I’m trying to encourage players to treat it the more fun way.

Backfill

Some achievements may be something that you’ve done before 2.0 went live. For the most part, achievements are not backfilled — you will need to do them again to earn the achievement.

However, there are a few exceptions. Some things from the pre-2.0 days will contribute to achievements. In some cases, you will need to trigger the achievement that you’ve already completed. For example, there’s an achievement for getting a gold star on every single-player level. If you’ve already gotten a gold star on every level, you can easily earn the achievement just by re-getting any one of the gold stars (for example, just beat level 1 again). This will cause the game to notice that you’ve gotten all six and award the achievement.

Trophies are different — all trophies are automatically backfilled. If you did anything to earn a trophy before 2.0, it will automatically be awarded when 2.0 goes live.

Coming soon: Points and levels!

WarLight 2.0 is coming! This blog post gives a sneak peek into one of the new features.

Points and Levels

In WarLight 2.0, all players will start at level 1. Any time you win a ranked game, you will receive points. Earn enough points and you can advance to the next level.

The idea of leveling up is familiar to anyone who’s played an RPG. However, WarLight’s leveling system has an important distinction: In WarLight, levels don’t actually make you stronger. WarLight is fundamentally a competitive strategy game, and games will always be won or lost based on your strategy alone. Levels will not do anything that gives you an advantage in a game. It’s just as easy for a level 1 player to defeat a level 30 player as it is for a level 40 player.

Instead of making your stronger, levels will unlock additional features you can use. For example, players can unlock the ability to set the luck modifier when creating games, create tournaments, create games with more than six players, and many other things.

The number of points you get for winning a game is based on the level of opponents you defeated, so it’s advantageous to challenge higher level players. As you may suspect, there will also be other ways of earning points, such as tournaments, ladders, and more.

Having point awards for winning games enhances the WarLight experience since it gives more meaning to winning games than just a tally on profile pages. This makes WarLight games a lot more exciting!

It’s a secret to everybody

Every level has a reward of some kind, so there are a ton of things available to unlock by leveling up (including some for members.) But I’m not going to spill the beans here. The level rewards will remain secret at first so that players can discover them on their own as they level up.

Because of this, some of the new 2.0 features won’t even be announced on the blog right away. You’ll have to level up to discover them.

Eventually, the level rewards will all become common knowledge and they’ll all be listed on the wiki. However, until that happens, please don’t post any big lists of level rewards on the forum. This makes it more fun for players who are leveling up for the first time and want to discover them as they go. Discussing them one at time is fine, just don’t post any comprehensive lists for a while.

Grandfather clause

Some of the level rewards are things that players get by default today. For example, in 2.0, players have to unlock the ability to create games using multi-attack, but prior to 2.0 everyone was able to use multi-attack right away.

All accounts created before this announcement will be considered grandfathered. All grandfathered accounts will automatically have access to all of the features that used to be given by default. This is done so that nobody loses anything when 2.0 goes live.

Because of this, if your account is grandfathered and you unlock a level, you will sometimes see a message that says “You already have the reward for this level.”

I hope you’re excited as I am for WarLight 2.0!

Season X

Congratulations to brisk for winning Season IX! It was a hard fought season that came right down to the wire, but brisk pulled out a victory with an impressive 17-3 record.

Season X will be a departure from the 1v1 seasons we’ve had up until this point. This marks very first time that WarLight has ever had an FFA (free-for-all) ladder!

Season X will be a four-player FFA on the Four Castles map:

Settings

TAKE NOTE: The boot time is lower in this season than normal. This season will use a 2-day auto boot instead of the usual 3-day auto boot. This helps ensure the games progress at a decent rate. If you’re going to be gone for more than two days, make sure to activate a vacation. Also, please don’t intentionally drag out games. We need everyone’s cooperation to ensure we get through most of these games before the end of the season. If you see someone intentionally playing slow in this season please report them to me.

Each player will start in their own castle for fairness. Surrenders must be accepted, so any player can veto someone trying to leave early. Army cap is enabled at 15x, which prevents players from stockpiling armies forever which could cause the games to drag out too long. (Essentially this means if you stockpile armies for more than 15 turns you’ll be forced to attack someone)

Everyone starts with a blockade card and can earn more rarely. Recon, priority, delay, and reinforcement cards are awarded regularly. Diplomacy card is also present, but rare. There will also be one random card piece per turn, so you won’t be able to predict exactly what cards your opponents have.

Check out the settings with this template: multi-player, single-player.

The season will start on Tuesday at midnight GMT (which is really Monday night for those in negative timezones). If you participated in Season IX, but don’t want to participate in Season X, be sure to leave the ladder before it starts.

Mechanics

Since this is the first FFA season, there are a few adjustments. First, there will only be 12 games in the season, not 20, since the games take a bit longer to play. However, the rate at which games are given out won’t be adjusted, so most games will be created early in the season so that they have time to finish.

The ratings are still calculated with a Bayesian ELO like they are now. Each 4-player FFA game gets fed to the ratings algorithm as three 1v1s, where the winner defeated each one of the three losers. Therefore, there is no second place, and all players should be trying to win at all times.

Also, there’s a chance that this season could finish after WarLight 2.0 is live (I’ll try for it but I can’t promise). If that happens, the people who do well in this season will be very pleased. Good luck!

WarLight 2.0 is coming!

There’s a major update to WarLight coming! And it’s going to be awesome!

WarLight will soon be upgraded to 2.0, which will be the biggest update to the game since 1.0 released over two years ago.

A big part of 2.0 will be the official release of the mobile client, which will allow playing from iOS and Android devices. However, the mobile client is not the only thing coming in 2.0 — there will also be changes and improvements to the website.

One of these changes is that the site will start showing advertisements to non-members. I’ve never been a huge fan of advertisements, but this change is unfortunately necessary. WarLight has, so far, never been able to be profitable under the membership revenue model, and at some point that needs to change. The site costs over $1,000 every month just to keep the servers running, and less than 5% of players purchase a membership.

By showing ads to non-members it provides two paths that players can take: You can either purchase the game (i.e. a membership), or play for free and see ads. I intend for the ads to be as unobtrusive as possible.

Along with this change, there will be ways for non-paying players to gain access to many of the features that are restricted to members today. More details on this will be announced later.

In the end, I believe that most non-members will be happy with the new WarLight, as they’re going to be getting a lot more from the game than they are now.

Stay tuned to the blog for more information about what else is coming in 2.0!

Mobile update 1.16.3.1

WarLight’s mobile client has just been issued an update to version 1.16.3.1. This is mostly a bugfix update. If you’re beta-testing the Android or iOS version of WarLight, you should update to this version.

Here’s a list of what’s changed:

– When starting a single-player level you previously abandoned, the game now prompts you if you want to resume your previous game.
– Added a “Previous Page” link to the My Games screen.
– Fixed the tutorial map, which was using an old version that had a missing connection.
– Fixed a bug that caused an error on maps that had broken bonus links such as the Europe Big map. (This fix may not appear immediately after the update since all maps need to be re-processed which will take several hours.)
– Android: Fixed a bug that caused an error when loading games on some devices.
– IOS: Fixed a bug on retina devices that caused the orders list to render incorrectly.
– IOS: Fixed a bug that could cause the bottom half the screen to be black after closing the software keyboard.
– IOS: Fixed a bug that sometimes caused the Common Games page to give an error.
– IOS: Fixed a bug that was slowing down the Settings page.

Site and mobile update 1.16.3

WarLight has just been updated to version 1.16.3! This is primarily an update to the mobile client, however a few changes snuck into the website too.

This update also marks the point where the mobile client graduates from alpha to beta! This simply means that the features in the app now are mostly the same features that it will be officially released with. I may have been inconsistent in using the word “beta” prior to this, but officially it was alpha before and beta now.

If you’re a member with an Android device and have been holding back on trying the Android app, now is the time to give it a whirl! Let me know what you think at fizzer@warlight.net.

Website Changes

  • The “Do you want to attack your teammate?” dialog no longer comes up when issuing repeat attack orders. For example, if you order armies to transfer to your teammate from A to B, then click A to B again, the game will assume your teammate answer is the same as when you first entered that order. You can still change it by altering the “treat teammates as enemies” checkbox.
  • The server now allows games to be created on versions of maps that have been superseded by newer versions (retired). You still can’t create a new template with a retired map, but if you already have one, you can now use it. In other words, you aren’t forced to use the newest version of a map if you don’t want to and happen to have a template already using the older version.
    This also helps to ensure that CLOTs aren’t broken just because somebody updated a map. The CLOT creator can choose to update his template to the new version, but they don’t have to.
  • Fixed a bug when watching the AI play itself in single-player that caused it to just skip to the last turn.
  • Fixed a bug that gave a misleading message if you tried to play a diplomacy card on someone who just got booted.
  • Fixed a bug that caused the letter “T” to appear in the chat box when using the “T” hotkey.
  • Fixed a bug that caused the invite list and black list buttons to appear on your own profile.
  • Added code to prepare for Season X.

Mobile Client Changes

  • Added players summary, below the orders list on the expandable right-column. This is similar to the Players section in the lower-right hand corner of the website; it shows the list of players in the game, accept surrender buttons, etc.

    This only appears when viewed on a device with enough vertical space. Depending on how big your device is, it may or may not appear, or it may appear in one orientation and not another. It will most likely never appear on phones, unless it’s an extremely large phone. On medium-sized tablets, like the Nexus 7 or iPad mini, it may appear in portrait orientation but not landscape. On a normal iPad or large Android tablet, it will appear in both orientations. When it’s not present, a “View Players” button appears in its place, so that you can still get used to going to that area to see the players.

  • Added advertisements for testing, just to ensure they work. They’ll appear at the top of every page. If they don’t show up on your device, or cause other problems, please let me know.
    Once you get tired of them, you can turn them off under Settings, and they’ll stay off once you turn them off. It was necessary to default them on, otherwise nobody would turn them on and I need to make sure they work on a wide range of devices.
  • Overhauled the look of the main menu.
  • Added the introduction balloons to the single-player levels.
  • Added the tutorial.
  • Added question-mark links next to the phases (deploy, attack, confirm) to help new players.
  • Added help menu.
  • The text at the top of the nudge/boot screen now scrolls.
  • Fixed a bug that caused the map to move erratically when zooming in.
  • Fixed a bug that caused errors on maps with bonuses that used non-ascii characters, such as the Concrete Complex map.
  • Fixed a bug that caused AIs to not play themselves in single-player games.
  • Fixed a bug that caused errors when using single-player’s Custom Game in rare cases.
  • Fixed a memory leak.
  • Android: Fixed a bug that, on some devices, caused text boxes to lose focus after the software keyboard came up.

Members: Sign up to beta test WarLight on iPhone, iPad, or iPod Touch

EDIT: We have all the testers we need for now. Thanks for everyone who applied!

If you’re a WarLight member and would like to be a beta tester of WarLight’s mobile client, now is your chance!

However, due to Apple’s restrictions, space is very limited. Not everyone will get in. So please only apply if you want to help improve the app, and are willing to share your experiences of using the app with me. Sharing your experience helps me improve the app, which is the primary goal of having beta testers.

If you’re not interested in providing feedback and just want to play the game on your device, you will need to wait until the app is officially released or switch to Android, where all members are allowed in since it’s not bound by Apple’s restrictions.

All iOS devices that are running iOS 5.0 or higher are supported. The first invitations will be sent out as soon as the upcoming 1.16.3 release is ready (hopefully in about a week).

If you applied before…

If you’ve applied to be a beta tester before and did not get in, feel free to try again. More space has recently opened up, so the bar is slightly lower. Please be sure to read the application page carefully, as the most common reason that players didn’t get in was not following the instructions precisely.

If you were an alpha tester…

If you’ve tested WarLight on iOS before, and are no longer a tester due to switching devices, feel free to apply again now. I will review the feedback you sent the first time, so you don’t need to submit as detailed of an application as the link above requests.

Season IX

Congratulations to Heyheuhei for winning Season VIII!

Last season was unique since the winner only completed 17 games (20 is the norm). Players who complete fewer than 20 games get a penalty of 40 rating points per game. This penalty isn’t too visible in the ratings since it’s not assessed at the end of the season (otherwise there would be a big jump at the end.) Instead, it’s implemented by simply giving 40 points to each player every time they receive a game, up to a max of 20 games. This is also why ratings tend to always go up as the season goes on.**

The purpose of this penalty is to prevent abuse. For example, if someone started off a season 15-0, they might get the bright idea of leaving the season to avoid having to face any more tough opponents. This shouldn’t be advantageous, since it prevents other players from getting their chance at taking on the champion.

For future seasons, this penalty is being increased from 40 to 65. However, I want to be clear that I don’t think Heyheuhei did this on purpose (since when has HHH ever refused a game?) This change is just being made in case someone else saw what happened and thought they might use it to their advantage.

Season IX

Season IX will use an elevated defensive kill rate – 85% instead of the normal 70%. This means when attacking, attackers suffer worse losses than normal. This marks the first time that a ladder has used alternate kill rates. It’s up to each player to figure out how to adjust their strategy.

Season IX will also continue to use the randomized bonus values that Season VIII did, with one exception: The zero-bonuses in Korea, Hawaii, Alaska and Japan are no longer randomized and will always be 0. All other bonuses, just like before, will have a 1/3rd chance of being increased by one, a 1/3rd chance of being decreased by one, and a 1/3rd chance of remaining unchanged.

Also changed from last season are the luck values. The luck percentage is now 0% instead of 16%, but rounding mode is still weighted random. Move order has also been changed to cyclic.

You can check out the settings with this template, however the randomized bonuses will not be present: multi-player / single-player.

The season begins on Tuesday at midnight GMT. (Which is really Monday night for those in negative timezones.) Good luck!

Have an idea for a future season? Let me know!

** It’s worth noting that this extra rating bonus does not impact matchmaking. Determining who you get matched against gets done before this rating bonus gets applied, so this mechanism does not penalize players who join late, as long as you get 20 games before the season ends.

Site and mobile update 1.16.2

WarLight has just been updated to version 1.16.2! This blog post describes what’s changed.

Updated UI

The first thing everyone will notice is that the UI of the left and right columns of the main game screen received some improvements. This is just one small part of a larger UI overhaul that was done to the mobile client, which itself received lots of updates throughout the app.

The new website UI provides a fresh look and also fixes a few minor visual issues. The game name now fits within the left column and won’t overlap the map anymore. The turn number is now easier to spot. The gradients that used to exist in the lower corners are gone, as they always looked strange when overlapping the map (this was most noticeable when the right column was unpinned.)

Surrender Prompt

When surrenders are available to be accepted, the game now pops-up a message asking if you want to accept them, instead of requiring your to click the Accept Surrender button in the lower-right. This prompt is simply a convenience, it does not change the surrender mechanics at all.

This helps for cases where there are a lot of players and you may not have seen the accept surrender button due to the players section scrolling. It also helps when multiple players surrender at once, as it can automatically accept all surrenders instead of requiring you to click Accept Surrender for each player. Additionally, it’s big help for players who play with the right column unpinned, as they wouldn’t notice the surrender button appearing.

The primary motivation for adding this feature is for the mobile client, where there isn’t room for an Accept Surrender button on the main screen like there is on desktop computers.

Improved Common Games

When viewing another player’s profile, there’s a link that allows you to see games that you played in common with them. This page received some improvements in this update. In addition to showing the game name, it now also shows the team makeup (1v1, 2v2, FFA, etc.) and the game’s date.

Misc Improvements

– If you don’t get your normal color in a game, but on the first turn of the game repeatedly try to deploy to territories that are your normal color, the game now kindly reminds you that those aren’t your territories. This fixes the “I can’t deploy” bug.
– Fixed a bug when creating games that sometimes caused the map thumbnail to not appear.
– Fixed a bug that prevented the escape key from being able to close the Analyze window.

Mobile Client Improvements

– Added a chat button alongside the game’s menu button. This allows you to see it when it flashes, and also brings the UI closer to parity with the Flash version.
– Added a “Skip” button while watching turns play out.
– When in landscape mode, the menu button is now in the bottom-left corner instead of the top-left. This maintains parity with the Flash version and portrait mode.
– Re-designed the button style slightly.
– Added a cards button for tablets, as well as labels on the three phase buttons.
– Added the ability to view other player’s profiles, which includes the ability to add or remove them from your invite list and see games that you shared in common. The only things missing are the ability to see favorite maps and ranked games stats.
– Added support for the blacklist. Players who are on your blacklist now get their chat hidden and little “B”s over their names on the My Games page.
– When viewing history on a manual distribution game, your picks are now shown by default.
– Nudge/boot is no longer shown on the menu for single-player games.
– Fixed a bug when creating games that prevented map changes from taking effect.
– Android: Fixed a bug that caused the app to consume more CPU and memory than it should have, sometimes even when the app was closed.
– Android: Fixed a bug that sometimes caused the screen to re-size itself incorrectly when rotating your device.
– Android: Fixed a bug that caused moving the attack/transfer dialog around on tablets inconsistent.
– IOS: Fixed a bug that caused some big maps to render incorrectly.
– IOS: Fixed a bug that caused things to layout incorrectly if you started the app while your device was in landscape orientation.

CLOT Improvements

CLOT is a way for players to make their own Custom Ladders Or Tournaments. The CLOT system has received a couple of improvements in this update.

First, it’s now possible for CLOTs to create games that use open seats. However, when doing so, a member-only prerequisite must be used on the open seats. See the Create Game API for details.

Second, CLOT now has an authentication system. Up until now, CLOT creators had to choose between allowing any player to add any player to their ladders (as unknownsolider did), or only allowing themselves to add or remove players from the ladder (as ps did). The problem with the former is abuse, and the problem with the latter is that it creates extra work for the CLOT creator.

CLOT’s new authentication system gives a third option where players can securely add or remove themselves from the ladder, as well as do anything else a CLOT creator can dream up. See CLOT Authentication for details.