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 / DBP without 2D or 3D capabilities

Author
Message
Uncle Sam
20
Years of Service
User Offline
Joined: 23rd Jul 2005
Location: West Coast, USA
Posted: 3rd Sep 2010 04:46 Edited at: 3rd Sep 2010 04:49
Hi all,

I'm having a real issue. I have a server I made that I need to run (unrelated to any games on these forums), so I bought a GoDaddy Windows VPS. Problem is, my server program utilizes 3D things (being Dark Basic, even though I render or load no media), so it can't run (and you can't install graphics drivers on a VPS).

So, I decided to try to remove all DLLs that might do anything related to rendering. I'm down to this necessary list (so that it can compile and run), in the plugins folder:



The one necessary one is the Basic2D dll. If I do not include it, the program opens and then closes immediately but at least runs without display error messages on the VPS (before closing)! So I have to include the Basic2D DLL to prevent it from immediately closing. This, however, utilizes the graphics card, causing it to crash on the server.

PLEASE, I need an experienced user to let me know if there is some way to get DBP to not just close without this DLL, or if there is a way to edit it (the Basic2D DLL) so that it does the bare minimum and that the program can keep running. It doesn't need to render ANYTHING, or even appear as a window!

Thanks.
Jeff032
18
Years of Service
User Offline
Joined: 13th Aug 2007
Location:
Posted: 3rd Sep 2010 05:23
I very much doubt that this will actually work , but I have attached a modified DBProBasic2DDebug.dll. Give it a try. (You are using 7.5, right?)

Uncle Sam
20
Years of Service
User Offline
Joined: 23rd Jul 2005
Location: West Coast, USA
Posted: 3rd Sep 2010 06:40
Thanks for the effort man, but it didn't work. I'm using 7.4, though. It compiled and everything but the server didn't like it still. How'd you edit it (what program)?
BatVink
Moderator
23
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 3rd Sep 2010 09:21
What are you creating in DBP that doesn't use graphical output? Surely another language would be better in this instance, even if it's holding together a networked DBP game?

Uncle Sam
20
Years of Service
User Offline
Joined: 23rd Jul 2005
Location: West Coast, USA
Posted: 3rd Sep 2010 09:34
It's just server code that handles data and sends it to clients. I know another language would be better (I wouldn't know which to use), but I don't have the expertise or the know-how to do it. Surely it must be possible to run DBP without loading or calling any DLLs that require a video card. :/
Uncle Sam
20
Years of Service
User Offline
Joined: 23rd Jul 2005
Location: West Coast, USA
Posted: 3rd Sep 2010 10:32
Is there possibly a way to emulate this? I tried 3D-Analyzer but it doesn't seem to do it.
Jeff032
18
Years of Service
User Offline
Joined: 13th Aug 2007
Location:
Posted: 3rd Sep 2010 15:47
Quote: "Thanks for the effort man, but it didn't work. I'm using 7.4, though. It compiled and everything but the server didn't like it still. How'd you edit it (what program)?"


Darn. I used visual studio 2008 to recompile the dll after removing most/all of the actual logic. Are you sure that the other dlls don't have any directx stuff? When you omit Basic2D, it could be exiting before it tries to initialize directx.

When you run it on the server, do you get an error message or does it just crash?

Also, how many lines of code is this server?

Uncle Sam
20
Years of Service
User Offline
Joined: 23rd Jul 2005
Location: West Coast, USA
Posted: 4th Sep 2010 00:31 Edited at: 4th Sep 2010 04:54
I have the code at home so I'll have to check there, but it's probably < 1000.

You have a point there! I assumed it was the 2D DLL because it just closes immediately when you open it without that DLL, so I assumed that it was used for necessary rendering or something, which would likely utilize the graphics card. But maybe it's one of the other DLLs. The one's in my list are necessary to compile my code (minus the sound one, I deleted that one now and it still compiles), so maybe one of those could be edited.

What happens on the server? I get "display not supported by (something, I think it said hardware) at line 0", something like that (I think error number 1512). I'm not setting the resolution or anything in my code. I have the project settings set to the lowest possible resolution. I believe, based on searching the forums, that that error is a result of insufficient hardware/graphics drivers. That's why I'm trying to remove any code that refers to that, so that it's like a typical Windows app.

Thanks again. I need to verify my info when I get home, shortly.
Brendy boy
21
Years of Service
User Offline
Joined: 17th Jul 2005
Location: Croatia
Posted: 4th Sep 2010 00:48
"globstruct.h" is calling some directx headers so any dbpro plugin which uses globstruct is calling direcx also even if it doesn't really need it.

Uncle Sam
20
Years of Service
User Offline
Joined: 23rd Jul 2005
Location: West Coast, USA
Posted: 4th Sep 2010 00:56
Oooh, that's good to know. I wonder if Multisync uses it, cause that's the networking plugin I use.
Jeff032
18
Years of Service
User Offline
Joined: 13th Aug 2007
Location:
Posted: 4th Sep 2010 01:25 Edited at: 4th Sep 2010 01:25
Quote: ""globstruct.h" is calling some directx headers so any dbpro plugin which uses globstruct is calling direcx also even if it doesn't really need it."


globstruct.h is only defining a few things; it is not really "calling" anything. You should be fine with plugins that include globstruct.h as long as they aren't trying to use the graphics device, etc. (It is possible to use directx without a graphics card.)


FYI, I have another possible solution, but it could take a bit for me to get it ready.

Jeff

Jeff032
18
Years of Service
User Offline
Joined: 13th Aug 2007
Location:
Posted: 4th Sep 2010 02:25
Here is a new DBProSetupDebug.dll that you could try instead. I don't know if there will be compatibility problems since it was built with 7.5 code. You could try it without and then with the 2D dll I had attached.

Jeff032
18
Years of Service
User Offline
Joined: 13th Aug 2007
Location:
Posted: 4th Sep 2010 02:26
And if that doesn't work, you could try this one, but I think this one is even less likely to work.

Uncle Sam
20
Years of Service
User Offline
Joined: 23rd Jul 2005
Location: West Coast, USA
Posted: 4th Sep 2010 03:15 Edited at: 4th Sep 2010 03:22
Wow, thanks so much for taking the time. I'll give it a shot now.

EDIT: upgraded to 7.5, now it should be easier to tell if it works.
Uncle Sam
20
Years of Service
User Offline
Joined: 23rd Jul 2005
Location: West Coast, USA
Posted: 4th Sep 2010 03:28 Edited at: 4th Sep 2010 03:36
Gives me an error every time:

"The program can't start because d3dx9_43.dll is missing from your computer. Try reinstalling the program to fix this problem."

Not sure what that's about. I'll google it.

EDIT: Oops, think I need to update direct X.
Uncle Sam
20
Years of Service
User Offline
Joined: 23rd Jul 2005
Location: West Coast, USA
Posted: 4th Sep 2010 03:42 Edited at: 4th Sep 2010 03:45
We're getting somewhere man! It compiles now, and it renders nothing (it's white), which means we're on the right track. However, on the server I get a different sort of error:

"Runtime Error 1511 - Display cannot be created due to invalid function parameters at line 0."

So now it's not talking about hardware support but about parameters, which means we've at least got past the hardware referencing code. I'm gonna keep toying around with this.

EDIT: Something interesting. The above test was done with your 2D DLL and your latest setup DLL. I tried now with DBP's 2D dll and your latest setup DLL and I just get the anonymous Windows crash window, after it opens. Just noting that here.
Jeff032
18
Years of Service
User Offline
Joined: 13th Aug 2007
Location:
Posted: 4th Sep 2010 05:28
Regarding:
Quote: ""Runtime Error 1511 - Display cannot be created due to invalid function parameters at line 0.""


I'm not sure if it got farther or if it is dying on something I changed. It is difficult to solve this/know if it is even possible to solve since I can't debug or accurately reproduce the problem.

I created a virtual XP machine and ran some simple non 3D code on it, which worked perfectly without using modified DLLs. Adding a MAKE OBJECT CUBE caused it to crash with the same error you were initially getting. (Display is not supported...)



It might be easier if I could look through the code you are using, if you are willing to share it.

Note that I am not sure how much free time I will have in the next few days.

Jeff

Uncle Sam
20
Years of Service
User Offline
Joined: 23rd Jul 2005
Location: West Coast, USA
Posted: 4th Sep 2010 07:15 Edited at: 4th Sep 2010 07:57
Wow! You're right. I tried your code and it worked. Instead of just sending all my code to you, I tried deleting code chunk by chunk so that I could find the command that was messing it up, and it turns out it was the lower$() command. :S I don't know how that utilizes the 3D stuff, since it's for strings. Now I'll see if I can get the whole server to run by removing those.

edit: also commands or calls such as upper$, str$, and val$. It's still throwing that same error after removing those so I have to figure out what it is. If it is only these few things I can probably make the server without them, although it would be harder, but maybe the DLL can also be edited.

edit: The culprit was found, checklist string$(num) and checklist quantity() (I think the second one), but performing the checklist somehow works. Trying the whole thing now.

edit: Got it all to run! Found out that input commands crash it too, which is perfectly ok since no one will need to touch the server.

I'm willing to code without all those commands, but a fix would be nice (probably it would be in the Text and Input DLLs).

So, the total known command list that is prohibited :

left$()
right$()
lower$()
upper$()
str$()
val$()
checklist string$(num)
checklist quantity() (most likely)
any input commands (wait key works)

Thanks SO MUCH Jeff, I would never have got this far without your help. Don't know how to make it up to you.
Jeff032
18
Years of Service
User Offline
Joined: 13th Aug 2007
Location:
Posted: 9th Sep 2010 16:38
Sorry, things have been a bit crazy here, and I'm not sure when I'll have time to look at this again. My initial attempt to fix the text DLL was unsuccessful.

Jeff

thenerd
17
Years of Service
User Offline
Joined: 9th Mar 2009
Location: Boston, USA
Posted: 10th Sep 2010 03:26
well, just a suggestion, you seem to be finding a solution for this, but in the future, you should take a look at python. the commands are nearly as easy as dark basic, it runs in the console, and takes up almost no cpu. I've had a lot of success getting it to interact with dark basic, and in fact I'm going to code the OpenFPS server software in python. the only real disadvantage of it is that you must do all calculations by yourself, especially the physics.

also, just wondering, is this for Time Front?

Uncle Sam
20
Years of Service
User Offline
Joined: 23rd Jul 2005
Location: West Coast, USA
Posted: 20th Sep 2010 10:51 Edited at: 20th Sep 2010 10:51
Quote: "Sorry, things have been a bit crazy here, and I'm not sure when I'll have time to look at this again. My initial attempt to fix the text DLL was unsuccessful.

Jeff"


No worries, you did more than enough!

Quote: "well, just a suggestion, you seem to be finding a solution for this, but in the future, you should take a look at python. the commands are nearly as easy as dark basic, it runs in the console, and takes up almost no cpu. I've had a lot of success getting it to interact with dark basic, and in fact I'm going to code the OpenFPS server software in python. the only real disadvantage of it is that you must do all calculations by yourself, especially the physics.

also, just wondering, is this for Time Front?"


You're right, I should probably look at other solutions. At least for now it works. It's true that the CPU usage is too high. In fact, my server manager contacted me and told me to figure out how to make it use less. The app takes 25% of CPU usage on my quad 3.0 comp (1 whole core out of 4)! And it's a small program. :/ I found out on the forums though that v-sync really helps this. When applied, it dropped to 1%, which would be only like 30 mhz.

And no, it's not for Time Front. It's for another project. Although I applied this new knowledge for the Time Front server list. So thanks, Jeff, you made that possible too!

Oh, I came back to this post to mention that v-sync fix. This is important for anyone who is going to use DBP to code their server app, otherwise it's just too taxing for most providers.
Uncle Sam
20
Years of Service
User Offline
Joined: 23rd Jul 2005
Location: West Coast, USA
Posted: 21st Sep 2010 09:43
Actually, v-sync might not work. It may have been that I had other code that was calling 3D or other dlls that would not work on the server...I don't know; it might still work. Either way, sync off works just as well (or maybe even better) to reduce the cpu usage to 0-1%.

Login to post a reply

Server time is: 2026-07-22 12:41:12
Your offset time is: 2026-07-22 12:41:12