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: 22nd Oct 2007 18:24 Edited at: 2nd Nov 2007 15:56


I've decided to write a A DBP BASIC Syntax Scripting Engine for my DarkMORG: A Multiplayer Online Roleplaying Game which I have lovenly dubbed DarkMachine. DarkMachine will feature a P-Code Compiler & Virtual Machine, and Command Line Interface (CLI) Interpreter.

Below is working Concept Code that I'm building upon to develope DarkMachine. Others may find it useful to write their own Scripting Engine, Compiler, Virtual Machine, Interpreter, or Parser.



jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 22nd Oct 2007 21:35 Edited at: 22nd Oct 2007 21:36
Interesting - but you might seriously consider C++ or FreePascal - and creating a DLL for this sort of thing. DarkBasic is just not good for extended parsing. You still could use DarkBasic for the game, just make aplugin for this portion - if you need fast as possible execution of code that is Parsing costs time - This you can minimize via a homemade plugin.

John Y
Synergy Editor Developer
21
Years of Service
User Offline
Joined: 4th Sep 2002
Location: UK
Posted: 22nd Oct 2007 21:50
My advice from much work and research around VM's (including the Java VM and .Net CLR) is to keep it simple. The example code is trying to write out ASM, which is cool and all, but unless your going to actually assemble it, not very handy. Something like one command and it's arguments on a separate line would be a lot easier to implement. But, if you want to make this a big project, than continuing with the ASM route will make it nice and powerful.

Synergy Editor - Available in the WIP forum
TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 22nd Oct 2007 23:19
This concept code merely provides a operational model. I will not be producing ASM but, moreso imitating the stack, register vars, labels, and op codes for p-code generation and execution.

I've been warned several times about attempting to use DBP for this purpose. However, without out a DBP-made engine, I cannot accept this as fact, I must find out for myself.

Have no fear. I will be secretly porting over some work from a previous Scripting Engine developed in BlitzBasic.

jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 22nd Oct 2007 23:22
I will secretly check it out when you make it available...secretly....

TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 22nd Oct 2007 23:59
Quote: "I will secretly check it out when you make it available...secretly.... "
Development will Openly Posted.

Mage
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Canada
Posted: 23rd Oct 2007 00:05 Edited at: 23rd Oct 2007 00:07
I use scripting in my work, for conversations, and handling events.

I wrote the a custom scripting program in using .net 2005. It just saves commands as strings in a text file and a determined number of lines after each command for data.

So there will be a line [Player_Talk] followed by "Hello!" followed by [Level_Switch] followed by "TestTestLevel.map".

The game knows ok, [Player_Talk]... make him say the next line, then advance the position in the script.

Or [If_Player_Good] might make the game jump to a different line in the script, depending on what number i placed on the line after the command.

The script is just a huge array of strings.

In the game if the script is activated the game opens the same text file, draws a speech bubble, and if the player presses action or the bubble expires then the level changes to another level.

------------------
[Custom Signature]
TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 23rd Oct 2007 00:49 Edited at: 23rd Oct 2007 09:52
@Mage: Huge array of strings. Very interesting. I'm essentially using Stack (Array) of Strings.

The Compilers job is to parse the BASIC code and break it down into even smaller Pseudo-Assembly (P-code) Instructions. Instructions are in the form of a byte value, followed by a string value that represents the data.

Example



The Machine loads PCode into a Instruction Array which is handled by a large Select...Case structure which reads the instruction to:
1. Assign data to Registers and Variables
2. Push & Pop Data on/off stack
3. Calculate and Compare Registers
4. Call Functions (another large Select...Case Structure)
5. Moves Instruction array pointer to next instruction.

tiresius
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location: MA USA
Posted: 23rd Oct 2007 01:12
Well, well you're ignoring the nay-sayers (I'm one of them) and actually going to try it out.

I wish you the best of luck and look forward to any progress you make! If you finish it and it is fast enough maybe I could use it to script turn-based AI logic for a strategy game I might make in the future.

I'm not a real programmer but I play one with DBPro!
Ric
19
Years of Service
User Offline
Joined: 11th Jul 2004
Location: object position x
Posted: 23rd Oct 2007 02:02
Good luck with this - from what other people have said, this looks like a major undertaking, but it does seem to me like it would be very useful.

Just so I'm clear what this would do .... would it do this:

Let's say I have a DBPro program which consits of a main menu, and several mini-games. Somebody downloads my compiled program. Then, sometime in the future, I want to add more mini-games to the program, and allow the user to download only the ones he wants. If the original program uses this scripting engine, would I be able to write the new mini-games as text files, and the user be able to simply download the appropriate text file, and run it with the original program? If so, that would be pretty cool!

And if that's possible, how long is it going to take you to do this?!!

aluseus GOD
17
Years of Service
User Offline
Joined: 19th Mar 2007
Location: I\'m here. Now I\'m there. I keep moving
Posted: 23rd Oct 2007 02:06
is this used to create compilers?

Hi. I am sorry for being a random n00b. I got carried away and started posting to much. Then again I am a little kid.
This has been a public announcement by John- who wants a taco.
TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 23rd Oct 2007 05:18 Edited at: 23rd Oct 2007 09:53
Quote: "is this used to create compilers?"
Yes. The concept code is based on that which was used to create a BASIC Syntax Compiler.

TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 23rd Oct 2007 10:29 Edited at: 23rd Oct 2007 14:11
Quote: "Let's say I have a DBPro program which consits of a main menu, and several mini-games. Somebody downloads my compiled program. Then, sometime in the future, I want to add more mini-games to the program, and allow the user to download only the ones he wants. If the original program uses this scripting engine, would I be able to write the new mini-games as text files, and the user be able to simply download the appropriate text file, and run it with the original program? If so, that would be pretty cool!"


Yes. Of course the need for speed would determine what components are scripted or hard coded.

Note To Self: Embedded Programming

Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 23rd Oct 2007 12:07
Well it's not exactly DBP Syntax yet, but it seems to be turning out pretty good, but as other people have said, it would probably be faster if you made it in C++.

"It's like floating a boat on a liquid that I don't know, but I'm quite happy to drink it if I'm thirsty enough" - Me being a good programmer but sucking at computers
Cash Curtis II
19
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 23rd Oct 2007 12:29
I assumed that it would be made in C++. Purebasic would be good too. DBP is no good at string processing. It will be crazy slow.


Come see the WIP!
TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 23rd Oct 2007 18:27
Quote: "I assumed that it would be made in C++. Purebasic would be good too. DBP is no good at string processing. It will be crazy slow."
We are about to find out. hehe.

jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 23rd Oct 2007 18:36 Edited at: 24th Oct 2007 03:02
Dude I'm not one for using a ton of plugins - just sparky usually - but if you're dead set on this - at least consider one of the string handling plugins - maybe IanM or CattleRustler or one of the other big contributors here has something - to at least pump the gas a bit more. You'll be needing alot of "InStr" or "Pos", Mid$, Left$, Right$, Ltrim$,Trim$,Rtrim$ like routines for sure. Not to mention wrapping this up into a decent Tokenizer so you can whip through the results, and handle quoted and non-quoted stuff (And Quote - but Escaped string) in a logical way. Better get that hammered before you get into the Language semantics. Just advice from someone who's written that kind of stuff - like an 32bit multi-tasking OS with its own compiler from scratch. It's no cakewalk and a great thing to do - I'm behind ya - just think about grabbing something to help with speed. I'm still thinkning making you're own plugin would be best...but this is all on you now!.... Who's signature is it that reads: [edit]Tin Tin[/edit]

Now Go Create!

TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 24th Oct 2007 02:10 Edited at: 24th Oct 2007 02:12
Quote: "You'll be needing alot of "InStr" or "Pos", Mid$, Left$, Right$, Ltrim$,Trim$,Rtrim$ like routines for sure."
I'm not a fan of (3rd party) dlls myself. I prefer TGC sponsered addons or DBP Code Snippets.
12 Additional Text functions

Mage
17
Years of Service
User Offline
Joined: 3rd Feb 2007
Location: Canada
Posted: 24th Oct 2007 05:47 Edited at: 24th Oct 2007 06:02
Quote: "@Mage: Huge array of strings. Very interesting. I'm essentially using Stack (Array) of Strings."


I would shy away from using a stack. It's better to use an array and keep your scripts position stored in another variable.

Here are some reasons why:

You need the same amount of memory for either approach.

Having an array allows you to jump both forward and backward in the script.

Example as layed out in a text file:
(line numbers added for cosmetic purposes)


01 [GOTO]
02 4
03 [END_SCRIPT]
04 [IF_PLAYER_GOOD]
05 next
06 11
07 [PLAYER_TALK]
08 "Welcome."
09 [GOTO]
10 3
11 [PLAYER_TALK]
12 "Die!"
13 [GOTO]
14 3

Command is followed by data on separate lines. Both game and script editor know how many lines each command is supposed to use.


If you do it this way the script is no longer linear. You can make things like conversations that loop back to a main conversation window, and more complex activities.

It also can cut down on repeated code, and repeated scripts. If you use a stack, once you "pop" from the stack that data is gone, and jumping back is impossible and jumping ahead is inefficient.

So all I did was open vb.net and make a simple editor using listview, so it adds the commands all nice and neat, and I'm not fumbling with manual entries. Also if I add code that might throw off commands that jump to specific line numbers, the editor automatically adjusts the values. Doing it like I showed above, allows you to avoid any sort of string parsing too.

This is how I solved the problem.

------------------
[Custom Signature]
TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 24th Oct 2007 08:57 Edited at: 24th Oct 2007 18:09
In the case of VM Thread Instruction Array, it operates like an Array (disregard the stack I mentioned earlier). Heres an example of the Instruction Array loaded with P-Code.

BASIC
a = 2

x86
mov eax,2
mov var,eax

P-Code
[0] 1 `mov eax
[1] 2 `value
[2] 5 `mov var eax
[3] 1 `var index


The InstructionPointer is adjusted forward or backwards to process next instruction and values, or jump to another index in the array.

Note To Self: http://scheme2006.cs.uchicago.edu/11-ghuloum.pdf

jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 24th Oct 2007 14:04
Yes Sir TechLord! Once you have that (Intel still offer opcode tech reference manuals?) You could actually get that stuff to execute! Tricky to debug in a DBPro - Call DLL - to fire it off though. I don't think you could allocate a memblock and jump to it - though you probably could if you wanted to bad enough. It does matter how the Memblock is allocated by the OS - I don't think Windows likes it when you use memory for execution that is allocated as a heep item.

Intel chipset allows OS's to implement and safeguard mechanisms so "Code Segments" and "DAta Segments" (segments of memory lets say) work as one or the other. Cause exceptions if rule breached.

TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 24th Oct 2007 18:10
I'm not developing a ASM compiler, just modeling my scripting engine from one.

jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 24th Oct 2007 19:03
I here ya - just got nostalgic on ya seeing the ASM code

Is what you are doing the same thing as the LUA stuff people talk about?

TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 24th Oct 2007 19:32
Quote: "Is what you are doing the same thing as the LUA stuff people talk about?"
I'm familar with such a discussion. Please elaborate if possible.

jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 24th Oct 2007 19:43
Ok... but I don't know much about it. There is some sort of "Compile on demand" scripting that can be done with something called LUA. I read someone got in "a little trouble" because they were able to Script DarkBasic with it somehow in a way that is in conflict with TGC. I guess its valid use is that a program can load scripts, compile them, and then run them DURING runtime or something.

Like I said - I don't know much about it but I know there are others here you can talk more intelligently about it than me.

TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 24th Oct 2007 20:00
Thank you for the details. To answer your question, the answer is No.

Greenster
19
Years of Service
User Offline
Joined: 3rd Feb 2005
Location: US ©
Posted: 25th Oct 2007 21:45 Edited at: 25th Oct 2007 21:46
Stack machines are awesome. I studied compiler design for a brief period in school, but never picked it up as a exclusive skill set.

Flip Code has a good article on doing one in C++ using FLEX and BISON that does pretty much what yours does. The 'tree walker' and stack can get so complex you can easily lose track of how your own automation works.

TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 28th Oct 2007 18:00
Quote: " The 'tree walker' and stack can get so complex you can easily lose track of how your own automation works."
Agreed. This article really sheds light on Stack Machines and what I'm attempting to achieve with DarkMachine.

jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 28th Oct 2007 18:38
TEchLord - this stuff kinda went over my head. I understand some principles though - and they similiar to the gains of a risc processor - gaining speed via less instructions - more predictable - where as a state machine seems to bebfit from more "Bit crunching" to get more functionality per clock cycle - a very honorable way to go. Got the CPU's Cycles almost as quick as is probably ok for silicon? Ok - Make it so more happens each cycle. Totally get that principle - and I understand how it relates to embedded processors and programming systems designed from the ground up that way.

I'm a bit lost how this would translate to a scripting engine in Darkbasic. What's your plan ?

TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 29th Oct 2007 00:33 Edited at: 29th Oct 2007 07:29
@jason p sage: I'll do my best to explain what I'm doing. The idea is to make a high performance scripting engine capable of handling recursive and nested calulations, conditions, loops, and function/argument calls and to make it fast as possible. To do this I selected to use a Compiler and Virtual (Stack) Machine.

The Compiler's job is to read and parse files with BASIC syntax outputing instructions (opcode) that tell the VM how to push and pop values (operands), move instruction pointer, make function calls (aka giant select...case list of functions). Its faster to process integers than strings, so we convert Opcodes into integers to be handled by the VM at run time. This is Psuedo Opcode aka P-code.

The Compiler consists of 9 functions. Two functions: CurrCh$() & NextCh(), that read in BASIC file text line by line, one character at a time. The function: GetToke(), uses those functions to create Tokens (integers that represent operators, keywords, constant, var, etc). Six recursive Parsing Functions: ParseStmt(), ParseExpr(), ParseComp(), ParseTerm(), ParseFact(), ParseLeaf() use the Tokens to output specific P-Code instructions based on those Tokens. P-code is written to files to be loaded into the VM.

Although I provided concept code for the Compiler, I have yet to provide concept code for the machine, so I will attempt to explain it the best I can. The VM consists of a Two Arrays and Two Variables. One Array is used to store load and store PCode Instructions and Operands sequentially. This is the Instruction Array.



The second Array is Last-In, First-Out (LIFO) Stack that handles pushing and popping values and 'jump' labels. This function of LIFO Stack is workhorse for nesting and recursive calculations and function calls. The two Variables act like registers to temporarily store and calculate values to push and pop on the Stack.



Quote: "
FYI: Did you know that the implementation of DarkBasic's Dynamic Unified Array System is also known as Deque or Dequeue.
"


Ok so you are probably wondering how Vars, Arrays, Labels, and Branch Subroutines aka Function are handled. Well this gets a lil tricky because I could not understand reference material that explained how these work in a Compiler or VM so I created my own method.

Ok my brain hurts now . To be continued.

Cash Curtis II
19
Years of Service
User Offline
Joined: 8th Apr 2005
Location: Corpus Christi Texas
Posted: 29th Oct 2007 16:50 Edited at: 29th Oct 2007 17:25
@TechLord -
I don't doubt for a second that with enough research, time, and hard work, you can make a fantastic scripting engine that suits your needs. However, I have to wonder why you'd need to reinvent the wheel when such a good one exists already. Yes, I know that you don't want to learn LUA syntax. It's not hard at all, I learned it in about an hour. Now I use it for everything with fantastic results. It's extremely fast and powerful and bug free. It's industry standard - it's used by Blizzard for their Warcraft games, just to name one. In order to make a scripting language that comes close to that will take such a monumental effort that you might get nothing else done besides that. As indie developers we have to be resourceful and stand on each other's shoulders to reach our goals.

[edit]
I don't doubt the learning value of doing this either. I think that it comes down to your desired end result - a professional strength scripting system, or a finished game.


Come see the WIP!
Zotoaster
19
Years of Service
User Offline
Joined: 20th Dec 2004
Location: Scotland
Posted: 29th Oct 2007 17:01
Quote: "I learned it in about an hour"

Took you that long?

I completelly agree with Cash, but that doesn't mean dont try. I spent months making mine, and I learned *alot*.

"It's like floating a boat on a liquid that I don't know, but I'm quite happy to drink it if I'm thirsty enough" - Me being a good programmer but sucking at computers
jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 29th Oct 2007 17:09 Edited at: 1st Nov 2007 20:39
Here Here -

If I didn't experiment with writing my own operating systems and compilers - assembly language and all that jazz - I wouldn't be nearly as proficient - nor really "Know" what's going on usually.

I say usually because computers in general have SO MUCH in them now that it's impossible to master it all... though having compiler/parsing/OS knowledge transfers over the breadth of it all When you know how to build foundations and do your own framing, everything else is just vinyl siding

TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 29th Oct 2007 23:47 Edited at: 29th Oct 2007 23:48
@Cash Curtis II: I agree with your stance on being indie developers and standing on each other's shoulders. Which is now my inspiration for developing this Scripting Engine. If I desired a Scripting Engine solution with a BASIC syntax, I'm certain others feel the same. Its time that another option existed. I don't feel that I'm reinventing a Wheel ... I'm offering a different 'Rim' design for it.

TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 1st Nov 2007 18:45 Edited at: 1st Nov 2007 18:46
Here's a sneek peek of the Work in Progress (WIP) code. It's NOT functional at the moment, but, its readable to a certain degree. Its progress, and I need progress to keep interested. Post your thoughts. thnx.

TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 18th Nov 2007 08:40
For those interested, I'm getting close to a working compiler and vm. My goal is to finish up this week before I go on vacation. I post the update in this thread so stay tuned.

Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 18th Nov 2007 10:10
Cool. IMO what would be awsome is if you converted the scripts to (instead of VM) real ASM code, then execute that code


Cheers,

-naota

"I'd newbie slap here, but I've no idea how far I'd need slap before they'd come back with a clue." - VanB
Aex.Uni forums
TechLord
21
Years of Service
User Offline
Joined: 19th Dec 2002
Location: TheGameDevStore.com
Posted: 18th Nov 2007 12:12
Quote: "Cool. IMO what would be awsome is if you converted the scripts to (instead of VM) real ASM code, then execute that code"
DBPro already achieves this, would you not agree?

Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 18th Nov 2007 12:40
I would definitely NOT agree to that fully... What it does is compile code to call a DLL to add 2 values together in a completely unoptimized fashion. A scripting language building to ASM in any form would still be a scripting language and would be much quicker than a VM.


Cheers,

-naota

"I'd newbie slap here, but I've no idea how far I'd need slap before they'd come back with a clue." - VanB
Aex.Uni forums
Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 18th Nov 2007 13:25 Edited at: 18th Nov 2007 13:34
Yes. Why would there be an ADD, SUB, MUL, DIV, Cast, and further functions of the like in DBProCore.dll if DBP took care of that itself?

Why would DBP have the user return an address to a float and return it (or something similar) instead of just returning a float if DBP actually used the built in FPU in _virtual.dat and not DBProCore.dll? I'll go ahead and build a simple DBPro app, grab the _virtual.dat, and show it's assembly to prove it used a CALL function and no actual ADD.

Edit
And I don't mean that in ASM when you ADD you have to use CALL, I mean that's what DBP does...

Edit 2
Actually I can't get dark_explorer.exe <From the_winch> to work, so I'm gonna have to try tomorrow on Windows XP. Here's the simple app if ya wanna do it yourself:


Night all, it's 4:36AM.

Cheers,

-naota

"I'd newbie slap here, but I've no idea how far I'd need slap before they'd come back with a clue." - VanB
Aex.Uni forums
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 18th Nov 2007 15:52
@Aaron,
You should investigate a little further before making statements of that kind.

Disassembly of 'a=a+2':


For those who don't do assembly, that's "move a value from a variable to the eax register, add 2 to the eax register, move a value from the eax register to a variable". The 0xffffffff bit gets filled in with the variables memory address at runtime.

Utility plugins collection and
http://www.matrix1.demon.co.uk for older plug-ins and example code
Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 18th Nov 2007 21:50
@WindowsKiller
I don't think a DLL call is much different from a simple CALL instruction. From what I understand, the DLL is loaded as a portion of the calling module's memory. From there the "GetProcAddress" function simply retrieves where in that memory the DLL's function is (Not relative, but usable for a real pointer). From there you would be able to call it like any function. And then freeing the DLL from memory just frees the allocated memory (Or something similar). I could be wrong about that, but that's my take on it. If I misread what you said please let me know.

@IanM
Sorry, I guess I was wrong about DBP's assembly methods. Still, what are those ADD, SUB, MUL, and DIV functions for then? It makes no sense why there would need to be a function to do what C++ or ASM can do easily. I think there could be one reason which would be to keep the compiler "modular", but that wouldn't make much sense as the standard mathematics, casting, and all that should be handled by the compiler... Or perhaps the function code is duplicated from the DLL! That would explain the 0xffffffff thing... Hmmm..... Sorry, I'm rambling now, but thank you for clearing that up.


Cheers,

-naota

"I'd newbie slap here, but I've no idea how far I'd need slap before they'd come back with a clue." - VanB
Aex.Uni forums
Kevin Picone
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Australia
Posted: 19th Nov 2007 01:25 Edited at: 11th Aug 2010 22:50
Only very early editions of Dbpro used that approach. Most of the operations were moved inline years ago. But there's probably some left over residue in the core. Interestingly during beta testing Dbpro was significantly slower than DB.

n008
17
Years of Service
User Offline
Joined: 18th Apr 2007
Location: Chernarus
Posted: 19th Nov 2007 01:35
Quote: "I would definitely NOT agree to that fully... "


Every compiled language is compiled, parsed and linked into ASM, then assembled. DBpro is a compiled language...



jason p sage
16
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 19th Nov 2007 12:00
Let's not forget - Only the really efficient languages compile straight to ASM. This is Why .Net is Bloated. Many "inline" style compiled languages are actually compiling to their C/C++ "generated assembly" which isn't nearly as efficient as languages that compile straight to optimized assembly.

This is part of the reason today's machines - running the fastest CPU's ever still seem slow - Or at least not THAT much better. The other big reason is plain old software bloat - but them together - it explains alot.

That's one reason I like game programming - It's the last frontier in some ways where thinking out of the box to write tight fast code is a good thing - versus - following the mainstream's idea of "Best Practices" - which isn't always ideal.

Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 20th Nov 2007 03:12
I agree, and I accept being wrong, you guys where right.

Anyways TechLord, under special licensing I can give you (for free) code to build directly to machine code. And not in the C/C++ "generated assembly" like jason p sage said, but what it would be in ASM. <I don't know if that makes sense, but I know what I mean>


Cheers,

-naota

"I'd newbie slap here, but I've no idea how far I'd need slap before they'd come back with a clue." - VanB
Aex.Uni forums
n008
17
Years of Service
User Offline
Joined: 18th Apr 2007
Location: Chernarus
Posted: 20th Nov 2007 03:16
Quote: "C/C++ "generated assembly""


That "generated assembly" is exactly what builds into whatever you are writing, so i see no point in building directly into it. That's the whole reason such Languages Exist. But if you want, you can open up the file and look at all the neat ASM.

Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 20th Nov 2007 03:26
I'm not sure what you mean by that n008, but from the sounds of it you are saying that building a program in pure ASM is just as fast as one built in BASIC because the C/C++ generated assembly is the same both ways... So, can you please rephrase what you said?

Cheers,

-naota

"I'd newbie slap here, but I've no idea how far I'd need slap before they'd come back with a clue." - VanB
Aex.Uni forums
n008
17
Years of Service
User Offline
Joined: 18th Apr 2007
Location: Chernarus
Posted: 20th Nov 2007 03:29
When you write something in a compiled language, it is basically changed into machine code, then assembled into a launch-able file. That's what i meant. You could just go look at the intermediate file, so what is the point of your offer?

Aaron Miller
18
Years of Service
User Offline
Joined: 25th Feb 2006
Playing: osu!
Posted: 20th Nov 2007 03:30
Mine was built through ASM and not C/C++, and that with my offer he'll be able to build into executable code. I've already made a program which can load a pure ASM file and launch it. Essentially it won't be much different through his script except it'll be quicker. That's about it.


Cheers,

-naota

"I'd newbie slap here, but I've no idea how far I'd need slap before they'd come back with a clue." - VanB
Aex.Uni forums

Login to post a reply

Server time is: 2024-04-25 05:08:27
Your offset time is: 2024-04-25 05:08:27