Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 04:12

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



About .ini or flatfile database

Discussion on About .ini or flatfile database within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
12tails's Avatar
 
elite*gold: 0
Join Date: Apr 2009
Posts: 782
Received Thanks: 458
About .ini or flatfile database

yo...

is there any issue with a .ini/flatfile database??
12tails is offline  
Old 05/17/2011, 20:59   #2
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,379
If done correctly then there's no reason a flatfile couldn't work just fine... but the real question to ask yourself is this..


1: Which is easier

2: Which is faster


The answer to both of those questions will 99 pct of the time be sql. The fact of the matter is. If flat file was 'better' then sql and other database systems would never have been invented.

Yes, sql could be slightly slower depending on how you use it and could pose issues... but again those only really pose an issue if you are using it incorrectly... and guess what! You face the exact same pitfalls using a flatfile database and give up all the advantages that sql brings such as lovely queries.


There are plenty of people who enjoy working with flatfile and when it comes right down to it, there's nothing 'wrong' with that... but I think anyone who looks into it very much will come to a conclusion that when used correctly and as intended a proper db system will outperform a simple binary/stream file when it comes to any serious data storage.


Now if you're dealing with static resources such as a magictype/itemtype or w/e there's much less encouragement to go with a db system other then the possibility of just using a linq type query to pull from db on use rather than storing the entire file structure in memory... In this case though I'm talking about say a character or item db that is crucial and is modified often.
pro4never is offline  
Thanks
1 User
Old 05/17/2011, 21:47   #3
 
12tails's Avatar
 
elite*gold: 0
Join Date: Apr 2009
Posts: 782
Received Thanks: 458
Ic...
Thanks for your advice pro ^^
12tails is offline  
Old 05/17/2011, 22:51   #4


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
This is well documented really i've been over it loads of times >_>"
Korvacs is offline  
Thanks
1 User
Old 05/18/2011, 03:41   #5
 
InfamousNoone's Avatar
 
elite*gold: 20
Join Date: Jan 2008
Posts: 2,012
Received Thanks: 2,885
Lets put it like this. The same reason .NET's "SuspendThread" method is deprecated is the same reason SQL was invented. It's more user-friendly and harder to make mistakes with.

People developing API have to assume their end users are mediocre programmers.
InfamousNoone is offline  
Old 05/18/2011, 15:28   #6
 
unknownone's Avatar
 
elite*gold: 20
Join Date: Jun 2005
Posts: 1,013
Received Thanks: 381
Performance, ease of use, preventing you from doing things wrong, etc. are all pretty valid reasons for using a DBMS, but there's a more fundamental reason you'd use one in the first place.

When you're trying to solve a problem, you should first try and specify what the domain of the problem is. In this case, it's quite obvious: our problem is that we want to implement a game server to emulate the functionality of official conquer servers so we can use the existing client more freely.

More specifically, the main problem is that of implementing the logic of a virtual world, specifying how virtual entities interact with eachother, blah, blah. In this problem domain, there is no mention of storage, because it isn't part of the problem. Storage is only one particular means of implementing the solution to the problem. We really need to consider storage to be it's own domain, separate from the domain of the game logic.

In a similar sense, we know that we need to communicate with the game client over TCP, using a protocol the client understands. This is part of our overall problem of making the game server, but it isn't really part of the primary problem domain: the game logic. In fact, the game logic doesn't need to know anything about the communication being used, in the same way it doesn't need to know about the storage being used. So likewise, communications should be in their own domain.

You might isolate some other problem areas into their own domains too. In the end, your overall problem domain has become more managable by breaking it up into sections that you can work with in isolation. The main problem domain of implementing game logic doesn't need to have the confusion of storage and communications associated with it. If we use a diagram to visualize this, it'll look a little like this, where the size of each of the subdomains are relative to the problem size (and how much code we should be writing for them.)



This looks nice, but if we move onto the storage now, we can begin to consider how things will be stored. This could be quite simple if we just vomit our data onto the hard drive without any consideration as to whether the data we are writing is sensible, but the chances are that will come back to bite you later. In order to make sure that we are writing sensible data, we need to write sensible code to store it.

When it comes to writing that sensible code though, you soon find out that it is not simple, except for the most basic of data being stored. Whenever you are storing non-trivial data, there's a lot of boilerplate code you need to place to ensure you're doing things properly, efficiently and in a modular way, so we can make the most of the code. If we do this, and do it right, our overall problem now looks a bit like this:



The problem is quite clear isn't it? Our problem of "emulating a game server" has now become a problem of data storage. Our solution has been overtaken by something that wasn't even part of the original problem, and we are going to waste a lot of resources doing it this way.

So the reason we use a DBMS is so that we can focus on the domain of our problem, and not one of storage. The DBMS themselves are projects which focus on the domain of storage, and they do it very well - in an abstract way that is easily reusable from other applications. These DBMS systems have millions of lines of code to make sure they're doing things right, and doing them well - you could never hope to match them in a specific implementation of any non-trivial data.
Attached Images
File Type: jpg diag1.jpg (9.1 KB, 61 views)
File Type: jpg diag2.jpg (8.7 KB, 60 views)
unknownone is offline  
Thanks
3 Users
Reply


Similar Threads Similar Threads
Wanna Talk About 5165 FlatFile Sources
10/25/2011 - CO2 Private Server - 8 Replies
Hello, Every one say That NewestCo is a bad source, WHY cuz i'm working on a NewestCO source with impulse's sockets and i never got a problem 2nd Thing is : is there a good source (NON PVP) flatfile , cvoding style like Newesto Co, i mean if a coder who's not good in C#, but has a good exp with NewestCO can code it? and if some1 wanna talk about 5165 sources here, let's talk
[DEV] CoEmu v5156 flatfile based.
08/03/2010 - CO2 Private Server - 54 Replies
Hey, I've started since 2 days earlier working on converting conqueremu version 2 to patch 5156, as I do not like the source 'NewestCOServer'. So what's your opinion on this, should I release it or not? And on what basic features should I release it? What should I implement ? Do you like conqueremu yourself? Updated features list: Database; - Loading character



All times are GMT +1. The time now is 04:15.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.