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 GDK / Encapsolation into Binary problem.

Author
Message
Zumwalt
17
Years of Service
User Offline
Joined: 1st Feb 2007
Location: Tampa, FL
Posted: 14th Feb 2007 21:27
I use Molebox pro, well, it doesn't work for the exe's created by this. I don't want my data files to be just out there naked, I want them encompased in a dat file with encryption, so how do I deal with it based on how the darkgdk.net works?

I have something I want to get tested by some people, because the FPS on my machine is at a CRAWL using this engine vs another engine that does the exact same thing.

Suggestions on how to increase my FPS?
Suggestions on how to encompass the data in a seperate file other than the binary and still be accessable?
James Bondo
17
Years of Service
User Offline
Joined: 12th Nov 2006
Location: Denmark
Posted: 14th Feb 2007 22:06
For encapsulating the media in an external file, see DarkEngine plugin DarkEmReL (Dark Embedded Ressource Loader). It doesnt encrypt data, but your data isnt just lying around "naked".

Otherwise, you probally have to make somekind of data loading class yourself.

Avoid using too many loops. I tried manually converting some examples from DBPro to DGDK.Net, and all those examples that use some kind of special effect with alot for-loops was VERY slow.

I dont know if this is DGDK.Net or if its C# in general.
Eventually take a look at this thread: http://forum.thegamecreators.com/?m=forum_view&t=95496&b=22

Using Dark GDK.NET
Zumwalt
17
Years of Service
User Offline
Joined: 1st Feb 2007
Location: Tampa, FL
Posted: 14th Feb 2007 22:20
I can't avoid loops, I have the game loop itself, and a loader loop that is for object instansiation. It only runs through the initialization prior to the game loop, once it is done instansiating the objects, the secondary loop sets them as enabled, then it goes into a very simple game loop.

I have set my camera distance to 400, this helped some, but not much. Still working on optimization, i'll look into the other DarkEmRel and see if that is suitable.

I would really like to continue to use my Molebox Pro solution, I might have to send them an unprotected watered down version of what I am doing and let them try to protect it on there end.

Thanks for that link, going to look at it.
Right now, I have successfully ported over some game code and I can dynamically load in entire levels without a fuss.

Its just the FPS is so dang SLOW
Zumwalt
17
Years of Service
User Offline
Joined: 1st Feb 2007
Location: Tampa, FL
Posted: 14th Feb 2007 22:35


By the by, SyncOff and SyncOn do absolutely nothing.
Without Sync in the loop, it never refreshes the screen, I think this is a bug.
Zumwalt
17
Years of Service
User Offline
Joined: 1st Feb 2007
Location: Tampa, FL
Posted: 16th Feb 2007 05:49
FYI, I have solved my MoleBox issue..
And I found a way to really make the key totally secured.
On top of that, I have a new way to instansiate the engine without creating any new security holes where someone could try to use the key for the application on a new application.

I'll explain the process tomorrow if anyone is interested. Took me all of about 45 minutes to think it up. End result is very sweet.
kBessa
17
Years of Service
User Offline
Joined: 8th Nov 2006
Location: Manaus, Amazonas, Brazil
Posted: 16th Feb 2007 06:12
I'm interested.
Maybe DarkEmReL could evolve (it is just too much simple by now).

Thiago
James Bondo
17
Years of Service
User Offline
Joined: 12th Nov 2006
Location: Denmark
Posted: 16th Feb 2007 09:31 Edited at: 16th Feb 2007 09:32
I didnt mean you should'nt use loops.
Consider this example:



In DBP, this piece of code would boost your games FPS by ALOT. But in DGDK.Net, these extra for loops makes your game ALOT slower.

What im trying to say is, watch out with for and foreach loops INSIDE your main game loop.

From that other thread i linked:
C# code


DBP Code


If you change the rows and columns variable in the C# code you thereby change the amount of for-loops in the main loop, the FPS slows down or speeds up by alot.
However, changing them in DBP has little to no effect.

Using Dark GDK.NET
Zumwalt
17
Years of Service
User Offline
Joined: 1st Feb 2007
Location: Tampa, FL
Posted: 16th Feb 2007 14:12
Always do all initialization outside your game loop, doesn't matter the engine, its just a common sense rule. The game loop should handle in game related object use only.

Like movement based on keypress, mouse triggers, events like calculation of damage, etc. Then there is the purpose behind multithreading, you setup a thread for handling a single object and pass that thread event handlers that make the object in that thread act accordingly.

Multithreading in .Net is a bit advanced for basic games though.
I am in the process of typing up a word document with some class adjustments and project adjustments to use the new method I have for starting up the engine.

Hopefully I can post it in the next hour or so. Shouldn't take me to long. I would have done it last night, but it was getting late and I was way to tired.
James Bondo
17
Years of Service
User Offline
Joined: 12th Nov 2006
Location: Denmark
Posted: 16th Feb 2007 15:04
I dont know how little you looked at those 2 examples. But there is NO initialization inside the game loop.

If you havent tried running the examples, i can enlighten you that they are 100% identical in functionality, one is DBPro the other is DGDK.Net.
Despite their identicallity the DBPro code runs with 100 frames per second whiles the C# code runs 65 seconds per frame on my system.

AMD X2 3800+
2GB DDR2 dual channel
GeForce 7900 GT

Using Dark GDK.NET
Zumwalt
17
Years of Service
User Offline
Joined: 1st Feb 2007
Location: Tampa, FL
Posted: 16th Feb 2007 15:25
@James, what I was reffereing to was in general, you do not want initialization of obects in the game loop itself, not directed at those examples. I suspect that there is some throttling going on in the GDK, although it is only theory.

ROUGH DRAFT OF INSTRUCTIONS FOR WORKING WITH YOUR GAME AND A 3RD PARTY PACKAGING UTILITY

DarkGDK.Net and VB.Net 2003
Project Setup to allow the use of MoleBox Professional or other 3rd party protection software.
Also a secondary way to start the game engine.
Written by Jonathan Wood aka Zumwalt

These instructions start off after you have already followed the tutorials for Visual Studio 2003 included in the HTML Help file that comes with DarkGDK.Net

Most 3rd party protection software tend to encrypt even the binary that makes up the entry point of your game. With this done, the DarkGDK can not make a hook into the binary and look for the embedded DGDK file that you were instructed earlier in the tutorial to create.

Initially, before you begin, you need to alter the dgdkGlobals.vb file as follows:


Now, near the very bottom of the module there is a catch statement with a MessageBox call in it and an End statement, modify that as follows:


Second thing is that we need to add a new project to your current project list in Visual Studio.

Step 1) Right click on your solution and click on Add -> New Project
Step 2) Under Visual Basic Projects, choose Class Library as the type
Step 3) Name the Class GameInit and click OK
Step 4) Add a reference to the DGDKLib
Step 5) Add the dgdkGlobals.vb to project
Step 6) Update the AssemblyInfo.VB making it identical to your EXE’s based on step 12 in the tutorial. (this is very important)
Step 7) Rename Class1.vb file to DCI.VB
Step 8) Altar the DCI.VB file and replace it with this code:

Step 9) Compile the DLL in release mode.
Step 10) Load up the Authenticator and then browse to the bin folder of the project, notice that there appears to be no files, well the Authenticator is looking for *.exe and has no way of drop down to change that. Just delete the .exe in the line for the filter and hit enter. This will give you a list of all files in that folder. Select the GameInit.dll and click Open.
[This will create your DGDK file the same as it would have done for the EXE but its target is the DLL, copy the large alpha numeric sequence and paste it in notepad to hold on to it until later]
Step 11) Like the tutorial following step 23-25, make sure to add in the GameInit.dgdk and make it an embedded resource (again VERY important) to the Class Project.
Step 12) Compile

Now, returning to your other project in the same solution that is your game, you will need to do some alterations.

Step 1) Add a project reference in your game to the GameInit project, it should automatically copy the DLL locally to your game project BIN folder.
Step 2) Using the SpinningCube as the base from the tutorial, change this bit of code:

To look like the following:

You make sure your key is in the Quotes, just grab it from the notepad document, this will pass the key from your exe to the dll and then initialize the engine and pass back the result of the initialization. There you have it, a way to detach the engine startup from your main game exe.

Notice that I am NOT storing the key in the DLL, but the key itself is passed from the game exe to the dll call and the engine result of instantiation is passed back.

Now when you compile your project, you should be able to MoleBox up the resulting EXE and project files, just DO NOT put the DLL in the project package, just put it in the folder that the EXE is generated, along with the interop dll.
Neither DLL should be added to the compressed project and should be stand alone!


Happy Gaming!
Zumwalt
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 16th Feb 2007 17:13
Zumwalt, pretty impressive, seen you've been busy

Paul.

Login to post a reply

Server time is: 2024-09-28 23:13:14
Your offset time is: 2024-09-28 23:13:14