Original Post
I''ve been doing some thinking lately on various ways to implement a scripting engine for my game. One of the main things That I''m not sure would be best is the execution of the script code. Should the script be compiled to actual x86 ASM codes and run directly, or should the asm codes be interpretted by my VM and my VM performs the correct action. The first seems like it would be alot faster, but the latter seems like it would be better for ease of implementation and would make the scripts more stable since they are more contained..
The second thing I''ve been thinking about is how exactly to make the VM. The system is event driven (Every ''Object'' has an attached script, that script recieves events caused by that objects interaction, think, etc..) So i figured having registers, and a stack would be sufficient. Then there would be all custom asm codes for operations etc. But I need some "Global" mem for the script cause otherwise no vars can be stored outside of a script call.. I''m just rambling now but hey.
I''m open to any comments or suggestions. Thx
-Zims