Harpys Spawning Too Close to the Surface

BadgerAttack

Terrarian
Steam or GOG
Steam
Single Player/Multiplayer
Single
Operating System
Windows 10
Terraria Version
1.4.0
Controls Used
Keyboard/Mouse
When in a desert (or possibly other places) I have noticed that some harpys will spawn when im on the ground at 280' surface level
Capture 2020-05-19 16_11_18.png
 
Also noticed this during testing around some world generations. It seem to be pretty common for small worlds. Often had this in my own worlds.
According to game code they start to spawn if the enemy npc spawn position height (depth or y coordinate to be correct) is less than worldSurface * 0.45.

For small worlds a common and also the max worldSurface is 337 (tiles below top of world). Times 0.45 would be 151. But harpies will also spawn if the player is deeper than this because they can spawn up to 46 (named spawnRangeY) tiles above the player. If we include this spawn-distance-above-the-player-range in the above equation harpies start to spawn for player positions higher than worldSurface * 0.45 + 46.
So in our test case 151+46 = 197. Scaling this again with our total worldSurface of 337 we will get a ratio of 197/ 337 = 0.585 which is much deeper than the 0.45 factor from above.
Theoretically the worldSurface could be down to 229, multiplied by factor 0.45 would be 103, adding the spawn height 46 will be 149 and with this the ratio would be 149/229 = 0.65 which is much worse than the target ratio 0.45.
(For medium an large worlds the worldSurface is bigger and with this it has less impact)


Fix suggestion: subtract the spawn-above-height from the actual spawn condition.
With this the harpy spawn ratio (player position where harpies start to spawn related to worldSurface) is always 0.45.
So harpies (and wyvern) would spawn if their the y coordinate of their spawn location is less than
(worldSurface)*0.45-46
(instead of less than (worldSurface)*0.45 as it is right now which leads to inconsistent spawn height ratios)

For example here some picture:
1652806102409.png

Green arrow is the player spawn location.
The dotted line (near the spawn) is the current Harpy-start-to-spawn-height. If the player moves above this Harpy will start to spawn. He has about no chance to avoid this for this world.
If we subtract the spawn-above-height the harpies would spawn if the player moves above the green line instead which gives the player at least some space to build his base of fight some bosses.
Furthermore with this the (player-position-where-harpies-start-to-spawn-height)/worldSurface = would always be 0.45, independent of the worldSurface variable or the world size in general.
(maybe special case for scopes & binoculars)

This could be some small change big impact update :)


---------------
Some statistics:
Out of 100 generated small world in 21 the harpies start to spawn in 34 or less tiles above the player spawn.
Means with resolution 1920x1080 the player could move at most that height which is visible at the start of the game without spawning harpies.
This is very limiting for base building and boss fights.
 
Last edited:
your post is very tough to follow, i'm assuming because of a language barrier
what you are trying to suggest is to only allow harpies to spawn if the player Y is < worldSurface * 0.45, instead of allowing any tiles within the spawning rectangle that are < worldSurface * 0.45 to spawn harpies?
messing with the spawn conditions that way sounds dangerous, it would be better to just reduce the surface factor depending on the world size. for example to only 0.3 for small worlds
 
suggest is to only allow harpies to spawn if the player Y is < worldSurface * 0.45, instead of allowing any tiles within the spawning rectangle that are < worldSurface * 0.45 to spawn harpies
Almost, they are allowed to start to spawn at the top most spawning area at this point. Below that other enemies will spawn. In source code it still need to be related to the enemy spawn position.

it would be better to just reduce the surface factor depending on the world size. for example to only 0.3 for small worlds
This would maintain (actually increase) the inconsistency among different worlds (with different worldSurface) and world sizes.
I don't think changing the surface factor would be less dangerous (assuming adding the offset is dangerous).
Which dangerous impact is present at '(worldSurface)*0.45-46' and not present at '(worldSurface)*0.3' ?
 
Last edited:
According to the wiki, harpies spawn above 65% (and 55% in hardmode) of the distance from 0 altitude to the top of the world.

So if the world generated with a particularly low ceiling, say, 450ft, then harpies can spawn at 247ft, and if the hills in the desert generated particularly high, say 185ft, then it's very much possible to stand at the top of this hill and have harpies spawn in hardmode.

So this does not seem like a bug, unless there is additional information, for example depth meter readings that show that the spawns happened much lower.
 
According to the wiki, harpies spawn above 65% (and 55% in hardmode) of the distance from 0 altitude to the top of the world.

So if the world generated with a particularly low ceiling, say, 450ft, then harpies can spawn at 247ft, and if the hills in the desert generated particularly high, say 185ft, then it's very much possible to stand at the top of this hill and have harpies spawn in hardmode.
If hardmode harpies/wyvern can spawn at 247ft the player only need to be above 155ft as they can spawn up to ~92ft above the player.

That means no hill is required. Normal non-hill terrain seem to be able to generate also up to this height. The doted line at the picture above shows the start of the harpies/wyvern hardmode spawn.
Here some other example:
The player just standing at a nearby oasis biome and a wyvern can spawn.
1652871637467.png

and the related map
1652871702465.png

Meaning every time the player jumps or builds a base above ground a wyvern/harpy can spawn.
At the oasis he doesn't even need to jump.
 
Did you miss the part about the world ceiling that I wrote before that?
Only used it as example and to emphasize the spawn can even be lower than a player height of 185ft.
But it can also be rephrased as:
If the world generated with a particularly low ceiling no hills are required to spawn harpies/wyvern in hardmode.

As statistics show that's pretty common in vanilla world gen.
 
messing with the spawn conditions like that is dangerous because all enemies depend on getting data from their randomly picked spawn tile, not from where the player is
hence changing the valid spawn area for harpies is better than adjusting core mechanics just for one specific case
 
messing with the spawn conditions like that is dangerous because all enemies depend on getting data from their randomly picked spawn tile, not from where the player is
ye, this fix suggestion is related to the enemy spawn position and the enemy spawn area height and not the player position.
spawn harpy if randomly picked spawn tile has a y variable < worldSurface * 0.45 - spawnRangeY
 
Back
Top Bottom