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 / GDK and SQL

Author
Message
SoulMan
21
Years of Service
User Offline
Joined: 22nd Nov 2002
Location: In a house somewhere on the planet earth
Posted: 2nd Jan 2008 21:45
I'm trying to find an example of a DarkGDK using a MySQL Database. I know there have been some developement for Dark Basic Pro but I haven't seen information for using it with this.

No Kittah, this is my potpie!!!
tempicek
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: Prague
Posted: 2nd Jan 2008 22:19
AFAIK there's no API functions for any database in DGDK.
I wonder what your application is going to be It's likely not a game, is it?
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 2nd Jan 2008 22:59
why?

there are a million ways to implement databases in C++, C#, VB.NET.
use the DGDK to handle DX, do anything and everything else natively in the host language (C++, C#, VB.NET), thats where the power is

My DBP plugins page is now hosted [href]here[/href]
tempicek
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: Prague
Posted: 2nd Jan 2008 23:16
Quote: "there are a million ways to implement databases in C++, C#, VB.NET."


Did I say anything else? DGDK's API does not provide database functions. You can use any other library for that, indeed, but that's probably not what SoulMan was asking for
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 3rd Jan 2008 00:05 Edited at: 3rd Jan 2008 00:07
I was speaking to him, not you. Sorry I wasnt clear on that bit. He was asking, if I understand correctly, if the dgdk engine itself implements database connectivity. If thats what he was indeed asking then I stand by my answer of "why?". A databasing ability in his game or any app should exist in his c++ code, whether it uses its own third party library or what have you, since almost anything will be faster and more robust OUTSIDE of the dgdk layer. Its like coding a game, using the dgdk in c++, and then using the dgdk/dbp arrays, or file functions, for example, instead of the native stuff in the c++ environment.

I guess the short answer should have been "sorry, no. you need to code your own or use a dll."



my apologies for any confusion

My DBP plugins page is now hosted [href]here[/href]
SoulMan
21
Years of Service
User Offline
Joined: 22nd Nov 2002
Location: In a house somewhere on the planet earth
Posted: 3rd Jan 2008 01:13
I was asking if there were any examples of this. I wasn't asking about Database functions within the GDK.

No Kittah, this is my potpie!!!
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 3rd Jan 2008 02:28
thats sorted then

none that I know of. youre coding in c++?

My DBP plugins page is now hosted [href]here[/href]
SoulMan
21
Years of Service
User Offline
Joined: 22nd Nov 2002
Location: In a house somewhere on the planet earth
Posted: 3rd Jan 2008 03:49 Edited at: 3rd Jan 2008 03:49
That is correct although I don't think I'll be coding the SQL access commands in Client Application, I'll let the server that is connected to the database handle sending messages back to the client.

No Kittah, this is my potpie!!!
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 3rd Jan 2008 17:04
Consider threading ... don't know what you're doing but a "Send Request" and "Request Available" & "Get Data" interface from main game to "Data backend" interprocess might be prudent - so you can keep visuals going while data is accessed etc...

Also, interfacing with MYSQL is easy when you directly hook to it -though it obviously locks you into MySQL for the long haul - not really a bad thing ..just a fact. BUT if you wish to use ODBC - Better roll up your sleeves... MySQL doesn't always play nice with ODBC. (Often need to tell MySQL ODBC driver a special flag or two to get it running ok without the quirks being so bad.)

I personally needed a ODBC "Client" in the Web server stuff I wrote in times past - so I could use MYSQL or anything else... and I found writing ODBC by hand was a trick - and each database (regardless of what they say) needs a little cohercing... MSSQL doesn't behave so nice if fields aren't in certain order (blobs last...so you need to make query column order change before you grab the actual data) MySQL was better though... providing you sent the ODBC flags I eluded to - you'll need their forums to find em)

Ok... for simple MySQL access - I'd code directly to their MySQL.dll (which talks natively to MySQL) and do it in a separate thread or make a multiplexor bit-o-code to do it. Both will work fine but the threading will give you more control of how much code is running and when in your main game thread.

Pixel Perfect
17
Years of Service
User Offline
Joined: 21st Feb 2007
Location: UK
Posted: 3rd Jan 2008 21:11
Reminds me of the problems I used to have querying Progress databases with SQL before they introduced a decent 'cost based optimizer'. With sometimes up to 20+ table joins and 10 of millions of records in some of the tables when the optimizer got it wrong .. it really messed up. Could take 2 hours to return the query results instead of 30 seconds when you hand optimized the where clause! But it required detailed knowledge of how their optimizer made its decisions to get it right.

However, with small databases and data sets it's generally not so much of an issue. If your not storing many table records then even using indexes is debatable, as the overhead of creating the index entries and writing them to disk might outweigh the gains of not reading the tables sequentially.

No matter how good your code is, someone will improve on it
SoulMan
21
Years of Service
User Offline
Joined: 22nd Nov 2002
Location: In a house somewhere on the planet earth
Posted: 4th Jan 2008 18:39
Well with the way that I am going to design this, I don't think I will have the client directly connect to the database.

Client <=====> Server <======> Database
The client will connect to the server which will have an established connection to the database. The Client will make a request that the server will then query the database if needed and return that result to the server which will process and send back data to the client. For security reasons this would make sense, so that you don't give the client any portals or direct connections to the database. The client won't do any direct writing/reading to the database since that will be handled by the server.

No Kittah, this is my potpie!!!
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 4th Jan 2008 19:42
Ahhh.... Ok, now we know what the heck you're likely doing.

So the question is... What language are you writing the server in?

SoulMan
21
Years of Service
User Offline
Joined: 22nd Nov 2002
Location: In a house somewhere on the planet earth
Posted: 4th Jan 2008 19:54
I will be doing it in C++ since the server will be based on Linux/Unix(More likely Linux).

No Kittah, this is my potpie!!!
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 4th Jan 2008 20:34
I've not looked at this thread in great detail, but one suggestion I'd very much go with is this:

If you download and install the ODBC MySQL driver from here http://dev.mysql.com/downloads/connector/odbc/3.51.html#win32

Installing this driver then allows you to create proper DataSets in Visual Studio 2005 or 2008. You can use the AutoCode generation of Visual Studio to create table adapters which are easily changed to reflect table structure changes and queries etc. Since this provides the ODBC driver for MySQL, Visual Studio integrates quite nicely with the system. You will need to create a System DSN to point to your MySQL database, and then use Visual Studio to create a Dataset with an application defined connection string to your System DSN entry. From there, you can use the standard Data Source wizard in Visual Studio.

Hope this helps.

Paul.

CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 4th Jan 2008 21:18
I agree with what apex said, you will most likely need the odbc driver installed and create the system dsn on you machine, but from there it depends on what you want to do. I tend to not use all the VS fluff to create any connections, datasets, adapters, etc. Youre probably better off making a valid connection string to use with your connection object in code as a string, and creating the other objects as needed in code is super easy, and not to mention the conn string is ultra portable for distributed apps/dlls. I have also done things the way Apex is describing, but I find that is better suited to office based static network client server scenarios, not for distro scenarios. But either way of proceeding can be made to work in either scenario.

If you want to get really fancy, if youre using SQL Server 2005 grab the free Enterprise Library install for your .NET framework version. It makes calling stored procedures a breeze because it encapsulates Parameter Types and counts by passing ParamArray objects, and the lib self-discovers the param counts and types so you end up never needing to build any Command or Parameter objects in your code. You end up with two or three lines of code to call any sproc, even if it has 15 parameters. Its very sweet. I took this concept a step further the last place I was working where I put Entlib on their web server and wrote a wrapper webservice for it. Then my distibuted App simply called the webservice (distro was nation wide) in one line of code, it called out over http 80 to the web service, the web service talked to sql db on another box, returned the dataset, which then was returned to calling client via http 80, as a Dataset in my app. Total encapsulation and simplification equated very little code app-side.

sorry to blab - just thought I'd share that technique. It scored me lots of point with the boss

My DBP plugins page is now hosted [href]here[/href]
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 4th Jan 2008 21:53 Edited at: 5th Jan 2008 03:14
Um... Guys... Did you read his post:

Quote: "I will be doing it in C++ since the server will be based on Linux/Unix(More likely Linux)."


Speaking of Which Soulman, FreePascal and Lazarus are SO perfect for this like C++ is. (You'd be pleasantly surprised how fast I [edit] ahem..excuse me..YOU [/edit] can whip up a MySQL application in linux with FreePascal - its sweet. )


And APEXNow....

Quote: "Installing this driver then allows you to create proper DataSets"


Proper? What is a Proper dataset? I figure anytime I run a SQL command or Stored procedure without a syntax error its "Proper". Can you elaborate...I'm confused. I think your suggesting that doing it Microsoft's way is "Proper" eludes that other way are not . I could totally be misunderstanding your slant on the use of the word proper admittedly but I think those kinds of sentiments are rubbish - placing Microsoft's "new fangled way" (of selling more software) as Proper is a stretch..especially considering the overhead of Microsoft's "new fangled way" versus a c++ approach using the NATIVE MySQL API for the database in question is absurd.

Have you seen some of the overhead of using MySQL with ODBC versus the Native MySQL Driver? Especially in a Linux Environment where MySql was originally written a honed/tuned for/on? How about some of the MySQL ODBC glitches it has when you start trying to pipe a bunch of MYSQL SQL commands over the wire via ODBC? (or local via loopback) MySQL's starting to get those ironed out - but it hasn't been there main focus because of the large number of users who just code to their native API.[edit]And I should have said that their ODBC is Pretty STABLE for basic SELECT queries - so its been good enough for most ODBC users[/edit]

I don't think its a question of what you may think is "proper" - I think its a question of his requirements for this application.

If he needs "database independance" - then he should consider writing directly to or using a help lib to get at the ODBC interface for whatever OS he's on... in this case linux... unlike Microsoft... there are a number of ways he can get at this.. and likely many ways to skin the ODBC cat going.


I stand by my previous statement
Quote: "Ok... for simple MySQL access - I'd code directly to their MySQL.dll (which talks natively to MySQL) and do it in a separate thread or make a multiplexor bit-o-code to do it. Both will work fine but the threading will give you more control of how much code is running and when in your main game thread.
"
and I think that Linux is the right choice for this type of web hosting/database combination. Even Apache/MySql (there are faster Web servers than appache... My own is the fastest I've seen yet - but no SSL or integrated PHP - must shell... you might [edit]want[/edit] integrated PHP and SSL for security. I make programs and compile them right into web server (Its the fastest way to do web coding - no thunking, no extra stuff... just take the base WEBSERVER and add your special stuff to it and compile it as one application so I personally don't need it - I don't use PHP much.... Anyways....

This config will be MUCH faster pound for pound = same hardware etc - than using Microsoft IIS, SQL server etc... plus it won't slow down once a week like IIS tends too. Apache and MySQL also TEND to run better in my opinion on linux from a speed persepective.

Consider LIGHTTP for Linux for this also...

Good Luck!

APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 4th Jan 2008 22:00 Edited at: 4th Jan 2008 22:07
I'm in total agreement with CR there, the Dataset, TableAdapter stuff works really well for Bespoke business solutions, but for game development, it may not be your cup of tea. Although the Visual Studio stuff CR mentioned about when dealing with parameter detection for Store procedures, this can also be applied when calling queries with user defined parameters. The difference being is that VS uses @MyParam types for SQL Server, where as with MySQL, you need to use ? instead.

For example, creating a query such as:

SELECT MyID, MyName, MyAge
FROM tblDetails
WHERE MyName LIKE ?


Visual Studio will then generate a TableAdapter method in code for your query which has the correct data type for the parameter defined by MyName. Which in this example, could be String.

Anyway..... this thread can get quite interesting with all the different ways this can be done.

[EDIT] Jason,

Quote: "Proper? What is a Proper dataset? I figure anytime I run a SQL command or Stored procedure without a syntax error its "Proper". Can you elaborate...I'm confused. I think your suggesting that doing it Microsoft's way is "Proper" eludes that other way are not . I could totally be misunderstanding your slant on the use of the word proper admittedly but I think those kinds of sentiments are rubbish - placing Microsoft's "new fangled way" (of selling more software) as Proper is a stretch..especially considering the overhead of Microsoft's "new fangled way" versus a c++ approach using the NATIVE MySQL API for the database in question is absurd"


OMG!!! Relax my friend. I was in no way trying to slander any other method of using MySQL, Linux or otherwise. I merely reffered to the proper in that, Visual Studio creates a correctly formed dataset with correct strong typed parameters to queries and such without any issues of dataconversion. A non 'proper'ly formed dataset would probably cause headaches for developers in trying to figure out why their queries are not firing or returning a valid set of rows purely because an integer was being converted to a string or something silly.

I'm really only trying to suggest helpful additions to using MySQL within Visual Studio, but I most certainly am not trying to write the bible on what is and isn't the proper way to do something.

Paul.

jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 4th Jan 2008 22:03 Edited at: 4th Jan 2008 22:10
I Agree THeRE! I get pretty excited over this kind of stuff because I've done so much of it... Writing ODBC clients directly for many different DBMS systems and the like - the web based "DATASTORE" ... its pretty exciting stuff

[edit] Writing my Own Webserver puts this kind of thing right in my cumfy ZONE! I know this stuff pretty much inside and out... MUCH more than I know how to code 3d thats for sure![/edit]

SoulMan
21
Years of Service
User Offline
Joined: 22nd Nov 2002
Location: In a house somewhere on the planet earth
Posted: 4th Jan 2008 22:59
Thank you for the information.

No Kittah, this is my potpie!!!
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 5th Jan 2008 00:17
I’m sorry I was so harsh – it was over the top. I’m sorry.

My motivation came from knowing that subject so intimately well more than most because I spent a long time writing a complete CRM system from Scratch (Customer Relationship Management System) and eventually had to put it one the backburner for more ludicrive opportunities – however the side effect of that project is a multi-threaded web server that runs on windows, linux and Mac, a Web template system makes web site creation pretty – non-redundant for content – (Designed for Templates and CACHING data per user – perfect for CRM – caching for GLOBAL is what to use for dynamic stuff for general public) – and MySQL is MY MAIN BACKEND for the system and I eventually made my own ODBC connectors to make it even more flexible.


I feel ashamed - I presented badly I MEAN well! Truly I do!

APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 5th Jan 2008 01:27
As said in the reply Jason, think nothing of it. I know you meant well. I can understand that certain disciplines do hold close to our hearts, and we do tend to overly react when certain buttons are pressed... even if not intentionally.

Anyway, moving on... happy thoughts

Paul.

CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 5th Jan 2008 02:32
Jason, omg! Look what you did....Apex is on a server right now stabbing people!!!!!

OMFG!!!



he's playing tf2

My DBP plugins page is now hosted [href]here[/href]
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 5th Jan 2008 03:18
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 5th Jan 2008 04:02
LOL.... I wasn't stabbing people, I was shooting them from the shadows...

Niels Henriksen
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 5th Jan 2008 21:21
Im also planning a database for my game. But my idea is that the client sends to the server. The server save it in RAM. Then the server will update the database when there is time to it

Niels Henriksen
Working on a (MMO)RPG right now in LightEngine
http://noggs.netopcom.dk/forum/default.asp - Forum for the game
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 5th Jan 2008 21:24
Quote: "But my idea is that the client sends to the server"


I'm not entirely sure what you mean by this... Sending DB requests is optimized by the server anyway, and you're requesting transactions which is effectively a client asking the server for data or to push data to it. Would you be good enough to elaborate on what you mean?

Paul.

jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 5th Jan 2008 21:40 Edited at: 5th Jan 2008 21:51
Yeah Neils - you could totally be on point as long as you TRY to keep the game packets tight and small... don't try sending SQL queries in a multi-player game from the client - What you do is some byte encoding for that - use single values to represent commands... like Send a NUMBER 1 - to get Server Name, and other numbers for other info, so you can ask for one or bit of info at a time embedded in your normal packets perhaps (or not) but...

Then make the server able to "pack the info" into one packet (or more...but as little info as possible) and send when approriate. Client needs to be smart enough to reckognize such info laden packets and handle accordingly.

Also - the IDEA of pumping just DATA to the Server in RAM and committing the info when its "conveinant" from a usage standpoint is a good idea... HOWEVER.... You will want to put limits on the amount of data you'll hold in a "cache" or "buffer" in RAM - because under major load - your memory will just skyrocket, then the server will slow down its reaction time to users... causing a viscous cycle that will likely bring your server to a crawl if at all.

I would make these kinds of "limits" easily controllable in real time so you literally could have a control panel to monitor total mem usage, concurrent threads, threads active, dead, and stats like this... Average "datachunk in mem" per thread etc... and have ways to force purging as a last resort to get things on track either manually or mechanically/automatically when the server is getting pressed.

Also, I personally make my multi-threaded server applications that are multi-threaded - FIXED - so I can limit the # of threads. Some people don't do this... and there are reasons for making them created on the fly and limiting the max number - but I personally find the whole process is ultimately a FASTER ENGINE if you d3ecide on a number of threads via config file or what have you... that your server can handle at one time, and MAKE THEM ALL "Sleeping" so the memory area specific to each one, and the TSS registers are all allocated... and then just recycle them as need... Loadem with data, fire them off, they finish, the go back to sleep.

This puts the THREAD creation load to when you fire up the server app - versus tons of little ... chugs" while new threads are created (and/or deleted). Some people will use a system of create as needed, THEN keep them and recycle. This is ok too. I prefer not to do this because BY NOT doing this - (say - like when I made my web server) - I don't want the slightest "pause" when a packet comes in for the first time... and considering each file request to a server is REALLY a first time because same ip could be asking for 50 files at once.... this is the FASTEST way to get the job done from a perfoamce perspective

[edit] Paul - I THINK he means a FIFO to actually fire off the SQL commands... like send a bunch of info, that doesn't matter when it needs to get saved... then firing off the transactions based on CPU usage. However after reading your question to him again - I think you're eluding to other things that could be fundementally wrong if your suspicions are correct. Like... trying to optimize the "SQL" server or something... I dunno. In many ways - the fifo is probably a stretch - even though I said good idea - because if you have a bunch of threads ANYWAY all grasping for their turn - you could effectively do the same thing as a mem cache - processing when there is time - by just tossing the info to the thread that "Does" this - or shoot - MySQL threads on its own - just send the data to it and go - done deal - it will happen when it happens... however transactions MIGHT cause a little binding I'd suspect, because some of it might need to be commited in the database in a serial manner - same table/row getting updated by two threads etc under the hood oin the SQL server...not to mention complicating and already complicated enough system... Yeah - I'm thinking Neils - you should hand the data to MySQL and go. I'd use a Messaging system for when askign for data within the server so if waiting on data - you client doesn't care - but when the server is ready, it triggers a thread that will pass the data to your client - and your client should always be ready for whatever comes its way [/edit]

Niels Henriksen
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 5th Jan 2008 22:06
APEX - jason got my idea. I dont sent sql from client to server, but sending information from client to server. The server will then use this data to sent to ram. Then other clients can use this data without using db.

There will be other tasks that will take data from ram and update the database. But if there will be a lot of data (and we are not talking about a little server with 4 GB ) then I might have to take a "snapshot" of ram just in case the server will go down.

jason - I will not just mySQL. It will be MS SQL I will be using

Niels Henriksen
Working on a (MMO)RPG right now in LightEngine
http://noggs.netopcom.dk/forum/default.asp - Forum for the game
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 5th Jan 2008 22:17
Quote: "[edit] Paul - I THINK he means a FIFO to actually fire off the SQL commands... like send a bunch of info, that doesn't matter when it needs to get saved... then firing off the transactions based on CPU usage"


Quote: "APEX - jason got my idea. I dont sent sql from client to server, but sending information from client to server. The server will then use this data to sent to ram. Then other clients can use this data without using db"


Ahh I see what you're getting at now. I agree in part that some kind of caching or FIFO that manages transaction requests from a client, could be beneficial, but of course you'd need to some how manage only transactions that would committ to the database without too much concern on the data being called by other clients. I.e, cummulative counters and such which are managed by the DB. I.e if you're managing experience points for that client, other clients are not necessarily going to need this information by the second because they'd only call upon client experience points during attack sequences. Group attack management etc.

I think that some very clever database designs need to be employed, and some major thought in how and what needs to be stored instantly, or what can be delayed per client requests etc.

Nice ideas there though. Good stuff!

Paul.

jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 5th Jan 2008 22:51
MS SQL Server should be fine - but I'd consider writing your own "server" from scratch for this! Also, weigh the "To ODBC or Not To ODBC" question. I haven't coded that low level for MS SQL so I don't know - I'd suspect they have a native API - I always used MSSQL via ODBC because I work Microsoft Shops by day and DirectX/DarkGDK/Linux/FreePAscal/C++ at night.

Niels Henriksen
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 6th Jan 2008 00:16
Jason - like me.. Im working (in a new job in www.wmdata.se) as consultant to pay my bills... in the evenings (my wife dont allow me to "play" at night) Im working on my game...

Niels Henriksen
Working on a (MMO)RPG right now in LightEngine
http://noggs.netopcom.dk/forum/default.asp - Forum for the game
tempicek
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: Prague
Posted: 6th Jan 2008 17:43
Just a side question - what sort of game project are you working on where the usage of database makes sense? I wouldn't be so curious if you weren't using GDK for it
Niels Henriksen
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 6th Jan 2008 20:49
tempicek - Im working on a MMORPG (well.. in the beginning it will be a RPG ... And Im planning beta release 1.1.2009

Niels Henriksen
Working on a (MMO)RPG right now in LightEngine
http://noggs.netopcom.dk/forum/default.asp - Forum for the game
tempicek
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: Prague
Posted: 6th Jan 2008 22:58 Edited at: 6th Jan 2008 22:59
Huh, that's a great vision But what has GDK to do with it then? I guess when you want to do some big stuff, you don't want to end up with a crappy backend (client-side), do you? What's your target anyway?

EDIT: I should probably rather send a private message than flooding this thread. Sorry for that. You can answer by email, I'm pretty curious...
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 7th Jan 2008 00:29
I'm surprised you say what you do sometimes TempIceK... I'm pretty happy over all with GDK

Niels Henriksen
20
Years of Service
User Offline
Joined: 27th Sep 2004
Location: Behind you breathing heavely
Posted: 7th Jan 2008 09:45
tempicek - GDK.NET is perfect in making a game in that size. By using .NET for the game I can use already developed code for connection to a server. The server software will be created in .NET and it will store data in RAM and DB.

So GDK will be used on the client and the client only and just for the visual view.

Niels Henriksen
Working on a (MMO)RPG right now in LightEngine
http://noggs.netopcom.dk/forum/default.asp - Forum for the game
tempicek
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: Prague
Posted: 7th Jan 2008 12:29
To be continued in mail...
SoulMan
21
Years of Service
User Offline
Joined: 22nd Nov 2002
Location: In a house somewhere on the planet earth
Posted: 7th Jan 2008 18:27
Anyway, I do thank those for providing some information to me.
Just to start out, I've built my Linux box that I will be using. For the moment it will hold the Linux Server/MySQL Database.

To start I will be writing a simple GDK APP that will connect to the server. GDK will send a message to the server which the server will take, Query the Database and then return the results to the GDK Application. I want to see how fast it is.
That will be the first part of the application.

No Kittah, this is my potpie!!!
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 7th Jan 2008 18:37 Edited at: 7th Jan 2008 18:39
cool. make sure you test over varying durations and numbers of calls to the db, since its common for first calls to take longer to return than other successive calls. A way around that is to put in a bogus call when your app back at the end user side is first starting (maybe in a thread during a splash screen or whatever), so you get that first connection/call taken care of and out of the way. Or it can be used as a db connectivity test at start, to know if the client app should even proceed, thus killing 2 birds with one stone. just a thought.

My DBP plugins page is now hosted [href]here[/href]
SoulMan
21
Years of Service
User Offline
Joined: 22nd Nov 2002
Location: In a house somewhere on the planet earth
Posted: 7th Jan 2008 18:54
That is something I will keep in mind. Technically the Server will be the first to connect to the database so I could use some sort of connection validation to ensure that not only did the Server connect to the database but it was able to query the needed tables for it and get a result back.

No Kittah, this is my potpie!!!
CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 7th Jan 2008 19:14


My DBP plugins page is now hosted [href]here[/href]
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 8th Jan 2008 17:36
@Cattle Rustler & @SoulMan - I've noticed the first calls are a bit laggy sometimes and subsequent stuff goes faster - but I found that typically - the initial LOGIN username/password is the one that suffers... also the first call to a given table SOMETIME SEEMS to have a similiar lag - but I can't recreate this so it doesn't have merit like the INITIAL call lag seems to be pretty consitant.

@SoulMan - I think you'll find MySQL to be very fast and will perform very well in your linux environment.

In your last post - you mentioned table verification stuff.... I have self tests like that in my code - when I fire up my Web Server - It literally (overkill) checks for the existance of every table I expect there. I also have been known to keep a table, with one column or more , one row - with statistical information that verifies things - like last Start, Last Stop, Server IP, Ran as Login Name, DateTime Start, DateTime End, etc.

One could use this kind of info to prevent "oops - was using wrong copy of database" self checking if they wanted to - probably over kill... but... I also keep a table with log information - not for each query - but for each server start date/time, stop date/time(crashed or proper shut down), query counts, etc. You could break this down into aggregates or keep a row for everything - can be alot of data admittedly but can also tell alot about your server usage... Note - much of this is handled in MySQL - from the Database point of view - but you might want this info from your "GameServer's" point of view.

And nothing replaces a good text file log - for errors, warning, info etc... debug info ... because if you can't save it in the DB - you got to put it somewhere you can look at it later!

CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 8th Jan 2008 18:11
I was speaking in general terms of the "first call to db" being laggy, regardless of if that call is to perform some login, or to just transact some data, regardless of the underlying process or reason. Its just a general trend I have noticed over the years with various systems/platforms. It probably has to do with setting that initial db connection being established in memory, and whatever else that entails behind the scenes (pooling etc). After that, whether youre using a connected or disconnected model to talk to the db, the successive calls for that same connection will be faster - as a general observation only.

a good example is posting on this site. first post takes longer than all others that follow in the session. at least in my experience.

My DBP plugins page is now hosted [href]here[/href]
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 8th Jan 2008 19:07
I TOTALLY agree with you - and that's what I was saying too - though maybe I worded it badly.

I definately notice the same lag you are describing... and all I meant was usually the initial "login" (as usually that is the first thing one does - is a system login query username/password hash) or something - is the one you notice this with.

I also agree it doesn't matter WHAT you do first - just whatever you do first - that initial call - does take longer - for reasons like you described

Sorry - I'm not always good at getting my thoughts across the way I mean to.

CattleRustler
Retired Moderator
21
Years of Service
User Offline
Joined: 8th Aug 2003
Location: case modding at overclock.net
Posted: 8th Jan 2008 23:07
nah, no worries. I know we are all on the same page. Im barely clear when I post. And I am barely coherent atm, with a cold.

My DBP plugins page is now hosted [href]here[/href]

Login to post a reply

Server time is: 2024-11-19 23:18:15
Your offset time is: 2024-11-19 23:18:15