Don’t fall on this

Screen Shot 2013-09-15 at 6.31.16 PMAnother bug screenshot, today.

Just found this spot in a generated world.  It’s actually supposed to be a very flat plain (I’ve temporarily removed most terrain features while I’m rehashing terrain modification), but the ground has wound up turning into a bed of spikes.

I haven’t fixed this yet, but I think the problem is that the world geometry has begun generating before the general world shape has been selected.

The world generation happens in a bunch of background threads.  It generates (right now) five different versions of the world ground data, at varying levels of detail.  And I believe what we’re seeing here is the result of one level of detail being generated while the world was in one state, and the next one being generated while it was in another.  So one vertex in every four winds up at a different height than all its neighbors.

Need to figure out exactly where the bug is, obviously.  Wouldn’t do for the poor players to impale themselves on the ground accidentally.  :)

Edit, 30 minutes later:  Finally found and fixed the bug.  Same cause as the bug from the last post.  All sorted out now;  it was exactly what I’d predicted;  certain bits of world shape weren’t being set until after the game’s first ‘draw’, and so any bits of the world which were generated before that were getting the wrong shape for the world.