285 reputation
16
bio website github.com/CodesInChaos
location Frankfurt, Germany
age
visits member for 3 years, 5 months
seen 9 hours ago

Sep
24
awarded  Autobiographer
Aug
22
comment How to avoid movement speed stacking when multiple keys are pressed?
It's about decoupling, not performance or different behaviour. I view computing the input direction and how the game reacts to it as different concerns. So I'd probably split this into two functions even, one GetInputDirection and then one that computes the movement. (And don't forget to use @nickname for notifications)
Aug
21
awarded  Commentator
Aug
21
comment How to avoid movement speed stacking when multiple keys are pressed?
I'd clamp to 1 and only multiply with moveSpeed after clamping and possibly merge it with the multiplication by deltaTime.
Aug
21
comment How to avoid movement speed stacking when multiple keys are pressed?
This produces NaN if no keys are pressed
Aug
19
comment What kind of steering behaviour or logic can I use to get mobiles to surround another?
Some kind of repelling force can be a good idea, but the details are tricky. I experimented with these in a space themed RTS and recommend not following physics too closely and rather modeling it so it behaves nicely. Some observations: 1) Since this is no physics simulation I'd only apply the force over short distances. 2) This can't prevent finite bodies from overlapping 3) The hard potential easily causes numerical errors, such as particles being refracted at high velocities. 4) Once you have a significant number of particles and pressure in the middle rises, things tend to get ugly.
Apr
1
comment How can I store game metadata in a .png file?
One could simply send the data through Base64 and store it as a single value
Sep
3
awarded  Critic
Jul
16
awarded  Yearling
Jul
11
revised Game getting progressively laggier?
formatting ans spelling
Jul
11
suggested approved edit on Game getting progressively laggier?
Jul
18
comment Unity or MonoTouch with XNATouch/MonoGame? same price
Seems to be outdated now: tirania.org/blog/archive/2011/Jul-18.html
Jul
18
answered In-Game Tutorial Decisions
Jul
18
comment What math should all game programmers know?
in most cases you want atan2 since this takes care of the quadrant handling by itself.
Jul
16
revised How are deterministic games possible in the face of floating-point non-determinism?
added 105 characters in body
Jul
16
awarded  Supporter
Jul
16
comment 2d top-down map: normalisation or not?
Still using fixed-point values for absolute positions can be a good idea. This leads to constant precision and identical physics all over the world.
Jul
16
revised Whats the most efficient method for controlling entities?
added 13 characters in body
Jul
16
revised How are deterministic games possible in the face of floating-point non-determinism?
added 113 characters in body
Jul
16
comment How are deterministic games possible in the face of floating-point non-determinism?
@jheriko you can hit a butterfly effect. You have sharp comparisons in your code, and the rounding error can happen to push a value over such a sharp boundary leading to quick resynchronization of the whole game state.