beyond-all-reason / beyond-all-reason/RecoilEngine

LuaParser should throw exception if at load

Open
#1,702 0 comments 0 reactions 0 assignees View on GitHub
good first issue
Dominant language
C++
Stars
679
Forks
290
Avg merge
3d 2h
Merged PRs (30d)
40

Description

If `gamedata/modrules.lua` fails to parse, it just continues with defaults. This is pretty bad since it's very hard for a gamedev to discover (the warning is buried deep in the infolog, there is no immediate feedback ingame since modrule effects tend to be subtle). Generally, all Lua files parsed at game load should throw an exception and exit to desktop if there is a Lua error in them.

Some examples I found:
* `gamedata/modrules.lua`
* `gamedata/icontypes.lua`
* `gamedata/explosions.lua` in the initial loading run (it can run again at runtime as part of `/reloadcegs`, where it shouldn't crash)
* `gamedata/resources.lua`
* `gamedata/resources.lua`
* `gamedata/resources.lua` (see #1703)
* `gamedata/sounds.lua`
* `objects3d/*.{dae,obj,etc}.lua` assimp model metadata

Contributor guide

Open the contributing guide

Research direction

Start by tracing LuaParser handling for gamedata/modrules.lua, icontypes.lua, explosions.lua, resources.lua, sounds.lua, and objects3d Lua metadata during game load. Compare the initial explosions load with the runtime /reloadcegs path. Done means Lua parse errors during initial loading throw an exception and exit to desktop, while runtime reload behavior remains non-crashing.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, lua
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.