Wind and Scent

I think it would be interesting to be able to gauge the wind and it’s direction so you could approach towns downwind so you have less of a chance of being detected. also good for stalking animals.

Yes, there will be a wind indicator once there’s wind. (yep, it’s currently still at all times… deathly still…)

And simultaneousy it will effect scent, and probably gas clouds.
Actually I’m looking at the scent calculations right now, it’s surprisingly CPU intensive, and I’m looking at ways to speed it up further.
Finally, if I can get it sped up enough, I’m thinking of having a scentmap that the player can use to smell zombies :smiley:

Hmm. Mutation: Canine Nose?

Trait: Big Nose/(insert generic terrible Jewish pun)/good smeller
You got a good sense of smell there! You will detect smells in the air more frequently and be able to tell the concentration more effectively.

Also have it tied to perception!

I assume it’s a b***h to code waves of air stumbling around buildings, open doors & windows, sometimes changing direction as drastic as 90 degrees per turn. A storm, and there you have a hardcoremode.
I am a big x100 fan of the scent system, though.

Lets fix the scent system too!

Currently zombies are a homing missile based on scent.
Scent should be calculated and tracked on a concentration basis like 1-5 old, 5-10 mid, and 10-20 recent. Scent should disperse while losing concentration levels, and zombies should go back to the highest scent level available and move randomly until it finds a higher concentration or moves to a lower concentration.

That’s how I would do it, to simulate some simple zombie thought process instead of scent-seeking-missile zombies we have now.

Wasn’t saying fantastic things about amazement and profound joy, just that the idea is well put in code.
Anyway, there are pockets of air and repeating patterns not necessarily following the path of wind, sublayers in the high, and scent that sticks - not to get to fancy with words and redundant with science nevertheless. So for me, it’s either random and fuzzy logic programming, or none.
Air an weather can be simulated, but it takes a world to gather all the data.

Isn’t this essentially how scent is simulated already? Scent is just an invisible cloud generated by the player which leaves a short-term trail behind them as they move around. It doesn’t disperse faster than something with the ability to smell can track it if they’re close enough to the player to stumble across it to begin with, but that’s as you’d expect, no? The player can’t be tracked by something more than a minute or two away from their position anyway, because the game doesn’t simulate the actions of anything more than a couple of screen lengths from where they are.

[quote=“vultures, post:5, topic:1516”]I assume it’s a b***h to code waves of air stumbling around buildings, open doors & windows, sometimes changing direction as drastic as 90 degrees per turn. A storm, and there you have a hardcoremode.
I am a big x100 fan of the scent system, though.[/quote]

You might be astonished at some of the algorithms for wind simulation floating around. Math is everywhere!

HalberdSurgeon
Scent is actually now a trail, and zombies will follow scent in a 100% accurate way. Always finding your exact location in under a few turns. Much like heat seeking missiles.

Really they shouldn’t even be able to smell that well. A dog can track an old scent trail because its scent neurons are x100 what humans have and 3/4ths of their brain is dedicated to scent, not the 15% humans have.

Even maxed out full capacity a human could only track a smell three minutes old and if they where rubbing against the ground.

Scent in the air disperses very quickly, especially with wind and is entirely untraceable. Footprints leave no scent and touching something leaves only a very light scent footprint.

So I’m just rather mad as how a zombie can smell me better than a wild deer IRL.

You might be astonished at some of the algorithms for wind simulation floating around. Math is everywhere!
The guy behind this game's algy knew what he's doing, important things, keeping both the world and player "alive"... If you can't give zombie a nuggie well, he can't drink half a bottle of scotch anymore, just so to deal with it. Good thing that noise is useful, rly. Only to say, real gens that predict world-scale weather need an equally large input to be precise and useful.

I wanted, and still want to make another scent system on top of the existing one that works like gtaguy described, leaves a trail, but the current system is still a cloud centered on the player.

Basically for each square in range it does a calculation where each square gets the average of its value and all surrounding squares, this is a simple diffusion simulation assuming particle mixing in a homogenous environment. The tricky part is excluding scent barriers (walls for example) in a simple way, because the very simple version of just skipping barriers when doing calculations means the average gets skewed and walls effectively eat scent instead of it flowing around them.

Adding wind to this would selectively apply an offset to the calculation so that the cloud as a whole would also migrate in the direction of the wind, possibly it would be applied stochastically so that it can represent a wide range of wind speeds. The real complication though is walls, scent would tend to pile up against walls and have no good way of moving around them other than lateral diffusion, which is really too slow, so we might have to do something to detect being blocked by walls and shift the scent laterally instead. Also the offset wouldn’t be applied inside buildings, so might need some special handling for hat, though I can’t see any major issues like with it piling up against walls.

For players smelling zombies in particular I wasn’t planning on making it require particularly acute senses as I assume the zombies are a bit… ripe 0_0

[quote=“Kevin Granade, post:12, topic:1516”]I wanted, and still want to make another scent system on top of the existing one that works like gtaguy described, leaves a trail, but the current system is still a cloud centered on the player.

Basically for each square in range it does a calculation where each square gets the average of its value and all surrounding squares, this is a simple diffusion simulation assuming particle mixing in a homogenous environment. The tricky part is excluding scent barriers (walls for example) in a simple way, because the very simple version of just skipping barriers when doing calculations means the average gets skewed and walls effectively eat scent instead of it flowing around them.

Adding wind to this would selectively apply an offset to the calculation so that the cloud as a whole would also migrate in the direction of the wind, possibly it would be applied stochastically so that it can represent a wide range of wind speeds. The real complication though is walls, scent would tend to pile up against walls and have no good way of moving around them other than lateral diffusion, which is really too slow, so we might have to do something to detect being blocked by walls and shift the scent laterally instead. Also the offset wouldn’t be applied inside buildings, so might need some special handling for hat, though I can’t see any major issues like with it piling up against walls.

For players smelling zombies in particular I wasn’t planning on making it require particularly acute senses as I assume the zombies are a bit… ripe 0_0[/quote]

Is the scent simulation even accurate? The impulse response doesn’t appear Gaussian. Every other turn there is a depression or hole in the origin, and there seem to be ripples every other turn as well. Also, it doesn’t obey conservation of matter. If you turn on olfactory mask and move to a fresh location, deactivate it for one turn, reactivate it and observe the evolution of the scent cloud, on the very first turn you’ll see that the origin has a scent of 300, and it’s surrounded by squares that all have scent 200. Shouldn’t the total scent add up to 600 (assuming this is a linear scale), since that’s how much scent you emitted?

Wouldn’t a simpler (and easier to understand) algorithm be something like every update, x% of the scent on a square is spread equally among its neighbors, i.e. each neighbor gets x%/8 scent added. I believe this has the virtue of resulting in Gaussian scent clouds which is what I would expect the impulse response of the diffusion equation to be. It also makes scent a conserved quantity. You could also make walls “refund” the scent given to them so they don’t act as sinks.

Lastly, the calculation could be made a lot faster, at least for long activities like sleep, if you stopped calculating scent once it reaches its steady state. With the current algorithm, that takes ~5 minutes. If you sleep for 8 hours, update_scent() is doing a whole lot of spinning its wheels.

It works basically as you describe, with one odd caveat, which is that fields don’t contribute to higher concentration fields. I’m skeptical that this is really what we want, but changing it changed the dynamics a great deal, so I deferred looking at it.

GalenEvil is working on a supposedly much faster Cellular Automata based diffusion system, so we’ll take another look at deactivating scent updating after it reaches steady state once that’s working.

Isn’t the current system already an example of cellular automata? The value of each cell post-update is dependent only on the values of its neighbors (and itself) pre-update.

Yes, though I got the idea that he was proceeding with more formal CA methods rather than the rather brute-force and ad-hoc nature of the existing code.