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.

Dark Physics & Dark A.I. & Dark Dynamix / [DP] Help file problems

Years of Service
User Offline
Joined: 4th Apr 2005
Location: North America
Posted: 7th Sep 2006 23:21
I realize that TGC may have been on a tight schedule to put out Dark Physics, and I'd like to point out some problems with the "dark physics manual" .chm help file that is distributed:

Many of the programs don't work. They weren't even tested prior to publishing.

Take this example code from the Tutorials/Advanced Machinery section:

The first thing noticable is that when pasting from the help file, everything gets double-spaced, so let's fix that:

Ok, with the spaces gone, let's try and run it.
"DarkBASIC professional Editor" - User function declaration must use no spaces, no numerical first character and include a set of brackets at line 49."
Hmm, already an error, let's fix that then by taking out the space between the function name and the open paranthesis (parenthesis are not brackets by the way, parenthesis=(), brackets=[]):

Now we might also notice that "end" used in the function's parameter list is highlighted in the editor as a keyword. We shouldn't be using DBP keywords as variable names, so let's fix that:

Ok, let's try running it again.
"DarkBASIC Professional Editor" - Could not determine parameter type of "metal1.tga" at line 6.
Hmm, it looks like the " character used in the .chm file is not the same " character used in the editor, so we'll change all occurances of the rogue " to the right ". Oh, and there's a special close qoute character being used, gotta replace those too.

Ok, before we try again, we can go ahead and see that we're going to have problems loading the images referenced in the program, so let's go ahead and comment those lines out.

Let's try running it again.
"DarkBASIC Professional Editor" - Could not determine parameter type of '-30' at line 27.
Weird, looks like the - character in the help file is not the same - character the editor uses, let's replace all the rogue -'s with the right -'s.

Try and run again.
"DarkBASIC Professional Editor" - Parameter mismatch in command 'PHY MAKE SPHERE JOINT' at line 35.
Hmm, the line looks ok, but let's retype it b/c we now that the help file characters are not friendly with the DBP editor.

Try and run again.
"DarkBASIC Professional Editor" - Could not understand command at line 39.
That line certainly does look odd, let's retype those 4 lines and make them compatible with the editor.

Try and run again.
Ok, now we've ruled out all the problems with the editor, but we're getting runtime errors now:
"Error" - Runtime Error 7007 - Object already exists at line 53
Now we get to the real trouble with this code, it was never tested and the program is trying to make objects that have already been created.
The problem starts on this line:

You'll notice that object 20 has already been created in the program just before that line:

Ok, so let's go through the code and try to guess what the author was trying to do and get rid of duplicate object numbers:

Let's run it and see what we get.

Ok that looks like a view of the scene from underneath the platform. Did the author forget to turn off the autocam? Yes. Let's put that in now.

Let's run and see what we get.

The program is running at warp 9 captain! Let's change the sync rate from 0 to 30 so we can see what's going on.

Run again. Now we see that something is very wrong with the chain of balls hanging from the tower, it starts out fine, but after a couple hundred frames the balls seem to get disconnected and appear at random positions that are generally in the area they should be in, so let's try tweaking some parameters to try and slow down the velocity:

We've taken out the incrementing of the value every loop, and just set it to a constant value. Everything seems to be fine now, except one of the box stacks seems to fall on its own.

Other example programs in the documentation have similar problems (not including the text export problems).

Please test example code before releasing it to the public, it's frustrating having to debug other's code, especially when the code is supposed to be illustrating how to do something you've never done before.

Years of Service
User Offline
Joined: 24th Mar 2006
Location: Nottinghamshire, England
Posted: 8th Sep 2006 00:29 Edited at: 8th Sep 2006 00:30

The code in the help files is different to the code in the sample projects, the code in the sample projects run sweet as a nut, I guess the help files just didn't get updated, but hey these things happen.

I know the voices aren't real, but they have good ideas!

Login to post a reply

Server time is: 2023-12-08 21:58:49
Your offset time is: 2023-12-08 21:58:49