Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualwodinoneeye

Posted 28 May 2013 - 07:25 AM

How complex is your 'script' ? (what data does it manipulate and what functions) 

 

Sounded mainly was manipulating a Unit's own state, issuing action initiation for the unit , getting game (map?) situational data...

 

Python may be overkill (and pulling/pushing data/calls to your 'core' might be extensive code (plus python is notoriously slow).

 

As you would do in Python you would have high level calls calling native functions that do extensive data crunching (like sensor scan/sort).

---

 

Something I did a few years ago was to build a script language using C macros, C preprocessor to convert it to native C code and then quick compiling it into a DLL.   The 'toolchain' would do all the conversion steps required with a single activation.

 

The macros allow you to pull game object attributes directly via the names in the core data structures ( via a string substitution in a C macro)

You can also build distinct named macros for specific Standard  attributes and functions  (which are obbvious in the script language what they do)

 

To limit what can be accessed, the generated C code can be forced to run within a DLL or class file for an  allowed subset.of data access/calling

 

The macros can if needed be made to do any thing you could do in C for debug purposes without the extra mapping layer Python->Core

(logging macro turns on text trace so that the 'print method of debug can be done if all else fails, beside using the standard C debugger)

 

 

One of the AI Gem books had an article on implementing FSM using C macros  for a tailored script 'language'  with inbuilt FSM features (which gets rid of alot of ugly wrapper code structure FSMs need)  and I incorporated that method also.


#1wodinoneeye

Posted 28 May 2013 - 07:22 AM

How complex is your 'script' ? (what data does it manipulate and what data) 

 

Sounded mainly was manipulating a units own state, issuing action initiation, getting game situational data...

 

Python may be overkill (and pulling/pushing data/calls to your 'core' might be extensive code (plus python is notoriously slow).

 

---

 

Something I did a few years ago was to build a script language using C macros, C preprocessor to convert it to native C code and then quick compiling it into a DLL.   The 'toolchain' would do all the conversion steps required with a single activation.

 

The macros allow you to pull game object attributes directly via the names in the core data structures ( via a string substitution in a C macro)

You can also build distinct named macros for specific Standard  attributes and functions  (which are obbvious in the script language what they do)

 

To limit what can be accessed, the generated C code can be forced to run within a DLL or class file for an  allowed subset.of data access/calling

 

The macros can if needed be made to do any thing you could do in C for debug purposes without the extra mapping layer Python->Core

(logging macro turns on text trace so that the 'print method of debug can be done if all else fails, beside using the standard C debugger)

 

 

One of the AI Gem books had an article on implementing FSM using C macros  for a tailored script 'language'  with inbuilt FSM features (which gets rid of alot of ugly wrapper code structure FSMs need)  and I incorporated that method also.


PARTNERS