Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Program Announcements / DBP Plugin: WB Scripting Engine

Author
Message
TKF15H
20
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 2nd Mar 2005 19:35 Edited at: 18th Mar 2005 18:56
DBP started working on my machine again, so I sat down and made the WarBasic Scripting engine run as a plugin.
It has around 312 of DarkBasicPro's commands, more coming later. Pain on the fingers having to register them all... I'm not done yet, but the core engine is one of those never-ending-works-in-progress so I thought it would be OK to announce it here.
This is usefull for lots of things: MODable games, AI, Events (controlling objects like doors/elevators), configuration files...
Download it here.
If you would like to see what commands exist before downloading, have a look here:http://www.flatface.net/~bugeyes/dls/DOCUMENTATION.TXT
If you want to see the test WarBasic script being executed in the demo, lookie here:
http://flatface.net/~bugeyes/dbpnet/?file=../dls/flybrain.wbc
Here is the test DBP program that uses this script:
http://flatface.net/~bugeyes/dbpnet/?file=../dls/zombie.dba
Thanks to IanM for the interface library, which this project uses extensfully.

[EDIT] Just re-uploaded the zip, took out unnecessary stuff, added something else. File size was 3mb, but is now 140kb (or so). It's smaller than a JPG, so you have no excuse not to download it.

[EDIT2] Mirror added as a download button below, my server seems to be a bit unstable ATM...

[EDIT3] Update 3/10/05, fixes some bugs, better example showing "flys" (spheres) bugging a dead body. Attachment below contains only the source code and the plugin, link above contains that and a precompiled version.

[EDIT4] Update 3/18/05, uploaded the new DLL with FOR LOOPs in the DOWNLOAD button below, did not update the DLL on the other server.

AphoticVM status: 30% (Yes, that number just went down.) AphoticBasic status: 10%

Attachments

Login to view attachments
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 3rd Mar 2005 03:43
Interesting.


"Lets migrate like bricks" - Me
Mr Underhill
20
Years of Service
User Offline
Joined: 23rd Apr 2003
Location: The Forgotten Worlds...
Posted: 3rd Mar 2005 03:54
Heh, it seems that DBP scripting is becoming popular. Powersoft, David T, and now TKF15H are working on scripting engines/wrappers.

Is this the start of a new trend?

My name is Underhill...commit it to memory.
"Vee vill drive zhem from zee peer-to-peer sites, vee vill beat zhem vith a stick!" ~Leo Laporte, mocking the RIAA
Benjamin
21
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 3rd Mar 2005 05:04
Silly isn't it


"Lets migrate like bricks" - Me
TKF15H
20
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 3rd Mar 2005 06:04
Quote: "Is this the start of a new trend?"

Not really, I've been working on this for an entire year. David T's scripting engine is a stand alone interpretor (not a plugin, as far as I know), therefore PowerSoft is the only competition.

AphoticVM status: 30% (Yes, that number just went down.) AphoticBasic status: 10%
PowerSoft
19
Years of Service
User Offline
Joined: 10th Oct 2004
Location: United Kingdom
Posted: 4th Mar 2005 00:58
And thats alot of competition, this is War...... (WarBASIC that is. )



I challenge you to a DUEL!

PowerScript: Currently Working on Expression Parsing, 80% complete
TKF15H
20
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 4th Mar 2005 18:59
You can't challenge me to a duel, you're still doing expression parsing!

AphoticVM status: 30% (Yes, that number just went down.) AphoticBasic status: 10%
PowerSoft
19
Years of Service
User Offline
Joined: 10th Oct 2004
Location: United Kingdom
Posted: 4th Mar 2005 21:10
Ahem! That is confidential information, you have broken the official secrets act. This has just given me a big incentive

PowerScript: Currently Working on Expression Parsing, 80% complete
TKF15H
20
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 5th Mar 2005 05:35 Edited at: 5th Mar 2005 13:07
[EDIT]

AphoticVM status: 30% (Yes, that number just went down.) AphoticBasic status: 10%
PowerSoft
19
Years of Service
User Offline
Joined: 10th Oct 2004
Location: United Kingdom
Posted: 5th Mar 2005 06:01
hey im the only one who can point out my obvious blunders...


PowerScript: Currently Working on Expression Parsing, 80% complete
TKF15H
20
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 5th Mar 2005 13:08
There y'go. Now get back to coding!!

AphoticVM status: 30% (Yes, that number just went down.) AphoticBasic status: 10%
PowerSoft
19
Years of Service
User Offline
Joined: 10th Oct 2004
Location: United Kingdom
Posted: 6th Mar 2005 15:13
Tk, this is looking very good. I like, i like.

PowerScript: Currently Working on Expression Parsing, 80% complete
TKF15H
20
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 7th Mar 2005 20:04
Thanks, PS. Tried doing anything with it?

AphoticVM status: 30% (Yes, that number just went down.) AphoticBasic status: 10%
PowerSoft
19
Years of Service
User Offline
Joined: 10th Oct 2004
Location: United Kingdom
Posted: 8th Mar 2005 01:30 Edited at: 8th Mar 2005 01:32
sorta. I might need to talk to you about expression parsing though (see sig)

PowerScript: Currently Working on Expression Parsing, 10% complete (Yep the number went down)
David T
Retired Moderator
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 8th Mar 2005 01:45
Quote: "Heh, it seems that DBP scripting is becoming popular. Powersoft, David T, and now TKF15H are working on scripting engines/wrappers."


I am? I was just making a compiler for myself (although I might rewrite it in DBPro for fun)

Quote: "sorta. I might need to talk to you about expression parsing though (see sig)"


I asked him. It's a lot more complex than rpn

bak on topic..

Nice to see this is finally finished! I will have a play around with it

Get 15 new commands, all the date / time commands left out of DBPro for free!
DOWNLOAD PLUGINS HERE: http://www.davidtattersall.me.uk/ and select "DarkBasic"
TKF15H
20
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 8th Mar 2005 06:09
It's not more complex... I just push the operator into the stack, and when a number comes afterwards, it pops the two and does the math. Same thing as RPN, but without the compile-time reversing.

AphoticVM status: 30% (Yes, that number just went down.) AphoticBasic status: 10%
PowerSoft
19
Years of Service
User Offline
Joined: 10th Oct 2004
Location: United Kingdom
Posted: 10th Mar 2005 01:25
{im screwed up with expression parsing}


Is this finished or i there more to dev?

PowerScript: Currently Working on Expression Parsing, 10% complete (Yep the number went down)
TKF15H
20
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 10th Mar 2005 08:25
As I said in the first post, this is one of those never-ending-works-in-progress. I've been working on it for a full year, so it's pretty mature. It will never be "finished" though. In fact, I'll make an update in a few minutes...

AphoticVM status: 30% (Yes, that number just went down.) AphoticBasic status: 10%
TKF15H
20
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 10th Mar 2005 19:21
...ok, that took more than a few minutes...
The example now shows something a bit more interesting than a sphere going round in circles. Check the first post again.

AphoticVM status: 30% (Yes, that number just went down.) AphoticBasic status: 10%
Sol462
19
Years of Service
User Offline
Joined: 12th Sep 2004
Location: playing with the spazookeedoo
Posted: 11th Mar 2005 07:08
Quote: "Now get back to coding!!"

EA-style.

TKF15H
20
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 11th Mar 2005 10:33 Edited at: 16th Mar 2005 20:01
Here's something for the screenie lovers:
http://forum.thegamecreators.com/xt/xt_apollo_pic.php?i=522445
10 spheres controled by a simple script with a love for not-so-fresh meat.

AphoticVM status: 30% (Yes, that number just went down.) AphoticBasic status: 10%

Attachments

Login to view attachments
TKF15H
20
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 17th Mar 2005 23:01
I just added FOR loops yesterday night (erm, this morning...) and I have some testing to do. If all goes well, I'll upload an update tonight.
Example For loop:

For i=0 UpTo 100
print(i)
Next
For i=100 DownTo 0
print(i)
Next

AphoticVM status: 30% (Yes, that number just went down.) AphoticBasic status: 10%
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 17th Mar 2005 23:57
Scripting is the new black .

I'm developing a scripting engine as part of vanmesh, in fact vanmesh is largely written in it (I call it F'Tang). The bit I'm still worried about keeping tabs on For...Next loops, I have pretty much everything parsing except that - even Repeat...Until loops are done, they were very easy, as was IF statement handling funnily enough.

I think F'Tang is taking things at a different approach to the other script systems though, it's more designed for programming modelling tools, so most of it is mesh data handling with a lot of math support. It'll make it possible to make your own plugins and tools, which is fairly rare in a DBPro app. I'm not sure how quickly it could be picked up, it's very much like a simplified basic but with strict guidelines - like function calls need to be formatted correctly and user defined variables need a leash, but when you can do things your own way it's worth it - like if I want to move a vertice along an axis in vanmesh, it's a case of: [VERT.X(100)]+0.1

It does work the long way too (var=var+what), but the point is that the DBPro code to do the same thing everytime I needed to would make developing vanmesh hell.


Van-B


It's c**p being the only coder in the village.
TKF15H
20
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 18th Mar 2005 01:12
Quote: "VERT.X"

wow, you went through the trouble of doing OOP?!?
The For..next loops were pretty easy, being a mix between DO..LOOP and IF. It's espetially easy with UpTo and DownTo instead of the way normal Basic works (for i = 1 to 10 by 2).
Are you making yours in DBP, VanB?

AphoticVM status: 30% (Yes, that number just went down.) AphoticBasic status: 10%
TKF15H
20
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 19th Mar 2005 22:46
Updated the [Download] button, now I'm thinking of adding OOP to it. WB already supports multi-dimentional variant arrays, so adding simple OOP is mostly done by using a pre-processor that turns this:
struct pie
crust
filling
endStruct
food as pie
food.filling = "Strawberry"

into this:
food = Dim(2)
food(2) = "Strawberry"

After that I'll have a headache about adding the THIS pointer as a parameter to functions...

AphoticVM status: 30% (Yes, that number just went down.) AphoticBasic status: 10%
TheOneRing
20
Years of Service
User Offline
Joined: 28th Aug 2003
Location: Right here.
Posted: 24th Mar 2005 05:49 Edited at: 24th Mar 2005 05:51
Wow. You guys got a bit further than I did. I had started a scripting engine plugin back in the day, written in old-fashioned C++. Supported a couple-hundred DBPro commands, used a syntax similar to C, IF/ELSE, WHILE, REPEAT, FOR constructs. The script would "compile" to a byte-code for quicker execution (sped up the execution probably 50x). Had a nice little feature called "Crossover" variables that could be defined in DBPro, then their value changed/queried in both DBPro and your script.

Sadly, I had to set it aside for more important work. I still have it up on the web with a small demo at http://www.mighty-atom.com/d-zone/transform-i/.

Good to see that folks are working to mature this particular field in DBPro.

Cheers!
TKF15H
20
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 24th Mar 2005 10:10
hey, I think I remember the name. Nice website you made for it.
Quote: "The script would "compile" to a byte-code for quicker execution"

WB compiles into a linked list of function pointers. It's a pain to code, but it optimizes the program's code pretty well (after hours of setting the program flow to 0x000000 ). The crossover variables you made sound pretty interesting. Do they have to have a certain name, or did you manage somehow to get a pointer to DBP's variables?

AphoticVM status: 30% (Yes, that number just went down.) AphoticBasic status: 10%
TheOneRing
20
Years of Service
User Offline
Joined: 28th Aug 2003
Location: Right here.
Posted: 24th Mar 2005 11:23 Edited at: 24th Mar 2005 11:27
No, nothing as complicated as addressing the actual DBPro variables in-memory. Just a set of commands where you could assign a value based on an index, both in DBPro and the scripting language.

Example in DBPro:



In your script you could reference the crossover variable '0' like:



I basically allowed for 1024 "slots" if you will for exchanging data. Worked really well. Something you could consider using, or even expanding upon for your language.

The expression parser was full featured. Followed order of operations and such, as well as allowed the DBPro functions to be used in expressions as well (just like C). Its a shame I had to drop it. I've considered picking it back up, just haven't had the time.

The code is all C++ and Standard Template Library. Very clean code, well documented, object based, broken out into 5 major pieces: DBPro command interface, built-in commands (keywords), functions (DBPro stuff), compiler, and parser. Very well built, if I do say so. If you want to see some source (don't know why) I'd be happy to include some.
TKF15H
20
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 24th Mar 2005 18:47
In WarBasic, all variables are crossover variables then.
"Set Int pCode, "FLY", 10"
"Set int" tells the VM that the variable you want to set is an integer
"pCode", a number that identifies a script
"FLY", the name of the variable to modify
"10", the value to pass to it.
There is also Set Float, Set Char, Set String, and their equivalent Get functions.

Quote: "If you want to see some source (don't know why) I'd be happy to include some."

Thanks for the offer, but I'm also a bit short on time. I work from 8am to 5pm, then I have classes from 7pm to 11. After that, the only thing I want to look at is my bed.

Quote: "The code is all C++ and Standard Template Library. Very clean code, well documented, object based, broken out into 5 major pieces"

*me hides under desk*
WB is a bit of a mess. I started working on it a year ago, and since then my coding style has changed a few times. Because of this there's a whole bunch of stuff in there that isn't very friendly to others. I even shared a chunck of the code on the forum once, people said they'd have a look and they never said anything again. Probably a medical condition...

AphoticVM status: 30% (Yes, that number just went down.) AphoticBasic status: 10%
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 24th Mar 2005 21:11
User variable handling can be tricky, my system is probably quite slow when dealing with them, but surprisingly it parses scripts in realtime fast enough to leave me with a cheesy grin. For example, the scripted version of the cube primitive tool is just as smooth as the hard-coded version. I did expect a lot of jittering etc, I certainly did'nt expect DBPro to be fast enough at parsing scripts natively.

One thing I did add was a variable deleting function, like in a script subroutine you might use a variable that you don't really need to leave in the system, so I just delete the extra variables when I'm done with them - internal variables like the number of polygons for instance, are kinda globalised because the real values are hacked into them during the script parsing. I think that's a good way to keep the user variables in order, the less variables it needs to check until it finds the right one the better.


Van-B

Computer says no.
TKF15H
20
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 30th Mar 2005 08:41
"the less variables it needs to check until it finds the right one the better"
Ouch, is that how you're doing things? Wouldn't it be better if you replaced the variable's name with a number which is its index in your variable-holding array?

Of course, to do that you'll need to do some preprocessing, instead of parsing real-time. I don't like calling WB a scripting engine because not only does it preprocess everything, it optimizes the code into a bunch of function calls (sorta like DBP does with DLLs) and the code is totally removed from memory. The disadvantage to this is that it takes a bit longer to load the programs. Runs a lot faster though.

AphoticVM status: 30% (Yes, that number just went down.) AphoticBasic status: 10%
TheOneRing
20
Years of Service
User Offline
Joined: 28th Aug 2003
Location: Right here.
Posted: 30th Mar 2005 08:51
You got it right. When outputting the 'byte-code', the variable name is replaced with an index to the variable-table. Yes, my scripts are 'compiled' down to byte code before any execution takes place. They stay in memory, and I allow a certian number of scripts to be loaded into memory and compiled. Don't remember the number, but its quite a few. Yes, this method is fairly quick.
DARKGuy
20
Years of Service
User Offline
Joined: 28th Nov 2003
Location:
Posted: 1st Jun 2005 14:06
Hmmm, flatface.net seems dead


http://dbfree.dbspot.com/ <- DB Freebie Archive! Royalty-free media for your games! FREE!
TKF15H
20
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 2nd Jun 2005 07:53
Arg, I'd noticed it was offline as my avatar is missing. If anybody wants the plugin I could just upload it here.

DARKGuy
20
Years of Service
User Offline
Joined: 28th Nov 2003
Location:
Posted: 2nd Jun 2005 07:54
I would like to test / use it


http://dbfree.dbspot.com/ <- DB Freebie Archive! Royalty-free media for your games! FREE!
TKF15H
20
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 5th Jun 2005 01:56
The download button on the first post has the plugin. o_O
Did you get that file?

DARKGuy
20
Years of Service
User Offline
Joined: 28th Nov 2003
Location:
Posted: 5th Jun 2005 06:14
Uh, just got it, but the manuals and documentation aren't there I can host the DLL and those files for you if you wish


http://dbfree.dbspot.com/ <- DB Freebie Archive! Royalty-free media for your games! FREE!
TKF15H
20
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 6th Jun 2005 12:09 Edited at: 6th Jun 2005 12:18
no doc? Oops...
Just attached it.

I'm remaking a this plugin using a faster core, but it'll take a while to be released (work, classes, no time to code). If there's anything you'd like to suggest, now is a good time.

Attachments

Login to view attachments
ALPHA ZERO PRODUCTIONS
20
Years of Service
User Offline
Joined: 28th Sep 2003
Location: Mom ! I forgot where we live !
Posted: 22nd Jun 2005 14:41
what is warbasic ?

TKF15H
20
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 23rd Jun 2005 04:49 Edited at: 23rd Jun 2005 04:50
As I said in the first post:
Quote: "WarBasic [is a] Scripting engine [that] runs as a plugin.
This is usefull for lots of things: MODable games, AI, Events (controlling objects like doors/elevators), configuration files..."

Think of it as a way of including code into your game after you compile it. This code can be used for changing the way something will behave in your game. Kinda like in Dead or Alive 2 (the ultimate fighting game, without a doubt) which uses a seperate file for each character that defines what moves the characters have. Or like Ghost Recon that uses XML to define variables for each weapon (bullet size, zoom, bullet speed, weight, etc).

Hawkeye
20
Years of Service
User Offline
Joined: 19th Sep 2003
Location: SC, USA
Posted: 23rd Jun 2005 06:07 Edited at: 23rd Jun 2005 06:14
V.nice

edit: ewwwwww.... I just made the sad mistake of looking at the zombie texture YUCK!


Benjamin says: fecking twat of a program [msn7]
Meh blog
TKF15H
20
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 23rd Jun 2005 08:22
hehehe, I should have made a cleaner demo... sorry!


Keaz
20
Years of Service
User Offline
Joined: 22nd Sep 2003
Location: Somewhere in south Texas
Posted: 23rd Jun 2005 09:00 Edited at: 23rd Jun 2005 09:01
Is this to make your game mod-able by the mod community? Or so the programmer can do post compile/release mods?

Breaking Stuff=Fun!,Bug Testing<>Fun!, Bug Testing=Breaking Stuff, so...
Bug Testing=Fun! Hmmmm....
DOES NOT COMPUTE! SYSTEM MALFUNTION!
Keaz
20
Years of Service
User Offline
Joined: 22nd Sep 2003
Location: Somewhere in south Texas
Posted: 23rd Jun 2005 09:09
Either way some comercial products don't want mods aka MMORPGS... Hmm how to protect the code.

Breaking Stuff=Fun!,Bug Testing<>Fun!, Bug Testing=Breaking Stuff, so...
Bug Testing=Fun! Hmmmm....
DOES NOT COMPUTE! SYSTEM MALFUNTION!
TKF15H
20
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 23rd Jun 2005 09:21
Quote: " Is this to make your game mod-able by the mod community? Or so the programmer can do post compile/release mods?"

Either one. If you don't want your project to be mod-able but want to use a scripting engine, you could put all the scripts in an encripted data file. When you need a script you just extract the one you want and run it. After loading it, delete it.

Narf The Mouse
19
Years of Service
User Offline
Joined: 16th Jul 2004
Location:
Posted: 6th Jul 2005 14:38
A clean .html document file would go a long way. And allow people to add it to the DBPro help file system.

Cheese!

Expert Bug-Finder, Horrible at Identifying Them.
TKF15H
20
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 7th Jul 2005 09:04
Well, I thought of doing that, but it looks like people aren't really using it.

WarBasic Scripting engine for DarkBasicPro
DC emulator code size: 13MB
DARKGuy
20
Years of Service
User Offline
Joined: 28th Nov 2003
Location:
Posted: 7th Jul 2005 09:05
I would if I had another monitor, can't program with this black and white one XD (and html documentation would be damn nice too )


http://dbfree.dbspot.com/ <- DB Freebie Archive! Royalty-free media for your games! FREE!
TKF15H
20
Years of Service
User Offline
Joined: 20th Jul 2003
Location: Rio de Janeiro
Posted: 9th Jul 2005 10:14 Edited at: 9th Jul 2005 10:37
bah, html docs... notepad is for the 1337!!!

That, and my current project is taking up all my time. You think it's easy working with 13 megabytes of C++ code?

WarBasic Scripting engine for DarkBasicPro
DC emulator code size: 13MB

Login to post a reply

Server time is: 2024-03-29 02:25:15
Your offset time is: 2024-03-29 02:25:15