Skip to content
FcornairePublic

About

Rollback netcode for TowerFall

Topics

Resources

Stars

28 stars

Watchers

2 watching

Forks

Latest commit

 

History

329 Commits

Folders and files

Repository files navigation


Logo

TF EX mod

Support me on Patreon Contributors Download Forks Stargazers Issues GPL-3.0 License

About The Project

TF EX is a mod that attempts to bring netplay to TowerFall (EX as in a Fighting game EX move). It uses FortRise (the supported version is 5.5.0-beta.4 )+ Rollback netcode as infrastructure. Due to the nature of the project, the mod is also able to record + view previous matches. Also, this project is still WIP!

The project ships as four mods, so the parts that are not about netplay can be used on their own:

Mod What it does
TF.EX (API) Online netplay with rollback
TF.State Saves and restores the level. The library both others are built on
TF.Replay Records matches, replay browser, seeking and GIF export
TF.InputDisplayer Fighting game esque input displayer

If you are a mod author making your own mod rollback/replay safe, TF.State is the one to read.

Features

  • Online Netplay

Online

  • Quickplay

quickplay

  • Lobbies

joining lobby

  • Private lobbies

joining private lobby

  • Connections through the server

    Players who can't reach each other directly (strict NAT, firewall , ...) still play together: only those pairs go through the server (Relayed), the others stay direct

  • Replays (via TF.Replay )

    animated

Usage

It fairly easy to install this mod:

  1. Install FortRise

    [!WARNING]
    The last supported version is 5.5.0-beta.4, This mean the mod won't load/work on version 4.X.X and older or even beyond.

  2. Download the latest TF EX release (DShad.TF.EX-vX.Y.Z.zip bundles the four mods; the other zips are the standalone parts)
  3. Create a Mods directory in the FortRise folder downloaded
  4. Put the zip in the Mods folder as Mods/DShad.TF.EX.zip (no extract needed)
  5. Launch FortRise.exe in FortRise folder directly, it will launch and patch Towerfall directly

After that first install the mod keeps itself up to date: when you enter NETPLAY it checks for a new version. Online play always requires the latest version.

Options (Each standalone mod have his options)

All options live in the in-game OPTIONS menu or with FortRise mods buttons.

TF.EX options:

Option Default What it does
INPUT DELAY 20 Local input delay in ms (0-332, steps of 4). Less delay plays better but rollbacks more, more delay rollbacks less but feels clunky. Find your sweetspot
AUTO ADJUST INPUT DELAY PROPOSE Adapts the input delay to the connection when joining a lobby: PROPOSE shows a slider at the top right of the lobby with the suggested value marked in blue (half the laggiest player's ping minus your ACCEPTED ROLLBACK, rounded up). Drag it with the mouse, or hold the button shown next to it (LB on a pad) and press LEFT/RIGHT; hold that button alone for 1.5 s to go back to your saved value. ENABLED applies the suggestion automatically. Your saved value is never changed
ACCEPTED ROLLBACK 2 How many frames of rollback you accept, in 60 fps frames (0-6, one frame is about 17 ms). The suggested delay is the no-rollback value minus this. 0 suggests a delay that never rolls back
CUSTOM SKINS FULL Show opponents' custom archer skins. Skins are visual only, streamed in memory and never saved
NETPLAY NAME PLAYER Your player name, shown to opponents in lobbies and matches
SERVER OFFICIAL The matchmaking server to connect to. Displays OFFICIAL, LOCAL or CUSTOM
AUTO UPDATE ON Downloads and applies the latest version automatically when entering netplay. Even with it disabled, online play still requires the latest version

The other mods' options are documented in their own README: TF.Replay and TF.InputDisplayer (TF.State has none).

Replays

Recorded matches are browsable in game: the main menu has a REPLAYS button with a browser (play, seek, take over, export as GIF...).

On disk, replays are stored in FortRise/Saves/TF.Replay/Replays and GIF exports land in FortRise/Saves/TF.Replay/Gifs.

Playing with other mods

  • Cosmetic mods (skins, custom archers...) are fine. With CUSTOM SKINS enabled, your custom archer is even streamed to opponents that don't have the mod.
  • WiderSetMod is fully supported: wide players match together in wide netplay lobbies.
  • Mods that change gameplay (custom variants...) are hidden in netplay unless the mod integrates with TF.State so its state can be tracked by the rollback. If you author such a mod, that README explains how.

Develop

This project uses:

  • FortRise as the main loader (C#)
  • ggrs-ffi which is a library that allows the GGRS API to be called by non-rust projects (Rust)
  • A matchmaking server that manages matchmaking (quickplay, lobbies, private codes) and also runs a signaling endpoint for easier connection (Rust)

Installation

To be able to add features or fix things, you will need to:

  1. Clone the repo

    git clone https://github.com/Fcornaire/TF.EX.git
  2. Launch the .slnx with your favorite IDE

  3. Do some modifications and build. If you didn't change Towerfall original installation folder, the mod dll will be copied automatically each build to your game Towerfall directory. Be aware that with the exception of Core.dll, the others are copied to the root of Towerfall installation directory which lets us debug.

  4. Launch Towerfall and on the main screen, open the Dev console wih the key ² (If not opening, ensure you enabled dev console in the game settings) and enter the following command

test LMS 0 1 42 2

A Last Man Standing game should be running in a GGRS SyncTestSession

Roadmap

As you can guess, this project is still WIP and missing a lot of features:

  • Automatically bump the version (meta + tag)
  • Refactor (There is a lot of things I want to refactor)
  • Less restrictive controller
  • [?] Fix bugs
  • Fix desynchronization (At least netplay code wise should be fine)
  • Support for all versus maps
  • Check Twilight Spire CrackedWall with teams on level 7
  • Support all items
  • Support 4 players (FFA and 2V2 teams )
  • Integrate the replay viewer in the menu

Contributing

What's the point of Github without contributions? Any contributions you make are greatly appreciated. But since there is a ton of things to do, I advise either contact me directly or create an issue explaining the missing feature or the bug fix before starting to code. This is only so I know what you are tying to do, provide help if needed and check if it's not already done or in the works 😉

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/cool-feature)
  3. Commit your Changes (git commit -m 'feat: Add some cool Feature')
  4. Push to the Branch (git push origin feature/cool-feature)
  5. Open a Pull Request

License

Distributed under the GNU General Public License, version 3 or any later version. See LICENSE for the full text.

The original netplay logo can be found at Icones8 but was re drawed in pixel art.

Contact

Twitter : DShad - @DShad66

Discord : dshad (was DShad#4670)

About

Rollback netcode for TowerFall

Topics

Resources

Stars

28 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages