Results 1 to 11 of 11

Thread: [Advantages and Disadvantages] VBScript scripting engine in a VB6 game

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2005
    Posts
    294

    [Advantages and Disadvantages] VBScript scripting engine in a VB6 game

    Has anyone else used a scripting engine in their game engine before? I have and got it working with vbscript to do the same things I did with compiled code. To try it out, I used a .txt loaded at runtime to run every tick to update the camera, essentially making an UpdateCamera() sub in VBScript and my framerate dropped from 70 to 65, 60 in some parts of the map but without it, the framerate is a constant 70. The camera code is fairly simple, 15 lines of code + finding the distance, so I decided to remove it until I can do something useful with it as the scripting engine was dropping the fps.

    So, has anyone used a scripting engine in their game engine and had any success with it? And scince I have the capability, where should it be implemented?

    I was thinking of perhaps using it to control the player, turning keyboard input into moving left, right, changing current animation, jumping, shooting etc, but would it be worth it to make this modifiable?

    Btw, if anyone wants to know how to use a msscript control to make a fully functional scripting engine that can interact with the game engine through variables, I will post my method. And if anyone is intrested in my game engine, the technology demo is coming soon

  2. #2
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: [Advantages and Disadvantages] VBScript scripting engine in a VB6 game

    Script is interpreted at runtime and is therefore an order of magnitude slower (if not worse) than compiled code.

    I once tried to use something like that in a math parsing engine but the speed (lack of) was laughable so i ended up writing a more efficient version that semi-compiled the text into readily available information. It was at least 15 times faster at evaluating math expressions than the standard scripting component.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2005
    Posts
    294

    Re: [Advantages and Disadvantages] VBScript scripting engine in a VB6 game

    Well what are its advantages? I could implement it in my game engine but I dont know what to use it for. Note that my speed difference was between VBScript and VB running in the IDE, so a native code compiled exe has an even larger difference.

  4. #4
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: [Advantages and Disadvantages] VBScript scripting engine in a VB6 game

    I suppose you could use it for letting people write their own AI code for a bot in a game. Something like an ALife simulator or whatever.
    I don't live here any more.

  5. #5
    type Woss is new Grumpy; wossname's Avatar
    Join Date
    Aug 2002
    Location
    #!/bin/bash
    Posts
    5,682

    Re: [Advantages and Disadvantages] VBScript scripting engine in a VB6 game

    Speed-wise script has no advantages at all. Functionality wise it offers some level of user-interactivity but it also lets in all kinds of bugs and security issues.
    I don't live here any more.

  6. #6
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: [Advantages and Disadvantages] VBScript scripting engine in a VB6 game

    Scripting is mostly used for testing. In a big game company you have all sorts of people working, and you can't expect everyone to know C++. So if a 3D modeler have made a new model, and he want to test it in the game, he can use a simple script to load it and do the stuff he want it to do.

    Other things scripting is good for is to test the same thing many times. You can never do that by hand, but if you run the same script many times, you are supposed to get the same result every time.

    A third thing it is used for is to add new feautures to the game. Making it possible for users to add new stuff. But here you also have all kinds of security issues.

    I guess there is many other things you can use it for too, just havn't had the time to use scripting to much. Never tried VBScript for games. But I guess it will work just as nice as any other language. I made my own mark up language to test feautures in one of my demoes a couple of years back. And next time I will build something big, I guess I will use Python since it is the best scripting language I have ever used.


    - ØØ -

  7. #7
    Frenzied Member Devion's Avatar
    Join Date
    Sep 2000
    Location
    The Netherlands
    Posts
    1,049

    Re: [Advantages and Disadvantages] VBScript scripting engine in a VB6 game

    Add the fact that some virus scanners will probably block your VBS code as soon as it's accessed. Getting multiple NAV or Mcafee dialogs during a game might be a 'annoying' to say the least

  8. #8
    Retired G&G Mod NoteMe's Avatar
    Join Date
    Oct 2002
    Location
    @ Opera Software
    Posts
    10,190

    Re: [Advantages and Disadvantages] VBScript scripting engine in a VB6 game

    Who the BEEEEEEP are running Virus scanners when they are playing games....it is not weird people buy new faster computers ever month these days..


    - ØØ -

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2005
    Posts
    294

    Re: [Advantages and Disadvantages] VBScript scripting engine in a VB6 game

    Its not .VBS, it is .txt file based, using a msscript ocx control.

  10. #10
    Fanatic Member neicedover1982's Avatar
    Join Date
    Jun 2005
    Posts
    566

    Re: [Advantages and Disadvantages] VBScript scripting engine in a VB6 game

    You would have to look into this but I dont think any antivirus programs will have a problem with running code locally. The script blocker feature of the programs deal with the scripts online on websites and such. I have never heard of someones antivirus blocking a locally running script.

    I know a firewall will popup a message if the script trys to access the internet so that might be an issue if thats what you want but that can easily be solved.

    NoteMe, I dont think people run the scans while playing, I personally have my Nortons on all the time but not scanning till I say so or when i download something. Doesnt effect my game. Unless I happen to be playing during one of its scheduled scans, now that can make a game run interestingly.
    Kevin | New England Iced Over | http://www.kevincawleyjr.com

  11. #11
    Frenzied Member Devion's Avatar
    Join Date
    Sep 2000
    Location
    The Netherlands
    Posts
    1,049

    Re: [Advantages and Disadvantages] VBScript scripting engine in a VB6 game

    Try dimming the FSO using MsScript... and watch NAV go haywire

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width