Experimental feature: Orders are now saved

WarLight was just updated with a new feature: If you start taking your turn in a game, but then close it without committing, your orders are now saved locally on that computer.

If you open the game again later, the orders you entered will be restored. If you don’t want them, you can click the Start Over button as you could have normally.

This is useful if you’re interrupted and not able to finish your turn, or if you’re not sure what to do and want to save a game for later. Note that your orders are saved on the device you were playing on, and not the server. That means they will only be restored on that same device — you can’t start a turn on an iPhone and finish it on your computer, for example.

This is also helpful if your computer crashes or accidentally close the game (example: hit your browser’s back button). Orders are saved every 5 seconds, so if your computer crashes within 5 seconds of entering an order, you may have to enter that last one again.

Website update 2.1: Mail, editing forum posts, private notes

WarLight has just been updated to version 2.01.0! This update brings a bunch of new features and improvements to the website, mainly centered around making it easier to communicate with other players.

WarLight Mail

It’s now possible to send messages to other WarLight players! This makes it easier to communicate on the site, especially with players who you might not happen to be in a game with at the time.

There are two ways to send mail: You can visit a player’s profile page and click the Send Mail button. This starts a one-on-one mail thread that both players can reply to. Alternatively, you can visit the new Community -> Mail tab and click Compose New Mail. Then you can select up to 20 players that will all be able to post in the same mail thread. You can think of this like a private forum thread that only the players you select can read or write to.

You can read mail that other players have sent you on the new Community -> Mail tab. Additionally, when on the single-player or multi-player tabs, there is a small envelope icon in the top-right corner that will blink when you have mail you haven’t read yet.

This new system is called Mail or WarLight Mail to help differentiate it from the other ways of communicating. WarLight has lots of ways of communicating: public chat, team chat, private messages, the forum, and the chat room. I didn’t want to call it “messages” or “chat” since those terms are already used elsewhere on the site and could cause confusion.

By default, if someone sends you WarLight mail and you don’t read it within 15 minutes, you’ll get an e-mail notifying you. You can control this email on the Settings tab.

Editing Forum Posts

You can now edit posts you’ve made on the forum! Next to any post you’ve made, you’ll find an edit button that lets you change it. You can edit any post as long as the thread hasn’t been idle for more than 30 days. Threads that don’t receive any new posts for 30 days can’t be replied to or edited.

As part of this change, much of the forum code has been re-written, so you’ll also notice other minor differences in the way the forum acts. Behind the scenes, the forum is actually stored in an entirely different database and data format now which should make it more extensible for the future.

Previously, forum posts older than 6 months were automatically “deleted”. This is no longer the case — forum posts now stick around indefinitely. Additionally, most of the old forum posts that were “deleted” have now been restored, as they were never actually deleted (I always kept a backup). You can now go browse back to the very first forum posts that were ever made! The only posts that weren’t restored are the ones that were in the old Bugs and Features forums since those forums don’t exist anymore.

Private Notes on a Player

It’s now possible to take notes on a player. These are stored for yourself only — nobody else can view them. For example, if you want to write down why you blacklisted somebody, you can do so. Or if you find that another player is an exceptionally good ally, you can write that down as well so you don’t forget.

Just visit a player’s profile and click the Private Notes button. Then you can enter whatever you’d like, or view/edit what you wrote previously.

Invite List renamed to Friends List

Originally, the invite list was named such because it defined which players you could invite to games. As WarLight grew, this became blurred a bit. For one thing, it became possible to invite players who weren’t on your invite list via the Search feature. Additionally, the invite list was used for more and more things, such as gifting memberships, teaming up on the ladder, and now sending mail. These things aren’t really “inviting” per se, so the name is a bit dated.

After much deliberation, I decided to just rename it to the friends list. The concept of a friends list is familiar to most people since it’s commonly used by most sites with a community. Of course, WarLight’s isn’t a perfect 1:1 match to what most sites call a friends list, but it’s close enough.

If you see anyplace that it’s still referred to as the invite list, please let me know! But I hope I changed them all.

Blacklisting a player removes you from their friends list

If you blacklist a player, it now removes you from their friends list (previously called invite list.) It also prevents them from adding you back.

This helps for cases where someone is inviting you to something and you don’t want them to. By blacklisting them, you now won’t appear on their list of tournament invites, for example. It will also prevent them from creating new mail threads with you.

Misc Changes

– When creating custom scenarios, it is now possible to set the contents of an entire bonus at once. Just select the bonus via the bonus link and then type in the new value on the left.
– The achievements list now shows you 5 acheivements that you don’t currently have. This also provides a way to know if you’ve unlocked every achievement, as this section will be blank if you have them all.
– The text on some achievements was changed so they have consistent tenses (“Won a game” to “Win a game”, “Rated a map” to “Rate a map”)
– When you earn an achievement from a game, the Points page now shows which game you earned it in. Additionally, the in-game popup won’t appear until after you’ve watched the turn for that game. This avoids spoiling what happened. This only happens for achievements earned after this update.
– CLOT: The ValidateInviteToken API can now be passed a list of template IDs to verify if that player has access to those templates. This makes it easier for a CLOT to determine if it should let a player join or not. See the wiki for full details.
– Forum posts with wide images now use scrollbars instead of growing the table. This is done to ensure that posts can’t overlap ads.
– Negative sanction cards can no longer increase a player’s income above 10,000. If incomes get too high, it often causes overflows which break the game.
– Fixed a bug in games with the Army Cap that prevented the “You’ve reached the army cap” message from appearing.

Points from ladders

WarLight’s ladders are a great way to earn points! Up until now, the formulas that the ladders use to give out points have not been revealed. This blog post reveals it all.

All of the ladders award points to players who are rank 30 or better. However, they do it at different times — the 1v1 and 2v2 ladders award points every 24 hours, whereas the seasonal ladder awards points when the season ends. This reflects the goals of each ladder. In the seasonal ladder, your goal is to achieve the highest rank at the end of the season (mid-season ranks don’t matter.)

The number of points they award is based on this formula: (31 – rank) ^ 3 * 0.6 + 1000. This gives about 17k to the #1 rank and 1k to the #30 rank.

The seasonal ladder also multiplies this by the number of days in the season. This means that all three ladders award the same amount of points over time. (Although technically, the seasonal awards slightly fewer since we usually take a few days off between each season.)

2v2 ladder

The 2v2 ladder is especially ripe for giving out points! Since it awards points to all teams rank 30 or better, and the there are currently only has 26 ranked teams, you can earn points even if your 2v2 skills aren’t quite legendary yet. If you’re a member, now is a great time to grab a partner and improve your 2v2 skills on the ladder.

WarLight app now on iOS, and 2.0 is complete!

The WarLight app for iPhone, iPad and iPod touch is now live on the Apple app store! This also means that WarLight 2.0 is now fully deployed and playable on all platforms for free — the website, iOS, Android, and Kindle Fire!



In case you missed it, here’s links to what else is new in 2.0, and a video showing what WarLight is all about:

Initial 2.0 announcement
Points and levels
Achievements and Trophies
Map unlocking
CLOT Changes

Update 2.00.1

WarLight has just been updated to version 2.00.1! This is a small update to both the website and Android client that fixes a few issues. The website changes are live now, and the Android update will begin rolling out in the next few hours.

Changes

– Points given out from winning tournaments increased by 66%.
– Fixed a bug that prevented games with more than 24 players and open seats from starting.
– The “Win on X different maps” achievements now correctly only count wins, instead of just counting any completed game.
– Kindle Fires are now properly detected by the website.
– Ads can now trigger when joining a game at the lobby.
– Mochi ads were removed in favor of Google’s.
– Full-screen ads are now only shown when committing orders.
– When ad-blocker reduces points, the points page now shows this in a tooltip.
– Pressing the escape key during the tutorial no longer causes errors.

– Android/iOS: When clicking chat in a game with private messaging enabled, each player’s color is now shown next to their name.
– Android: Various fixes for specific devices.

AI Offload

This update also contains a change to the way that AIs take their turns in multi-player games. This is mostly a behind-the-scenes change (AIs still make the same moves), but it will have a couple minor things that will be noticeable.

Previously, AI players or humans that were turned into an AI would take their turns synchronously along with the last committing player. This means if you were the last player to commit your orders for a turn, the AI processing would happen while you watched a spinning “committing orders” wait dialog. And when the turn advanced, the AIs had already played their turn (no *’s appeared next to their names.)

Now, the server will let you commit without the AIs playing their turn, and fire off a background task to take the AI turns in the background.

This has a number of advantages. For one, it means the last committing player no longer has to wait as long, which means the game will respond faster.

Secondly, it fixes an issue that comes up sometimes in really big games with lots of AIs and on big maps. In these situations, it can take quite a while for AIs to calculate all of their moves. Sometimes, it takes so long that the server times out and rejects the request. This is a big problem since it basically means the game is stuck — the last player can’t commit or be booted.

Lastly, it also allows me to move the AI processing off of the overloaded web servers and onto cheaper servers. This helps reduce the cost of hosting WarLight. Further, since the CPU is cheaper here, this removes one of the barriers to writing an improved AI for WarLight that makes smarter moves. I don’t know yet when this will happen, but this update is a step towards it.

Because of this change, you may actually see AIs with *’s next to their name, indicating they haven’t moved yet. When everything is working correctly, they should move very quickly (within less than a second.) If you see an AI who hasn’t moved for more than a few minutes, please report it at http://warlight.net/ReportBug (be sure to include a link to the game.)

WarLight 2.0 is now live at WarLight.net!

It’s finally here! All of WarLight 2.0’s features are now live on the website at http://warlight.net!

Releases of the Android, Kindle Fire, and iOS versions will be coming soon, as per the previously announced schedule.

Players will now begin earning achievements and points when playing in multi-player games. Go crazy, and have fun!

Also, check out WarLight’s new promotional video! It’s mostly geared towards new players, but you may find it interesting anyway:

Members who don’t want to see advertisements can turn them off on the Settings tab. If you’re not a member and don’t like ads, you can purchase a membership to play ad-free for life!

In case you missed it, here’s links to the information that’s been announced previously:

Initial announcement
Points and levels
Achievements and Trophies
Map unlocking
CLOT Changes

WarLight 2.0 release date: Wednesday July 31st! (without iOS)

WarLight 2.0 is right around the corner!

Since Apple’s developer website is down, I’ve decided to go ahead and release WarLight 2.0 without the iOS clients. Here’s the planned time table of the release:

Morning of July 31st: 2.0 goes live on the website. Points, achievements, and all new features are all live for warlight.net players.
Later on July 31st: The Android app goes live on Google Play. Android phone or tablet users can download it from Google Play.
The next day, August 1st: The Kindle Fire app goes live on Amazon.com for Kindle Fire users.

The iOS app for iPhone, iPad and iPod Touch users is postponed. Even once Apple fixes their website, which has been down over a week, they still have to approve the app before it can go live. Under normal conditions, it usually takes Apple a week to approve apps, but since they’ll be coming off of downtime, I would not be surprised if review times take much longer than normal.

Other than the iOS delay, I hope you’re as excited for WarLight 2.0 as I am! It’s going to be awesome!

If you missed it, here’s links to the previous announcements that explain what 2.0 is all about:

Initial announcement
Points and levels
Achievements and Trophies
CLOT Changes

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!