|
-
Aug 8th, 2005, 10:28 AM
#1
Thread Starter
Hyperactive Member
[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
-
Aug 9th, 2005, 04:21 AM
#2
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.
-
Aug 9th, 2005, 05:06 AM
#3
Thread Starter
Hyperactive Member
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.
-
Aug 9th, 2005, 06:05 AM
#4
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.
-
Aug 9th, 2005, 06:07 AM
#5
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.
-
Aug 18th, 2005, 02:31 AM
#6
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.
- ØØ -
-
Aug 18th, 2005, 05:46 AM
#7
Frenzied Member
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
-
Aug 18th, 2005, 06:33 AM
#8
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..
- ØØ -
-
Aug 18th, 2005, 07:23 AM
#9
Thread Starter
Hyperactive Member
Re: [Advantages and Disadvantages] VBScript scripting engine in a VB6 game
Its not .VBS, it is .txt file based, using a msscript ocx control.
-
Aug 18th, 2005, 07:25 AM
#10
Fanatic Member
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.
-
Aug 18th, 2005, 08:09 AM
#11
Frenzied Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|