Programming, Work

128th day

Working on the command line all day.

Creating a .dll to handle all the interpretation and programming support of the players and programming game logic for me. Setting it up so that it is very os agnostic, it basically links against the OS’s msvcrt for windows just like directX and all those utilities, by using the c-runtime that comes with the windows driver development kit. This little package contains the LUA interpreter, ASMJIT and some ZMQ stuff as well. What I do like about LUA is that it is so small that you can effectively just pick what part of it you actually need. There are no massive lua libraries that it depends on, and I can tell you that python is a mammoth beast in comparison.

The ASMJIT is there for creating a JIT ASM interpreter for the programs. Yes. The little .asm functions will be very fast because it is basically getting converted straight to machine code. But I can set up various hooks into the .asm code through this library, so that I can control what goes in between the instructions and effectively kill any running routine that is miss behaving. Like a battery being drained or just a limit of frequency or anything like that.

The scripting language is going to be a mix of LUA and assembly.

Most of the game logic and set up is basic unity Mono C# stuff, but all the machines that are programmed to do certain things will use this mix of LUA and Assembly. Maybe I should just use the LUA JIT 2.0 since I am already getting my fingers jumping.

None of the functions that are accessible through the command line are some pre-compiled stuff out of C#. They will all be written in LUA and assembly and allowing the players to play with them and edit.

But, for this game most of these features are well beyond what you will need, but why I am adding them I will keep to myself for the time being.

The performance possibility of this scripting set up will make any scripting language seem like a sloth in comparison.

I need to play with this some more since I was at a point where I was about to have all my LUA results being echoed to the command shell within the game through callbacks and interops.

One of the biggest reasons for using LUA and this ASMJIT is to utilize supported utilities that already have this available instead of me implementing a VM for this in C#. There is no escaping this, and it does not scare me one bit.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s