Gosh I do feel complimented!
Thanks for the tips, I appreciate them: I honestly had not considered skipping input for frames. This is mostly because while I know I wouldn't notice, there are "gam3rz" out there who have special keyboards and mice to get the extra milliseconds of responsiveness out of it, and I thought it might bug them.
Given I'm not writing a "twitch" game, though, good call.
More tips:
* I often use the construction:
PLAYER.SpeedZ# = (PLAYER.WalkSpeed# * keyState(KEY.Forward)) - (PLAYER.BackUpSpeed# * keyState(KEY.Back))
However, I've no idea if this is faster or slower than using "IF keyState(KEY.Forward)". I suspect it's slower. But I find it faster in programmer time, and so long as I am getting good FPS, that's what I'm optimising for.
* Where keys are exclusive, and you cannot use one and the other at the same time, ideally you would use SELECT to pick between them. But I think in DBP's SELECT requires its CASEs to be static, which means if you use mappable keys, you can't check them with CASE. Testing each key in turn with an "if" is gonna be slow, because you're testing all of them. The fastest is probably a nested IF-ELSE-ladder, with the most often-used keys at the top. These are ugly, but do slightly optimise for speed by ignoring the less common options. If you find this ugly, you can have a non-nested chain, with a goto in each one to take you to the end of the chain.
if keyState(KEY.Shotgun)
select(shotgun)
else
if keyState(KEY.Uzi)
select(Uzi)
else
if keyState(KEY.Fists)
select(Fists)
endif
endif
endif
* If you're writing a game where people can only press one key at a time (so not a FPS where people can circlestrafe and fire while jumping) then it's gonna be a ton faster to just store SCANCODE once than check KEYSTATE once for each key.
Yet another programmer - http://www.thudgame.com/mmo
All my posts are Public Domain unless I say otherwise.
You may use all my code and ideas as you see fit.