dhewm / dhewm3

dhewm 3 main repository
https://dhewm3.org/
GNU General Public License v3.0
1.81k stars 348 forks source link

Feature Request: JIT for script compiling #101

Closed nbohr1more closed 9 years ago

nbohr1more commented 10 years ago

See Fabien Sangarld's article here:

http://fabiensanglard.net/doom3/scripting_vm.php

Doom 3 uses a realtime script interpreter and would benefit from a JIT compiler just like Quake 3 had.

DanielGibson commented 10 years ago

Feel free to submit a pull request :-P Probably nowadays one would use LLVM for that. I personally am not motivated to do this:

nbohr1more commented 10 years ago

Yeah, I created this as a bountysource tracker to help The Dark Mod since we have an number of script aficionados in our mapping community. I have been trying to preach against expanding the script model but at least a few of the core coders have the hots for "doing more stuff with scripts".

DanielGibson commented 10 years ago

Hmm are mapscripts expensive? AFAIK the main performance problems with scripts in doom3 were related to enemies, weapons etc being scripted (and I think Quake4 implemented those in C++ for that reason)

motorsep commented 10 years ago

Having scripts in binary form will not make them faster. Clever design (heavy stuff in c++ and not too heavy in script) will make the difference. Plus on modern PC it's not an issue anyway.

nbohr1more commented 10 years ago

Yes, I should have clarified. We have scripts that do AI routine modifications, weapon changes, and even interactions with custom Dark Mod systems. (And those coders keep expanding their use cases... grrr...) Of course, Doom 3 itself is plenty fast on a modern PC but the scripts in missions like "No Honor Among Thieves" will still beat up a mid-range CPU pretty badly. At least one of the top offenders is a very good script writer and makes very clean C-like implementations which run fairly well... unfortunately, as Thief mappers (who have a history of using and abusing script systems in Dromed) start migrating to The Dark Mod they will undoubtedly push the envelope further...

DanielGibson commented 9 years ago

I guess this isn't gonna happen..

if TDM does it after all, a pull request would be welcome, of course.