BriskVM 2

BlitzMax Forums/BlitzMax Programming/BriskVM 2

Armitage 1982(Posted 2012) [#1]
Hi

I'm currently re-writing my game engine and I think it would be nice to use script to make thinks more modular and fun.

I would like to ask you what do you think of BriskVM 2 as a first virtual machine choice?

I fixed all the examples and the tutorial today, so I know it is working, but I wonder on the long term if it's a good choice compared to LuaJIT 2.0 from Zeke. Lua is probably faster but I seriously prefer a strong typed language like BriskSL which is very similar to BlitzMax.

In addition, it appears that BriskVM 2 support reflection, that would probably help me a lot to attach a component inspector to every newly created game objects driven by scripts (though I don't know if it would be fast enough for doing that, I need to try but it will require a major overhaul).

On the other hand, learning and using Lua is always good cause it is widely used on many games & engines.


Thanks for your opinion ;)


Michael


Yasha(Posted 2012) [#2]
I would recommend Lua, or failing that, any other widely-used script language (JavaScript, Python, Lisp, Tcl...). Lua is part of the official BlitzMax distribution anyway, and like all of the other listed languages it is alive and actively developed (the same almost certainly not being true of Brisk).

The purpose of scripts is to be modifiable by the end user (they are not for you: if you're the one writing all the scripts, you should be rolling them into your binary instead). BriskVM is both obscure and complex, comparatively speaking. This is not going to make me very many friends, but I honestly believe it is not a very good scripting solution in any important respect. It just looks like one to BlitzMax users, because it looks a bit like BlitzMax.

Looking like BlitzMax is not important at all, because your users aren't modifying your Max code (if they were, they wouldn't be writing scripts). Strong typing is also generally considered a negative feature for script languages - you want maximum flexibility, maximum brevity, maximum removal from the machine layer - abstraction is everything.

Last edited 2012


ziggy(Posted 2012) [#3]
Brisk works pretty well and it is very well designed so it could be a viable option if you're going to be writing the scripts for your own game. It would make your life easier as you already know BlitzMax and it is quite similar. It also runs reasonably fast. But if you're willing other people to create their own scripts for your game, then I would recommend Lua or any other standarized solution. Python would be super cool too, but as yasha has pointed out Lua is currently part of the official BlitzMax distro, so its adoption should be very straight-forward.


JoshK(Posted 2012) [#4]
Lua integration is NOT straightforward at all. The whole language feels like it was designed for C, and exposing OO APIs is a pain, always requiring third-party libraries. Noel's LUGI module is great for exposing an OO BMX command set to Lua, but if a command is entered wrong, you will simply get a silent crash. I have used BriskVM in the past, and found the syntax and integration with BMX to be really nice. However, I have not used it extensively and can't comment beyond that.

If you are using Lua with C++, don't use anything except ToLua++. Do not use LuaBind, it has serious flaws in its design.

Last edited 2012


ziggy(Posted 2012) [#5]
@JoshK: Thanks for the info. Are you talking abut the built-in official Lua or the JITted version of it? or both are complicated to integrate?


JoshK(Posted 2012) [#6]
LuaJIT is easy to turn on and off.

The biggest challenge is exposing BMX commands for Lua script to execute.


GW(Posted 2012) [#7]
I could be wrong here, But the lastest luajit2 mod by Zeke *does not* with bmax unless you build juajit2 as a dll and rewrite all the function definitions. Static linking the way it works in the mod is broken. I've tried 4 versions of bmax/mingw across 4 machines and never got it to work.

btw: Ive used BVM since the beginning and it works great.


N(Posted 2012) [#8]
.

Last edited 2012


N(Posted 2012) [#9]
.

Last edited 2012


N(Posted 2012) [#10]
.

Last edited 2012


N(Posted 2012) [#11]
.

Last edited 2012


Armitage 1982(Posted 2012) [#12]
LuaJIT 2.0 beta 10 from Zeke as well as the LuGI modules from Noel are working correctly here. I tried several simple Lua script to get started with.

At first glance it seemed easy but then I started to read "Programming in Lua" (320 pages...) and after a few chapter I found the Lua language a bit cumbersome.

I already know that an interpreted script isn't as fast as binaries code, but I mainly plan to write logic code like updating object, AI, state changes, level parameters, etc. So a Virtual Machine "should" be fast enough and interesting to try (except maybe with collision solver since I'm using Box2D).
Also each levels produced by the engine can be self contained, meaning you could already customize everything. Adding script abilities on top would allow modding.

The thing I like with BriskVM 2 is that I could potentially create, list, setup and process 100% scripted object & class thanks to reflection and strong similarities with BlitzMax. I could certainly achieve the same thing with Lua but it's already much more complex and harder to debug...

I already used BVM in the past with Blitz3D and it really fit my needs. The only thing is that the BriskVM 2 forum is dead and development has stagnated. But since BriskVM 2 is similar to BlitzMax I could probably try it quickly enough and take a decision.

But you're probably right on something: if I'm the only one to mod, then maybe it's easier to hard code everything and release extension/update if needed ^^


Armitage 1982(Posted 2012) [#13]
I ask status about BriskVM more than 2 weeks ago but Régis never answered, so I think I will avoid scripting one more time :)


JoshK(Posted 2012) [#14]
But you're probably right on something: if I'm the only one to mod, then maybe it's easier to hard code everything and release extension/update if needed ^^

YES. Don't add a script interpreter unless you really need one.