5,999 reputation
11432
bio website vyznev.net
location Helsinki, Finland
age
visits member for 3 years, 10 months
seen Jun 23 at 19:39

I'm a PhD student in biomathematics, working on stochastic individual-based models of evolution in spatially structured populations. My other interests include cryptography, programming games and puzzles, photography and graphic design.


I'm the main author and maintainer of the Stack Overflow Unofficial Patch (SOUP), a user script for browsers with GreaseMonkey-compatible user script support (Firefox, Chrome, Opera, possibly Safari) that fixes or works around a number of outstanding issues with the Stack Exchange user interface.

I tend to answer a lot more questions than I ask. Some answers I'm rather proud of:

CC-Zero Please consider any (original) code I post to Stack Overflow and other Stack Exchange sites to be released under CC-Zero unless stated otherwise. You may do whatever you want with it and don't have to credit me in any way, although of course that would be nice.


Jun
23
reviewed Approve Creating a separate renderer for entities in a 2D game
May
24
comment How to render infinite universe?
Do you plan on having some kind of a maximum view distance, or do you have some way of merging distant points so that you don't have to render them individually, or are the "points" opaque and arranged so that most of them will be hidden from any given viewpoint? Because if none of the above hold, I don't see any way to prevent the user from finding camera angles from which most of the points (or at least a significant fraction of them) will be visible at the same time.
May
19
comment Trying to implement gun cooldowns in C#
@Zee: If the longer cooldown is meant to simulate reloading a clip, then you might not want to auto-reload until the gun is empty, or unless the player explicitly does an early reload.
May
19
comment Trying to implement gun cooldowns in C#
Why have the if (bulletCounter == 3) check outside the keypress handling code? The only way bulletCounter can become 3 is by getting incremented when a shot is fired, so it IMO makes more sense to check for it right there. (For example if (bulletCounter == 3) { gunCooldown = Time.time + 0.80f; bulletCounter = 0; } else { gunCooldown = Time.time + 0.12f; } or even just gunCooldown = Time.time + (bulletCounter % 3 == 0 ? 0.80f : 0.12f );)
Apr
23
comment Pausing the game inside the game loop
@user3730788: A branch that executes once per game loop (i.e. less than 100 times per second) will have no discernible performance impact, not even if it's mispredicted every time.
Apr
12
answered Strategy game tile and unit storage
Apr
7
comment Framerate is affecting speed of object
@MooingDuck: Well spotted. I've fixed it now, I think. Thanks!
Apr
7
revised Framerate is affecting speed of object
fix lastTime tracking per comments
Apr
7
awarded  Nice Answer
Apr
7
comment Framerate is affecting speed of object
@MooingDuck: That's a very good point. I've edited my own answer to reflect it. (Usually, you shouldn't be dividing anything by the timestep in a typical game state update, so a zero timestep ought to be safe, but allowing it does add an extra source of potential errors for little or no gain, and thus should be avoided.)
Apr
7
revised Framerate is affecting speed of object
better variable name
Apr
7
comment Framerate is affecting speed of object
@Carpetfizz: updateInterval is just the number of milliseconds you want between game state updates. For, say, 10 updates per second, you'd set updateInterval = (1000 / 10) = 100.
Apr
7
revised Framerate is affecting speed of object
better variable name
Apr
6
answered Framerate is affecting speed of object
Mar
29
awarded  Revival
Mar
18
awarded  Good Answer
Mar
14
comment How to render a pseudo-3D view like in the game Biosys (1999)?
Well, I was going to answer this, but it looks like the question got closed. Anyway, it looks like they've pre-rendered the scenes and baked them into cube maps, allowing you to look around but not move your viewpoint. They also sort of fake movement by zooming in on the exit when you move between scenes. Incidentally, Google Street View basically uses the same trick (and even has the same zoom transition effect), except that, of course, they use real 360 degree panoramic photos.
Mar
14
revised How to render a pseudo-3D view like in the game Biosys (1999)?
well, let's rewrite it ask "how to achieve this effect", then
Mar
2
revised How can I make a “random” generator that is biased by prior events?
added 3507 characters in body
Mar
2
comment How can I make a “random” generator that is biased by prior events?
@DMGregory: If you insert random cards into the deck, then yes, you lose the balancing effect. (In fact, that happens whether you insert them gradually or only when the deck runs out.) However, if you make sure to insert the cards at a fixed ratio (e.g. using something like the dithering algorithm in my answer, or just by, say, maintaining a shuffled deck of up to 2*N cards, and shuffling in a fixed N-card set whenever the deck gets down to N cards), the balancing effect is retained (to some extent, depending on the deck size and replenishment scheme).