Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Constant crashing after reaching the half of Limanks level. #828

Closed
Tracked by #382
DarkJoney opened this issue Jun 21, 2021 · 13 comments
Closed
Tracked by #382

Constant crashing after reaching the half of Limanks level. #828

DarkJoney opened this issue Jun 21, 2021 · 13 comments
Labels
Bug The issue in the run-time. Clear Sky This can affect Clear Sky compatibility, or related to this game. Critical A critical issue that must be resolved as soon as possible. Help wanted
Projects

Comments

@DarkJoney
Copy link

DarkJoney commented Jun 21, 2021

Describe the bug
The game simply starts to crash with the black screen in 1-5 mins or immediately. The repeatable crashing starts after we help the group of clear sky to fight for the house, a moment before the bus surrounded with space anomaly at Limansk. Before this moment the game worked perfectly.

The console says this:
! [LUA][ERROR] ERROR: Invalid AI map at kamp point [lim_smart_terrain_9_kamp_1]
stack traceback:
...es\s.t.a.l.k.e.r. Чистое Небо\gamedata\scripts_g.script:974: in function 'abort'
...t.a.l.k.e.r. Чистое Небо\gamedata\scripts\xr_kamp.script:309: in function 'getDestVertex'
...t.a.l.k.e.r. Чистое Небо\gamedata\scripts\xr_kamp.script:58: in function <...t.a.l.k.e.r. Чистое Небо\gamedata\scripts\xr_kamp.script:54>

FATAL ERROR

[error] Expression : 0
[error] Function : ErrorLog
[error] File : C:\projects\xray-16\src\xrScriptEngine\ScriptEngineScript.cpp
[error] Line : 40
[error] Description : ERROR: Invalid AI map at kamp point [lim_smart_terrain_9_kamp_1]

To Reproduce
Steps to reproduce the behavior:
Reach the point of the level described before.

Expected behavior
A clear and concise description of what you expected to happen.

I expected that I would be able to completely pass Clear Sky with the current build of openXray. I am not able to pass Limansk level since the game crashes each few mins or after the save loading at the explained point of the level. The crash appears absolutely randomly, but for now, I can't stay at the level for longer than 2-5 mins.

Screenshots
If applicable, add screenshots to help explain your problem.

BugTrap error report
Please, add a crashreport if you have it. It should be located in _appdata_/reports folder
OpenXRay_error_report_210621-231657.zip
OpenXRay_error_report_210621-231645.zip
OpenXRay_error_report_210621-231422.zip
OpenXRay_error_report_210617-145211.zip
OpenXRay_error_report_210616-221438.zip

Desktop (please complete the following information):

  • OS: Window 10 20H2
  • OpenXRay build version December 2020 Preview Install and Play
  • i7 5820K
  • RTX 2080 (466.27)

Additional context
I have tried to run it with R4, original DX10 renderers, static one, but nothing helps.
The compartibility with Win 7 also does nothing.

This is very pity, because in the general it runs very well and I expected 0 crashes before reaching of this point of the game.

@DarkJoney DarkJoney added the Bug The issue in the run-time. label Jun 21, 2021
@Xottab-DUTY
Copy link
Member

Xottab-DUTY commented Jun 21, 2021

Unfortunately, this is the number one serious bug that we didn't figure out how to fix yet.
This crash with "Invalid AI map at kamp point" can appear even on swamps in the beginning of the game and it can be avoided by avoiding the place where this crash happens...

But since Limansk is a corridor location and it is impossible to avoid that house, the only thing can help is to load the game saves before reaching that house (I'd recommend to load a save before even entering Limansk) and hope that stalkers will refuse to go to that invalid kamp. (kamp is just incorrect spelling of camp)

@Xottab-DUTY Xottab-DUTY added Clear Sky This can affect Clear Sky compatibility, or related to this game. Critical A critical issue that must be resolved as soon as possible. labels Jul 9, 2021
@Xottab-DUTY Xottab-DUTY added this to To do in Main flow via automation Jul 27, 2021
@makpif
Copy link

makpif commented Aug 20, 2021

Тоже встретил этот баг. Также иногда вылет происходит не в доме, а уже после телепортов. Причем если сохранится между домом и вылетом, а потом загрузить сейв будет 1-2 fps. Ждал долго, лагать не перестало

OS: Linux

@BielBdeLuna
Copy link

how can I help solve this? playing along gdb maybe and returning the stack would help you?
what places in swamp have this problem? as far as I know, this is error is not activated by the player but by another unit in the faction war isn't it?

@DarkJoney
Copy link
Author

mate, I don't remember exactly. I should give it a second try since it is labeled as closed, am sitting at home anyway now.

@BielBdeLuna
Copy link

are my assumptions right thou?

  • is this related to the faction wars units movement?

@Xottab-DUTY
Copy link
Member

Xottab-DUTY commented Mar 23, 2022

it is labeled as closed

It is not closed. I've only closed the duplicate issue, but not this issue.
The crash is still here.

how can I help solve this?

Gimme few minutes...

@Xottab-DUTY
Copy link
Member

Unpack this into the game folder:
gamedata.zip

There's just one script with the workaround borrowed from #936 (comment)

@Xottab-DUTY
Copy link
Member

are my assumptions right thou?

  • is this related to the faction wars units movement?

No, it's related to the generic camp logic, which xr_kamp.script is for. NPC is trying to sit near the campfire and cannot find a point where he could sit.

The original script works fine with the original Clear Sky's X-Ray 1.5 engine, but mainline OpenXRay is an Call of Pripyat engine (based on X-Ray 1.6) and, probably, something was changed under the hood... I didn't find the root of the problem yet :(

@Xottab-DUTY
Copy link
Member

We have figured that this bug happens due to different luabind behaviour.
We need to research further in the luabind.

@Xottab-DUTY
Copy link
Member

This may be also helpful
https://github.com/OpenXRay/xray-16/blob/dev/src/xrGame/ai/monsters/basemonster/base_monster.cpp#L467

// sometimes accessible(object->Position())) returns true
// but accessible(ai_location().level_vertex_id()) crashes
// because level_vertex_id is not valid, so this code syncs vertex_id with position

bool CBaseMonster::useful(const CItemManager* manager, const CGameObject* object) const
{
    const Fvector& object_pos = object->Position();
    if (!movement().restrictions().accessible(object_pos))
    {
        return false;
    }

    // Lain: added (temp?) guard due to bug http://tiger/bugz/view.php?id=15983
    // sometimes accessible(object->Position())) returns true
    // but accessible(ai_location().level_vertex_id()) crashes
    // because level_vertex_id is not valid, so this code syncs vertex_id with position
    if (!ai().level_graph().valid_vertex_id(object->ai_location().level_vertex_id()))
    {
        u32 vertex_id = ai().level_graph().vertex_id(object_pos);
        if (!ai().level_graph().valid_vertex_id(vertex_id))
        {
            return false;
        }
        object->ai_location().level_vertex(vertex_id);
    }

    if (!movement().restrictions().accessible(object->ai_location().level_vertex_id()))
    {
        return false;
    }

    const CEntityAlive* pCorpse = smart_cast<const CEntityAlive*>(object);
    if (!pCorpse)
    {
        return false;
    }

    if (!pCorpse->g_Alive())
    {
        return true;
    }

    return false;
}

@Decane
Copy link

Decane commented Mar 26, 2023

I suggest giving the xr_kamp destination vertex assignment logic in Decane/SRP@1377f51 a try. The vanilla logic is buggy; it tries to assign NPCs to the nearest accessible vertex to level.vertex_position(4294967296) if the preferred campfire position is inaccessible. This doesn't cause a crash in vanilla X-Ray v1.5, but it does cause strange NPC behavior.

BTW, I'm guessing level.vertex_id(position) in X-Ray v1.6 returns 4294967295 for an inaccessible position, whereas X-Ray v1.5 returns 4294967296 (which is why there is no crash with v1.5). To use the SRP logic with OpenXRay, 4294967295 may therefore need to be substituted for 4294967296.

@Xottab-DUTY
Copy link
Member

Xottab-DUTY commented Apr 10, 2023

Interesting detail:
https://cs.stalker-game.com/en/?page=patches&item=1

Look at the changelog of the official patch 1.5.05:

fixed crash (ERROR: Invalid AI map at kamp point [mar_smart_terrain_6_8_kamp_1](_g.script:973: bad argument 2 to 'format' (string expected, got nil)))

This is the smart terrain from #977.

Just as memo, the problematic kamps are:
mar_smart_terrain_6_8_kamp_1
lim_smart_terrain_9_kamp_1

Main flow automation moved this from In progress to Done Apr 11, 2023
@Xottab-DUTY
Copy link
Member

Xottab-DUTY commented Apr 11, 2023

BTW, I'm guessing level.vertex_id(position) in X-Ray v1.6 returns 4294967295 for an inaccessible position, whereas X-Ray v1.5 returns 4294967296 (which is why there is no crash with v1.5).

Much thanks, @Decane! Finally the bug is fixed!

To use the SRP logic with OpenXRay, 4294967295 may therefore need to be substituted for 4294967296.

It it possible to add openxray.ltx file to the SRP distribution with the settings that define 4294967295/4294967296 behaviour? :)
Oh, it's actually not needed, but it's still can be beneficial to configure other OpenXRay behaviours specifically for SRP :)

@Xottab-DUTY Xottab-DUTY unpinned this issue Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug The issue in the run-time. Clear Sky This can affect Clear Sky compatibility, or related to this game. Critical A critical issue that must be resolved as soon as possible. Help wanted
Projects
Status: Done
Main flow
  
Done
Development

No branches or pull requests

5 participants