Finer grained controls

Started by
6 comments, last by lask1 9 years, 3 months ago

Hi Guys,

I have found my controls to be sluggish i.e. my character slowish to respond to input

But if I increase the frequency of my game updates the controls become increasingly sharp

Are there ways of increasing the sharpness of my controls without increasing the frequency of game updates?

cheers

Reject the basic asumption of civialisation especially the importance of material possessions
Advertisement

Depends entirely on how you implemented your controls and the needs of your game.

For instance:

* if your controls accumulate over time, consider changing the rate of accumulation at the start.

* if your event response is implemented with animations, consider changing the animations.

* if your simulation runs several frames in the past, you might consider inserting the event into prior simulation steps and resimulating. (In a modern shooter often it makes sense to roll the simulation back and insert the event back in the correct location in time.)

* if your simulation queues events or has a response delay due to technical requirements, consider using audio or another feedback ("yes, sir") to let the player know the action is queued.

* if your game requires a time delay, such as allowing time for the player to input a multi-button combo, perhaps introduce an action that lets both the active player and the opponents know that a heavy action is being entered.

Hi frob,

cheers for the feedback

I take the last position of the mouse per update

Should I queue the mouse move events in my model & handle them incrementally when I am updating?

Think that would be good? Any pitfalls there? Collision detection could be difficult though?

Reject the basic asumption of civialisation especially the importance of material possessions

Your movement needs to take into account your framerate. You want to normalize movement to a "per-second" value rather than a "per-frame" value. This should be as simple as multiplying by the time since the last frame (and dividing by some constant of course).

This isn't normally what I would attribute to "sluggishness", but it's what I suspect the problem is here.

HI SeraphLance,

my game updates are considered once per update, i'm updating 30 time per second

when I up the updates to 60 times per second control increases

I think what I need to do is convert my mouse movement into impulses, queue the impulses in my character & then execute them in my update

Does that seem like a good idea?

Reject the basic asumption of civialisation especially the importance of material possessions

HI SeraphLance,

my game updates are considered once per update, i'm updating 30 time per second

when I up the updates to 60 times per second control increases

I think what I need to do is convert my mouse movement into impulses, queue the impulses in my character & then execute them in my update

Does that seem like a good idea?

What you are describing is buffered input, which is common when the program doesn't have to update very often.

However, if you are polling input at a rate of 30 times per second, especially changes in keys being pressed, there's a good chance that it might miss some key presses or mouse clicks from the user in between these frames, which can explain why the control response is better at 60 FPS.

New game in progress: Project SeedWorld

My development blog: Electronic Meteor

Cheers CC Ricers,

I have created a virtual joystick with my mouse not keys,

do you think averaging out the mouse move events positions would increase control?

cheers for the info

Reject the basic asumption of civialisation especially the importance of material possessions

Your movement needs to take into account your framerate. You want to normalize movement to a "per-second" value rather than a "per-frame" value. This should be as simple as multiplying by the time since the last frame (and dividing by some constant of course).

This isn't normally what I would attribute to "sluggishness", but it's what I suspect the problem is here.

I agree with SeraphLance,

This sounds like the problem you are having. If the game is updating inconsistently then the controls will too. You need to multiply the values of how much the mouse moved by the delta-time between each frame.

Cheers!

This topic is closed to new replies.

Advertisement