Git Product home page Git Product logo

bindcontrol's Introduction

BindControl

BindControl is a helper app for creating and maintaining keybinds for City of Heroes.

It is an enhanced port of Konoko and Monorail's CityBinder 0.76, using Python and the WxWidgets UI toolkit.

During City of Heroes' original run, CityBinder was the go-to app for keybinds. It's written in lua, using the IUP toolkit, and the required versions of those can be difficult to set up for development on modern OSes. I wanted to add features and clean up the UI, so in a stunningly unwise act of hubris, I instead started work on BindControl.

I worked on it on-and-off for the remainder of the original run of the game, then shelved it, ostensibly forever. Now here in the age of the SCORE, Homecoming, and other servers, it once again has value, so I've dusted it off and continued to add features and modernize it.

With Homecoming recently securing the licensing for City of Heroes from NCSoft, development of the game and its ecosystem, BindControl included, is likely to remain very Homecoming-centric in the near to medium term. Recent changes to BindControl's Speed on Demand code incorporate changes made specifically in Homecoming Issue 27, and while it will probably continue to work elsewhere, I don't currently have a presence on these other servers to test and validate. Please feel free to open issues for non-Homecoming servers, but know that they might not receive as much attention as Homecoming-specific ones do.

Features

  • Runs on Windows, MacOS, and Linux

  • Separate profiles for different characters, archetypes, or situations

  • Controller support (WIP, binds created with a controller work perfectly, but BindControl itself sometimes has trouble detecting controller input to create such binds)

  • Basic Gameplay Binds

    • One-key next-teammate / previous-teammate selection, with support for setting team size and optionally skipping the player in the next/previous rotation
    • Rebind the keys for the in-game power tray buttons
    • Various helpful shortcut binds, "Quit to Desktop", "Invite Target", "Show FPS", "Show Netgraph" - more to come
    • Chat binds with optional 'typing' notifier and custom chat colors
  • Custom Binds

    • Create simple binds using PowerBinder, a flexible tool for stringing together arbitrary commands for keybinding
    • Complex binds, chains of PowerBinder actions that fire sequentially on multiple presses of a keybind
    • Buffer binds, allowing quick one-key buffing of each teammate and/or pet
  • Movement / Speed-on-Demand

    • Speed-on-Demand based on citybinder and the original Gnarly's SoD keybinds
    • Supports all formal travel powers: Fly, Mystic Flight, Group Fly, Super Jump, Mighty Leap, Super Speed, Speed of Sound, Teleport, and Team Teleport
    • Secondary travel powers like Mystic Flight's "Translocation" are starting to be better integrated
    • Supports Homecoming travel power changes - WIP but functional
    • Homecoming's powexec_location cursor feature incorporated into Teleport binds, with "teleport immediately" and "teleport on key release" options available
    • Kheldian form toggles; Kheldian movement powers incorporated into Speed-on-Demand
    • One-key reset in case SoD binds get tangled up
  • Inspiration Popper

    • By-type; dual and team inspirations supported
    • Option to use or skip "super" inspirations
    • Largest-first or smallest-first
    • Optional /say feedback with per-inspiration custom colors
  • Mastermind / Pet Binds

    • Select pets by power level: all, minions, lieutenants, and boss
    • Orders for aggressive / defensive / passive stances; attack, follow, go to, and stay, for all or selected pets
    • Pets can give feedback on each order; chattiness can be toggled via keybind
    • "Bodyguard mode" shortcut -- you can define which pets should be treated as bodyguards, and turn Bodyguard Mode on for them with a single keypress
    • By-name pet selection
    • Next-pet / previous-pet binds

TODO

  • Attempt to make every slash command in the game available in some way, typically via PowerBinder
  • Access to MacOS for testing is via a MacOS VM several OS versions old. I don't want to buy an actual Mac just for this wee vanity project, so mileage may vary on how it acts in an actual recent Mac environment
  • Bodyguard mode, as implemented in citybinder, doesn't work as intended, and might not be able to due to game restrictions
  • Investigate improvements to Mastermind binds to clarify and expand the behavior
  • More error detection and handling
  • Temporary powers in speed-on-demand
  • Roll standalone binaries for Windows, MacOS, Linux - partially implemented
    • Windows binary distribution of Python apps can trigger anti-malware warnings
    • MacOS binaries need signing and notarization; I release them anyway for the brave
    • Linux binaries might be possible with some container scheme
  • More and better help text and documentation
  • Fix bugs as found

Using Binary Releases

Windows users: try the ZIP file from the latest release, and give feedback. If that works for you, it's the quickest path to victory.

MacOS users: an experimental binary release has been made available. It is not signed and/or notarized, and might or might not work at all. Any feedback is encouraged.

Linux users: an extremely experimental binary release is now available. You should be able to unzip the zipfile anywhere, and run the "BindControl" binary from within it.

If you receive malware warnings, please read my comments on that issue.

Running From Source

Dependencies

  1. Python version 3.10 or later
  2. wxPython version 4.2 or later
  • Windows users, follow the instructions on the above sites' download pages to install Python and wxPython.

  • MacOS users, I recommend following the instructions in this article at opensource.com to get Python 3 installed and working by default. Once everything is working, you will want to run pip3 install wxPython.

  • Linux users, install your distribution's packages for Python 3 and wxPython.

Getting and running the code

  • Clone this repo, or download the source as a ZIP file

  • Windows (and possibly Mac) users: Double-click BindControl.py in the top-level folder

  • Mac / Linux users: In a terminal, cd to where you put the BindControl source, then python BindControl.py. Some distributions might need python3 instead of python.

Credits

BindControl is in many places a direct port of CityBinder code, and in most other places was extremely influenced by it. Keybinding code drew from similar code in PADRE.

Various newer functionality was added to CityBinder for Homecoming by tailcoat, who kindly provided his source code and permission to adapt for use with BindControl, as well as offered suggestions and advice for improvements.

Citybinder's acknowledgements are reproduced below:

    Obviously, without Cryptic and NCSoft to have created/funded/published
    City of Heroes and City of Villains, there would be no point to this
    program.  Thanks to Gnarly and the numerous people who contributed to the
    creation of the Speed on Demand System.  Thanks to Sandolphan/Khaiba and
    the many people who posted Mastermind binds in the CoV Beta forums.
    Again thanks to Sandolphan for the Bodyguard mode binds.  Also thanks
    to the following people, who directly contributed to CityBinder, either
    with bug reports, feature suggestions, or contirbuted binds.
    PerezPersuader, Blue_Daze, Back_Blast, IronVulture, Darkelven,
    Shadowhand, Knight_Marshal, Nilt_, Psygon, DuskA, CyberKnight7, ErieFF,
    Darc_Reign, Beerninja, BarfBag, Oronis, TrystarMojo, Pyrobard,
    Ang_Rui_Shen, Konoko, Draznar, Local_Man, tyrose, Caustic, 80sboi,
    DarknessEternal, reiella, Robotech_Master, Ground_Zeroo, Stylina, and
    ShieldBearer.

The improved Inspiration Popper design was gratefully adapted from an unreleased version of CityBinder for Homecoming by Tailcoat.

Github Actions for automated building of binary releases graciously provided by JamzTheMan.

Additional feedback and suggestions provided in the Homecoming Forums thread and in Github issues by:
DevoDog68, BlackSpectre, Premmy, kenlon, Lumenia, xizar, autobotpinto

License

BindControl is licensed under the GPL version 3 or later.

[email protected]

bindcontrol's People

Contributors

emersonrp avatar jamztheman avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

bindcontrol's Issues

0.17.10.3_windows triggers Windows Defender.

Windows Defender claims that it detects "Trojan:Win32/Bearfoos.A!ml", and then chucks it in the bin.

I tested 0.17.10.2 and Windows forced a scan before it let me run it this time, but that one seems to be fine.

CoH doesn't seem to allow multiple mod keys in many cases

I feel like we've been through this at least once before. Need to investigate permutations of this -- "/show_bind SHIFT+CTRL" reports Invalid Key Combination, but the game still allows such a bind. However, "SHIFT+CTRL+R" for instance seems to trigger "SHIFT+CTRL" instead. Need to clean this up and only allow BindControl to create valid binds. Yet Another KeySelectDialog logic rewrite, sigh.

Dragging the mainwindow around the desktop is strangely laggy.

With 0.14.2.1 (and earlier versions as well, I think), dragging the window around the desktop is strangely laggy.

If I click and drag the window, the movement does not keep up with where the mouse cursor actually should be based on mouse movement. This can be demonstrated by releasing the window ("unclicking" the mouse) and the cursor will be exactly where expected, while a phantom cursor remains with the software window. During this "phantom time", the window will continue moving to finish the path that was traced out with the mouse, and will end where it's supposed to.

I believe this must be related to my monitor's refresh rate. When set to 120Hz, the window's movement also appears to be unreasonably smooth. If I set it to 60Hz, the movement is still laggy, but much less smooth.

This behavior is not present when resizing the window when resizing from any of the 8 drag handles.

This doesn't seem to break anything, though I did experience with 0.14.1 that my cursor was off-set from the mouse after running and persisted after closing the program. This was resolved on rebooting my computer so I didn't think anything of it. I can't reproduce this behavior now so might have been a fluke.

I do not know if it's related but making when the window wider, when trying to recenter all the various binding options on any tab, that stuff is a bit jerky. Changing window width when it would be too narrow to show everything is properly smooth. This jerkiness is present at both 120 and 60Hz.

Custom Chat Colors Save/Load

Where do the Custom Chat Colors get written? I couldn't find it.

I had to manually edit a file I created, Duke-Options.txt to save/load them.

Team Select binds are unfinished.

The team select bind logic, with the team size / position / rotation, is unfinished. Not clear if it ever worked even in CityBinder. It needs to be polished up and finished, or removed as "WONTFIX".

Temp movement powers are not supported

The original CityBinder temp movement power logic relied on tray icon position to trigger things. We can do better. With the list of temporary movement powers that's available in GameData, we can provide a picker (or pickers), and enable temp movement powers by-name.

Set up Teleport/Translocate to trigger on-release rather than on keypress.

To very clumsily explain, if we could press the teleport hotkey as a sort of "initiate teleportation" step. This could do things like Hiding Windows and/or showing the teleport targeting reticle for as long as the key is depressed.

On releasing the key, the game actually executes the teleportation (and re-shows windows/etc).

Offer a binding in SoD for jumping-style movement that is just a toggle.

Binding "jump" into the cardinal movent directions can feel awkward in a way that doesn't happen with flight or running. Typically flying is one dimensional movement at any given instant, while jumping (either Super Jump or Mighty Leap) is two dimensional unless you're jumping straight up.

This two dimensional movement can be an annoyance when you just need to move over slightly and you end up hitting your head on something (as in-game translation for "feels bad" or "camera gets weird").

While turning jumping's SoD into a toggle defeats the purpose of SoD (switching to low endurance drain movement or single-key movement), ... I'll hit my head less? (I don't have a good justification for putting that toggle here other than just keeping all my movement bindings managed in once place (the software) rather than setting up the keybinding in-game.)

Mastermind's "Bodyguard Mode," as implemented, is not correct

CityBinder's "Bodyguard Mode" logic may have never actually worked as advertised, or the game may have changed out from under it. In any case, it's not working as documented. IIRC, the pets that are not on bodyguard mode can't be addressed as a group (two minions and a lieutenant for instance), and "one power per bind" means they can't be stacked as separate commands. This needs some research, but might simply not be possible to do as intended.

(Feature request) Have character name be it's own thing, distinct from character bind directory

Due to limits on the length of directory and file names, it's preferable to have short directory names for all the bind files.

Due to the freedom of character naming in CoX, you can have some really abusive bar-code style names, or really long silly names, or names with a bunch of glottal stops. Directory names like these (especially with apostrophes) can be cumbersome.

Currently, the solution in BindControl is to use a nickname that will hopefully be memorable and recognizable. This might not always be feasible if you have a tanker named Lilgren Mann saved as "LGM" and a mastermind named Little Green Men.

Perhaps the bind directory name has it's own unique-ish field, while the text field for "Character name" can have the actual name which would also serve as the profile's file name.

This also might suggest having BC automatically generate it's own unique identifier to use for the bind directory. Presumable the software knows how long the longest namespace is for all of the bind files when including the base bind directory as well. Given that it is possible (if quite absurd and highly unrealistic) to have something like 5000 characters on Homecoming servers, having BC in charge of directory naming could be helpful.

Experiment with re-ordering SoD bind strings

With the Speed-on-Demand binds, tapping keys quickly can sometimes get the "mobile" power and the "stationary" power toggled into incorrect states. This is assuredly due to lag and latency in bind_load_file, but it might be that re-ordering the "powexec_toggle" steps and the "up down forward etc" steps in some way would help -- putting the powexec first might make sure that executes earlier?

It's not clear whether this is actually a path to victory; it's most likely in the actual bind_load_file step where the lag happens; this probably won't help. But it's worth a tinker to see.

"Select Key" window Not Receiving any inputs

Currently this update does not recognize inputs from controllers, keyboards, or mouse Buttons when using the Key select menu.
All menu Options are selectable as normal, but any attempt to input a key for a bind in any of the tabs yields no response.

Pressing the Return/Enter Key Closes the window, The 'Ok" and "Cancel" menu options are selectable, and the "Bind left/Right mod keys Separately" checkbox is selectable

Things that still seem to Work as Usual:

All of the the options under "Profile" Help" and "Log" seem to function as usual
The "write Binds" function works as usual
All interactable Options elements In the "General" "Gameplay" "Custom Binds" "speed on Demand" "inspiration Popper" and "Mastermind/Pet Binds" tabs

Mystic Flight is totally borked (0.14.2.1)

SoD bindings to use Mystic Flight as a flight power are currently unusable.

Enabling SoD Flight with Mystic Flight will make the character jump nonstop or might actually turn on Mystic Flight, and then you soar into the heavens. Moving in any of the three dimensions turns off the behaviour of flying straight up (tangent: I remember this being an optional setting in SoD), and you can fly around or teleport without issues.

Hitting "F" to toggle Mystic Flight off does not toggle it off, but sets you to soaring straight up as described above (though, since MF is already active, there's no jumping).

I believe Mystic Flight worked fine prior to 0.14, though I hadn't played my Sorcery toons much since restarting playing a few weeks ago. (edited to correct version from 0.4.14... I got over enthusiastic with my 4s.)

"UP" for Fly is misconfigured (doesn't swap hover/fly, doesn't turn off fly when you release key) (v0.15.0.3)

Going up from hovering turns on Fly but does not turn off Hover. stopping going up stops you from going up, but does not turn off Fly

showbind "space" while Fly is on

+down$$up 1$$down 0$$forward 0$$backward 0$$left 0$$right 0$$powexectoggleon Fly$$bindloadfilesilent F:\TCB\RedWater\F\F100000.txt

showbind "space" while Fly is off

+down$$up 1$$down 0$$forward 0$$backward 0$$left 0$$right 0$$bindloadfilesilent F:\TCB\RedWater\R\R100000.txt

showbind "f" (toggle Fly) while Fly is on

+down$$bindloadfilesilent F:\TCB\RedWater\F\F000000r.txt

showbind "f" (toggle Fly) while Fly is off

+down$$powexectoggleoff Sprint$$powexectoggleon Fly$$up 1$$down 0$$forward 0$$backward 0$$left 0$$right 0$$bindloadfilesilent F:\TCB\RedWater\BO\BO000000.txt

Sorcery/Mystic Flight seems to work fine.

(I did see you updated, but it doesn't seem like it changed any of the bind writing, only configuring in-software, so I've been lazy and haven't updated.)

Allow user defined default save locations for profiles.

It would be nice if we could choose where to put profiles files. My particular installation has CoX installed on a NAS, with sundry support software in a directory nested below. (This is mostly so I have an extra copy of bind profiles and costumes laying around rather than on my local drive.)

(Feature request) Button to delete the old bind directory

It would be nice if there was a function to delete all the old binds before writing the new ones, either as an on-demand button (delete now) or just before writing out bind files.

Your recent patch note about not writing unused MM binds if they're not set, suggests for people upgrading versions are going to have a lot of junk laying around. While this doesn't necessarily hurt anything, it's unsightly.

Going forward, this will still be useful after respec'ing a character out of one travel power to another. (For example, going from Teleportation to Flight, or Sorcery to Force of Will.)

Mousewheel Bind

Had to add this to the reset file manually.

MOUSEWHEEL "+camdistadjust$$playerturn"

Mystic Flight SoD binds try to insert Hover, even if you don't have Flight Pool.

The "Player has Hover" tickbox status does not check to see if you have the flight pool meaning that you can have a situation where Mystic Flight will try to insert Hover into the bind files. (I only checked Bo000000.txt; I assume other ones are compromised as mystic flight would detoggle in-game.)

This can be fixed manually by enabling Flight as a power pool, going to the SoD tab, un-ticking the Hover box (while it's no longer grey-ed out) and then removing Flight again.

(perhaps related, "Hide Windows when Teleporting" doesn't work for Mystic Flight's translocate)

Window allocates too much vertical space (was: program window cannot be shortened)

On startup, the window covers the full height of my desktop (1440p resolution) and refuses to allow itself to be shortened. This creates a lot of wasted space (roughly 1/5 of the vertical space) and also makes it frustrating to move around, as the "write binds" button is at the bottom of the window making it inaccessible if I reposition the window so it sits lower on the screen.

"Start Chat" bind broken

Currently, if the Typing Notifier box is checked, the bind for Start Chat is ends with "beginchat " - which doesn't work. I'd likely want to replace that with "startchat" since we're not feeding the command any text to enter into the new chat.

Unkown command: back

Looks like the S binding to 'back' should be 'backward' instead?

CoH chat shows "Unknown command: back" on a new profile on Homecoming.

Virus Detected

On Windows 11, both Edge and Chrome won't download due to virus detection. Oddly enough, I'm able to download the .exe ok (after ignoring warning) but edge just refuses to download the zip...

image

Feature Suggeestion: Tray Tab

Add Tray tab or add a section under the Gameplay Tab
image

In the tray tab, the user could assign:

  • 1-0 to tray 1
  • CTRL+1-0 to tray 2
  • SHIFT+1-0 to tray 3
  • etc etc.

Add support for "Modern" keybind defaults

Issue 27 Page 7 updated the default keybinds to a new "Modern" set. The "Classic" set is still available. BindControl should have a preference to choose between these for when we reset to default.

Changing Power Pools can leave hidden powers activated

From kenlon:
"3: Deselecting a power pool hides the associated powers, but does not change the binding settings. This led to some confusion when my default profile, with no power pools selected, was causing all my windows to vanish when I hit shift."

This is going to be tweaks to how hidden controls are treated when writing bindfiles -- removing all pools will make, for instance, the fly control group invisible, but the picker/wx.Choice inside it is still active. Need to check for Visible as well as Enabled.

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.