View Full Version : insect ingame
Apr 26 2008, 10:58
Hi, I want to understand how the syntax used in the insects and windclutter classes work:
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">cost = "(9 + (2 * houses)) * (1 - night) * (1 - rain) * (1 - sea) * (1 - windy)";[/QUOTE]
<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">probability = "5 - (meadow * 0.5) + (forest * 0.4)";[/QUOTE]
Apr 26 2008, 18:22
Yeah I've looked at those too. Looks to me like you're constantly multiplying the probability by percentages & arbitrary probabilities to get an eventual final probability of existing.
Example, (1 - rain) sounds to me like when it's fully raining (rain = 1) then the multiplier is 0, and anything multiplied by 0 is 0. So no insects at all when it's fully raining. However if it's only 25% raining I suppose there is a multiplier of 0.75.
So rain, time of day, and sea either do not affect at all, or reduces the probability set out by the rest of the equation. After all any "* (1 - (0 to 1 value))" can only ever reduce a value, never increase it. So this part of the equation influences the probability.
The other part of the equation is some logical way to define the actual probability then. (9 + (2 * Houses)) sounds to me like an arbitrary probability (9) multiplied by twice the value of Houses. Whatever that is. Houses could either increase the probability or decrease it, depending on how you've set the logic up. I would guess that Houses must decrease the insect probability, giving you more insects out in the wild, however that's not what it looks like in the above example. So I would have to say that the insect being defined here is a housefly type insect that you DO want to be more populous around buildings.
Missed the point of the question, sorry http://forums.bistudio.com/oldsmileys/biggrin_o.gif however I'll leave my answer up for others to read.
Actually, reading it again, I would say that the Probability equation is exactly that, while the Cost equation is a reducer for environment.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.