Aspect ratio calculator / The Battle of Two Banners

The Battle of Two Banners

An imagined Sengoku battle with over a hundred paper soldiers, in five acts. Free to download, copy or embed.

Bonus · 2026 series · All animations

Free to use, change and share under the MIT License. One file, no libraries, no sign-up.

What it is

A large battle staged as a paper puppet play. More than a hundred small cut-paper soldiers stand in ranks on a little theatre stage, each on its own stick, with a white paper edge around the larger figures and a wooden floor with a slot along the front. Two armies, the Blue Banner and the Red Banner, fight through five acts while a narrator’s line runs under the stage.

An imagined battle. It is set in Japan’s age of warring states (the Sengoku period, roughly the late 1400s to about 1600), and it uses the kinds of troops that fought then: foot soldiers with long spears, matchlock gunners, archers and mounted warriors with banners on their backs. The two clans, their crests and the events are invented. It is not a reconstruction of any real battle.

The five acts

  1. Morning fog. Strips of paper fog slide away and the two armies see each other across the plain, below a castle.
  2. The guns speak. The front ranks fire their matchlocks in turn. Smoke rolls up and arrows cross overhead.
  3. The charge. The Red horsemen gallop in. The Blue spearmen lower their spears and hold.
  4. The hidden reserve. Blue soldiers who waited behind the hill come round it and hit the Red line from the side.
  5. Evening. At sunset the Red Banner rides away and the Blue army raises the victory shout.

Fallen soldiers simply tip over and fade, as paper puppets would. There is no blood. The last line of the narration reminds the viewer that real battles did not end so gently.

How the crowd is made

Every soldier is one entry in a list: which side, which rank, where it stands, how it wobbles, and a random number that decides how early it falls. As each act raises the losses for a side, the soldiers whose number is below that level tip over. Ranks are drawn from back to front so that nearer puppets overlap farther ones, and only the front rank shows its sticks.

How to take it

Press Download the HTML file above to get battle-of-two-banners.html, or press Copy the code and save it as a file ending in .html. It works offline.

View the code
Loading…

Embed it on your page

<iframe src="https://aspect.tools/paper-battle" style="border:0;width:100%;max-width:900px;aspect-ratio:900/930" title="The Battle of Two Banners, a paper puppet play" loading="lazy"></iframe>

License and credit

MIT License. You can use it, change it, share it and sell things made with it, for personal or commercial work. The one condition: keep the copyright and license notice that is at the top of the file.
The Battle of Two Banners, 2026 series, by aspect.tools (https://aspect.tools/sengoku-battle), MIT License

A visible credit is appreciated but not required.

How to change it

What to changeWhereExample
The narration, or a translationthe ACTS list[0.36, 'The Blue spearmen lowered...']
Size of each armythe muster(...) lines: side, number, from x, to x, kindmuster(1, 45, 120, 372, 'spear')
Army coloursBLUE and REDBLUE = '#2f4f8a'
How many fall, and whenredLoss and blueLoss in battlepr(4, 0.2, 1) * 0.36
Size of the reserve and the cavalrythe RESERVE loop and the horsemen loopq < 14, i < 7
SpeedACT, the length of one act in secondsvar ACT = 13

To stage a real battle, rename the sides in the narration, set the numbers and the turning point to match your sources, and say on your page which sources you used.

Questions

Is this a real battle?

No. It is an imagined battle set in the Sengoku period, with the kinds of troops used then. The clans and events are invented.

What is a paper puppet play?

A small theatre in which flat cut-out figures on sticks are moved in front of painted paper scenery. This page imitates that look with code.

How many soldiers are on stage?

About 108 foot soldiers in the two lines, plus 14 in the reserve, 7 horsemen and two mounted commanders.

Is it suitable for a classroom?

It shows a battle without blood: fallen puppets tip over and fade. The narration is short and plain.

Can I use it on my own website?

Yes. It is under the MIT License for personal and commercial use. Keep the license notice inside the file.

Related tools and guides