Page MenuHomeWildfire Games

Const-Correct the long range pathfinder
ClosedPublic

Authored by wraitii on May 13 2018, 7:30 PM.

Details

Reviewers
vladislavbelov
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Commits
rP22219: Const-Correct the long range pathfinder
Summary

Pretty much does what it says on the tin.

Test Plan

Compile.

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

wraitii created this revision.May 13 2018, 7:30 PM
Vulcan added a subscriber: Vulcan.May 13 2018, 7:32 PM

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/differential/486/display/redirect

vladislavbelov requested changes to this revision.Feb 16 2019, 5:06 PM
vladislavbelov added a subscriber: vladislavbelov.

The patch looks good for me. It only needs to fix some details.

source/simulation2/helpers/LongPathfinder.cpp
721 ↗(On Diff #6539)

It's not necessary. It'd be better to have an assertion here, like:

auto it = m_JumpPointCache.find(passClass);
ENSURE(it != m_JumpPointCache.end());
state.jpc = it->second.get();

Because it's easier to disable and the std::map::at may be slower for some implementations.

727 ↗(On Diff #6539)

You modify this here, so the ComputeJPSPath can't be const currently (as you can see by compilation errors). You may use mutable.

This revision now requires changes to proceed.Feb 16 2019, 5:06 PM
wraitii added inline comments.Apr 13 2019, 11:36 AM
source/simulation2/helpers/LongPathfinder.cpp
721 ↗(On Diff #6539)

Right.

wraitii updated this revision to Diff 7745.Apr 13 2019, 11:37 AM

Make the JPS cache and the debug variables mutable. The reasoning is that neither of those should affect the outer const-ness of the functions.

It's a bit dirty for debug variables but honestly implementing a messaging system for debug stuff is way too annoying in my opinion, and this isn't dangerous.

Still relies on Hierarchical pathfinder const-ness which I believe is in D53.

Build failure - The Moirai have given mortals hearts that can endure.

Linter detected issues:
Executing section Source...

source/simulation2/helpers/LongPathfinder.h
|   1| /*·Copyright·(C)·2017·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2017"

source/simulation2/helpers/LongPathfinder.cpp
|   1| /*·Copyright·(C)·2017·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2017"
Executing section JS...
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/differential/1211/display/redirect

Stan added a subscriber: Stan.Apr 19 2019, 2:54 PM
Stan added inline comments.
source/simulation2/helpers/LongPathfinder.cpp
727 ↗(On Diff #6539)

Build fails because of this :)

wraitii updated this revision to Diff 7809.Apr 22 2019, 6:17 PM

Should run on top of rP22210.

Stan added inline comments.Apr 22 2019, 6:20 PM
source/simulation2/helpers/LongPathfinder.h
254 ↗(On Diff #7809)

made → mutable ?

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...

source/simulation2/helpers/LongPathfinder.h
|   1| /*·Copyright·(C)·2017·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2017"

source/simulation2/helpers/LongPathfinder.cpp
|   1| /*·Copyright·(C)·2017·Wildfire·Games.
|    | [NORMAL] LicenseYearBear:
|    | License should have "2019" year instead of "2017"
Executing section JS...
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/differential/1256/display/redirect

vladislavbelov added inline comments.
source/simulation2/helpers/LongPathfinder.h
254 ↗(On Diff #7809)

Is that correct?

wraitii added inline comments.Apr 22 2019, 11:12 PM
source/simulation2/helpers/LongPathfinder.h
254 ↗(On Diff #7809)

I think I meant to write Debugging variables are made mutable as they should not prevent const-ing functions.

This revision was not accepted when it landed; it landed in state Needs Review.Apr 24 2019, 9:07 PM
This revision was automatically updated to reflect the committed changes.

Not sure if related, but I got this in the game uploading loading a map:

Assertion failed: "it != m_JumpPointCache.end()"
Location: LongPathfinder.cpp:722 (LongPathfinder::ComputeJPSPath)

Call stack:

LongPathfinder::ComputeJPSPath (longpathfinder.cpp:722)
    this = (unavailable)
    x0 = 
        value = 54245520 (0x033BB890)

    z0 = 
        value = 39199728 (0x025623F0)

    origGoal = 0x2FAE5E9C -> 
        type = CIRCLE
        x = 
            value = 49356808 (0x02F12008)

        z = 
            value = 42282016 (0x02852C20)

        hw = 
            value = 328096 (0x000501A0)

        hh = 
            value = 0 (0x00000000)

        u = 
            X = 
                value = 0 (0x00000000)

            Y = 
                value = 0 (0x00000000)


        v = 
            X = 
                value = 0 (0x00000000)

            Y = 
                value = 0 (0x00000000)


        maxdist = 
            value = 458752 (0x00070000)


    passClass = 4 (0x0004)
    path = 0x0053ED70 -> 
        m_Waypoints = (unsupported vector<Waypoint >)

    state = 
        steps = 0 (0x00000000)
        goal = 
            type = POINT
            x = 
                value = 0 (0x00000000)

            z = 
                value = 0 (0x00000000)

            hw = 
                value = 0 (0x00000000)

            hh = 
                value = 0 (0x00000000)

            u = 
                X = 
                    value = 0 (0x00000000)

                Y = 
                    value = 0 (0x00000000)


            v = 
                X = 
                    value = 0 (0x00000000)

                Y = 
                    value = 0 (0x00000000)


            maxdist = 
                value = 0 (0x00000000)


        iGoal = 0 (0x0000)
        jGoal = 0 (0x0000)
        passClass = 0 (0x0000)
        open = 
            m_Heap = (vector<PriorityQueueHeap<TileID,PathCost,PathCost >::Item >)

        tiles = 0x00000000
        terrain = 0x00000000
        hBest = 
            data = 0 (0x00000000)

        iBest = 0 (0x0000)
        jBest = 0 (0x0000)
        jpc = 0x00000000

    j0 = 60744 (0xED48)
    start = 
        id = 
            data = 5499980 (0x0053EC4C)

        rank = 
            data = 2 (0x00000002)

        h = 
            data = 5500164 (0x0053ED04)


    i0 = 2 (0x0002)
    profile2__ = 
        m_Name = 0x00D46AC4 -> "ComputePathJPS"
        m_Limit = 0.0002 (0x3F2A36E2EB1C432D)
        m_StartTime = 21.4404 (0x403570C0A2877EE4)
        m_PushedHold = true 

    curr = 
        id = 
            data = 5499980 (0x0053EC4C)

        rank = 
            data = 2 (0x00000002)

        h = 
            data = 5500164 (0x0053ED04)



LongPathfinder::ComputePath (longpathfinder.h:229)
    this = (unavailable)
    x0 = 
        value = 54245520 (0x033BB890)

    z0 = 
        value = 39199728 (0x025623F0)

    origGoal = 0x2FAE5E9C (see above)
    passClass = 4 (0x0004)
    path = 0x0053ED70 (see above)

CCmpPathfinder::ComputePath (ccmppathfinder_common.h:251)
    this = (unavailable)
    x0 = 
        value = 54245520 (0x033BB890)

    z0 = 
        value = 39199728 (0x025623F0)

    goal = 0x2FAE5E9C (see above)
    passClass = 4 (0x0004)
    ret = 0x0053ED70 (see above)

CCmpPathfinder::ProcessLongRequests (ccmppathfinder.cpp:718)
    this = (unavailable)
    longRequests = 0x0053EDC0 -> (unsupported vector<AsyncLongPathRequest >)
    profile2__ = 
        m_Name = 0x00D40240 -> "Process Long Requests"

    path = 
        m_Waypoints = (unsupported vector<Waypoint >)

    msg = 
        
            m_Cached = (unique_ptr<JS::PersistentRooted<JS::Value>,default_delete<JS::PersistentRooted<JS::Value> > >)

        ticket = 0 (0x00000000)
        path = 
            m_Waypoints = (unsupported vector<Waypoint >)



CCmpPathfinder::ProcessSameTurnMoves (ccmppathfinder.cpp:763)
    this = (unavailable)
    longRequests = (unsupported vector<AsyncLongPathRequest >)
    shortRequests = (unsupported vector<AsyncShortPathRequest >)

CSimulation2Impl::UpdateComponents (simulation2.cpp:562)
    simContext = 0x17DD19F8 -> 
        m_ComponentManager = 0x17DD1A10 -> 
            m_ScriptInterface = 
                m_CxPrivate = { pScriptInterface = 0x17DD1A10 (see above), pCBData = 0x17DD1A10 (see above) }
                m = (unique_ptr<ScriptInterface_impl,default_delete<ScriptInterface_impl> >)
                m_rng = 0x73756F69 -> 
                    lcf = 
                        _x = (unavailable - internal error)



                m_CustomObjectTypes = (unsupported map<basic_string<char,char_traits<char> >,ScriptInterface::CustomType >)

            m_SimContext = 0x17DD19F8 (see above)
            m_SystemEntity = 
                m_Id = 1 (0x00000001)
                m_ComponentCache = 0x17DAD820 -> { numInterfaces = 101 (0x00000065), interfaces = [1] { 0x00000000 } }

            m_CurrentComponent = 0 (0x00000000)
            m_CurrentlyHotloading = false
            m_ComponentTypesById = (unsupported map<int,CComponentManager::ComponentType >)
            m_ScriptedSystemComponents = (unsupported vector<int >)
            m_ComponentsByInterface = (unsupported vector<boost::unordered::unordered_map<size_t,IComponent *,boost::hash<size_t>,equal_to<size_t> > >)
            m_ComponentsByTypeId = (unsupported map<int,map<size_t,IComponent * > >)
            m_LocalMessageSubscriptions = (unsupported map<int,vector<int > >)
            m_GlobalMessageSubscriptions = (unsupported map<int,vector<int > >)
            m_ComponentTypeIdsByName = (unsupported map<basic_string<char,char_traits<char> >,int >)
            m_MessageTypeIdsByName = (unsupported map<basic_string<char,char_traits<char> >,int >)
            m_MessageTypeNamesById = (unsupported map<int,basic_string<char,char_traits<char> > >)
            m_InterfaceIdsByName = (unsupported map<basic_string<char,char_traits<char> >,int >)
            m_DynamicMessageSubscriptionsNonsync = (unsupported map<int,CDynamicSubscription >)
            m_DynamicMessageSubscriptionsNonsyncByComponent = (unsupported map<IComponent *,set<int > >)
            m_ComponentCaches = (unsupported unordered_map<size_t,SEntityComponentCache *,hash<size_t>,equal_to<size_t> >)
            m_DestructionQueue = (unsupported vector<size_t >)
            m_NextScriptComponentTypeId = 122 (0x0000007A)
            m_NextEntityId = 4927 (0x0000133F)
            m_NextLocalEntityId = 536870912 (0x20000000)
            m_RNG = 
                lcf = 
                    _x = 188079394945109 (0x0000AB0EA5867855)



        m_UnitManager = 0x1A2ABB28 -> 
            m_Units = (unsupported vector<CUnit * >)
            m_ObjectManager = 0x17DD4570 -> 
                m_MeshManager = 0x17DD4538 -> 
                    m_MeshMap = (unavailable - unspecified error 0x186A2 (0))
                    m_ColladaManager = 0x17DD452C -> 
                        m = 0x1A32A610 -> 
                            dll = 
                                m_Name = 0x00D56760 -> (too much output; skipping to next top-level symbol)

                            set_logger = 0x43DB8001 -> 
                            set_skeleton_definitions = 0x42003333 -> 
                            convert_dae_to_pmd = 0x00000004
                            convert_dae_to_psa = 0x00000000
                            m_VFS = (shared_ptr<IVFS>)
                            m_skeletonHashInvalidated = false
                            m_skeletonHashes = (unsupported vector<u64 >)

                        m_VFS = (shared_ptr<IVFS>)


                m_SkeletonAnimManager = 0x17DD4554 -> 
                    m_Animations = (unavailable - unspecified error 0x186A2 (0))
                    m_ColladaManager = 0x17DD452C (see above)

                m_Simulation = 0x1A335488 -> 
                    m = 0x17DD19F8 (see above)

                m_Objects = (unsupported map<CObjectManager::ObjectKey,CObjectEntry * >)
                m_ObjectBases = (unsupported map<CStrW,CObjectBase * >)


        m_Terrain = 0x1A316850 -> 
            m_MapSize = 257 (0x00000101)
            m_MapSizePatches = 16 (0x00000010)
            m_Patches = 0x160C2024 -> 
                
                    m_WorldBounds = 
                        m_Data = [2] 
                            
                                X = 0.000000 (0x00000000)
                                Y = 0.000000 (0x00000000)
                                Z = 0.000000 (0x00000000)

                            
                                X = 64.000000 (0x42800000)
                                Y = 22.260870 (0x41B21643)
                                Z = 64.000000 (0x42800000)


                    m_Transform = 
                        _11 = 1.000000 (0x3F800000)
                        _21 = 0.000000 (0x00000000)
                        _31 = 0.000000 (0x00000000)
                        _41 = 0.000000 (0x00000000)
                        _12 = 0.000000 (0x00000000)
                        _22 = 1.000000 (0x3F800000)
                        _32 = 0.000000 (0x00000000)
                        _42 = 0.000000 (0x00000000)
                        _13 = 0.000000 (0x00000000)
                        _23 = 0.000000 (0x00000000)
                        _33 = 1.000000 (0x3F800000)
                        _43 = 0.000000 (0x00000000)
                        _14 = 0.000000 (0x00000000)
                        _24 = 0.000000 (0x00000000)
                        _34 = 0.000000 (0x00000000)
                        _44 = 1.000000 (0x3F800000)
                        _data = [16] 
                            1.000000 (0x3F800000)
                            0.000000 (0x00000000)
                            0.000000 (0x00000000)
                            0.000000 (0x00000000)
                            0.000000 (0x00000000)
                            1.000000 (0x3F800000)
                            0.000000 (0x00000000)
                            0.000000 (0x00000000)
                            0.000000 (0x00000000)
                            0.000000 (0x00000000)
                            1.000000 (0x3F800000)
                            0.000000 (0x00000000) ...
                        _data2d = [4] 
                            [4] { 1.000000 (0x3F800000), 0.000000 (0x00000000), 0.000000 (0x00000000), 0.000000 (0x00000000) }
                            [4] { 0.000000 (0x00000000), 1.000000 (0x3F800000), 0.000000 (0x00000000), 0.000000 (0x00000000) }
                            [4] { 0.000000 (0x00000000), 0.000000 (0x00000000), 1.000000 (0x3F800000), 0.000000 (0x00000000) }
                            [4] { 0.000000 (0x00000000), 0.000000 (0x00000000), 0.000000 (0x00000000), 1.000000 (0x3F800000) }

                    m_InvTransform = 
                        _11 = 0.000000 (0x00000000)
                        _21 = 0.000000 (0x00000000)
                        _31 = 0.000000 (0x00000000)
                        _41 = 0.000000 (0x00000000)
                        _12 = 0.000000 (0x00000000)
                        _22 = 0.000000 (0x00000000)
                        _32 = 0.000000 (0x00000000)
                        _42 = 0.000000 (0x00000000)
                        _13 = 0.000000 (0x00000000)
                        _23 = 0.000000 (0x00000000)
                        _33 = 0.000000 (0x00000000)
                        _43 = 0.000000 (0x00000000)
                        _14 = 0.000000 (0x00000000)
                        _24 = 0.000000 (0x00000000)
                        _34 = 0.000000 (0x00000000)
                        _44 = 0.000000 (0x00000000)
                        _data = [16] 
                            0.000000 (0x00000000)
                            0.000000 (0x00000000)
                            0.000000 (0x00000000)
                            0.000000 (0x00000000)
                            0.000000 (0x00000000)
                            0.000000 (0x00000000)
                            0.000000 (0x00000000)
                            0.000000 (0x00000000)
                            0.000000 (0x00000000)
                            0.000000 (0x00000000)
                            0.000000 (0x00000000)
                            0.000000 (0x00000000) ...
                        _data2d = [4] 
                            [4] { 0.000000 (0x00000000), 0.000000 (0x00000000), 0.000000 (0x00000000), 0.000000 (0x00000000) }
                            [4] { 0.000000 (0x00000000), 0.000000 (0x00000000), 0.000000 (0x00000000), 0.000000 (0x00000000) }
                            [4] { 0.000000 (0x00000000), 0.000000 (0x00000000), 0.000000 (0x00000000), 0.000000 (0x00000000) }
                            [4] { 0.000000 (0x00000000), 0.000000 (0x00000000), 0.000000 (0x00000000), 0.000000 (0x00000000) }

                    m_RenderData = 0x00000000
                    m_BoundsValid = true 

                m_MiniPatches = [16] 
                    [16] 
                        
                            Tex = 0x1A8F5628 -> 
                                m_Tag = { (unsupported basic_string<char,char_traits<char> >) }
                                m_pProperties = (shared_ptr<CTerrainProperties>)
                                m_Material = 
                                    m_DiffuseTexture = (shared_ptr<CTexture>)
                                    m_Samplers = (vector<CMaterial::TextureSampler >)
                                    m_RequiredSamplers = (unsupported vector<CStrIntern >)
                                    m_ShaderEffect = 
                                        m = 0x1A7F36F8 -> 
                                            data = (unsupported basic_string<char,char_traits<char> >)
                                            hash = 784405102 (0x2EC1126E)


                                    m_ShaderDefines = 
                                        
                                            m_Items = 0x005F4008 -> 
                                                items = (unsupported vector<pair<CStrIntern,CStrIntern> >)
                                                hash = 0 (0x00000000)



                                    m_ConditionalDefines = 
                                        m_Defines = (vector<CShaderConditionalDefines::CondDefine >)

                                    m_CombinedShaderDefines = (unsupported vector<CShaderDefines >)
                                    m_StaticUniforms = 
                                        
                                            m_Items = 0x1A832B70 -> 
                                                items = (unsupported vector<pair<CStrIntern,CVector4D> >)
                                                hash = 7319470 (0x006FAFAE)



                                    m_RenderQueries = 
                                        m_Items = (unsupported vector<pair<int,CStrIntern> >)

                                    m_AlphaBlending = false

                                m_TextureMatrix = 
                                    _11 = 0.022097 (0x3CB504F3)
                                    _21 = -0.022097 (0xBCB504F3)
                                    _31 = 0.000000 (0x00000000)
                                    _41 = 0.000000 (0x00000000)
                                    _12 = 0.000000 (0x00000000)
                                    _22 = 0.000000 (0x00000000)
                                    _32 = 0.000000 (0x00000000)
                                    _42 = 0.000000 (0x00000000)
                                    _13 = -0.022097 (0xBCB504F3)
                                    _23 = -0.022097 (0xBCB504F3)
                                    _33 = 0.000000 (0x00000000)
                                    _43 = 0.000000 (0x00000000)
                                    _14 = 0.000000 (0x00000000)
                                    _24 = 0.000000 (0x00000000)
                                    _34 = 0.000000 (0x00000000)
                                    _44 = 1.000000 (0x3F800000)
                                    _data = [16] 
                                        0.022097 (0x3CB504F3)
                                        -0.022097 (0xBCB504F3)
                                        0.000000 (0x00000000)
                                        0.000000 (0x00000000)
                                        0.000000 (0x00000000)
                                        0.000000 (0x00000000)
                                        0.000000 (0x00000000)
                                        0.000000 (0x00000000)
                                        -0.022097 (0xBCB504F3)
                                        -0.022097 (0xBCB504F3)
                                        0.000000 (0x00000000)
                                        0.000000 (0x00000000) ...
                                    _data2d = [4] 
                                        [4] { 0.022097 (0x3CB504F3), -0.022097 (0xBCB504F3), 0.000000 (0x00000000), 0.000000 (0x00000000) }
                                        [4] { 0.000000 (0x00000000), 0.000000 (0x00000000), 0.000000 (0x00000000), 0.000000 (0x00000000) }
                                        [4] { -0.022097 (0xBCB504F3), -0.022097 (0xBCB504F3), 0.000000 (0x00000000), 0.000000 (0x00000000) }
                                        [4] { 0.000000 (0x00000000), 0.000000 (0x00000000), 0.000000 (0x00000000), 1.000000 (0x3F800000) }

                                m_BaseColor = 0 (0x00000000)
                                m_BaseColorValid = false
                                m_Groups = (unsupported vector<CTerrainGroup * >)
                                m_TerrainAlpha = (unsupported _Tree_iterator<_Tree_val<_Tree_simple_types<pair<Path const ,TerrainAlpha> > > >)

                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)
 ...
                    [16] 
                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)
 ...
                    [16] 
                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)
 ...
                    [16] 
                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)
 ...
                    [16] 
                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)
 ...
                    [16] 
                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)
 ...
                    [16] 
                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)
 ...
                    [16] 
                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)

                        
                            Tex = 0x1A8F5628 (see above)
                            Priority = 0 (0x00000000)
 ... ...
                m_X = 0 (0x00000000)
                m_Z = 0 (0x00000000)
                m_Parent = 0x1A316850 (see above)

            m_Heightmap = 0x171FF048 -> 2048 (0x0800)
            m_BaseColor = 
                R = [8] { 255 (0xFF), 255 (0xFF), 255 (0xFF), 255 (0xFF), 1 (0x01), 1 (0x01), 0 (0x00), 0 (0x00) }
                G = 255 (0xFF)
                B = 255 (0xFF)
                A = 255 (0xFF)

            m_HeightMipmap = 
                m_MapSize = 257 (0x00000101)
                m_Mipmap = (unsupported vector<SMipmap >)


        m_SystemEntity = 
            m_Id = 1 (0x00000001)
            m_ComponentCache = 0x17DAD820 (see above)


    turnLengthFixed = 
        value = 13107 (0x00003333)

    commands = 0x0053F5CC -> (unsupported vector<SimulationCommand >)
    msgTurnStart = 
        
            m_Cached = (unique_ptr<JS::PersistentRooted<JS::Value>,default_delete<JS::PersistentRooted<JS::Value> > >)


    profile2__ = 
        m_Name = 0x402D244B -> [8] { 0, 0, 0, 0, 0, 0, 0, 0 }

    msgUpdate = 
        
            m_Cached = (unique_ptr<JS::PersistentRooted<JS::Value>,default_delete<JS::PersistentRooted<JS::Value> > >)

        turnLength = 
            value = 0 (0x00000000)


    profile2__ = 
        m_Name = 0x402D244B (see above)

    msgUpdate = 
        
            m_Cached = (unique_ptr<JS::PersistentRooted<JS::Value>,default_delete<JS::PersistentRooted<JS::Value> > >)

        turnLength = 
            value = 1077243442 (0x40356E32)


    msgUpdate = 
        
            m_Cached = (unique_ptr<JS::PersistentRooted<JS::Value>,default_delete<JS::PersistentRooted<JS::Value> > >)

        turnLength = 
            value = 0 (0x00000000)


    profile2__ = 
        m_Name = 0x402D244B (see above)

    msgUpdate = 
        
            m_Cached = (unique_ptr<JS::PersistentRooted<JS::Value>,default_delete<JS::PersistentRooted<JS::Value> > >)

        turnLength = 
            value = 5501080 (0x0053F098)


    profile2__ = 
        m_Name = 0x402D244B (see above)


CSimulation2Impl::Update (simulation2.cpp:402)
    this = (unavailable)
    turnLength = 200 (0x000000C8)
    commands = 0x0053F5CC (see above)
    profile2__ = 
        m_Name = 0x00D372EC -> "sim update"

    primaryStateBefore = 
        state = (basic_stringstream<char,char_traits<char> >)
        debug = (basic_stringstream<char,char_traits<char> >)
        hash = (unsupported basic_string<char,char_traits<char> >)

    mapType = (unsupported basic_string<char,char_traits<char> >)
    mapReader = (unique_ptr<CMapReader,default_delete<CMapReader> >)
    mapSettingsCloned = 
        { 
                (js::ValueOperations<JS::Rooted<JS::Value> >)
 }
        stack = 0x00000020
        prev = 0x1A42C5C8 -> 
            (js::RootedBase<void *>)
            stack = 0x046CB978 -> 0x07052E00 -> 
                (js::RootedBase<void *>)
                stack = 0x00000000
                prev = 0x00000000
                ptr = 0x00000000

            prev = 0x0A1CBD48 -> 
                (js::RootedBase<void *>)
                stack = 0x000000B9
                prev = 0x00000000
                ptr = 0x00000000

            ptr = 0x17B7BAE0

        ptr = 
            data = 
                asBits = 1892070533280916768 (0x1A41FC201A316520)
                s = { payload = 
                        i32 = 439444768 (0x1A316520)
                        u32 = 439444768 (0x1A316520)
                        boo = 439444768 (0x1A316520)
                        str = 0x1A316520 -> (JSString)
                        sym = 0x1A316520 (see above)
                        obj = 0x1A316520 (see above)
                        cell = 0x1A316520 (see above)
                        ptr = 0x1A316520 (see above)
                        why = 439444768
                        word = 439444768 (0x1A316520)
                        uintptr = 439444768 (0x1A316520)
, tag = 440532000 }
                asDouble = 3.3861e-182 (0x1A41FC201A316520)
                asPtr = 0x1A316520 (see above)



    rq2 = 
        mContext = 0x00000000

    mapFile = (unsupported basic_string<wchar_t,char_traits<wchar_t> >)
    mapfilename = 
        path = (unsupported basic_string<wchar_t,char_traits<wchar_t> >)
        separator = 25888

    secondaryStateBefore = 
        state = (basic_stringstream<char,char_traits<char> >)
        debug = (basic_stringstream<char,char_traits<char> >)
        hash = (unsupported basic_string<char,char_traits<char> >)

    primaryStateAfter = 
        state = (basic_stringstream<char,char_traits<char> >)
        debug = (basic_stringstream<char,char_traits<char> >)
        hash = (unsupported basic_string<char,char_traits<char> >)

    secondaryStateAfter = 
        state = (basic_stringstream<char,char_traits<char> >)
        debug = (basic_stringstream<char,char_traits<char> >)
        hash = (unsupported basic_string<char,char_traits<char> >)


CTurnManager::Update (turnmanager.cpp:165)
    this = (unavailable)
    simFrameLength = 0.011588 (0x3C3DDCE2)
    maxTurns = 1 (0x00000001)
    commands = (unsupported vector<SimulationCommand >)
    profile2__ = 
        m_Name = 0x2FF522C4 -> [8] { 200, 114 ('r'), 245, 47 ('/'), 71 ('G'), 155, 233, 179 }

    stream = (basic_stringstream<char,char_traits<char> >)
    $S2 = (unsupported _Tree_iterator<_Tree_val<_Tree_simple_types<pair<size_t const ,vector<SimulationCommand > > > > >)

CGame::Update (game.cpp:397)
    this = (unavailable)
    deltaRealTime = 0.00927065 (0x3F82FC7D00000000)
    doInterpolate = true 
    profile2__ = 
        m_Name = 0x3C3DDCE2 -> (unavailable - internal error)



Frame (main.cpp:394)
    realTimeSinceLastFrame = 0.009271 (0x3C17E3E8)
    time = 18.7251 (0x4032B9A12E16B2DF)
    profile2__ = 
        m_Name = 0x00D32CB8 -> "frame"

    profile2__ = 
        m_Name = 0x4032B9A1 -> [8] { 0, 0, 0, 0, 0, 0, 0, 0 }


RunGameOrAtlas (main.cpp:634)
    argc = 1 (0x00000001)
    argv = 0x009E0008 -> 0x009E0028 -> "C:\Users\micha\Wildfire Games\0 A.D\binaries\system\pyrogenesis.exe"
    replayFile = 
        path = (unsupported basic_string<wchar_t,char_traits<wchar_t> >)
        separator = 47 ('/')

    modsToInstall = (unsupported vector<Path >)
    scriptEngine = 
        (Singleton<ScriptEngine>)
        m_Runtimes = (unsupported list<JSRuntime const * >)

    args = 
        m_Args = (unsupported vector<pair<CStr8,CStr8> >)
        m_Arg0 = 
            path = (unsupported basic_string<wchar_t,char_traits<wchar_t> >)
            separator = 92 ('\')

        m_ArgsWithoutName = (unsupported vector<CStr8 >)

    res = 4.52899e-010 (0x3DFF1F79BE892445)
    modPath = 
        path = (unsupported basic_string<wchar_t,char_traits<wchar_t> >)
        separator = 60713

    paths = 
        m_root = 
            path = (unsupported basic_string<wchar_t,char_traits<wchar_t> >)
            separator = 62963

        m_rdata = 
            path = (unsupported basic_string<wchar_t,char_traits<wchar_t> >)
            separator = 20176

        m_gameData = 
            path = (unsupported basic_string<wchar_t,char_traits<wchar_t> >)
            separator = 4

        m_userData = 
            path = (unsupported basic_string<wchar_t,char_traits<wchar_t> >)
            separator = 3944

        m_config = 
            path = (unsupported basic_string<wchar_t,char_traits<wchar_t> >)
            separator = 0

        m_cache = 
            path = (unsupported basic_string<wchar_t,char_traits<wchar_t> >)
            separator = 1919

        m_logs = 
            path = (unsupported basic_string<wchar_t,char_traits<wchar_t> >)
            separator = 23870


    replay = 
        m_Stream = 0x3DFF1F79 -> (basic_istream<char,char_traits<char> >)

    mod = 
        path = (unsupported basic_string<wchar_t,char_traits<wchar_t> >)
        separator = 27528

    zip = 
        path = (unsupported basic_string<wchar_t,char_traits<wchar_t> >)
        separator = 0

    mods = (unsupported vector<CStr8 >)
    paths = 
        m_root = 
            path = (unsupported basic_string<wchar_t,char_traits<wchar_t> >)
            separator = 28656

        m_rdata = 
            path = (unsupported basic_string<wchar_t,char_traits<wchar_t> >)
            separator = 1919

        m_gameData = 
            path = (unsupported basic_string<wchar_t,char_traits<wchar_t> >)
            separator = 33976

        m_userData = 
            path = (unsupported basic_string<wchar_t,char_traits<wchar_t> >)
            separator = 20479

        m_config = 
            path = (unsupported basic_string<wchar_t,char_traits<wchar_t> >)
            separator = 32 (' ')

        m_cache = 
            path = (unsupported basic_string<wchar_t,char_traits<wchar_t> >)
            separator = 63780

        m_logs = 
            path = (unsupported basic_string<wchar_t,char_traits<wchar_t> >)
            separator = 0


    builder = 
        m_VFS = (shared_ptr<IVFS>)
        m_Files = (unsupported vector<Path >)
        m_TempDir = 
            path = (unsupported basic_string<wchar_t,char_traits<wchar_t> >)
            separator = 15

        m_NumBaseMods = 1999658302 (0x77305D3E)

    installedMods = (unsupported vector<CStr8 >)
    installer = 
        m_VFS = (shared_ptr<IVFS>)
        m_ModsDir = 
            path = (unsupported basic_string<wchar_t,char_traits<wchar_t> >)
            separator = 32 (' ')

        m_TempDir = 
            path = (unsupported basic_string<wchar_t,char_traits<wchar_t> >)
            separator = 8

        m_CacheDir = 
            path = (unsupported basic_string<wchar_t,char_traits<wchar_t> >)
            separator = 63608

        m_InstalledMods = (unsupported vector<CStr8 >)

    paths = 
        m_root = 
            path = (unsupported basic_string<wchar_t,char_traits<wchar_t> >)
            separator = 28656

        m_rdata = 
            path = (unsupported basic_string<wchar_t,char_traits<wchar_t> >)
            separator = 1919

        m_gameData = 
            path = (unsupported basic_string<wchar_t,char_traits<wchar_t> >)
            separator = 33976

        m_userData = 
            path = (unsupported basic_string<wchar_t,char_traits<wchar_t> >)
            separator = 20479

        m_config = 
            path = (unsupported basic_string<wchar_t,char_traits<wchar_t> >)
            separator = 32 (' ')

        m_cache = 
            path = (unsupported basic_string<wchar_t,char_traits<wchar_t> >)
            separator = 63780

        m_logs = 
            path = (unsupported basic_string<wchar_t,char_traits<wchar_t> >)
            separator = 0



SDL_main (main.cpp:680)
    argc = 1 (0x00000001)
    argv = 0x009E0008 (see above)

main_utf8 (sdl_windows_main.c:126)
    argc = 1 (0x00000001)
    argv = 0x009E0008 (see above)

wmain (sdl_windows_main.c:151)
    argc = 1 (0x00000001)
    wargv = 0x005CD820 -> 0x005CD828 -> 67 (0x0043)
    wenvp = 0x005CFD70 -> 38496 (0x9660)
    argv = 0x009E0008 (see above)
    retval = 0 (0x00000000)
    i = 1 (0x00000001)

CallStartupWithinTryBlock (wseh.cpp:365)
    ret = 13035712 (0x00C6E8C0)

RtlAreBitsSet (:0)

RtlAreBitsSet (:0)


errno = 0 (No error reported here)
OS error = 0 (no error code was set)
This comment was removed by wraitii.

Yup, that ENSURE was broken... Mind you my initial code was _also_ broken since at() would have failed here too. Apparently I didn't playtest that revision and we have no tests calling ComputeJPSPath, which we really ought to (might add some this WE).

Regardless, rP22225 cleans this up.