Git Product home page Git Product logo

tf.ex's Introduction


Logo

TF EX mod

Contributors Download Forks Stargazers Issues MIT License

About The Project

TF EX is a mod that attempts to bring netplay to TowerFall (EX as in a Fighting game EX move, usually costing meter). It uses FortRise + 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 a WIP!

Features

  • Online Netplay

animated

1 new mode available, Netplay

animated

Create a lobby for some online action!

animated

Or join an available one

animated

Or even spectate! (Experimental)

animated

  • Modded variants

    Ability to run online play with custom variants as long as they are EX compatible. Read EX API for mor details.

    animated

  • Replays

    Replay is "normally" automatically exported at the end of a game. Use the replays menu to watch precedent games

    animated

    animated

Usage

It fairly easy to install this mod:

  1. Install FortRise with Debug ON , this can be changed by modifying the PatchVersion.txt file in the Towerfall root directory
  2. Download the latest TF EX release
  3. Create a Mods directory at the root of your Towerfall install directory if not done already
  4. Extract the TF.EX zip into the Mods folder.
  5. You are now ready and the mod should be referenced and loaded by FortRise when the game starts

You have the option to change your username in the in-game options. You can also change the input delay, but leaving it at 2 is usually fine.

You should also be able to see a new versus mode called Netplay (all the way to the right). This allows you to create and join online lobbies.

If you've played some matches, a Replays directory should have been created in the Towerfall root directory. You can view the replays by:

  1. Launching Towerfall
  2. In the main menu, press ` to open it and enter the following command
replay {replay_name}

whith {replay_name} being something like "20-06-2023T22-17-46" (No file extension)

Troubleshooting

I advise to not use this mod with mods that do other things than cosmetics/skins. For example, WiderSetMod has been reported to break the mod. I will try to investigate why it's happening but for now, only use the TF EX mod by itself.

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)
  • matchbox-client-ffi which is a library that allows the matchbox API to be called by non-Rust projects (Rust)
  • A matchmaking server which is closed source for now, it manages matchmaking 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 .sln 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 GPL-2.0 License. See LICENSE for more information.

The netplay logo can be found at Icones8

Contact

Twitter : DShad - @DShad66

Discord : dshad (was DShad#4670)

tf.ex's People

Contributors

fcornaire avatar strongsand94191 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

strongsand94191

tf.ex's Issues

Quickplay mode

Add a quickplay mode like in the older versions of this mod, where you can just queue in and play against anyone else in quickplay
A random map would be automatically selected and the game would default to tournament settings, 1v1 Last Man Standing

Bug: Incorrect versus awards are shown

Versus awards are shown that are incorrect, such as Comeback King when a comeback never happened. Versus awards are also not synced between players, with different players seeing different awards.

Enhance rematch

Rematch work now but could be better since we don't have any clue yet what the opponent want to do/have no way to send the opponent our choice. Idea :

  • Reconnect to the lobby at Versus Result screen
  • Send Choice to opponent (Exit / rematch / archer select)
  • Properly go to the right menu depending of the mutual choice

Coop Freeze

When i try to play local coop with this mod enabled it chooses the level automatically and when the match starts the game freezes

Automatically disconnect on long pairing time

Or at least give the player the choice.
When the level is loading, the 2 clients are trying to etablish a connection. This might fail or take some time.
Investigating why sometime it take some time but the idea is the game should let player disconnect after some amount of time

Issues when exiting and reopening Quickplay

If you exit the mode selection while selecting a mode other than Quickplay, such as Last Man Standing, and go back to Quickplay, then the player counter at the top left disappears.

If you exit the mode selection while selecting Quickplay and reselect Versus, the mode will already be set to Quickplay and the player counter disappears. If you try and move the cursor upwards to change modes, the cursor will disappear. From here, you can't do anything except hit Z to exit the Quickplay screen, which (only sometimes) takes you to the archer select screen. This also shouldn't happen because the archer select screen should only show after you've already selected a mode. You also can't select an archer or use the arrow keys to change archers, only exit the menu.

I had many inconsistencies while trying to replicate this again, so expect weirdness.

Screenshot 2023-07-04 135701 The Quickplay screen without the player counter or the cursor shown.

Better log

Add some sort of of custom logger (Singleton ? Transient ? ) on top of FortRise Logger :

  • Only trying to log on debug mode
  • Proper severity logging

"Failed to Connect to Server" opens Archer Select, causing lots of bugs

If you select Versus, sometimes you will get a "Failed to Connect to Server" message before selecting Quickplay. If you exit out of the message using the confirm button, then you get to the archer select screen. This shouldn't happen, as you haven't selected a mode yet. If two archers are selected, you can start the game. For some reason, players are required to choose teams, even if you were never in Team Deathmatch, and even if there are only two players. Then, a "Syncing" message appears at the top of the screen, and the game freezes, I assume because it's trying to connect two local players to the server. At this point the game softlocks.

Screenshot 2023-07-04 140658 The softlocked game.

Miasma Dissipate

Miasma can cause a desynchronization by dissipating
If a kill happen by something else than touching the miasma, it dissipate
Right now, it's not properly tracked and just ignored causing one player to still have an active miasma while the other doesn't

Will be fixed in #52 when i did some reel test

Game freeze at end round

One player is frozen at end round while the other still advance round
They are both still connected.
Digged a bit last time and it's turn out that the level is frozen (intended at end round) but no VersusRoundResult spawned.
Going to remove the replay recoder since it can mess with adding the VersusRoundResult

Input persists during "Failed to Connect to Server"

Inputs can still happen, such as selecting a mode, while the "Failed to Connect to Server" message is displaying. For example, you can still use the arrow keys and the Z button (not the confirm button) to move through menus while this message is displaying.

Could not resolve remote name error

Got this error after connecting to another client on the same network. However, one client was able to see the other client's lobby and connect to it, only after the game started it dropped the connection.

[ERROR] Ln: 21 [MatchmakingService] Error while listening to server message : An internal WebSocket error occurred. Please see the innerException, if present, for more details. 
[ERROR] Ln: 21 [MatchmakingService] Error while listening to server message - InnerException : A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
[ERROR] Ln: 21 [MatchmakingService] inner exception : A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
[ERROR] Ln: 21 [MatchmakingService] Error when connecting to server : Unable to connect to the remote server
[ERROR] Ln: 21 [MatchmakingService] Error when connecting to server - InnerException : The remote name could not be resolved: 'tf-matchmaking-server.herokuapp.com'

Further testing is probably needed, it might be on my end

Better controller management

The mod assume the player is using a controller (XInput) while letting the keyboard as player 2
This is obviously not optimal since it bypass several cases.
What needed is :

  • Patch directly (if possible ?) the base ControllerInput class
  • Add missing controller (Defaulting to Keyboard ?) automatically to be used by the remote(s) player(s)

Invisible players at round start

No player spawned when changing round. for one player
But both games appear to still be connected.
No idea whats happening, but looks super rare

Track HUDFade

Right now at the end of a round, the screen looks too bright because the HUDFade is removed.
It should be tracked instead

Handle SFXs

When a SFX is played, a SoundEffectInstance is created then played
We can grab all of SoundEffectInstance created to save them somewhere to be able to stop it when needed
The real problem come to when a Rollback happen.
Let's admit we save the SoundEffectInstance related to an archer in the game state, we should at least save the time played and what SFX being played
The real problem come to how to restore a SoundEffectInstance to a specific time ?
Look likes SoundEffectInstance has a FAudioVoiceState with SamplesPlayed being the value we want but trying to modify it that value crash the game

So if anyone has an idea how to fast forward a SoundEffectInstance using FAudio ๐Ÿ˜…
(there is this branch that started something https://github.com/Fcornaire/TF.EX/tree/feature/track-sfx)

Disconnect state somehow persist between 2 session

If the game failed to connect and retry with (same ?) opponent, despite making the connection, the game doesn't start and freeze at the initial connection dialog before aborting
I believe the game keep the state disconnected from the previous , thus preventing to connect to someone

DL less auto updater

The current auto updater always DL the latest release to check if there an update or not.
A feature should be a way to check without donwloading as since it happen after the game load, it can interfere with the game.
One solution is to use the Github Api but this one require a token, which isn't optimal for the mod.
The second solution is to instead get the last tag from the repository since a release is always tied to a tag

The buttons for Refresh and Spectate are swapped

The Spectate button displays the RT icon, but to trigger it you have to press LT.
The Refresh button displays the LT icon, but to trigger it you have to press RT.

(sorry about the discord ping in the video)

VID20231118190104.mp4

Bug: Versus replays have several issues

Versus replays appear to have many bugs. I was able to replicate each of these in all of my saved replays.

  • Inputs don't correspond to the input display at the bottom
  • My archer doesn't move at all
  • Both archers stop moving after a while
Replay.bugs.mp4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.