Theory: Certain blocks cannot have enemies spawn on them?

We should make a suggestion to the dev clean up the code! :p
On a serious note, @Thiner did you notice anything special about the new underground desert?
Also, just a thought, do some biomes take precedence over there in spawns?

It seems that we shouldn't make a suggestion to the dev clean up the code because we shouldn't look at the code at the first time.

And what you are asking is very very hard to speak because there are many many biomes and many many conditions. If there is no sufficient reason, no one want to read every line of the great SpawnNPC function. (2000+ lines as of 1.3.0.7)
As far as I can say, events and airborne and spider cave and aquatic mobs have precedence(mostly..) But the whole spawning dictionary must be made up before answering your question. So you asked a really big question. Please provide a sufficient reason before you ask such questions.
 
It seems that we shouldn't make a suggestion to the dev clean up the code because we shouldn't look at the code at the first time.

And what you are asking is very very hard to speak because there are many many biomes and many many conditions. If there is no sufficient reason, no one want to read every line of the great SpawnNPC function. (2000+ lines as of 1.3.0.7)
As far as I can say, events and airborne and spider cave and aquatic mobs have precedence(mostly..) But the whole spawning dictionary must be made up before answering your question. So you asked a really big question. Please provide a sufficient reason before you ask such questions.

If I get round to it I will have a look at the code just to see how complicated it is.
As for priority I was unaware that it would take so long.
 
As for priority I was unaware that it would take so long.

Spawning priority is annoying to calculate because it's set up as one gigantic branching function. So while it's relatively easy to see what conditions are required to make something spawn (although not *so* easy, as the discussion in this thread shows), it's particularly challenging to say what conditions are sufficient.

For example, maybe at the very end of the spawning routine, it checks to see if the block is grass and then spawns a zombie. So you can say very quickly that zombies can only spawn on grass. But in order to list out where exactly you can be sure that zombies will spawn, you need to look at the rest of the function to see if something would take precedence. (This is just an example, the zombie spawn is not near the end of the routine.)

It's probably possible to have some automated system parse the code and figure it out, but it would be non-trivial to write that system. For reference, I did this analysis manually with the fishing system (so that I could determine in exactly what conditions you could catch each fish) and it took me a few hours. And there're far fewer fish than enemy types!
 
2. Standing on marble blocks in rock layer is the EASIEST way to set the marble-spawn flag true. In the best condition(when nothing goes wrong) with the marble-spawn flag true you can ensure 4/5 of the spawns are marble-styled.
I was finding a rate more like 1 in 5 marble mobs whether standing directly on 2 marble blocks, or with then 20 tiles away. Caveats to this finding holding true universally are: (A) RNG and a small sample size for me. (B) I was at the edge of the world, and do not know that this (literal) edge case might cause differences.
marble blocks under where the mobs would spawn
Seemed to more reliably boost marble mob rate. But again still lower than 4 in5, I think. Wonder if game progression (bosses downed) changes things possibly?
6. If the marble style is settled, then Medusa will spawn in 5/6 chance when there isn't a Medusa, and won't spawn when there is one.
"settled"? (You mean natural vs smooth?) Certainly I did seem to find that Medusa was posibly always first to spawn, each test, followed by a Hoplite, sometimes. And never got 2 at once.
do some biomes take precedence over there in spawns?
Well, generally it goes by biome of spawn surface block found during spawn event, so less a case of 'precedence' and more of randomness biased (or controlled) by terrain. Presumably a marble (or granite) block is equally likely to produce a marble (or granite) mob, respectively, regardless of the spawn surface block types...? That kind of thing would take a lot of effort to test to any degree of veracity.
anything special about the new underground desert?
I'm feeling that Antlion mobs are a little different too, since I had one turn up, in my above tests, when it's only possible source was half a dozen hardened sandstone back walls. Couldn't duplicate though. There's a lot of different sub-rules for spawning... Chaos Elementals require a lack of player placed wall behind you, for example (Diceman found in one of his farm builds). Can't remember if they need a halloed surface, or just a active biome...?
 
Last edited:
Again lower than 4 in5

Well I read the section of the code again and this time I found the 4/5 line near the end of the function, which means there is a lot of exceptions. The best chance is no higher than 2/5 as there is a rand(2)==0 check before the marble-spawn line and I didn't see more because there are tons of codes between. After all, you are right.
But I can't find any difference between the marble tiles under the player and the enemies. Actually they work the same way, both flip the marble flag to true and them spawn marble enemies at the right tick.
 
Back
Top Bottom