Fundynamic / RealBot

Counter-Strike 1.6 - AI Opponent
http://realbot.bots-united.com
53 stars 19 forks source link

Deal with func_illusionary #29

Open stefanhendriks opened 5 years ago

stefanhendriks commented 5 years ago

Related to #28

So this is what I know:

The fences are func_illusionary:

image

And in code dll.cpp around Spawn_Post there is already a piece of code that unsets some flag. However, that deals with windows. Ie, everything with a render mode: kRenderTransTexture.

However, the func_illusionary are actually drawn with rendermode kRenderTransAlpha.

Now, having tested this by adding the following:

        (pent->v.rendermode == kRenderTransAlpha && strcmp("func_illusionary", STRING(pent->v.classname)) == 0)) { // func_illusionary on cs_italy uses this rendermode

to the if statement and then nothing, makes them still undetectable by a trace_hull or trace_line. But.. when I add this:

        pent->v.solid = SOLID_BSP;
        pent->v.movetype = MOVETYPE_PUSHSTEP; // this seemed to be the best choice, does not do much

the trace_hull and trace_line do find them. Which is nice and good. But when applying this to the level, there is strange behaviour:

image

the leafs are also func_illusionary and they become solid and at the floor. Hence you can't walk through them making that path unplayable.

Also, this would probably make cs_747 unplayable as well because it would make the curtains solid. So that won't be an option for #28 :/

So what other options are there?

This is just a brain fart:

Known cases to deal with:

... other cases??

stefanhendriks commented 5 years ago

Note, even YAPB seems to rely on tpHit to give something back (see this commit), and removes the flag (see this commit) as Realbot also does.

So they probably also can see through the curtains and such.

stefanhendriks commented 5 years ago

FYI:

Even when reading point information it won't read SOLID. (as expected)

    for (int i = 1; i < 40; i += 2) {
        v_dest = v_source + gpGlobals->v_forward * i;
        int contents = POINT_CONTENTS(v_dest);
        char msg[255];
        sprintf(msg, "Content for step %d is %d", i, contents);
        pBot->rprint_trace("BotShouldJump", msg);
    }