RobertBeckebans / RBDOOM-3-BFG

Doom 3 BFG Edition source port with updated DX12 / Vulkan renderer and modern game engine features
https://www.moddb.com/mods/rbdoom-3-bfg
GNU General Public License v3.0
1.37k stars 244 forks source link

Need more memory allocation to compile scripts with a large number of variables. #835

Closed RolledNodes closed 4 months ago

RolledNodes commented 5 months ago

RBDOOM-3-BFG fails to compile my mod scripts with an error "Exceeded global memory size". This error occurs in the idProgram::ReserveDefMemory function in master/neo/d3xp/script/Script_Program.cpp, and seems to be caused by the size of the array "variables" being smaller than "numVariables". The size of the array "variables" is defined in #define MAX_GLOBALS 296608 in master/neo/d3xp/script/Script_Program.h, so increasing this value should solve the problem. Does this number have any meaning? If not, I would like to increase this value more.

RobertBeckebans commented 4 months ago

I think this is related to https://github.com/dhewm/dhewm3/issues/204 and https://github.com/dhewm/dhewm3/issues/303 I'm going to merge the fixes from Dhewm3 into a branch and then you can test it again

RobertBeckebans commented 4 months ago

You can get the changes by

git checkout 671-imgui-docking and compile a new binary. This is the 1.6.0 development branch.

RolledNodes commented 4 months ago

Sorry, but the same error occurred. There is no indication that anything in particular has improved.

RobertBeckebans commented 4 months ago

If the last changes don't help then I would suggest to just double the MAX_GLOBALS value.

RolledNodes commented 4 months ago

Tried it. #define MAX_GLOBALS 999999 Now it all worked out. :D There appears to be no particular problem.