migration from irrlicht 1.4.1 to 1.8.4

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
kas1e
Posts: 212
Joined: Sun Jan 21, 2018 8:39 am

Re: migration from irrlicht 1.4.1 to 1.8.4

Post by kas1e »

I think Irrlicht 1.8 was probably r4344 (at least that's the last commit before the release date I see in changes.txt).
Seems so, yes. At least, in r4344 we didn't fall under the floor for sure :)
So if you go with 1.8 it might still be worth copying over newest CSceneNodeAnimatorCameraFPS code from trunk. And I totally don't say that because I want another person testing all my new changes ... *looksaway* (seriousy, 1.8 ignored all kind of mouse movements, rotation was bad!).
In that game i didnt use any code from CSceneNodeAnimatorCameraFPS, but instead just from CCameraSceneNode.cpp and a bit of CBillboardSceneNode.cpp.

Now, when i build r5975 now, i have that "fall down" issue back. I.e. in r4344 i didn't have that, in r5975 have. So i will try to find out guilty commit. At least it will be something to think about (for me it will be easer than create test case from the code i not understand :) )

And while i "fall down" under the floor, i can move out of the maps borders. I.e. like, there is no limits absolutly now. I can just go to any place while falling down.

Probabaly the only one difference i do there for trunk's code in compare with 1.8.4 , its just :

Code: Select all

 
 
// 1.8.4 
//! returns the axis aligned bounding box of this node
const core::aabbox3d<f32>& CAABillboardSceneNode::getBoundingBox() const
{
    return BBox;
}
 
// 1.9.0-trunk fallback
 
#ifdef __irrlicht_r5975__
const core::aabbox3d<f32>& CAABillboardSceneNode::getTransformedBillboardBoundingBox(const irr::scene::ICameraSceneNode* camera)
{
    return BBox;
}
#endif
 
But not sure is that change could cause this ? (or can ?)
CuteAlien
Admin
Posts: 9645
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: migration from irrlicht 1.4.1 to 1.8.4

Post by CuteAlien »

I don't know how billboard code can be related to physics or camera?
But this shouldn't be about the camera. It simply sounds like the collision response animator doesn't get any collisions.
Maybe one of my changes I made in there to fix problems broke your use-case somehow (biggest change was in r5305).
You could set a breakpoint in CSceneNodeAnimatorCollisionResponse::animateNode and step through to see if it gets there, maybe for some reason the code is never called now?
If it does - it probably finds no collisions. Several things have been changed (fixed...) in collisionmanager as well. But without knowing anything about your game-code I have no clue. Collisions in the Demo still work.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
kas1e
Posts: 212
Joined: Sun Jan 21, 2018 8:39 am

Re: migration from irrlicht 1.4.1 to 1.8.4

Post by kas1e »

Run out of time today, but what i found is that it is not r5305 which is guilti. I find out that at least with r5310 all fine, but r5355 already have that issue. So something after 5310 and before 5355. Will try to reduce it more tomorrow.
CuteAlien
Admin
Posts: 9645
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: migration from irrlicht 1.4.1 to 1.8.4

Post by CuteAlien »

Ah yeah, another big rewrite in r5350-r5353. Where I found several problems while trying to add a feature. Guess I also messed up something :-(

edit: As I never asked - I suppose this is a proprietary game, so you can't post the source-code?
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
kas1e
Posts: 212
Joined: Sun Jan 21, 2018 8:39 am

Re: migration from irrlicht 1.4.1 to 1.8.4

Post by kas1e »

edit: As I never asked - I suppose this is a proprietary game, so you can't post the source-code?
Yeah closed sourced, but author ok if i share it with another dev. I have private github repo with it already, so if you can give me your github acc, i can made it visibly for you
CuteAlien
Admin
Posts: 9645
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: migration from irrlicht 1.4.1 to 1.8.4

Post by CuteAlien »

Ah, better not in that case. Unfortunatly a bit of a risk risk looking at proprietary sources when you work in open source projects (all games kinda need the same stuff so things tend to look similar even if you re-implemented them from scratch).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
kas1e
Posts: 212
Joined: Sun Jan 21, 2018 8:39 am

Re: migration from irrlicht 1.4.1 to 1.8.4

Post by kas1e »

No no, its not commercical, its just closed sourced. Author is one person and have no problems with anything of the sort you fear of :)
CuteAlien
Admin
Posts: 9645
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: migration from irrlicht 1.4.1 to 1.8.4

Post by CuteAlien »

No problem, I was just a bit curious. If we can't figure out some bug it's good to have that option.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
kas1e
Posts: 212
Joined: Sun Jan 21, 2018 8:39 am

Re: migration from irrlicht 1.4.1 to 1.8.4

Post by kas1e »

So, there is results of last bug we discuss:

r5349: all fine, no fall down.
r5350: can't start actual game, menu fine, but choice "new game" made app meditating in busy loop
r5151: can't start actual game, menu fine, but choice "new game" made app meditating in busy loop
r5152: can't start actual game, menu fine, but choice "new game" made app meditating in busy loop
r5153: game starts again, and there we already have fall down bug introduced.


Now, seeing that in r5153 you fix some thing done wrong in r5350, i then tried again r5350 and r5351 with that bugfix from 5153 applied (to see, is it exactly r5350 which is guilty, or r5351). And our winner commit 5350. I.e. 5349 no bug, 5350 (with bug-fix from r5153) bug is here.

Now i put bunch of prinfs to CSceneNodeAnimatorCollisionResponse::animateNode, to see where we go, so code looks like this then:

Code: Select all

 
void CSceneNodeAnimatorCollisionResponse::animateNode(ISceneNode* node, u32 timeMs)
{
    printf("we inside of CSceneNodeAnimatorCollisionResponse::animateNode\n");fflush(stdout);
    CollisionOccurred = false;
 
    if (node != Object) {
        printf("node != Object\n");fflush(stdout);
        setNode(node);
    }
 
    if(!Object || !World) {
        printf("!Object || !World\n");fflush(stdout);
        return;
    }
 
    // trigger reset
    if ( timeMs == 0 )
    {
        printf("tineMs == 0\n");fflush(stdout);
        FirstUpdate = true;
        timeMs = LastTime;
    }
 
    if ( FirstUpdate )
    {
        printf("FirstUpdate\n");fflush(stdout);
        LastPosition = Object->getPosition();
        Falling = false;
        LastTime = timeMs;
        FallingVelocity.set ( 0, 0, 0 );
 
        FirstUpdate = false;
    }
 
    const f32 diffSec = (f32)(timeMs - LastTime)*0.001f;
    LastTime = timeMs;
 
    CollisionResultPosition = Object->getPosition();
    core::vector3df vel = CollisionResultPosition - LastPosition;
 
    FallingVelocity += Gravity * diffSec;
 
    CollisionTriangle = RefTriangle;
    CollisionPoint = core::vector3df();
    CollisionResultPosition = core::vector3df();
    CollisionNode = 0;
 
    // core::vector3df force = vel + FallingVelocity;
 
    if ( AnimateCameraTarget )
    {
        printf("AnimateCameraTarget\n");fflush(stdout);
        
        // TODO: divide SlidingSpeed by frame time
 
        bool f = false;
        CollisionResultPosition
            = SceneManager->getSceneCollisionManager()->getCollisionResultPosition(
                World, LastPosition-Translation,
                Radius, vel, CollisionTriangle, CollisionPoint, f,
                CollisionNode, SlidingSpeed, FallingVelocity*diffSec);
 
        CollisionOccurred = (CollisionTriangle != RefTriangle);
 
        CollisionResultPosition += Translation;
 
        if ( diffSec > 0 )  // don't change the state when there was no time
        {
            printf("diffSec >0\n");fflush(stdout);
            if (f)//CollisionTriangle == RefTriangle)
            {
                printf("Falling = true\n");fflush(stdout);
                Falling = true;
            }
            else
            {
                printf("Falling = false\n");fflush(stdout);
                Falling = false;
                FallingVelocity.set(0, 0, 0);
            }
        }
 
        bool collisionConsumed = false;
 
        if (CollisionOccurred && CollisionCallback) {
            printf("CollisionOccurred && CollisionCallback\n");fflush(stdout);
            collisionConsumed = CollisionCallback->onCollision(*this);
        }
 
        if(!collisionConsumed)
            printf("!collisionConsumed\n");fflush(stdout);
            Object->setPosition(CollisionResultPosition);
    }
 
    // move camera target
    if (AnimateCameraTarget && IsCamera)
    {
        printf("AnimateCameraTarget && IsCamera\n");fflush(stdout);
        const core::vector3df pdiff = Object->getPosition() - LastPosition - vel;
        ICameraSceneNode* cam = (ICameraSceneNode*)Object;
        cam->setTarget(cam->getTarget() + pdiff);
    }
 
    LastPosition = Object->getPosition();
}
 
And that what i have in return when tried to play in game:

Code: Select all

 
we inside of CSceneNodeAnimatorCollisionResponse::animateNode
AnimateCameraTarget
diffSec >0
Falling = false
!collisionConsumed
we inside of CSceneNodeAnimatorCollisionResponse::animateNode
AnimateCameraTarget
diffSec >0
Falling = false
!collisionConsumed
we inside of CSceneNodeAnimatorCollisionResponse::animateNode
AnimateCameraTarget
diffSec >0
Falling = true
!collisionConsumed
we inside of CSceneNodeAnimatorCollisionResponse::animateNode
AnimateCameraTarget
diffSec >0
Falling = false
!collisionConsumed
we inside of CSceneNodeAnimatorCollisionResponse::animateNode
AnimateCameraTarget
diffSec >0
Falling = false
!collisionConsumed
we inside of CSceneNodeAnimatorCollisionResponse::animateNode
AnimateCameraTarget
diffSec >0
Falling = false
!collisionConsumed
we inside of CSceneNodeAnimatorCollisionResponse::animateNode
AnimateCameraTarget
diffSec >0
Falling = true
!collisionConsumed
we inside of CSceneNodeAnimatorCollisionResponse::animateNode
AnimateCameraTarget
diffSec >0
Falling = false
!collisionConsumed
we inside of CSceneNodeAnimatorCollisionResponse::animateNode
AnimateCameraTarget
diffSec >0
Falling = false
!collisionConsumed
 
And so on. Sometime i can see that "Falling = true" instead, but very rare, and dunno if it anyhow important there.

Have any ideas what next ?:)


EDIT: maybe getCollisionPoint() rewrite have a bug ? Because that one which use game a lot, and that what i see in r5350 was changed.
EDIT2: if i do grep on word "collision" in all the .cpp files game use, then those ones i find: createCollisionResponseAnimator(),getCollisionPoint() and setCollisionCallback(). Nothing else seems so. And from those 3 i see that in r5350 only getCollisionPoint() was in touch.
CuteAlien
Admin
Posts: 9645
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: migration from irrlicht 1.4.1 to 1.8.4

Post by CuteAlien »

Tricky as I just don't know enough about what you are doing and I have no test-case. I experimented a bit with Irrlicht demo, but never could get it to fail.

Do you fall through always? Or only when you move? Or only sometimes/in some places?

Do you get Falling set to true even when you do not move?

What's the value of CollisionOccurred? Do you get any collision (probably you do)? If you get them, print out CollisionPoint together with node->getAbsolutionPostion() to see if results make sense.

Do you use a MetaTriangleSelector in your game?
What kind of triangle selectors do you use? Like octree triangle selector or TerrainTriangleSelector or the one which takes a mesh or the one you create by just passing a node?

edit: Just did go over patch once more, but not seeing any obvious problem so far. Unfortunately that patch got pretty huge because I found several problems while working on adding a feature (feature was to allow to find out which material the collided triangle has). And instead of fixing those things in extra patches I just fixed them while working and committed it all together :-(
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
kas1e
Posts: 212
Joined: Sun Jan 21, 2018 8:39 am

Re: migration from irrlicht 1.4.1 to 1.8.4

Post by kas1e »

Do you fall through always? Or only when you move? Or only sometimes/in some places?
Its just when i start the game, after 2-3 seconds i just start to fall down under the floor. I also can see that zombies go though all the walls. If i start to move at begining of game, i can see, that i can go thorugh any barricade/building/three/whatever on the level is placed. Like there is no collision absolutly for anything at all. Only sometime i can't go thorugh some wall on the house, but its very rare. Most of time i can go everywhere and though any thing while didn't fall down too much :)
Do you get Falling set to true even when you do not move?
Its all the same all the time if i move, or don't move : most of time Falling false, but very rare true. On the begining of level (i.e. when i just press "new game" and doing nothing, just stay as it starts), then:

Code: Select all

 
we inside of CSceneNodeAnimatorCollisionResponse::animateNode
FirstUpdate
AnimateCameraTarget
!collisionConsumed
we inside of CSceneNodeAnimatorCollisionResponse::animateNode
FirstUpdate
AnimateCameraTarget
!collisionConsumed
we inside of CSceneNodeAnimatorCollisionResponse::animateNode
FirstUpdate
AnimateCameraTarget
!collisionConsumed
we inside of CSceneNodeAnimatorCollisionResponse::animateNode
FirstUpdate
AnimateCameraTarget
!collisionConsumed
we inside of CSceneNodeAnimatorCollisionResponse::animateNode
AnimateCameraTarget
diffSec >0
Falling = true
!collisionConsumed
we inside of CSceneNodeAnimatorCollisionResponse::animateNode
AnimateCameraTarget
diffSec >0
Falling = false
!collisionConsumed
we inside of CSceneNodeAnimatorCollisionResponse::animateNode
AnimateCameraTarget
diffSec >0
Falling = false
!collisionConsumed
we inside of CSceneNodeAnimatorCollisionResponse::animateNode
AnimateCameraTarget
diffSec >0
Falling = false
!collisionConsumed
we inside of CSceneNodeAnimatorCollisionResponse::animateNode
AnimateCameraTarget
diffSec >0
Falling = true
!collisionConsumed
we inside of CSceneNodeAnimatorCollisionResponse::animateNode
AnimateCameraTarget
diffSec >0
Falling = false
!collisionConsumed
we inside of CSceneNodeAnimatorCollisionResponse::animateNode
AnimateCameraTarget
diffSec >0
Falling = false
!collisionConsumed
we inside of CSceneNodeAnimatorCollisionResponse::animateNode
AnimateCameraTarget
diffSec >0
Falling = false
!collisionConsumed
we inside of CSceneNodeAnimatorCollisionResponse::animateNode
AnimateCameraTarget
diffSec >0
Falling = true
!collisionConsumed
we inside of CSceneNodeAnimatorCollisionResponse::animateNode
AnimateCameraTarget
diffSec >0
Falling = false
!collisionConsumed
we inside of CSceneNodeAnimatorCollisionResponse::animateNode
AnimateCameraTarget
diffSec >0
Falling = false
!collisionConsumed
 
And so on.
What's the value of CollisionOccurred?
When ? In the middle of CSceneNodeAnimatorCollisionResponse::animateNode, or at end of CSceneNodeAnimatorCollisionResponse::animateNode ?
Do you get any collision (probably you do)? If you get them, print out CollisionPoint together with node->getAbsolutionPostion() to see if results make sense.
Do you mean at end of CSceneNodeAnimatorCollisionResponse::animateNode ?

Do you use a MetaTriangleSelector in your game?
Yes, in one place, in CLevel::processMap() :

Code: Select all

 
//! process map
void CLevel::processMap() 
{ 
    //create empty meta triangle selectors
    m_pMetaSelector = m_pGame->getSmgr()->createMetaTriangleSelector();
    m_pPlayerExtraMetaSelector = m_pGame->getSmgr()->createMetaTriangleSelector();
    
    //select some specified scene nodes
    array<ISceneNode *> nodes;
    #if defined(__irrlicht_1_8_4__)
    m_pGame->getSmgr()->getSceneNodesFromType(ESNT_OCTREE, nodes);
    #else
    m_pGame->getSmgr()->getSceneNodesFromType(ESNT_OCT_TREE, nodes);
    #endif
    m_pGame->getSmgr()->getSceneNodesFromType(ESNT_MESH, nodes);
    m_pGame->getSmgr()->getSceneNodesFromType(ESNT_ANIMATED_MESH, nodes);
    m_pGame->getSmgr()->getSceneNodesFromType(ESNT_TERRAIN, nodes);
    m_pGame->getSmgr()->getSceneNodesFromType(ESNT_EMPTY, nodes);
    m_pGame->getSmgr()->getSceneNodesFromType(ESNT_CUBE, nodes);
 
    //process all
    for (u32 i=0; i < nodes.size(); ++i)
    {
        ISceneNode *node = nodes[i];
        ITriangleSelector *selector = NULL;
        
        //always apply fog
        node->setMaterialFlag(EMF_FOG_ENABLE, true); 
        
        //always normalize normals
        //node->setMaterialFlag(EMF_NORMALIZE_NORMALS, true);   
        
        //HACK!!! setup animated mesh(irredit doesnt support...)
        if(node->getID() == 4)
        {
            ((IAnimatedMeshSceneNode*)node)->setFrameLoop(1, 40);
            ((IAnimatedMeshSceneNode*)node)->setAnimationSpeed(5);
            
            selector = m_pGame->getSmgr()->createTriangleSelector(((IAnimatedMeshSceneNode*)node)->getMesh(), node); 
            node->setTriangleSelector(selector);
            m_pMetaSelector->addTriangleSelector(selector); 
            selector->drop(); 
            
            continue;
        }
        
        //HACK!!! car headlights
        if(node->getID() == 8)
        {
            node->setMaterialFlag(EMF_FOG_ENABLE, false);
            continue;
        } 
        
        //HACK!!! player-area box
        if(node->getID() == 23)
        {
            playerArea = node->getTransformedBoundingBox();
            continue;
        }
        
        //HACK!!! trees has no collision
        if(node->getID() == 42)
        {
            continue;
        }
 
        //octrees
        #if defined (__irrlicht_1_8_4__)
        if(node->getType() == ESNT_OCTREE) 
        #else
        if(node->getType() == ESNT_OCT_TREE) 
        #endif
        {
            IAttributes* attribs = m_pGame->getDevice()->getFileSystem()->createEmptyAttributes(); 
 
            if(attribs) 
            {
                node->serializeAttributes(attribs); 
                stringc name = attribs->getAttributeAsString("Mesh"); 
                attribs->drop(); 
    
                IAnimatedMesh* mesh = m_pGame->getSmgr()->getMesh(name.c_str()); 
    
                if(mesh) 
                {
                    selector = m_pGame->getSmgr()->createOctTreeTriangleSelector(mesh->getMesh(0), node, 128); 
                    node->setTriangleSelector(selector); 
                }
            }
        }
        //meshes
        else if(node->getType() == ESNT_MESH) 
        {
            selector = m_pGame->getSmgr()->createTriangleSelector(((IMeshSceneNode*)node)->getMesh(), node); 
            node->setTriangleSelector(selector);
        }
        //empty nodes are used as spawns
        else if(node->getType() == ESNT_EMPTY)
        {
            m_vSpawns.push_back(node->getPosition());
        }
        
        else if(node->getType() == ESNT_CUBE)
        {
            selector = m_pGame->getSmgr()->createTriangleSelectorFromBoundingBox(node);
            node->setVisible(false);
            
            m_pPlayerExtraMetaSelector->addTriangleSelector(selector);
            selector = NULL;
        }
        
        
        //add selector(if any)
        if(selector)
        {
            m_pMetaSelector->addTriangleSelector(selector); 
            selector->drop(); 
        }
    }
} 
 
What kind of triangle selectors do you use? Like octree triangle selector or TerrainTriangleSelector or the one which takes a mesh or the one you create by just passing a node?
Not that i understand game's code well, but seems from function above it is createOctTreeTriangleSelector() and createOctTreeTriangleSelector() and createTriangleSelectorFromBoundingBox()
CuteAlien
Admin
Posts: 9645
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: migration from irrlicht 1.4.1 to 1.8.4

Post by CuteAlien »

OK, let me ask this different. Is there a time you actually collide with the floor? Or is it simply never happening?
And I'm interested in collisions and values after the CollisionOccurred is set.
Maybe also interesting to have Translation value (as in: does it go down only when falling or maybe otherwise as well).

To check which triangleselectors you have you could check after each getSceneNodesFromType in your processMap() function if nodes.size() has increased. Most interesting would be what the floor is using.

And seeing that code - creating an example doesn't look too hard. Start by kicking out all nodes except the floor in the map you are loading there. If you no longer fall through after doing that it's likely a problem of metatriangleselector. If you still fall through it's likely something else. If you still fall through - send me that model (to zeilfelder@gmail.com) and tell me which triangleselector is used for that and I'll give it a shot here.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
kas1e
Posts: 212
Joined: Sun Jan 21, 2018 8:39 am

Re: migration from irrlicht 1.4.1 to 1.8.4

Post by kas1e »

OK, let me ask this different. Is there a time you actually collide with the floor? Or is it simply never happening?
Never happens. Just once game starts , after 1 or 2 seconds i start to fall down does not matter what i do : move, or stay at the same place. Dunno if i can call first 2 seconds as "collide", but in first second or two, i stay on the place, and start falling down after that 1-2 second perios, not immediately.
And I'm interested in collisions and values after the CollisionOccurred is set.
Maybe also interesting to have Translation value (as in: does it go down only when falling or maybe otherwise as well).
Will check.
To check which triangleselectors you have you could check after each getSceneNodesFromType in your processMap() function if nodes.size() has increased. Most interesting would be what the floor is using.
To just clear things - floor it just one of pieces which i just see righw away when game starts because i start to fall down. But as i say : if i start move, almost every object have no collision : anything. And bots also have no collisions and can walk through anything. So its not just floor's issue. Its issue everywhere. Just with floor it visibly right when you start game, and for others you need to move while you didn't fall very much under the floor.
And seeing that code - creating an example doesn't look too hard. Start by kicking out all nodes except the floor in the map you are loading there. If you no longer fall through after doing that it's likely a problem of metatriangleselector. If you still fall through it's likely something else. If you still fall through - send me that model (to zeilfelder@gmail.com) and tell me which triangleselector is used for that and I'll give it a shot here.
Its only Level:ProcessMap function, but there is a loooot of other kind of code, menu and all poop : game use some big .irr file, in which gazilion of nodes, and i can rip them off from that file, and keep only floor, but then it will not change the game's code. And while we in interst in simple test case, the hard part for me its to remove additional game's code. I probabaly can just rip everything off and keep floor only, just so test-case values will be printed about it only .. If it will be possible .. Sorry, i not that good with all that programming stuff.

Will check other stuff
CuteAlien
Admin
Posts: 9645
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: migration from irrlicht 1.4.1 to 1.8.4

Post by CuteAlien »

I get that there's more stuff not colliding. But having less things which are of interest is always better. So if floor alone is already enough to reproduce the bug it's more useful than having floor + other stuff. Only when the bug gets away when you remove other stuff it becomes complicated (but then we can be pretty sure it's about metatriangleselector and not about collision). That's why I only care about floor for now.

And all other things in code don't matter too much to me. If floor alone can reproduce it - the other part of interest is the collision animator. Rest of game-code shouldn't matter. So if that's already enough I can probably reproduce it here with a simple example using the floor-model + it's position/rotation/scale by using the same triangle selector and same collision animator.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
kas1e
Posts: 212
Joined: Sun Jan 21, 2018 8:39 am

Re: migration from irrlicht 1.4.1 to 1.8.4

Post by kas1e »

Ok, found something interesting which probabaly will give us a clue !

I found that if i comment out whole clevel::processmap() to just that:

Code: Select all

 
void CLevel::processMap() 
{ 
 
    //create empty meta triangle selectors
    m_pMetaSelector = m_pGame->getSmgr()->createMetaTriangleSelector();
    m_pPlayerExtraMetaSelector = m_pGame->getSmgr()->createMetaTriangleSelector();
}
 
Nothing changes ! Same fall down.

So then i build r5349 (where we don't have that bug) and check what happens if i also comment out it like that : and bug is here !

Then i firstly put printfs everywhere , to see maybe it differes between 5349 and 5350 : no. All code executes the same.

Then i block by block comment it out, and find out, that to reproduce that "fall down" issue on 5349, i need to comment out just that block in clevel::processmap():

Code: Select all

 
        else if(node->getType() == ESNT_CUBE)
        {
            printf("node->getType == ESNT_CUBE\n");fflush(stdout);
            selector = m_pGame->getSmgr()->createTriangleSelectorFromBoundingBox(node);
            node->setVisible(false);
            
            m_pPlayerExtraMetaSelector->addTriangleSelector(selector);
            selector = NULL;
        }
 
Code in both commits executes there, i see those prinfs there, just with 5350 if that code is here, we have bug like we fully comment it out in r5349. Like code executes, but didn't do what expected to do.

Is it give us any clue ?:) Maybe something about ESNT_CUBE ?
I checked if r5350 was touched anything about createTriangleSelectorFromBoundingBox, but nope..
Post Reply