I’m not sure if it’s a good idea to store multiple parameters with each block. That would cause a lot of overhead while storing the data. if you have 10 Million blocks, I assume that the parameters of most of the block which are equal have the same parameter, except they have been modified by the user.
Multidimensional? You’re always free to define a “multidimensional data model” in any database. That’s up to you and not the job of the database.
What’s the use of “big” chunks? Keep your chunks not to big. I had chunks of a size of 15x256x15 and ran into problems when I wanted to transfer them via Spidermonkey from server to client. The size exceeded 32KB (which is a spidermonkey limit) and that even if I used only 1 single byte for each block (no extra parameters as you plan).
But taking this aside: I do not believe that da database is a good deal. I plan to store my data on the filesystem in a directory structure that represents the dimensions of the world. Why would you use a database? A db is good for complex data models, and the chunks of a world are not complex in any way. The total oposite is the case: you should keep this structure as easy as possible.
Why specifically use a database engine, is it just for the convenience of a DSL for query?
Why not just store them directly to a file somewhere and then load them, you could split it so each chunk is in a separate file if need be. How much data are you looking at per chunk/block? How do you intend to query the database for these blocks/chunks?
I can suggest a whole load of databases but without knowing how you are going to query on them it’s all the same, pretty much useless advice
I’m not sure if it’s a good idea to store multiple parameters with each block. That would cause a lot of overhead while storing the data. if you have 10 Million blocks, I assume that the parameters of most of the block which are equal have the same parameter, except they have been modified by the user.[/QUOTE]
You assume wrong. Strategy game. For example every block that resource (iron, silver) will be mined instead of destroyed, thus will have a random quantity of that resource.
[quote=“Andreas_Heidt_Altwei, post:2, topic:33520, full:true”]
Multidimensional? You’re always free to define a “multidimensional data model” in any database. That’s up to you and not the job of the database.[/QUOTE]
Normally I would agree with You but DB’s are the part od programming world that I hate with true hatred, not to mention they bore me to death. So there is no way in this lifetime I’m going to do DB custom works. Ready to use out-of-the-box solution is the only option for me.
What’s the use of “big” chunks? Keep your chunks not to big. I had chunks of a size of 15x256x15 and ran into problems when I wanted to transfer them via Spidermonkey from server to client. The size exceeded 32KB (which is a spidermonkey limit) and that even if I used only 1 single byte for each block (no extra parameters as you plan).[/QUOTE]
No server, no client. 100% single player game. As for “bug chunks” what I meant was something around 100*100 grid of blocks (but mention every blocks having several parameters).
Again, strategy game. Events that change my “world” will happen as often out of the screen as they do on screen. So I need a way to query for specific blocks very fast and everywhere in my “world”. Not to mention I believe that having (for example) filesystem of several dozen CSV files, each with very small chunk stored, would be too optimal for Android device.
Okay. But even in this case you would have the chance to calculate the amount of the ressource in a block. I can see no reason to save this data, until it is really modified by the player. E.g. you set a random amount of silver for block X. If you use the same seed for your random number generator it should always produce the same amount of silver if you always use the same element of the random sequence. In that case you would only have to save the seed for the random generator. Only and really ONLY if the user has changed the amount of the ressource in the block you would have to save a delta value.
We have something in common. I really hate that db stuff, too, especially while I have to do this boring stuff at ma job. But do not misunderstand me. I don’t mean that you have to customize th database. But a database is a database. The datamodel has to be written by YOU. And I do not believe that there is a solution with a ready defined datamodel that fits your need.
Just therefore I would prefer not using a database. Or if you use on, you really have to convert your object oriented data model in some kind of SQL model (or whatever db you’re using - even if you use an object oriented db, you would have to make modifications and grapple with the database)
Hmm … I could argue here, but that would make so sense, doesn’t it? To be honest: I do not have enough information about your design that I could argue without presuming things that might b true (or even not). And: for Android I’m really out. I do not have enough knowlodge about this, but again I’d consider that 10 Million blocks with each block having several parameters will need to have at least(!) 10 MB if you only have 1 paramter per block that is of the type byte. How much parameters are you going to hold? Have you already pre-calculated the final size of you’re data structure and if this is suitable for your games target device?
Random seed sounds fine (I actually love the idea), thanks. But still even if I just link my db info to random seed instead of storing actual numbers, resources will be all revealed sooner or later (AI will mine too, so most likely sooner).
In the beginning I was aiming at object oriented database in which case all I have to do is prepare my object classes (schema-like-thingy that is the actual datamodel in object DB’s) which would all be pure java. That’s why I love OrientDB so much. And I’ll probably stick with those in the end, but still it kills my aim at Android Devices. That’s why I look for alternatives.
Btw. as far as documentation goes OrientDB (and NoSQL fast databases in general) are able to withstand thousands of queries at the same time, so there shouldn’t be much problem with performance.
I didnt use databases for games yet, but when I start to use, I will just write my own database.
It may sounds crazy, but you guys would be surprised on how easy is to build and simple dedicated database engine inside your game, like save the data serialized in the file and load registers by indexes, its very very fast, and reliable.