Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: v1.0 Dwarf Fortress: Battle Royale Mode [DFHack Script]  (Read 3204 times)

SpeardwarfErith

  • Bay Watcher
    • View Profile
v1.0 Dwarf Fortress: Battle Royale Mode [DFHack Script]
« on: August 09, 2018, 10:15:04 pm »

I have noticed that nowhere in the devnotes is a battle royale mode mentioned. Adamant to not let dwarf fortress fall behind on the latest cheap gaming trend, I have taken it upon myself to create one myself. Introducing:
DWARF FORTRESS: BATTLE ROYALE MODE

DOWNLOAD

What it is:
As the name implies, Battle Royale Mode adds a new "game mode" (Though there isn't much interactivity) to dwarf fortress that's inspired by battle royale games like PUBG and Fortnite. Battle Royale Mode is designed to be played in the object testing arena. It spawns dwarves and randomized gear within a specified area. The dwarves will path towards the gear and pick it up, slowly upgrading their equipment from the starting platinum knife. They will fight to the death and loot from the corpses of their fallen enemies until only one victor remains.

With default settings in the provided arena, matches are usually over quickly, though it does rarely happen that one of the last dwarves becomes insane. Since dwarves only fight in encounters and do not actively hunt each other, the sane dwarf will let the insane one hang out in some corner of the map indefinitely, and intervention is required.

While it's possible to take control of one of the fighters in adventure mode, it doesn't tend to be very fun- The AI is not particularly competent, and you can easily win by just not participating in the starting bloodbath and going straight for the cornucopia.

Features:
  • Spawns randomized gear, with a cornucopia in the center where adamantine gear spawns
  • Spawns dwarves in random locations around the arena
  • Dwarves will path to the closest gear that's better than what they have, and pick it up. They will drop their current inferior gear if they have any
  • Dwarves will fight any other dwarf they encounter, and loot good gear from corpses
  • Dwarves will tend to move towards the cornucopia if not actively going after gear
  • The script ends when only one dwarf is left alive

Installation:
Installation of this script is very easy. From the .zip file, move battleroyale.lua and the folder named "battleroyale" into <dwarf fortress directory>/hack/scripts. While it is not required, it is highly recommended to also replace the vanilla arena.txt file (found at <dwarf fortress directory>/data/init) with the one provided, since the default arena doesn't have suitable terrain.

Usage:
The base command for Battle Royale Mode is battleroyale. At bare minimum, it requires an area in which the battle royale will occur to be specified. The following parameters are necessary, and the script won't run without them:
Spoiler (click to show/hide)

(Note: The script doesn't have a way to see coordinates yet, but running teleport -showpos gives you the cursor's coordinates)

So for example,
Code: [Select]
battleroyale -x1 2 -y1 2 -z1 4 -x2 142 -y2 142 -z2 4 will begin a Battle Royale game between coordinates (2,2,4) and (142,142,4), which is just about the entirety of the ground level of the arena. This is, incidentally, what the default values for the other parameters are balanced for. If this is done in the vanilla arena, half of all the dwarves and gear will spawn over water/magma.
The script also accepts the following optional paramteres:
Spoiler (click to show/hide)
For another example,
Code: [Select]
battleroyale -x1 2 -y1 2 -z1 4 -x2 142 -y2 142 -z2 4 -equipment 400 -units 96 -cornucopiaradius 50 will spawn twice as much gear and dwarves, and make most of the map inside the cornucopia, thus making most of the gear adamantine. You probably won't see a lot of dwarves wielding hammers in this setup. (Also, it would be pretty laggy!)

Gallery:
A dwarf picking up bismuth bronze buckler, then being mauled to death by another, better-geared dwarf:
Spoiler (click to show/hide)

A winner stands in the depleted cornucopia, surrounded by corpses
Spoiler (click to show/hide)

5 dwarves in a mosh pit during the starting bloodbath. Only one of them will leave.
Spoiler (click to show/hide)

A dwarf walks through a city and upgrades his gear. Note that he drops some of his own gear in favour of the better equipment, while ignoring the gear that's worse than his.
Spoiler (click to show/hide)

The inventory of a typical mid-game survivor
Spoiler (click to show/hide)

The inventory of a typical winner
Spoiler (click to show/hide)
« Last Edit: August 10, 2018, 05:44:48 pm by SpeardwarfErith »
Logged
The swordsman Smoma Acaltekud: Hello Ago. Life is, in a word, death.
The swordsman Smoma Acaltekud stabs you in the lower body with his iron scimitar, tearing apart the muscle and tearing apart the left kidney!
The iron scimitar has lodged firmly in the wound!

Battle Royale Mode: A DFHack Script

SpeardwarfErith

  • Bay Watcher
    • View Profile
Re: v1.0 Dwarf Fortress: Battle Royale Mode [DFHack Script]
« Reply #1 on: August 09, 2018, 10:15:53 pm »

reserved
Logged
The swordsman Smoma Acaltekud: Hello Ago. Life is, in a word, death.
The swordsman Smoma Acaltekud stabs you in the lower body with his iron scimitar, tearing apart the muscle and tearing apart the left kidney!
The iron scimitar has lodged firmly in the wound!

Battle Royale Mode: A DFHack Script

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: v1.0 Dwarf Fortress: Battle Royale Mode [DFHack Script]
« Reply #2 on: August 10, 2018, 01:52:07 am »

Where is the Zombie! expansion/dlc?

(Honestly thought at first that the script would just make everyone crazed in fort-mode, and un-craze the last survivor. :D )
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Nikitaw99

  • Escaped Lunatic
    • View Profile
Re: v1.0 Dwarf Fortress: Battle Royale Mode [DFHack Script]
« Reply #3 on: August 10, 2018, 02:21:06 am »

I have long been waiting for this day.
Logged

SpeardwarfErith

  • Bay Watcher
    • View Profile
Re: v1.0 Dwarf Fortress: Battle Royale Mode [DFHack Script]
« Reply #4 on: August 10, 2018, 10:24:10 am »

Where is the Zombie! expansion/dlc?

It's already fully developed but I'm delaying it for maximal profit.
Logged
The swordsman Smoma Acaltekud: Hello Ago. Life is, in a word, death.
The swordsman Smoma Acaltekud stabs you in the lower body with his iron scimitar, tearing apart the muscle and tearing apart the left kidney!
The iron scimitar has lodged firmly in the wound!

Battle Royale Mode: A DFHack Script

Koumakan

  • Bay Watcher
  • Amanojaku
    • View Profile
Re: v1.0 Dwarf Fortress: Battle Royale Mode [DFHack Script]
« Reply #5 on: August 10, 2018, 12:16:31 pm »

This is amazing
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: v1.0 Dwarf Fortress: Battle Royale Mode [DFHack Script]
« Reply #6 on: August 11, 2018, 03:16:56 am »

Where is the Zombie! expansion/dlc?

It's already fully developed but I'm delaying it for maximal profit.
Smart. No day-one DLC means no fan outrage and cancelled pre-orders.

I do hope that there will be hats.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: v1.0 Dwarf Fortress: Battle Royale Mode [DFHack Script]
« Reply #7 on: August 20, 2018, 12:52:55 am »

Nice!

Where is the Zombie! expansion/dlc?

It's already fully developed but I'm delaying it for maximal profit.
Smart. No day-one DLC means no fan outrage and cancelled pre-orders.

I do hope that there will be hats.


Damn my own ideas of earning quick dwarfbuck will be foiled!
Must develop hats faster :D

Quote
--don't knkow what .active doesn't filter out the dead ones

Active means: in map and not "removed" in some way AFAIK. But it's not exact as there are hundreds of cases.

BTW nice scripting and ascii art :)
« Last Edit: August 20, 2018, 01:02:18 am by Warmist »
Logged

SpeardwarfErith

  • Bay Watcher
    • View Profile
Re: v1.0 Dwarf Fortress: Battle Royale Mode [DFHack Script]
« Reply #8 on: August 20, 2018, 02:59:45 pm »

Quote
--don't knkow what .active doesn't filter out the dead ones

Active means: in map and not "removed" in some way AFAIK. But it's not exact as there are hundreds of cases.

BTW nice scripting and ascii art :)

Ah. It gets confusing seeing as the "active" flag on creatures symbolizes more or less that it's alive and on the map. It's things like this that make me suspect that df's code is a huge spaghettified mess.

Also, thanks!
Logged
The swordsman Smoma Acaltekud: Hello Ago. Life is, in a word, death.
The swordsman Smoma Acaltekud stabs you in the lower body with his iron scimitar, tearing apart the muscle and tearing apart the left kidney!
The iron scimitar has lodged firmly in the wound!

Battle Royale Mode: A DFHack Script

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: v1.0 Dwarf Fortress: Battle Royale Mode [DFHack Script]
« Reply #9 on: August 20, 2018, 06:13:13 pm »

(Honestly thought at first that the script would just make everyone crazed in fort-mode, and un-craze the last survivor. :D )

pretty sure making everyone crazed would end the game actually

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: v1.0 Dwarf Fortress: Battle Royale Mode [DFHack Script]
« Reply #10 on: August 21, 2018, 06:11:48 am »

True, i had that once while testing things with undead civs.
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::