5 ms·
This would be great for Rally racing games, since it's all about reacting to unknown terrain. Also, it would be better if mouse steering is damping impulse bas
by xeonmc 4y ago
This would be great for Rally racing games, since it's all about reacting to unknown terrain.
Also, it would be better if mouse steering is damping impulse based, i.e. every frame the steering position exponentially decays, mouse position resets to center and the change is added as impulse on the steering position.
sensitivity = max_ang / ( screenwidth/2 )
decay_rate = 6.0
frame(dt){
dx = mouse.x - center_pos
mouse.reset()
steer_ang += dx*sensitivity
steer_ang.clamp(-max_ang,max_ang)
steer_ang *= exp(-decay_rate * dt)
}
- anslo 4y agoThanks! I'll give that a go and at least add it as an optional alternative, if not the default :)
- xeonmc 4y agoOh, and I noticed that the tyres don't seem to respond to the steerangle changes immediately, instead it seems to slowly interpolate towards it. Not sure if it's cosmetic and does not represent the logical wheel state, but if it does then you might want to change it so that the steer-bar position directly sets the wheel angle, otherwise they'll end up being derivatives of derivatives making it extra sluggish.
- aliqot 4y agobike doesnt lean
- erwincoumans 4y agoAny chance for joystick controls?
- whoopdedo 4y agoYour description is that steering decays then has mouse impulse added, which makes sense to me. But the code decays the steering after adding the delta-X. Is there a reason for that?
- xeonmc 4y agoAs the discrete impulse is meant to approximate average derivative, applying decay after the impulse ensures that the value is always attenuated by decay (low frame rate underestimate the ground truth impulse, whereas the converse overestimates at low framerate).
- astrobe_ 4y ago> This would be great for Rally racing games, since it's all about reacting to unknown terrain. Indeed, eventually you know the tracks by heart, so much so that you don't need the pacing notes anymore. I'm surprised nobody thought of using procedural generation here. It's not exactly true that you react to unknown terrain, though, because IRL there's reckons in order to make pace notes, and I suspect that rally races tend to happen more-or-less on the same roads. PS: actually someone did think about using procgen for rally games: https://www.racedepartment.com/downloads/procedurally-generated-rally-league-stage-demo-pack-1.19270/ https://www.racedepartment.com/downloads/procedurally-genera...
- consumer451 4y agoI have a keyboard steering related question. I like key control, but I do find the on/off nature of keyboard turning to be lacking. First let's move WASD over to the right by one key, so ESDF. S and F would now turn slightly. Now let's add A and G and assign those to more extreme turning. Is there any driving game which has done this, or at least has some sort of configurable system where it could be tried? I assume it has to exist somewhere if it is at all usable.
- anslo 4y agoInteresting idea - I could try implementing this experimentally
- xeonmc 4y agoOr alternatively, have ijkl serve 75% weight and esdf serve 25% weight. Then you can achieve 100%, 75%, 50%, and 25% combinations using both hands. Left | Right | Total ------|-------|------ +0.25 | +0.75 | +1.00 0.00 | +0.75 | +0.75 -0.25 | +0.75 | +0.50 +0.25 | 0.00 | +0.25 0.00 | 0.00 | 0.00 -0.25 | 0.00 | -0.25 +0.25 | -0.75 | -0.50 0.00 | -0.75 | -0.75 -0.25 | -0.75 | -1.00 (two ternary digits -> 3^2 = 9 combinations)
- nomel 4y ago> but I do find the on/off nature of keyboard turning to be lacking. This may interest you: https://aimpad.com/ https://aimpad.com/ > Aimpad® patented technology adds full analog movement control to the traditional WASD keyboard layout
- Karawebnetwork 4y agoDoes this require software at all?
- Toutouxc 4y ago> This would be great for Rally racing games I'm pretty sure the tracks in Dirt 4 were procedurally generated. This made them feel extremely generic and bland compared to the hand modelled tracks in the sibling-series Dirt Rally.
- galangalalgol 4y agoThat is also why Bethesda switched from procedural generation for Daggerfall to hand built for Morrowind. I have to wonder if we could train a model now to do this stuff? For terrain it is mostly mappable to an image anyway. Could fix undercut cliffs in a post processing step using voxel models instead. Probably not a very good database to pull from for underground stuff though if you want to generate dungeons.
- anslo 4y agoYou're right - I spent a while looking for existing procedural driving games before I started, and seeing how disappointing the Dirt 4 implementation was was all the motive I needed. Thanks for the kind words.
- xeonmc 4y agoCORRECTION: missed a divide-by-dt for the += corrected code should be sensitivity = userpref.sensitivity * max_ang / ( screenwidth/2 ) decay_rate = 6.0 frame(dt){ dx = mouse.x - center_pos mouse.reset() steer_ang += sensitivity*dx/dt steer_ang.clamp(-max_ang,max_ang) steer_ang *= exp(-decay_rate * dt) }