Tremulous Forum
Mods => Modding Center => Topic started by: nissarin 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 (http://pastebin.com/xWxVaBbA)
x86 Linux binaries (http://www.mediafire.com/?hz8148cbmd61ne6)
x86_64 Linux binaries (http://www.mediafire.com/?yf5926ftg1r7v7x)
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").
-
Nice! Can't wait to try this with wallwalking :D
-
This is really not the correct place. This (https://bugzilla.icculus.org/enter_bug.cgi?product=Tremulous) is (change "Severity" to "enhancement").
-
Sure... if it gets positive feedback.
-
It will.
-
Great patch. I'll test it out.
-
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.:
bind a "+moveleft"
bind d "+moveright"
bind s "+back"
bind dta "+button6"
bind dtd "+button6"
bind dts "+button6"