RE: [Algorithms] Scripting
Brought to you by:
vexxed72
From: Jason D. <jas...@bl...> - 2001-03-28 23:16:53
|
That'd be wonderful if my message hadn't been preceded with "for a console project I worked on". It was for the original PlayStation, and while doing code overlays was something we initially looked into, it was a bugger to get right. With no operating system to help us, either all the code would have to be compiled to start at the same address, we load and fix all jmp / jsr's ourselves, or we used scripts. We went with scripts. As I said, it's not for everyone. Jason -----Original Message----- From: gda...@li... [mailto:gda...@li...]On Behalf Of Phil Teschner Sent: Wednesday, March 28, 2001 2:37 PM To: gda...@li... Subject: RE: [Algorithms] Scripting Just to throw some fuel into the fire: Couldn't you just have loaded c/c++ code dynamically. There's nothing that says you can't load/unload code at run time. Certainly in Windows you can do this through LoadLibrary/FreeLibrary and GetProcAddress methods. This requires a standard known interface between these libraries and your code, but you have to have that with "real" scripting languages. This also means you can compile these things while your game is running and the link step should be fairly minimal (which means you can do iterative programming without exiting/entering the game). The drawback is that you don't get compiler warnings when you incorrectly use the functions that you got via GetProcAddress. The other drawback is that it is c/c++ and not something higher level. Phil -----Original Message----- From: Jason Dorie [mailto:jas...@bl...] Sent: Wednesday, March 28, 2001 2:19 PM To: gda...@li... Subject: RE: [Algorithms] Scripting For a console project I worked on a couple years ago we needed loadable code for AI (too many unique behaviors took up too much RAM). We implemented our own virtual machine, and used YACC and LEXX to create the language. The VM was pretty simple - it had 32 general use registers, a stack, and about 12 basic instructions (add, sub, cmp, jsr, jmp, jmp on condition...) and a bunch of game specific ones. All the native code we wanted could be implemented as instructions in the virtual machine, and it was actually pretty elegant. It took two people about a week to get it running. The VM itself was written as a class, so multiple VM's could be running at the same time, and debugging was pretty easy because you had full access to the registers (class members), call stack (linked list), and could watch the machine evaluate the code. We could tell the machine to execute 100 instructions, execute until a JMP was called (new state), etc... It was pretty cool. I wouldn't recommend it for everyone, but it was worth trying, and the result was fast. Jason -----Original Message----- From: gda...@li... [mailto:gda...@li...]On Behalf Of bmarshall Sent: Tuesday, March 27, 2001 1:51 AM To: GDA...@li... Subject: [Algorithms] Scripting Anyone have any experiences with runtime scripting that they are happy to share. I'm looking at alternatives for scripting level setup, menus etc for a game. I 'm thinking about either something like Java or Perl. The main emphasis being on good editing/debugging support over speed as critical functions/queries will be in native code. Any thoughts appreciated, but please guys I don't want to start a Java vs. Perl vs. whatever flamer war! Thanks, -Brian. Brian Marshall Rare Limited, Manor Park, Twycross, Warks, England, CV9 3QN Phone: +44(0)1827 883400 _______________________________________________ GDAlgorithms-list mailing list GDA...@li... http://lists.sourceforge.net/lists/listinfo/gdalgorithms-list _______________________________________________ GDAlgorithms-list mailing list GDA...@li... http://lists.sourceforge.net/lists/listinfo/gdalgorithms-list _______________________________________________ GDAlgorithms-list mailing list GDA...@li... http://lists.sourceforge.net/lists/listinfo/gdalgorithms-list |