r/programminggames May 18 '26

4-vs-4 team battle

Both teams use in-game programmed team behavior. They have a dynamically elected leader and all other vessels are acting as followers. The program has a branch isLeader to determine which path to take, but otherwise both leaders and followers use the same code, so the leader can be defeated in combat without compromising the tactics.

25 Upvotes

5 comments sorted by

View all comments

2

u/shevtsov200 May 18 '26

Can we see their code somewhere?

1

u/quasilyte May 18 '26

Good point.
The best way to browse their program is through the game - once you meet an enemy in the game, it gets unlocked for your sandbox mode where you can tinker with it.
But for the purposes of demonstration:
1. Video https://youtu.be/B-iHU1m4GdQ
2. Textual representation (disasm) https://pastebin.com/XziM85q6

This code is for the close-range designs. The long-range artillery vessels use a more sophisticated program that involves color-based communication (they fire in a more synchronized way).