Jump to content
  • Advertisement
Sign in to follow this  

Alpha test release download of new shhArc game dev scripting language now available

This topic is 3689 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Greetings The shhArc compiler and VM alpha release is now ready for viewing and testing. Download it using subversion from: http://code.google.com/p/shharc/ The code has a GPL licence and there is also an unrestricted licence available on request. If you wish to report any bugs please email the project owner on the google code project home page. There are Win32 and Linux directories containing projects and makefiles in each of the project directories. Look in Code/TestHarness/Integration/ and Code/TestHarness/Spritely/ for some sample solutions (set the runtime directories to /TestHarness/Integration/Runtime and Code/TestHarness/Spritely/Runtime respectively). The spritely app requires SDL (win32 version included in repository, youll have to install seperately for linux). The spritely app also requires some command line args (language, script, number of threads, and timeout for processes). The language is Cshharc (excuse the pun) which is a C/C++ compiler, script is test.cpp or whatever you write, it also requires the number of threads you wish to create for vm processes to run on, and last of all the it requires the timeout for each process. The number of threads and timeouts will only work if USE_TIMEOUTS, THREAD_SAFE and USE_VM_PROCESS_THREADS are #defined for use in the Code/Core/VM/Config.h file. There are also some other settings there that you can play with. I have as yet to write a manual (will do that this week hopefully), but if you look in the cpps that has main() in it in the sample apps, there are comments for use of the API and it is fairly self explanatory. In brief it just sets up the datatypes you wish to use in script, c++ engine functions you wish to call from script, configures the memory manager, compiles the script and runs it. All c++ engine functions you register for access from script are of the form ‘ProcessState funcname(type *, type* …etc)’ or the class member function equivalent. Ie they take pointers to a registered datatype and return a process state which for all but the complex situations should be ProcessOk. Code/Core/VM/Api.h contains all the functions you need to access and Code/Core/VM/VMTypes.h contains some general typedefs. In addition to the API the MemoryManagement project has a garbage collection pointer class in it (GCPtr.h), and a #define in MemoryManager.h which you can include at the beginning of your engine classes if you want them memory managed (all data used inside shhArc scripts is memory manged, just thought people might want to memory manage their own ‘in engine’ classes too). Aside from that there is a debug library with asserts, exceptions and alike in it. It is worth noting that scripted data types can only be cast explicitly. The C/C++ language has no modifiers (static, const etc), no unions, enums or typedefs. The C++ supported is single public inheritance and public and protected interfaces. There seems to be a link error in the Linux release build. To be honest its got me a bit stupped so if any one has any suggestions that would be appreciated, else just use the ‘make debug’ for now if you are using Linux. For those of you who didn't catch my previous post here is a feature list: • Ability to script in any LALR parsable language given a grammer and rules file for the language. This implies the ability to design your own scripting language for use with the compiler and VM. Currently comes packages with the rules for c/c++. • Link time type checking and function call resolution. • Ability to run scripts written in different languages on same VM and process. • Function visability privileges allowing for inter-script/inter-function restricted access. • Function overloading. • Stores data and code in memory block chunks so as to minimize memory fragmentation and thus take advantage of minimal fetching of data between memory and the processor cache thus improving performance. • Seamless extendibility and integration of VM into c++ engine allowing for; c++ engine functions and object member functions to be called from scripts, scripts and functions to be called from c++, c++ engine classes to be used in scripts, c++ engine member variables to be accessable in scripts, and c++ class data variables to be exchanged between the engine and scripts with ability to integrate with engine reference counting garbage collection. • Scriptable classes with single inheritance, public and protected interfaces, and virtual functions. • Integral single dimension array data type for all soft and hard data types. • Pointers to objects (no pointer arithmetic). • Function pointers. • User definable integral number data type optimised for speed. Define int, float or even a class as your integral data type so it performs faster than ordinary data types registered with the vm. • Variant data type. • Explicit casting between c++ engine types used in script. • Explicit data passing in function calls as well as pointers. • Type registering to allow consistent exchange of data between VMs and engines. • Uses VM processes to run script function call threads so can have multiple processes operating on the same code and data. • Optional time slicing of processes to manage time allocation spent on each process. • Ability to perform pre-emptive multi tasking. • Yeilding feature to halt a VM process update until a callback is received. • Optional instruction count overflow catching to stop infinite loops. • Thread safe VM so can distribute updating of VM processes on different threads and processors. • Relative addressing of all data so data can be moved or resized at runtime. • Uses true stack so garbage collection only required for heap newed data. • Reference counted garbage collection so no garbage collection phase. • Self regulating memory manager cache Enjoy

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!