Update 5.17: Income breakdown, finish vs AI, mod expansion

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

Income Breakdown Dialog

When playing a Warzone Classic game, have you ever struggled to understand how your armies per turn are calculated? Now with this update, there’s a small question mark button next to your income that explains everything that goes into the calculation.

This is really useful in in the larger or more complex Warzone games since they and have lots of things that can affecting your income such as sanction cards, army caps, bonus armies from territories, cities, negative bonuses, or mods (which is new, see below).

You can also see how incomes are calculated for other players in a game by clicking on their name in the lower-right players panel and selecting the new Income Breakdown button. This button also respects history, so if you open history to a specific turn and then click it you’ll see how their income was calculated at that point in time.

Finish Versus AI

When a multi-player game finishes with territories intact, such as by a surrender, the end game dialog now has a button to allow finish playing this game out versus AI opponents.

This only works when you and at least one opponent still has territories on the map when the game ends. This usually happens in games that are ended by surrender or boot, but not when a game ends by elimination.

This feature was originally added as a preview in 5.15 for members, but now it’s available for everyone!

Mod Expansion

This update also features the biggest expansion to the Warzone mod framework to date! Lots of new features were added to expand what mods are capable of doing, and mod games with non-members are also now 33% cheaper to create!

If you haven’t experienced Warzone mods before, you can read about what they are on the wiki.

Along with the mod expansion, I’m releasing new mods that take advantage of the new features. Part of the reason for making these mods is to serve as examples to mod developers on how to use the new features, however all the new mods are useful mods in their own right that will appeal to Warzone Classic players. Let’s talk about the new mods first, since I know most people reading this blog post aren’t mod developers.

New mod: Forts

When the Fort Mod is enabled, each player will get the opportunity to build a fort every few turns (configurable by the game creator). After building a fort, an icon will appear on the map on that territory so all players know there is a fort there. Any time your opponent attacks a territory with a fort, the armies in the fort (on that territory) won’t be harmed and the attack will be repelled, and the fort will be destroyed.

New mod: Hybrid Distribution

The Hybrid Distribution Mod allows for a game to mix auto-distribution and manual-distribution. For example, a game could have one territory auto-distributed to all players, and the remainders be picked using the normal picking system.

New mod: Gift Armies 2

The Gift Armies 2 Mod is an upgraded version of the normal Gift Armies Mod. In the normal Gift Armies Mod, armies that another player gifts you are randomly distributed on your territories. In Gift Armies 2, the gifted armies are added to your income to the next turn so that you can place them as you’d normally place any armies. Additionally, Gift Armies 2 makes it easier to select the territory to gift from.

New mod: Random Starting Cities

The Random Starting Cities mod distributes some cities around the map at the start of the game. This is intended to be used with commerce games, since cities have no effect otherwise.

Mod Expansion Details

This section is intended for mod developers. If you’re a coder and have never experimented with Warzone Mods before, check out the mod developers guide to get started. If you are familiar with Warzone mods, read on to know what’s new in this update:

  • Mods can now place icons on territories! These structures will persist and save on the territory. This can be done by the Structures property on TerritoryStanding. This can be done at the game start when standings are directly editable, for example:

    function Server_StartGame(game, standing)
    
        local structures = {};
    
        structures[WL.StructureType.ArmyCamp] = 1;
        structures[WL.StructureType.Recipe] = 1;
        structures[WL.StructureType.City] = 5;
    
        standing.Territories[1].Structures = structures;
    end
    
    

    Structures can also be changed mid-game by a GameOrderEvent, for example:

    function Server_AdvanceTurn_Order(game, order, result, skipThisOrder, addNewOrder)
    	local terrID = 1;
    	local structures = game.ServerGame.LatestTurnStanding.Territories[terrID].Structures;
    	if (structures == nil) then structures = {}; end;
    	if (structures[WL.StructureType.ArmyCamp] == nil) then
    		structures[WL.StructureType.ArmyCamp] = 1;
    	else
    		structures[WL.StructureType.ArmyCamp] = structures[WL.StructureType.ArmyCamp] + 1;
    	end
    	local terrMod = WL.TerritoryModification.Create(terrID);
    	terrMod.SetStructuresOpt = structures;
    	addNewOrder(WL.GameOrderEvent.Create(WL.PlayerID.Neutral, 'Creating an army camp', {}, {terrMod});
    

    The list of icon types available will be familiar to Warzone Idle players: ArmyCamp, Mine, Smelter, Crafter, Market, ArmyCache, MoneyCache, ResourceCache, MercenaryCamp, Power, Draft, Arena, Hospital, DigSite, Attack, Mortar, Recipe

    See the Fort mod for an example of this in action.

  • Mods can now modify player’s incomes! To do this, use the new 6th parameter to GameOrderEvent and pass a collection of IncomeMod objects. WL.IncomeMod.Create takes four arguments:

    1. Player ID of the player whose income you want to modify
    2. Number of armies you want to add (or pass negative to reduce their income)
    3. A message that will be visible to this player in the Income Breakdown Dialog. Use this to explain why their income is being modified.
    4. Optionally, you can pass a bonus ID as the 4th argument to require these new armies to be only deployed within a single bonus, like in a Local Deployment game. Or if the 2nd argument is negative, this will reduce armies that were required to be deployed to this bonus.

    Here’s an example:

    function Server_AdvanceTurn_End(game, addNewOrder)
    	local incomeMod = WL.IncomeMod.Create(4569, 5, '5 free armies from the ModNameHere mod');
    	addNewOrder(WL.GameOrderEvent.Create(4569, 'Giving away stuff', {}, nil, nil, {incomeMod}));
    end
    

    See the Gift Armies 2 mod for an example of this in action.

  • Mods can now be notified when players click territories or bonuses on the map! This is useful when you want to prompt the player to pick a territory. Previously, mods would have to pop up a list of territories and require players to click the territory by name. Now, mods can simply instruct the player to click a territory on the map, and the mod will be notified of the player’s next click. Here’s how a mod would use that:

    
    
    function Client_PresentMenuUI(rootParent, setMaxSize, setScrollable, game, close)
    	vert = UI.CreateVerticalLayoutGroup(rootParent);
    
    	TargetTerritoryBtn = UI.CreateButton(vert).SetText("Select source territory...").SetOnClick(TargetTerritoryClicked);
    	TargetTerritoryInstructionLabel = UI.CreateLabel(vert).SetText("");
    end
    
    function TargetTerritoryClicked()
    	UI.InterceptNextTerritoryClick(TerritoryClicked);
    	TargetTerritoryInstructionLabel.SetText("Please click on a territory.  If needed, you can move this dialog out of the way.");
    	TargetTerritoryBtn.SetInteractable(false);
    end
    
    function TerritoryClicked(terrDetails)
    	TargetTerritoryBtn.SetInteractable(true);
    
    	if (terrDetails == nil) then
    		--The click request was cancelled.   Return to our default state.
    		TargetTerritoryInstructionLabel.SetText("");
    	else
    		--Territory was clicked
    		TargetTerritoryInstructionLabel.SetText("Selected territory: " .. terrDetails.Name);
    	end
    end
    
    
    

    See the Gift Armies 2 mod or Fort mod for examples of this in action.

  • Mods can now assign territories to players in the Server_StartDistribution hook. See the Hybrid Distribution mod for an example of this in action.
  • Added a function Added WL.IsVersionOrHigher that checks what version of the Warzone client the player is using. It’s necessary to call this before using a feature that was added in this update, since if a player has not updated their app it’s better to give them a message letting them know they need to update than to simply have your mod crash. Here’s an example of how you would use it:
    
    if (not WL.IsVersionOrHigher or not WL.IsVersionOrHigher("5.17")) then
    	UI.Alert("You must update your app to the latest version to use this mod");
    	return;
    end
    
    

    Since this function doesn’t exist prior to 5.17, the absense of this function is the proper way to know that the version is less than 5.17. That’s why this code snippet needs to have the “not WL.IsVersionOrHigher” condition.

  • Increased the allowed rate of custom messages by 6x. This makes it possible for mods that send custom messages to send many more before hitting the rate limit.
  • Added a new parameter to the “addNewOrder” function in Server_AdvanceTurn_Order that lets you skip your added order if the source order itself gets skipped by another mod. This is important for some mods, such as the medics mod.

Other Changes

– Mods: Reduced the cost of non-members playing in coin games by 33%.
– Website: Fixed bonus links not being clickable in the map designer after editing a bonus.
– Website: Fixed tournament chat messages duplicating when pressing enter multiple times.
– Idle: Pending clan requests are now deleted if a player finishes that level before it’s filled.
– Idle: Fixed market numbers not updating on the main tab when a purchase was made.
– Idle: Fixed update dialog inserting duplicate columns.
– Unity: Fixed errant Reply button on forum list.
– All: Fixed length limit on profile bios.

8 thoughts on “Update 5.17: Income breakdown, finish vs AI, mod expansion”

  1. I played a commerce game and when I built 2 and 3 cities on territories, I only saw 1 city icon moving to the left. From 4 cities it was as normal, a 4 with the city icon. Could you fix this, please?

  2. Income Breakdown Dialog is awesome … BUT … can you implement it so that it can be used not just during the game while in distribution mode, but after the game is completed to be able to analyze various positions through the match from perspectives of any given player?

  3. CORRECTION: Income Breakdown _does_ work during game review mode!

    Just instead of hovering over the “?” in the top left, you click on the player’s name in the player box in the bottom right, then click “Income Breakdown”.

    AWESOME UPDATE, thanks.

  4. This is fantastic. I love the idea of the income analyzer to more easily see which of your opponents are messing with you!
    Also, a little plug for my buddy, Just_a_Dutchman. He has been building some awesome new mods that take advantage of these new features. I’m having a blast helping him test them. The mod to simplify large local deployment games is a godsend.

Leave a Reply to krunx Cancel reply

Your email address will not be published. Required fields are marked *


*