script life cycle
Posted: 20 May 2013, 18:20
Hi,
could somebody elaborate a little bit about scripts? How do you handle them from text representation through compilation to execution or how do you intend to do it. I am not modder so I do not understand ESX/BSA file formats that well yet.
It seems to me, that script is stored in uncompressed binary format inside ESX and openmw uses compiler component just to translate console commands into bytecode so compiler component is mainly part of opencs.
In compiler there seems to be class for each syntactical unit (token) which handles everything from lexical analysis to code generation and error handling.
I didn't look at interpreter component yet. But I wonder how do you manage memory usage for script interpretation. In game there are big increases in memory usage around big cities like Balmora, Aldruhn... Game starts at ~400 MB Ram and it can reach 1 or 2 GB within 15 minutes or less.
Ps. Of course I have red Ghan's Morrowind Scripting for Dummies (briefly).
Btw. How do you study new classes - do you use some IDE feature or do you use (doxygen) documentation? I would appreciate more comments on design choices inside code on some places - but maybe it is because I am not used to OOP that much.
I always wondered if there is some design draft inside OSS projects. I intend to crawl through most of the code anyway so feel free to leave my post unanswered.
Thanks anyway.
could somebody elaborate a little bit about scripts? How do you handle them from text representation through compilation to execution or how do you intend to do it. I am not modder so I do not understand ESX/BSA file formats that well yet.
It seems to me, that script is stored in uncompressed binary format inside ESX and openmw uses compiler component just to translate console commands into bytecode so compiler component is mainly part of opencs.
In compiler there seems to be class for each syntactical unit (token) which handles everything from lexical analysis to code generation and error handling.
I didn't look at interpreter component yet. But I wonder how do you manage memory usage for script interpretation. In game there are big increases in memory usage around big cities like Balmora, Aldruhn... Game starts at ~400 MB Ram and it can reach 1 or 2 GB within 15 minutes or less.
Ps. Of course I have red Ghan's Morrowind Scripting for Dummies (briefly).
Btw. How do you study new classes - do you use some IDE feature or do you use (doxygen) documentation? I would appreciate more comments on design choices inside code on some places - but maybe it is because I am not used to OOP that much.
I always wondered if there is some design draft inside OSS projects. I intend to crawl through most of the code anyway so feel free to leave my post unanswered.
Thanks anyway.