Ideas on introducing Lanchester equation into SLG games

Ideas on introducing Lanchester equation into SLG games

[[147326]]

The Lanchester equation has always been used in large-scale sandbox battlefield simulations, and can accurately calculate war casualties and losses. Imagine using this in strategy games, so that strategy games are no longer simple attribute collisions, will it bring a more realistic and intuitive experience?

1. Introduction to the Lanchester equation (from Wikipedia, Baidu Encyclopedia)

In 1914, British engineer FW Lanchester first proposed his famous Lanchester equation in his article "Aircraft in Combat", which was a study of the best organization of air combat units.

It was initially used to analyze the casualty ratio between the two sides during a battle, and its use was gradually expanded.

Lanchester simplified the battle into two basic situations: long-range firefights and close-range concentrated firepower killing. In long-range firefights, the loss rate of one side is proportional to both the opponent's strength and its own strength, which can be expressed as a differential equation:

dy/dt=-a*x*y

dx/dt=-b*x*y

Among them, x and y are the number of combat units of the Red Army and the Blue Army respectively, and a and b are the average unit combat power of the Red Army and the Blue Army respectively. Therefore, the condition for the two sides to be equal in strength is:

a*x=b*y

2. Brief summary

In close combat, the number of units participating in the battle on either side is proportional to the combat efficiency of the participating units, which is generally referred to as Lanchester's linear law;

(In ancient warfare, in a phalanx of heavy infantry armed with spears, one soldier could only attack another soldier at the same time. Each soldier could only either kill the opponent or be killed by the opponent, so the loss after the war would be the difference in numbers between the two troops, with no difference in weapons (combat effectiveness).)

[[147327]]

In long-distance combat, the number of units participating in the battle on either side is proportional to the square of the combat efficiency of the participating units, which is generally referred to as the Lanchester square law.

(For shooting weapons, when aiming and shooting at long distances, they can shoot at any enemy in the enemy line, and will also be attacked by any enemy in the local line. At this time, the ratio of the army's consumption will be related to the number of firepower on both sides (assuming there is no difference in combat power). Lanchester believes that the strength of such an army is not only related to the number of troops, but to the square of the number.)

[[147328]]

When the combat effectiveness of both sides can be quantified, the advantage of the stronger side increases exponentially with every increase.

Let's take a simple example to illustrate:

2,000 German tanks besieged 1,000 Soviet tanks. Assuming that the performance of the tanks on both sides is exactly the same and neither side has a commander, the question is: How many tanks will the German army lose before it can completely wipe out the Soviet tanks?

The answer is a loss of 268.

The calculation is as follows:

sqrt(a*X^2-b*Y^2)=sqrt(2000^2-1000^2)=1732

2000-1732=267.9=268

3. Application ideas for SLG games

I was discussing a popular SLG mobile game with a friend. Although there is no combat performance, I still enjoy playing it, so the numbers are particularly important. I think there are some things we can talk about, such as the relationship between this equation and the game, and what kind of different feelings it can bring to the game, as well as the scalability of the equation.

Let's start by building a simple model.

rule

  • Restraint coefficient relationship

  • Bow Knight

  • Rider

  • Bu Ke Bow

  • This is a casual shot, the restraint coefficient is 1.2

This coefficient is directly used to quantify other unstable factors in the equation, such as range, movement speed, difference in health of soldiers, attack speed, etc. The consumption of troops or supplies is assumed to be natural loss by default. (The restraint coefficient can be equivalently offset: 1 infantry = 0.8 archers = 1.2 cavalry)

Combining the above conditions, we can determine an idea, which is to unify the model as much as possible, use the restraint coefficient and then use the equation to calculate the battle results. Since this is a game and not an actual battle, we can define it very subjectively. Every unit in the game can play its role from beginning to end in every battle, so the square law is used here and the linear law is not involved.

First the simplest one:

Infantry 10 VS Infantry 10

Under the premise of unification, there is no doubt that they will be evenly matched.

Here's an added advantage for one side:

Infantry 10 VS Infantry 11

sqrt(11^2-10^2)=4

By increasing the strength by one, you can save three more infantrymen.

3000 Archers VS 1500 Infantry

sqrt(a*X^2-b*Y^2)=sqrt(3000^2-0.8*1500^2)=2683

To make it easier to understand, a represents the quality of archers, x represents the number of archers, b represents the quality of infantry, and y represents the number of infantry.

3000-2683=317

Next, let’s look at more complex troop battles.

If the Lanchester equation is used strictly in a melee, the formula would be something like this:

But games are games, and no matter how complicated the formula is, the experience it brings may not be very good. Here Xi(t) is the combat force of the i-th type of party X, and Aij is the damage coefficient of the j-th type of weapon of the y-th party to the i-th type of target of the x-th party. The following can be deduced by analogy, and then the distribution matrix coefficient (I won’t write it down to avoid being criticized. If you are interested, you can continue to deduce~)

Simply using model conversion can more easily deduce the results:

First, the initial model is defined as the type of troops that account for the largest proportion of the troops on both sides;

The lost arms are distributed according to the maximum ratio between the lost strength and the original strength.

(This can be more complicated, for example, if infantry casualties are less than 30%, no archers will be lost, or if there are cavalry, if infantry casualties are 20%, archers will start to be lost, etc., in order to bring a more realistic experience)

A side has 1000 archers and 1500 infantry VS B side has 2000 archers and 1000 infantry

Function = sqrt(a*X^2-b*Y^2) = 1732

B Archers remaining 1237

B Infantry Remaining 495

At this point, there should be no problem with the calculations. Now, we can add the common development elements of the game, which are commonly used in SLG, such as morale, protagonist attribute input, weather influence, terrain coefficient, etc. It can be seen that the game based on this calculation method has no less scalability than numerical collision and formula addition, subtraction, multiplication and division.

Off topic~

Before doing this, I saw someone test it online. In Warcraft, without interference, 10 infantrymen beat 10 human infantrymen, 11 beat 10, and 12 beat 10. The results are almost the same as those calculated by the Lanchester equation. Although Warcraft focuses on operation, a veteran can easily reduce consumption to a minimum. However, in large-scale battles, if both sides are evenly matched, the final result will undoubtedly be linked to the number of participants, quality and other data. At this time, the equation will play a huge role. It can deduce the battle damage and resource consumption, so as to arrange the layout. In the SLG game, if the combat performance is ignored, the final result will give players a more realistic feeling.

<<:  How to motivate users to continuously produce high-quality content

>>:  Summary of the 6th offline open class of Mobile Developer Service Alliance (MDSA): Best Practices for Mobile Business-Level Operation and Maintenance

Recommend

Brand Marketing: How to build a brand?

Let’s answer a question first: what is a brand? W...

Five key trends in the automotive industry in 2025

The automotive industry has always been one of ev...

How can an APP quickly build a push operation system?

The Internet population dividend has completely b...

Facebook's "Skynet Project" The Secret Behind Internet.org

Internet.orgFor many Facebook investors, this ser...

Soaking the server in water turns out to be for... | Digital Literacy

Audit expert: Zheng Yuanpan Professor of Zhengzho...

Analysis of Happiness Cake’s Private Domain Traffic Drainage Plan

As a well-known domestic cake chain brand, "...