Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#20 making entities viewable while outside the map

open
nobody
other (4)
5
2011-08-02
2011-08-02
Gman
No

Computers have gotten so powerful since Hexen2 came out, that simply displaying everything (world and entities) while no-clipping outside of the map isn't a problem. This is already enabled in the Darkplaces Quake1 source port, and it works great. I've done this before to glquake just by changing one line in the code.

This would turn noclip into a very useful map mode, in case you're having trouble finding an artifact buried somewhere. (as an alternative to constantly referring to walk-throughs for help on the exact location of an item.)

Discussion

  • Ozkan Sezer
    Ozkan Sezer
    2011-08-02

    Can you point me to the source changes please?

     
  • Gman
    Gman
    2011-08-03

    Found it in my notes. I'm pretty sure this works in singleplayer, since singleplayer is running both client and server on the same machine.

    file: sv_ents.c
    function: SV_WriteEntitiesToClient

    Within this for loop:

    for (e = MAX_CLIENTS+1, ent = EDICT_NUM(e); e < sv.num_edicts; e++, ent = NEXT_EDICT(ent))

    Just by commenting-out the continue statement here enables it:

    if (i == ent->num_leafs)
    continue; // not visible

    Maybe only enable if MOVETYPE_NOCLIP is set, so framerate won't be degraded at all while playing.

    If there are alot of entities, some might blank out (at least this was the case with Quakeworld.)
    That may have been a limit with MAX_PACKET_ENTITIES though, I'm not sure.

    This would be a great tool to use if someone is having trouble finding a key, for example. As a last resort after exploring the map a few times: Oh, its behind 'that' set of crates!

     
  • Gman
    Gman
    2011-08-03

    Just realized that may work for Hexenworld, but for Hexen2 it's here:

    file: sv_ents.c
    function: SV_PrepareClientEntities

    if (i == ent->num_leafs)
    {
    DoRemove = true;
    goto skipA;
    }

    If noclipping don't set DoRemove to true

    Then in

    file: cl_main.c
    function CL_RelinkEntities

    near the end

    if (cl_numvisedicts < MAX_VISEDICTS)

    might need to be altered when in noclip mode to avoid ents from blanking out.