ValveSoftware / ValveSoftware/source-sdk-2013

CNavAreas have incorrect lighting information

Open
#1,707 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
10k
Forks
3k
Avg merge
8d 11h
Merged PRs (30d)
2

Description

The CNavAreas in the latest navigation mesh version (16) store 4 floats with a value between 0 and 1 representing the light intensity at the 4 corners of that CNavArea. When generated from a listen server the function CNavArea::ComputeLighting should be able to get the light and ambientColor at these positions and calculate the light intensity from these.

However, calls to "engine->GetLightForPointListenServerOnly" and "GetTerrainAmbientLightAtPoint" are annotated with the comment "// FIXMEL4DTOMAINMERGE" and commented out, and CNavArea::ComputeLighting will instead always return false on a listen server, meaning that regardless of whether the navigation mesh is generated from a dedicated or listen server, or the command nav_update_lighting is run, the light intensity values will always remain at their default.

Being able to calculate and store these values would benefit bot vision. Since all bot decision making is run server side, and there are no server side functions to get the ambient lighting at a position in the map, bots do not have any information about how well lit other bots or players are. If this issue was fixed, and a navigation mesh was generated on a listen server, bots could look to the navArea that either it or other bots/players are occupying to help inform their decision making, and reward stealthy gameplay with slower reaction times.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at CNavArea::ComputeLighting and trace the commented GetLightForPointListenServerOnly and GetTerrainAmbientLightAtPoint calls marked FIXMEL4DTOMAINMERGE. Verify how lighting is computed for the four corners on a listen server and how nav_update_lighting reaches this code. Done means listen-server-generated navigation meshes store non-default light intensities when lighting data is available.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.