Reputation
329
Top tag
Next privilege 500 Rep.
Access review queues
Badges
1 7
Impact
~9k people reached

Apr
18
comment How can a game handle all characters at once?
For a beginner I wouldn't recommend using separate graphic and logic threads, since unless you copy the required data, rendering the game state requires read access to the game state, so you can't modify the game state while drawing it.
Apr
18
comment How can a game handle all characters at once?
If you want to use multi-threading for path finding, create a separate pathfinding phase during which nothing else happens, and then multi-thread only that phase. Since pathfinding is a simple, well defined problem that can be separated into non interacting subproblems, multi-threading it is much easier than multi-threading arbitrary game logic. I recommend only looking to multi-threading if you still have performance problems after you have exhausted algorithmic improvements.
Apr
18
comment How can a game handle all characters at once?
@LorenPechtel For example in a tower defense game, you could use the fact that there are typically only a handful of destination points. So you could run Dijkstra's algorithm for each destination to compute a direction map which guides all the units. Even in a dynamic environment where you have to recompute these maps every frame, this should still be affordable.
Jan
23
comment How to encrypt Save Files without using a key?
For obfuscation I'd rather use custom algorithms, not standard crypto. Crytographic security doesn't matter, since you can't keep the key safe from the attacker, and figuring out the custom algorithm is more work for the reverser.
Dec
5
comment How can I create borders in an open-world game that don't feel artificial?
@IlmariKaronen Populous: The beginning used a wrapping square, not a torus, and the mismatch between a sphere and square could lead to confusing effects.
Nov
12
comment Why not pre-render story parts in a game?
For me seeing close ups of ingame graphic is far more immersion breaking than a pre-rendered video with better graphics. Especially since faces/hairs aren't handled well in real time, even today.
Mar
3
awarded  Citizen Patrol
Jan
25
comment Unity 3d 4 players Only 4 buttons can be pressed at a time
Cheap keyboards won't even recognize many 3 key combinations.
Jan
20
comment What is the simplest way to calculate distance in a 3D environment?
Most vector libraries should have a built in function to compute the (squared) length of a vector.
Jan
20
comment What is the simplest way to calculate distance in a 3D environment?
This is not the Euclidean distance, it's Manhattan distance
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