 |
|
|
Scene.org is hosted and supported by:
|
|
|
|
Scene.org is sponsored by:
|
|
|
|
|
 |
forum - #coders |
|
 | | Topic: | Demo Virtual Machines? | | | Anyone in the Demoscene played with writing a sort of Virtual Machine for thier Demos?
I've just recently started fiddling with GFX programming and figured I'd try hooking a Forth VM directly to the linear framebuffer. I'm getting some decent results, but was curious what other peoples experience has been.
Been checking out Forth and some of the "Vector based" languages(K, J, APL, Vector C, etc..) and finding them to be far more efficient than I had originally anticipated.
I dont suppose anyone would have a use for a specialized Vector based Virtual Machine for Demo coding.
Just an idea that I have floating around. Any thoughts?
Freejack | | |
| I was actually thinking of writing a very tiny executor for a stack-based language, not exactly Forth, more like a mix of that and PostScript. The compiler would be able to parse in some source and save it in a highly compacted format for the executor. Perhaps one could do somewhat smaller than PC assembler. But then again, WHAT FOR? It doesn't bring more quality into coding, it's just error prone. For assembler, you at least have a debbugger. Nor does it really gain you on size because of compression, i would guess.
If you mean it performace-wise, then i'd like to know more about your idea. Do you mean a vector-aware JIT compiler? However, in a typical situation, you can very well assume that every computer supports Pentium 3 instructions - the very tiny performance critical assembly snippets can be handdwritten, generated by something like Vector Pascal, or the whole task could even be offloaded to vertex shaders? I recall that due to the need of different optimised snippets being executed depending on a processor, someone wrote a run-time assembler which should be easy to extend. Here: http://softwire.sourceforge.net/
If it's about portability, then i'd say make demos GPLed (perhaps only the execution part, not the toolchain), or simply wait until JITs evolve further - then take some and improve on it. For example, the new one on which MONO crew has been working on might be promising. There is also Lightning, VCode, they are all extensible. | | |
| | i suspect that most of us have, at some point, used either scripting or something like a VM for init, scripting, etc. But if that doesn't cover your needs ... | | |
| | Yeah I've been thinking about this as well, looking at the current generation of editors smode/werkkzeug for all intents and purposes these are very high level VM's. And Generally they're the fastest type - i.e. late binded native functions. | | |
| Actually what is very common in games like i.e. FarCry is the use of Lua. It's a script language that binds with your native functions and the overhead to support the binding is small. Other possibilities are to write your own interpreter or compiler, but neither approach will fully bring you all the things you'd desire.
Interpretion can be slow and insecure,
Compilation is a preprocess step and may not suit your needs.
Another thing that sets tools like werkzeug appart is that they can't be used to do 'smart' effects, that are simulated rather than 'designed'. | | |
| Hi - yup I agree with ya.
But I think with the right thoughts behind yer editor (I'm pro editor at the moment :) ) you can potentially expose enough of the hardware to get back to "demo" basics - i.e. pushing the envelope of hardware visuality.
The current generation of game vm's (lua,unreal script,quake c, e.t.c) tend to be rather slow - esp on consoles. I guess thats why doom3 used Flash for alot of it's fancy texture fx/consoles?
I think the closest thing at the moment is that softwire rendering thingy? | | |
| | We've used a virtual machine for doing particle effects. This enabled us to have a small footprint (can be used for 4kb intros), as well as allowed for a straight forward scripting language. Our group artists have been able to contribute particle effects, without needing to "code". | | |
|
|
|