RealBot icon indicating copy to clipboard operation
RealBot copied to clipboard

Deal with func_illusionary

Open stefanhendriks opened this issue 4 years ago • 2 comments

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:

  • perhaps we can remember which entities we have altered, do some tracelines at the beginning to determine if node connections (neighbours) are blocked by anfunc_illusionary, then remove the changes again and we have some metadata?
  • another way would be to not change anything, but enhance the 'trace' detections? Perhaps we can add the entities ourselves to some kind of function? Ie. remember the coordinates and create our own version of trace_line where it only detects func_illusionary things? Not sure how to do that
  • yet another way , a more crude but feasable approach, is when bots get stuck (which they evaluate every 0.1 sec anyway) the bots check in sphere if a func_illusionary is blocking them to judge if they should jump. That will solve the movement for cs_italy, but it won't solve the curtains in cs_747

Known cases to deal with:

  • [ ] cs_italy the fences to jump over
  • [ ] cs_747 the curtains bots seem to be able to see through (#28)

... other cases??

stefanhendriks avatar Sep 21 '19 05:09 stefanhendriks

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 avatar Sep 21 '19 05:09 stefanhendriks

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);
    }

stefanhendriks avatar Sep 21 '19 06:09 stefanhendriks