Darwinbots Forum

Code center => Bugs and fixes => Topic started by: Ulciscor on August 12, 2005, 04:47:44 PM

Title: Problem with 3.4 source code?
Post by: Ulciscor on August 12, 2005, 04:47:44 PM
Hey, I've unzipped the source code and am having trouble running it...
I'm getting 'User-defined type not defined' on 'pos as Vector' in robots.bas

I have copied fastmathDLL.dll to system32 folder, and tried running regsvr32 at the command prompt to check if that was the problem but got even more weirdness there. Something about an entry point not being found and the file not being registered.

Am I doing something wrong? I reeeeally wanna get a peek at 3.4, someone help please!!  :(
Title: Problem with 3.4 source code?
Post by: Numsgil on August 12, 2005, 04:55:52 PM
Definatley not the DLL.  You'll know the DLL problem because it says "can't find fastmath.dll"

Instead, there's some source missing.

Vector type should be defined in the common module (yes, that's what it's called).

It may be that the project file isn't including common.bas into the project.  That'd be my guess.  If that's the case, just insert it via project -> add file and look for common.bas.
Title: Problem with 3.4 source code?
Post by: Ulciscor on August 12, 2005, 08:09:52 PM
There is no new common module in the .zip on the FTP, so I inserted the old one from the last version I have and it won't work.
Title: Problem with 3.4 source code?
Post by: Numsgil on August 12, 2005, 11:10:44 PM
No, it wouldn't work since the entire vector class is new to 2.4.

I have no idea why it didn't include common.bas.  I've reuploaded 2.4 to the FTP.  It should work now.
Title: Problem with 3.4 source code?
Post by: Ulciscor on August 13, 2005, 05:31:08 PM
You are probably fed up of me by now lol :lol: but I'm getting the dll not found error. Both the .dll and .lib files are copied to system32, regsvr32 still won't work.
Title: Problem with 3.4 source code?
Post by: PurpleYouko on August 13, 2005, 08:52:20 PM
Are you making sure to use the full path with regsvr32?
Title: Problem with 3.4 source code?
Post by: Ulciscor on August 13, 2005, 09:13:13 PM
I didn't think you needed to, as system32 was the default directory, but I'll do that now...

It says "[The dl]l was loaded but the DllRegisterServer entry point could not be found. This file cannot be registered." I'll have a google to see what's going on.
Title: Problem with 3.4 source code?
Post by: Ulciscor on August 13, 2005, 09:23:02 PM
Just tested it with another dll and get exactly the same response :( it must be my machine. I haven't found any help on the matter either.
Title: Problem with 3.4 source code?
Post by: Numsgil on August 14, 2005, 03:33:53 AM
Try the system directory instead of system32.

DLLs are hell.  I absolutely hate it, and wouldn't even do it except I found a way to find the inverse square root of a number super fast using bit manipulations, and you can't manipulate bits in VB :/
Title: Problem with 3.4 source code?
Post by: Ulciscor on August 14, 2005, 11:56:12 AM
Goddam it it still says the same thing for every dll, no matter where they are :burnup: I don't know what's going on!
Title: Problem with 3.4 source code?
Post by: Ulciscor on August 14, 2005, 12:02:31 PM
OK Microsoft support says the error can be generated as following:


Dllname is not a .dll or .ocx file. For example, typing regsvr32 wjview.exe generates this error message.

OR

Dllname may not be exported, or a corrupted version of Dllname may be in memory. Consider using Pview to detect the file and remove it.

I've no idea which of these is most likely.
Title: Problem with 3.4 source code?
Post by: PurpleYouko on August 14, 2005, 12:05:39 PM
I had the same problem a while back with an excel utility that used a bunch of activex features.
I had to use the full path C:\WINNT\System\System32...ect. and actually be in the root directory at the time or the bloody dll just would not register.

I haven't tried this new version yet cuz I have been too busy. Maybe I will give it a shot today to see how it goes.
Title: Problem with 3.4 source code?
Post by: Ulciscor on August 14, 2005, 12:17:32 PM
Just found this, don't know if it has any relevance.

Error: "C:\Program Files\SoftArtisans\WordWriter\WordWriter.dll was loaded, but the DLLRegisterServer entry point was not found. DLLRegisterServer may not be exported, or a corrupt version of C:\Program Files\SoftArtisans\WordWriter\WordWriter.dll may be in memory. Consider using PView to detect and remove it."
This error is the result of attempting to register the WordWriter.dll with regsvr32, which can be used to register COM objects, but not .NET ones.

I have some .net framework installed on my pc, and possibly a partial remnant of vb.net remaining from a previous installation. Would this cause the problems I am having? The site suggests running regsvr on the COM object not the DLL.
Title: Problem with 3.4 source code?
Post by: Ulciscor on August 14, 2005, 12:21:29 PM
Lol sorry to post again, ut interestingly the DLL error disappears when I change

Declare Function FastInvSqrt Lib "FastMath" (ByRef x As Single) As Single

to

Declare Function FastInvSqrt Lib "FastMathDLL" (ByRef x As Single) As Single

but weird stuff is happening. Not sure if this is just because of wonky settings or the change I have made. But there are no dll errors now.
Title: Problem with 3.4 source code?
Post by: Numsgil on August 14, 2005, 02:41:26 PM
There are so many changes, I have a feeling we'll be sorting through wonky things for quite a while.  Be sure to set all physics values to something real.  That's the most obvious solution.

After that start posting what you find weird.  This is a long road.
Title: Problem with 3.4 source code?
Post by: Ulciscor on August 14, 2005, 03:15:15 PM
Well this is nothing big but is just odd. The little symbol that is supposed to be inside each bot appears to be outside instead.

(http://I.1asphost.com/toxicshock/weirdveg.PNG)

I've just restarted with a new symbol and it's fine now.  :wacko:  :blink:


Also tried Helios out and it freaked out, then I got a "subscript out of range" in

  IntStack.val(IntStack.pos) = value
Title: Problem with 3.4 source code?
Post by: PurpleYouko on August 14, 2005, 03:17:53 PM
Oh No!

Inside out robots!  :unsure:
Title: Problem with 3.4 source code?
Post by: Ulciscor on August 14, 2005, 03:26:32 PM
It seems that the symbols aren't being resized for growing/shrinking bots.

(http://I.1asphost.com/toxicshock/weirdDE.PNG)

Do you mind if I poke around to try and solve some of these myself? I can post either whole forms/modules or just blocks of code as appropriate.
Title: Problem with 3.4 source code?
Post by: Ulciscor on August 14, 2005, 03:36:02 PM
You don't even wanna see what's happening with ties.  :rolleyes:

Are you going to start hating me pretty soon?  :P

Take a look-see! (http://I.1asphost.com/toxicshock/tie-disaster.PNG)
Title: Problem with 3.4 source code?
Post by: Numsgil on August 14, 2005, 03:53:57 PM
1.  Ties don't have a breaking length at the moment.

2.  Helios freaks out because as it reproduces to make it's body, the distances between bots change.

3.  Feel free to fix any and all problems.  I'm much better at editing source code (editing in the same way that a magazine Editor edits) than writing it.

If you want alot of fun, turn on gravity.  The bots will actually bounce off the bottom like it's a trampoline.  Weeee!  This bot is fun too to experiment with the new tie physics:

Code: [Select]
cond
start
.tie inc
stop

cond
start
100 *.numties div .sharenrg store
stop

cond
*.nrg 25000 >
start
10 .repro store
stop
end

Just drag those babies around with the mouse, and they'll tie to anything and everything.  Use the console to fixpos one with gravity on, and the rest will hang and bounce around quite realistically.
Title: Problem with 3.4 source code?
Post by: Botsareus on August 15, 2005, 12:32:19 PM
Forgive me for a being a little off topic yet again , but this is interesting:

What is the "inverse square root" of a number , and how the hell are you using it in db?!

I think you do indeed have bit manupilation in vb, there is a convirt into bytes function, and then you use an erray loop and do your and xor not or whatever right using vb code itself.
What kind of bit manupulation are you talking about?!



Edit:

This is sad: vb indeed has no way to convirt numbers into a bit array unless you do it yourself ( I beleave convirt using hex() first )
However: the vb's and or xor not opperators actualy do bit compare, read the msdn on it , its at the bottom of each page.
Title: Problem with 3.4 source code?
Post by: Numsgil on August 15, 2005, 02:14:24 PM
There's this really neat function that finds that inverse square root of a numkber FAST.  And think about it.  Usually you're dividing by the square root anyway.  And if you need the actual square root, you just take the square times the inverse square root.

If you're interested in it, you can look in the DLL source code I included in 2.4, and see how I use it in the Common.bas file.
Title: Problem with 3.4 source code?
Post by: Ulciscor on August 15, 2005, 05:33:35 PM
The inverse square root is the reciprocal of the square root of a number, isn't it?

The inverse square root of 4 is 4^(-0.5) or 1/(4)^0.5, which equals a half.
Title: Problem with 3.4 source code?
Post by: Numsgil on August 15, 2005, 06:00:21 PM
Exactly.  Turns out the inverse square root of a number is easier to calculate than the square root using certain numerical methods.

I had an article at one time explaining how the cryptic function worked, but I'm not sure what happened to it.  I do know it was lifted from Quake 2 source.
Title: Problem with 3.4 source code?
Post by: Zelos on August 21, 2005, 06:21:27 AM
how do I make so I can get it as exe file and use it? the source code I mean
Title: Problem with 3.4 source code?
Post by: Zelos on August 26, 2005, 03:00:34 PM
can someone answer plz
Title: Problem with 3.4 source code?
Post by: Numsgil on August 26, 2005, 04:02:53 PM
I assume you have visual Basic (henceforth refered to as VB).

Load up the source code into VB (I assume yo uknow how to do this).

File->Make Darwin2.4, put it in your DarwinbotsII folder.
Title: Problem with 3.4 source code?
Post by: Zelos on August 27, 2005, 02:11:38 AM
ive tried installing VB on 2 pc but it dont work, it keeps saying that somefiles cant be copied so it quit
Title: Problem with 3.4 source code?
Post by: Ulciscor on August 27, 2005, 05:14:55 AM
2.4 is only available as source code atm, so you need VB.

Are you having trouble installing the VB from the DB server? If so try reading the readme in the zip file, as you can get errors if you select to install programs other than VB such as Visual C.
Title: Problem with 3.4 source code?
Post by: Zelos on August 27, 2005, 05:35:45 AM
I install the basic, nothing mroe than it want to install from the begining but I still get errors
Title: Problem with 3.4 source code?
Post by: Numsgil on August 27, 2005, 10:26:42 AM
I'm not sure what to tell you then.  Even if I compiled the source for you it crashes so much still that you really need to run it through VB front end or you'll get disgusted.

You can always try buying it on Ebay.  Visual Basic 6.0 (I'm sure 5.0 would work too, I think).

Here's one I think: Visual Basic 6.0 (http://cgi.ebay.com/Microsoft-visual-basics-6-0-PROFESSIONAL-EDITION_W0QQitemZ5802679371QQcategoryZ1251QQrdZ1QQcmdZViewItem).
Title: Problem with 3.4 source code?
Post by: Botsareus on August 28, 2005, 09:32:02 PM
or it might be not enough disk space or any other stupid thing you might of missed.