Quasar
Moderator

Posts: 2200
Registered: 08-00 |
Ajapted said:
That suggests something fundamental is wrong. EDGE is using such a "loose" system, yet flying monsters can go over other monsters, the player can walk over a bunch of imps, etc, without anything getting stuck together.
A single above_mo/below_mo at least keeps things simple. EDGE computes the new below_mo in PIT_CheckRelThing (btw we split up relative moves and absolute moves like spawning).
BTW, I just noticed EDGE never sets the above_mo. You could probably go without, or at least ensure that thing->below_mo->above_mo = thing.
Managing multiple below objects may be the best way, but is much more complicated of course. I've had an idea though: are you familiar with how the Boom touchnodes work? If not, get familiar with it. You could use the same type of system to implement multiple below/above objects.
Flying monsters can be optimised a little, since they don't need to be supported like gravity-affected things.
Sounds like you need to pull out SoM's code and do your own thing. You can't fix serious problems in code that you don't fully understand. Maybe have a look at the way EDGE and/or ZDoom tackle this problem.
ZDoom's sector movement code has given me some ideas, but unfortunately its basic over/under code is still derived from Hexen so that gives me licensing difficulties. I'm not sure I can (or should) combine Eternity's floorz/ceilingz crap with ZDoom's method of sector movement; I think it would not be guaranteed to work, and we have issues with maintaining the floorz/ceilingz anyways.
The chief problem with our existing system is this. Let's say the player is standing on a barrel, and has a cacodemon over his head. The player moves. The barrel's ceilingz should now be the cacodemon's z level, and the cacodemon's floorz should now be the top of the barrel. How must this be accomplished? The player must do a blockmap traversal and find every object affected by his move. Then every one of these objects must do blockmap traversals to find all objects that set their floorz or ceilingz. A nightmare in and of itself, and since there are so many special cases of movement in DOOM, sometimes it doesn't happen like it should and things get out of sync. The result is something getting stuck or hanging in midair. And when it comes to sector movement, the floorz/ceilingz values are no longer valid and are of no help at all in determining whom must move up or down what, and it's nearly impossible to keep something from being adjusted more than it should be.
So those are the problems with the existing system. Something simpler like you describe is quite tempting, however I fear EDGE has probably gone too "true 3D" to be of direct use to me. We don't have move vectors, for instance. Movements are still split into XY and Z planes and this creates some complication (though manageable I believe, as ZDoom deals with it fine).
|