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.

DarkBASIC Professional Discussion / DarkMachine: A DarkBASIC Syntax Scripting Engine

Author
Message
TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 20th Nov 2007 09:00
Sorry, Aaron, in my opinion compiling to ASM is beyond the scope of this project. Speed is a priority, however, speed critical processes should be handled within the App/Game Engine directly. To be honest, once DarkMachine is functional I'm moving on to the next phase of my Game Engine development.

Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 21st Nov 2007 06:57
That's fine, I'll just keep it all to my self....


Cheers,

-naota

"I choose to believe, what I was programmed to believe!"
Aex.Uni forums
TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 21st Nov 2007 08:13
Bad News. No update before vacation. I totally miscalculated my leave date for vacation. Heading to Colorful Colorado in the morning. I will resume efforts immediately when I return in a week. Until then, Happy Thanksgiving to all.

Greenster
19
Years of Service
User Offline
Joined: 3rd Feb 2005
Location: US ©
Posted: 26th Nov 2007 08:37 Edited at: 26th Nov 2007 08:57
I think this is cool, but you should do it in a DLL so you have more of an idea of the efficiency of the engine itself. Going from BASIC to 8086 kernel 32 binary is bound to throw in a lot of excess.

Also have you gotten to control structures like IF yet, and leveling? That's where the hard work starts.

I've seen 3rd party engines like gamemonkey and LUA, but there not practical for an inline script language where you have to implement a security model cause you have to strip down too much code, and classes and OOP aren't good for the average player.

My old project has a virtual file system with a pcode stack machine in a DLL using FLEX and BISON. The compiler is actually written in the scripting language, and compiled before the game is distributed. I also wrote a virtual kernel for in game processes that is compiled before hand that has a native API for hooking and debugging. I'm still working on the design model.

It's suppose to give a general interactive representation of a real system, but has a security layer built into it to to have the malicious actions like buffer overflows in the stack machine caught and applied to the virtual stack and heap.

It'd be cool as a back-end feature to a 3D game.
TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 27th Nov 2007 07:43
Quote: "I think this is cool, but you should do it in a DLL so you have more of an idea of the efficiency of the engine itself. Going from BASIC to 8086 kernel 32 binary is bound to throw in a lot of excess."
I'm writing the scripting engine in DarkBasic Pro.

Quote: "Also have you gotten to control structures like IF yet, and leveling?"
Yes. Not sure what leveling is, please explain.

Greenster
19
Years of Service
User Offline
Joined: 3rd Feb 2005
Location: US ©
Posted: 30th Nov 2007 03:34
Leveling is basically keeping track of conditional control layers so you can nest conditional statements.
TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 2nd Dec 2007 23:48
Quote: "Leveling is basically keeping track of conditional control layers so you can nest conditional statements."
Yes, its in place but requires rework. I'm using a stack for management.

TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 5th Dec 2007 20:50 Edited at: 7th Dec 2007 18:00
Hi guys I have a working demo of my DarkMachine Scripting Engine w/BASIC Syntax written in DarkBasic.

Unfortunately, I've ran into some quirky-ness with the DBP IDE when I separated the MAIN Execution Loop from the DarkMachine Lib. There are 5 files that are included with the MAIN prog from within the DBP IDE. The code compiles with no errors. However, when it attempts to run it crashes with the Send Error Report Alert.

The 5 files are:
DarkMachine.dba - DarkMachine Compiler & Virtual Machine Engine Lib
String.Lib.dba - Coin's 12 Text Function Lib
dmcvm.h - Contains True DB Source Code Functions use by the functions below
dmcvm_CompilerCallIndex.dba - Contains Compiler Command Lookup Function generated by Code Wizard
dmcvm_ThreadCallIndex.dba - Contains VM Command Select Function generated by Code Wizard

Prior to separating the MAIN from DarkMachine Lib, the code compiled and ran flawlessly. The DarkMachine Lib and MAIN execution prog resided in a single file and all other files were included via IDE. As a single file The MAIN execution prog was located between the Declarations and Functions like so:

DMCVM Consts, Globals, UDTs, Arrays
|
MAIN Prog
|
DMCVM Functions

I read at least one hours worth of Forum-searched Posts to get a grip on the DBP IDE include behavior I could never get the #Include directive to work. Including the files via IDE eventually worked! But needless to say, I desire the DarkMachine Lib to be independent from the MAIN.

Separation was simple. I merely pulled out the MAIN prog between DMCVM Declarations and Functions. I then saved the two as separate files. I created a new project that loads the MAIN prog as the Main Source and includes the 5 files I mentioned aboved via IDE. Now it will compile, but will not run

Get the WIP here: http://www.hpquest.com/techlord/apps/DarkMORG/code/DarkMachine.WIP.zip
Inside the WIP you will find two versions of the *.dbpro file. I reconstructed the working version as DarkMachine.v2.dbpro. The bad version is DarkMachine.v1.dbpro.

Any and all help with this issue will be greatly appreciated.

Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 9th Dec 2007 02:33
I had a go... load and run DarkMachine.v1.dbpro and DarkMachine.v2.dbpro.

The dbpro files you supply seem to not work correctly on my machine. As with DarkMachine.v2.dbpro, I was not able to see any code for 'String.lib.dba' and hadn't a clue where your 'Instr' function was created as the DBPro IDE wouldnt highlight where it was for an 'unable to use a reserved word 'Instr' ' type of error.

Sooo... I reconstructed my own darkbasic project with the same files from DarkMachine.v1.dbpro. Find out that in 'String.Lib.dba', you have created a function that is the same as the a function used with the Matrix1Util dll number 16.

I would assume that the Matrix1Util is a popular set of dlls. They provide cool commands that I would think a lot of people use. At least I like them. Might want to rename your 'Instr' function or at least warn people that your program wont work with Matrix1Util dll number 16.

I temp removed the Matrix1Util dll number 16 and recieved an error "Cannot understand command at line 13" of Main.dba. Which is "DebugPrintClear()"

That's as far as I got as I cant find where these debugprint commands are from.

Matrix1Util dlls can be found here :
http://forum.thegamecreators.com/?m=forum_view&t=85209&b=18

Inspirational Music: Descent ][ Soundtrack
TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 11th Dec 2007 17:22 Edited at: 12th Dec 2007 03:51
Thanks Todd for giving it a go. As of 12/08, I resolved the Include issue and have uploaded a new WIP file. I'm currently using DBP 1.062 (Trial) with no DLLs at the moment. I will consider your advice on relabeling Functions in Coin's String Lib. Taking a hard look at Matrix1Util dlls.

Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 26th Jan 2008 09:40
Hi TL , making any headway with this? Im starting to get ideas how this could help my GUI for user gui gfx designs... About finished up with the menus and hopefully getting to the easier stuff. If you have a new WIP, let us know

Inspirational Music: Descent ][ Redbook Audio CD Soundtrack
TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 18th Feb 2008 17:24 Edited at: 18th Feb 2008 19:32
Well, I had suspended efforts on DarkMachine to make use of Barnski's LUA Plugin in my MORG. Unfortunately, I've ran into some issues and I'm revisiting DarkMachine.

I've replaced Coin's String Lib with IanM's Matrix1 Util String Functions for a performance boost. I'm also considering using Matrix1 Util Function PTRs, but, don't have a firm idea on how I'm going to manage Function registering.

If anyone is interested in the WIP get it here --> DarkMachine WIP. Load & Run Main.dbpro for demo.

IMHO, DarkMachine has a few key advantages:
* Its FREE!
* It uses DBPro BASIC Syntax.
* Its written in DBPro; Code can be expanded and modified.
* DMScripts can access DBP, DLL, and Custom Functions in Script.
* Can be used in conjuction with other Scripting DLLs (no conflict).

Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 19th Feb 2008 02:44 Edited at: 19th Feb 2008 04:07
Hey this looks cool!

The only problem I had was compiling the main.dbpro to an .exe. Some reason the full path to the compiled exe directory wont update. So I manually edited it to my full path to the DarkMachine Directory. I guess thats to be expected when passing around project files.

I will have to go back and try to figure it all out again. Your documentation has alot of reference to Blitzbasic stuff which I had to read around. Kind of confusing to follow.

So, the ".dm" file is a dark machine script.

The ".h" header file compiles with your program which contains dbpro custom functions to be called from the ".dm" script. Is that right?

Just curious, should "dmcvm.h" always have this name? Can I call it for example, "MyGUILib.h"?

What I would like to do is to call Color Schemes for the GUI code Im writting. Would I just simply create functions that uses dbpro commands in the ".h" file so the user customizable ".dm" can call these functions?

Sorry for the quick questions, I just want the quickstart guide.

I definetly want to figure this all out because it feels like it's what I need. I had to start from scratch again with my GUI because my laptop's hardrive died . Im almost back where I was again with the code and look forward in trying to use this.

Keep up to cool work, TL! I apprieciate it!

Inspirational Music: Descent ][ Redbook Audio CD Soundtrack
TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 20th Feb 2008 15:07 Edited at: 21st Feb 2008 05:10
Hi Todd,

Sorry, about the Docs. I ported code and docs from my BlitzScript Project. The docs are no where near ready for viewing.

Yes, the *.dm File(s) are DarkMachine Script Files which are compiled to *.dmo Pcode files. The *.h file is simply a file that can contain User Defined Functions that are included in the Application to be called from the dm script. The extension has no technical significance and its not required store User Define Functions in a separate files.

The dmcvm_CommandInstaller Utility will parse any files for User Defined Functions & Macros to generate the Command String Lookup Function dmcvm_CompilerCallIndex() used by the DM Compiler; and Command Select...Case Function dmcvm_ThreadCallIndex() used by DM Virtual Machine.

A Macro is a simply a block-of-code thats gets an ID and its own Case...EndCase within the Command Select...Case Function dmcvm_ThreadCallIndex(). Macros are given a Command name thats added to the Command String Lookup Table Function dmcvm_CompilerCallIndex(). The Macro Command can be used in the DM Script like any other command to pass arguments or return a value. Macros require slightly more work and are riskier than functions because you code the macro with Script Engine's Arguments and Register Variables directly.

There is still some work to do get the Scripting Engine and Utilities in the state I desire, so, I will resume efforts immediately.

TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 21st Feb 2008 06:17
Quote: " I had to start from scratch again with my GUI because my laptop's hardrive died "

Todd, thats very unfortunate. No backup on a FTP Server?

I started writting a GUI myself. Its more so a Markup Language that creates Clickable/Draggable Text with GUI-Like behaviors. It would be interesting to compare notes on the event detection.

jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 21st Feb 2008 16:41 Edited at: 22nd Feb 2008 15:02
I'll be doing a gui myself - and frankly - Van B's in the Terrain editor he made - is the best I've seen for DarkBasic so far. (Not to say there isn't better ... but I haven't personally seen anything come close!)

(Irrlicht Engine has a nice system I wouldn't mind cloning! It has a GUI for "Designing" GUI's - then you just add to your program...sweet... Like VB [edit]VB=Visual Basic HEre[/edit].. We need something like that here - but so you can "Skin it"

Todd Riggins
19
Years of Service
User Offline
Joined: 29th Oct 2004
Location: Texas, USA
Posted: 22nd Feb 2008 05:52
TL, nope, no backup on FTP server. I've always like the idea of a gui created by a markup language way. It will definetly be interesting to see. So far, my main "global events" are based on an active part, moving part and a "mouse over" part. But, those events are still dealt with internally. It's pretty straight forward and simple to deal with. At the end result, using the "user functions", one will not have to worry about events.

Jason, that sounds cool. I have a very easy way of skinning all of the gui stuff any way you want(DarkMachine would work perfect here looks like). I still got some basic gui components I want to make and mabie even a designer too before I release the GUI system source for free. Dunno how soon though....

Inspirational Music: Descent ][ Redbook Audio CD Soundtrack
TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 22nd Feb 2008 13:19 Edited at: 22nd Feb 2008 13:39
Todd,

My original goal for the Text UI in my MORG was to use a simple Text/Keyboard combo for everything other than First-Person Player Movement with a Mouse|Joystick. However, I acknowledged the benefits of point n' click and desired the ability to change the UI from the server side. Internet Browser is what popped in my head, so I started to designing my Text UI based on my experience with Web Browsers.

Full HTML Parsing and Formatting was the first . Too much work and I'm too lazy. So I settled on a simpler more specific set of tags using `DBXML - an XML Document Parser Plugin for DBPro by Thomas Cheah, Bad Nose Entertainment. (thomascheah@badnose.com). I refer to the system as Active Text Markup (ATM) and its simple in its design. ATM is practically just a pointer and text within boundboxes System. No sophisticated Skin's, icons, and animations. IMHO, any GUI Gadget can be represented by Text alone.

After a few experiments I quickly realized that rendering Text directly results in super low frame rates, so I'm using a lot of bitmap/image blit full screens of text to increase performance. I have written a few other GUIs in the past, and the major difference between ATM and a GUI is the lack of loading and drawing icons and gadgets.

Quote: "So far, my main "global events" are based on an active part, moving part and a "mouse over" part. But, those events are still dealt with internally. "

Very very Interesting. ATM is a Pointer and Gizmos.

* Pointer is a Cursor controlled by Mouse/Joystick/Keyboard or other input device.
* Gizmo is Active Text Control (AKA Gadget in other GUIs). It has its own Boundbox, ViewPort, Events, Behaviors, and Actions.
** Gizmo Boundbox a rectangular area around text used for collision detection with Pointer.
** Gizmo Viewport a rectangular area used to display all or portion of text (Future use, currently not used.)
** Gizmo Event is the result of collision and conditional checks between Pointer and Gizmo.
** Gizmo Behavior is hardcoded|scripted function executed during a event on the Gizmo and its relatives. Defines the `Behavior` of the Gizmo.
** Gizmo Action is Script that is executed usually during a 'Click' event on external data.

ATM will simply be too plain for other's games, so I will not be advertising it. To make it useful for a media previews as a in-game editor, I will be adding functions that generate clickable image previews for textures and models. Thus it will not be completely devoid of graphics.

TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 23rd Feb 2008 13:54
ATML Example


TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 1st May 2008 15:06
I cannot believe how dedicated I have been with development of DarkMORG. Its like if I don't get this game into a playable state I will be or .

Anyhow, the time has come to resume my efforts DarkMachine and start implementing it into DarkMORG.

Omen
17
Years of Service
User Offline
Joined: 7th Nov 2006
Location: Maple Grove, MN US
Posted: 4th May 2008 16:49
@Techlord,

It's really serendipitous that you post about your ATML idea right now, as I'm currently testing out a system that uses BlueGUI's "webBrowser" Gadgets in my Online Updater system. Since the gui2_web.dll that it uses seems to support (at least so far in my testing) everything that Internet Explorer 7 supports -- so you get Javascript support, DCOM, CSS, everything! I don't use any of BlueGUI's "native" gadgets like the buttons or comboboxes... everything is a webBrowser Gadget. For example, one of my webBrowser gadget has a Edit box, a Password box and 2 buttons -- "Cancel" and "Logon"... this is all my logon screen is.

What I'm doing is making all my UI components as web forms with the URI set to "localhost" - the client is using IanM's Matrix28 Util to listen on localhost TCP at port 80 and it catches all the form submits as web requests and parses them so that DBPro can respond appropriately. So, the client "talks to itself" I have some security measures in place as well so the client can 100% verify that any given websubmit came from itself.

The really nice part about this is I didn't have to write my own script parser (I can use any HTML, DHTML, Javascript I want) and I can have multiple "skins" for the interface just by changing the Cascading Style Sheet.

....anyways, it's working out really well for me, so I thought I'd share the technique with you since we seem to be thinking along similar lines

-Omen

TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 4th May 2008 17:10 Edited at: 4th May 2008 22:36
Omen,

Very clever. I do a lot of web programming which has influence in most of my online gaming concepts. Other than Real-time I/O needed for player control, handling menus/dialogs/forms like web forms is a very logical in Server/Client scenerio.

I wouldn't recommend ruling out other gadgets such as combo boxes, etc sometime they are the best control for the job. Also there will be cases where you need to see immediate action from a gadget events without pressing the submit button.

jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 4th May 2008 19:38
Yeah, and if you want to do local form submits without a big local IIS thing running.. like if you want posts and responses etc all web server-ish...

I can give ya my lil webserver... One config file, a directory for "home www" and you're off..

I doubt you'll need it.. but if you do... I'll toss that gem your way. (smaller and faster than Apache and LHttp .. IIS doesn't come close.

Omen
17
Years of Service
User Offline
Joined: 7th Nov 2006
Location: Maple Grove, MN US
Posted: 4th May 2008 20:27
@TechLord,

Quote: "Also there will be cases where you need to see immediate action from a gadget events without pressing the submit button."


Very true - that's what I'm finding. The responsiveness on the local port is along the order of 5-30 milliseconds, so most of the time you don't notice... but if I do move this system over to the client, then I'll probably need to use BlueGUI's native buttons there for Action buttons, since most gamers have zero tolerance for any delay when they want to attack something.

@Jason,

Quote: "I can give ya my lil webserver... One config file, a directory for "home www" and you're off..
"


That's very kind of you, Jason. I'm currently just parsing out the text that's received, and then based on the commandID sending it into a big SELECT statement to react appropriately...but I can imagine there may be times where I'd actually want to have something like a "multi-page" experience in a gadget, like a Bug Report form for example. Hmmm, I'll keep that in mind

calcyman
16
Years of Service
User Offline
Joined: 31st Aug 2007
Location: The Uncertainty Principle
Posted: 7th May 2008 21:25
Eax register? Shouldn't it be using the accumulator?

By the way, if you are going to make a program write in assembly language, you may as well have it translate the opcodes to binary, and have it write in machine code instead.

The optomist's right, The pessimist's right.
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 7th May 2008 21:37
The EAX register is the accumulator. That's what the 'A' part of the name stands for.

However, good point about writing directly to machine code - no point going through an assembler, except that it's easier to debug. Maybe best to have the ability to write to both.

Login to post a reply

Server time is: 2024-05-04 11:08:13
Your offset time is: 2024-05-04 11:08:13