I am facing the infamous - “Lighting needs rebuild” error during game-play, and unfortunately it is not the standard - click the Build button - issue. Sorry if this post is long, but I have tried several things and went through many posts, but nothing seems to solve this error. So I decided to post my problem in detail.
I have been using the UE4 ShooterGame sample as the base template for my game (solely for the FPS player pawn and weapons systems - NOTHING ELSE is used). I began with v4.5.1 and created a new map consisting of a large forest - so it makes heavy use of the foliage system and also has a post-processing volume.
(A note to Epic: if using the ShooterGame as a base template is not permissible please do tell me.)
Whenever a major version release was made since 4.5.1, I did the following to stay up to date with the latest ShooterGame code:
1.1. Download & create a new project of the compatible ShooterGame version in a new directory
1.2. Migrate the entire map I created from the previous ShooterGame to this newer one
1.3. Compile & Build the newer version
1.4. Run it (in editor & launch mode) to check if it’s fine
1.5. Keep working if everything is OK
Everything worked fined up until 4.8.1. Even the major release for 4.8.0 transition was without errors. But after updating to 4.8.1 I keep getting the “Lighting needs to be rebuilt” error.
2.1. The error only occurs when playing the game (whether within the UE4 editor or in launch mode)
2.2. Oddly, while working on the game from within the editor (not playing) the error does not display at all
The common solution stated is to rebuild the project (click the Build button). However, this is what happens:
3.1. Click on Build button (build all, not just light)
3.2. Build completes successfully
3.3. Save the project
3.4. Click on Play button and run from within editor
3.5. NO error messages in-game
3.6. Close project (exit editor)
3.7. Editor prompts to save all levels before exiting - click YES
3.8. Open project again
3.9. NO error messages displayed within the view-port window
3.10 Click on Play button and run from within editor
3.11. “Lighting needs to be rebuilt for XXX objects” error displayed in-game
3.12. Stop the game
3.13. NO error messages displayed within the view-port window
3.14. Again click on Play button and run from within editor
3.15. “Lighting needs to be rebuilt” error still displayed in-game
3.16. Stop the game
3.17. NO error messages displayed within the view-port window
Figure A - No error while modifying game in editor
Figure B - Error while playing game in editor
If I build project again the result is steps 3.1 through 3.17 all over again, no matter how many times I build the project.
I have also tried the following:
4.1. Verified that all foliage instances have a lightmap-resolution value of 8 (least possible I assume) then rebuild
4.2. Deleted the foliage instances completely and then rebuild
4.3. Deleted entire project and recreated the project using the steps mentioned at the very top of this posts (1.1 -
1.4) - when I had first done this with 4.8.0 it was fine, but now that the engine is 4.8.1 the error is there right after project creation and map transfer.
4.4. Printed to the log output the list of Actors that are causing the error, deleted them, and rebuild (reference post - Maps need lighting rebuilt - Rendering - Epic Developer Community Forums)
Nothing seems to get rid of this error. I even build & played a backup of the previous version project (4.7.6) that I saved - everything is fine in 4.7.6. It appears there’s a lot more to lighting being built then just clicking the Build button.
I would appreciate it if someone could help me with this problem.