buzer2020 / Amnesia64

64-bit Windows port of Amnesia:TDD
GNU General Public License v3.0
19 stars 11 forks source link

Compiling on other platforms? #4

Closed shamazmazum closed 2 years ago

shamazmazum commented 2 years ago

Hello! I would like to run Amnesia the Dark Descent on FreeBSD. I have found your repo as one of few repositories providing the source code for Newton Game Dynamics engine. My port to FreeBSD compiles and runs, but when I start the game, Daniel falls through the floor.

If I disable gravity in CharacterBody.cpp like this:

    void iCharacterBody::UpdateForces(float afTimeStep)
    {
#if 0
        ////////////////////
    // Gravity
    if(mbGravityActive && mbClimbing==false)
        {
            if(mbCustomGravity) mvVelocity += mvCustomGravity * afTimeStep;
            else                mvVelocity += mpWorld->GetGravity() * afTimeStep;

            float fLength = mvVelocity.Length();
            if(fLength> mfMaxGravitySpeed)
            {
                mvVelocity = (mvVelocity /fLength) * mfMaxGravitySpeed;
            }
    }
#endif
        //////////////////
    // Normal force
    mvVelocity += mvForce * (afTimeStep * (1.0f/mfMass));
        mvForce =0;
    }

I am able to walk through the first level and interact with doors, cabinets etc, but walls are no obstacle for me. In terms of physical engine, it's convex-hull-to-mesh collision detection which fails.

I know this is a bit offtopic, but have you encountered the same problems when creating this Windows port? I looked into sources of Newton, it's a totall mess, nearly impossible to debug (at least with my skills). The authors of Newton Game Dynamics do not respond and I am not able to register on their forum (even registration is premoderated there). If you can share some advices, I would be happy :)

Anyway, thank you for your work of collecting all the ancient versions of required software, it's really helpful even for a non-windows user!

shamazmazum commented 2 years ago

Just to be clear, I started from this repository, but took yours AngelScript and Newton.

buzer2020 commented 2 years ago

Hello! Yes, I remember encountering the similar issue. I think I fixed it by changing MAP_CACHE_FORMAT_VERSION to something else (see dfc3f5247c28452981678e6012af3016f1bb1841)

shamazmazum commented 2 years ago

Thanks! This was really helpful! Now I am kinda stuck in the floor, but can move by jumping. I compiled your code and the problem is still there, so this must be related to a compiler. I hope this will be easier to debug than no collision at all :))

buzer2020 commented 2 years ago

Also check out issue #1 - the guys over there were porting this fork to a BSD system as well. Maybe they have more info.

shamazmazum commented 2 years ago

Oh, I mislooked it. Now seemingly the only bug left is that AngelScript does not read values returned in xmm0 register correctly. I think this will be easy to fix compared to that Newton magic number.

And I'll also contact that another guy. Thanks for the info!