The first hound wave can happen as early as the start of day 6, but at that time, it is very rare for a player (including the host) to actually receive hounds; they only get the warning.
attack_delays = { intro = function() return TUNING.TOTAL_DAY_TIME * 5, math.random() * TUNING.TOTAL_DAY_TIME * 3 end, light = function() return TUNING.TOTAL_DAY_TIME * 5, math.random() * TUNING.TOTAL_DAY_TIME * 5 end, med = function() return TUNING.TOTAL_DAY_TIME * 7, math.random() * TUNING.TOTAL_DAY_TIME * 5 end, heavy = function() return TUNING.TOTAL_DAY_TIME * 9, math.random() * TUNING.TOTAL_DAY_TIME * 5 end, crazy = function() return TUNING.TOTAL_DAY_TIME * 11, math.random() * TUNING.TOTAL_DAY_TIME * 5 end, },
New players and the host receive hound wave protection based on whether or not they "lived shorter than the minimum wave delay". What is supposed to happen is that they should receive exactly one hound, but that is not always the case.
for player, group in pairs(groupindex) do local attackdelaybase = _attackdelayfn() local playerAge = player.components.age:GetAge() -- amount of hounds relative to our age -- if we never saw a warning or have lived shorter than the minimum wave delay then don't spawn hounds to us local playerInGame = GetTime() - player.components.age.spawntime local spawnsToRelease = (playerInGame > _warnduration and playerAge >= attackdelaybase) and CalcPlayerAttackSize(player) or 0
spawnsToRelease will sometimes equal 0 because playerAge is not greater or equal to attackdelaybase. My guess is that it ends up calling the attackdelaybase = _attackdelayfn() function again, which can potentially return a number greater than playerAge, which causes the variable to return 0. The problem here is that attackdelaybase is not synced with the current hound wave, and could be fixed by removing the math.random variance from the function in this case. This is supported by the fact that hounds fail to spawn more often closer to day 6.
Here are some debug commands from the file for easy access:
TheWorld.components.hounded:ForceNextWave()
c_announce(TheWorld.components.hounded:GetDebugString())
-
2
-
1
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now