Author Topic: [patch] Double tap support  (Read 5308 times)

nissarin

  • Posts: 8
  • Turrets: +1/-0
[patch] Double tap support
« on: February 16, 2011, 05:28:28 pm »
Patch adds optional double tap support for certain actions, namely:
  • dodging - cl_doubleTapDodge (0/1) - keys: Move Left, Move Right, Move Back
  • jetpack (toggle) - cl_doubleTapJetpack (0/1) - keys: Jump
  • walk/run (cl_run toggle) - cl_doubleTapSpeed (0/1) - keys: Sprint, Walk/Run
  • crouch/wallwalk - cl_doubleTapCrouch (0/1) - keys (turn on): Crouch, keys: (turn off - without double tap): Crouch, Jump, Dodge (using dt), Sprint, Walk/Run

Other cvars:
  • cl_debugDoubleTap (0/1) - print some timing information
  • cl_doubleTapDelay (>0, 150) - used for double tap detection and for "cool-down", i.e. time period between first (current) key press and last double tap is greater than given delay

Download:
Patch against current svn gpp branch
x86 Linux binaries
x86_64 Linux binaries
I advice patching the source code, since I can't guarantee those binaries will work for you but feel free to try.

Additional info:
1. Don't get too cocky and set very small delay, you should probably stick to something between 100(ms) and 200(ms), well 200 might be a bit too high. If in doubt set cl_debugDoubleTap to 1.
2. About cl_debugDoubleTap.. you might notice that all keys/buttons support double tap, however only those specified above are used and since dt flag isn't cleared they only "fire" the first time they are used.
3. Actually I was planning to steal borrow code from recently released ET but it appears that ET send additional information (regarding double tap) to server so it's no-go. Also, ET uses separate structures and mapping for dt keys but I decided to expand existing structures a little, so it might actually cost you like 200 bytes of memory and couple of CPU cycles per game frame, duh.
4. Dodge comes with additional cheat feature, which allow to dodge even when moving forward, to be precise, it will stop you from moving forward for duration of two game frames (during dodge). This mean you can keep moving forward and dodge right/left. I don't know if current behavior is intentional but it sure is irritating (to me at least).
5. Actual dodge is delayed by one game frame, i.e. two consequent snapshots "keep" dodge key down, it doesn't work if only one snapshot include it (I didn't bother to check why, probably server needs to calculate some "dodge vector").
6. If you are planning to use double tap with wall walk (crouch) make sure you unchecked ww toggle, since this one actually keep you moving "down" and unlike sprint it won't "toggle" any cvar (cg_wwToggle works only for aliens).

Testing:
I played a bit (whole one game..) online and spend some time on "localhost". It works for me (TM). I only played in human team (double tap crouch might useful for aliens) because I'm a noob and I actually didn't played trem for several months (and I really suck with my current "mouse").

cron

  • Donators
  • *
  • Posts: 197
  • Turrets: +22/-22
    • GrangerHub
Re: [patch] Double tap support
« Reply #1 on: February 16, 2011, 05:51:34 pm »
Nice! Can't wait to try this with wallwalking :D

Undeference

  • Tremulous Developers
  • *
  • Posts: 1254
  • Turrets: +122/-45
Re: [patch] Double tap support
« Reply #2 on: February 16, 2011, 07:04:42 pm »
This is really not the correct place. This is (change "Severity" to "enhancement").
Need help? Ask intelligently. Please share solutions you find.

Thats what we need, helpful players, not more powerful admins.

nissarin

  • Posts: 8
  • Turrets: +1/-0
Re: [patch] Double tap support
« Reply #3 on: February 16, 2011, 08:22:18 pm »
Sure... if it gets positive feedback.

Meisseli

  • Spam Killer
  • *
  • Posts: 765
  • Turrets: +83/-25
Re: [patch] Double tap support
« Reply #4 on: February 16, 2011, 09:19:17 pm »
It will.

Celestial_Rage

  • Posts: 636
  • Turrets: +120/-8
Re: [patch] Double tap support
« Reply #5 on: February 17, 2011, 08:00:51 pm »
Great patch. I'll test it out.
"The reports of my death are greatly exaggerated" ~Mark Twain

nissarin

  • Posts: 8
  • Turrets: +1/-0
Re: [patch] Double tap support
« Reply #6 on: February 19, 2011, 05:42:43 pm »
Just to make a few things clear..
I'm planning (but keep in mind that I'm lazy person) to poke around in input code and perhaps rewrite it a bit, so I treat current patch as "working prototype". Originally I only intended to add dodge support but ended up with code that could potentially work for any command and so I went ahead and added a lot of stuff which I think might be useful. I would like to remind you that while I like Trem I never really played it that often, I lack (in game) experience to be confident enough about those additional changes. That being said, if I don't come up with anything new and there will be no complains (gameplay related) about current version I'll post it on bugzilla (and I think there is still plenty of time before release).

Now, one idea I had when working on current patch was to move double tap detection one "level" down, instead detecting commands (+something, -something) try detecting actual double key press. That would allow to customize it, f.e.:
Code: [Select]
bind a "+moveleft"
bind d "+moveright"
bind s "+back"
bind dta "+button6"
bind dtd "+button6"
bind dts "+button6"