[Demo] A Database plugin for 3dgs!!

Posted By: Sinthoras

[Demo] A Database plugin for 3dgs!! - 10/04/06 17:58

Hello there!

After a developement time of nearly two years, I finally finished my work.
A database plugin for 3dgs, without implementation of mySQL or something else.

My first version was based on text files, but I soon recognized that the speed is not acceptable.
30 seconds for a data amount of 1000 strings (ten chars) is way too much

Therefore, I tried a version based on the heap memory - the speed increased for about 10 000 times.
I think the current speed is acceptable now.

The database works a bit different than others, for example
- no script language, all is based on functions (but you could implement a language, of course.. )
- no front end (means no predefined columns, every row can imply different data types)
- no query tables (resulting out of the first and the second example)

Features
  • save / load all your data in/from only one file!
  • multithreaded save/load functions, the engine can run while your database is stored!
  • organize your data in tables!
  • name your tables as you like!
  • store as many variables/strings/vectors needed in only one row!


advanced dll Features (full version)
  • create as much databases as you like (via dll)!
  • complete source code provided!


I have uploaded a demo version in the Webshop
The full version is not available at the moment.
I have to write a bit more documentation for it, means it will take some days to its release.

Try it, and feel free to comment, report bugs or send new innovations by mail, post or PM.
A documentation for the dll is included in the download.

Regards,
Sinthoras
Posted By: Orange Brat

Re: A Database plugin for 3dgs!! - 10/04/06 18:40

Thanks. I have a dialogue heavy project with a subtitles option, so this should make life easier.
Posted By: sheefo

Re: A Database plugin for 3dgs!! - 10/04/06 19:09

Wow, I needed a non-SQL database and have been searching for ages. Now that I found one I don't know what to do

Good job, you do a lot of great work Sinthoras.
Posted By: darkstein

Re: A Database plugin for 3dgs!! - 10/04/06 19:12

what version of 3dgs do you need for this?
Posted By: Sinthoras

Re: A Database plugin for 3dgs!! - 10/04/06 19:17

@Orange Bratt and sheefo:
Thank you, I hope you can enjoy my work.

@darkstein:
Well, I think the Standard Version 6.4 is enough. You can use plugins there, too, and no special feature of higher versions is recommended.
Posted By: EpsiloN

Re: [Demo] A Database plugin for 3dgs!! - 10/04/06 20:12

Sounds good , but what is the max number of chars for a cell ?
Posted By: Sinthoras

Re: [Demo] A Database plugin for 3dgs!! - 10/04/06 20:24

What do you mean with 'for a cell'?

I tried storing a 50kilobyte string (~50000 chars) at position 1,1 of a table - no errors, I could save, load and change it.

[in addition]
I already tried saving a 16 mb table in a file, with around 10000 strings in it. This lasted quite long, means around 20 seconds (without threading the save function the engine stops for that time!!). You shouldn't save that many data in only one table, not because of save / load time but for access speed matters.
It is definately better to create a small amount of big strings and store it to quite little positions than create hundreds of thousand small strings.

Posted By: HeelX

Re: [Demo] A Database plugin for 3dgs!! - 10/04/06 22:12

Is it limited on strings, chars and numbers (floats/int) or can it also save as container format for other data types? Tell more about encryption possibilities.
Posted By: Sinthoras

Re: [Demo] A Database plugin for 3dgs!! - 10/05/06 19:25

Well - if you own the source code, you can store any data type possible. You just have to reserve memory (with a special dll function) and copy your data there.
The functional structure in c++ is nearly the same as in c-script.

The demo version (without source) is limited to 4*4 = 16 data cells per (3 possible) tables.
[important!]
The limitations of the demo version are 1-4 cells per row / column, not 1-5 as written in the README.
I regret this, thought it was more..

You can store one variable, one vector or one (unlimited) string in each of these cells.
In c-script, of course.

The full version is not limited in cells per table, and also not in tables per database.

Encryption is not implemented yet, because its hard to find a way to crypt all possible byte structures. If you have a good solution, just say it. (Or wait for the full version and implement it yourself )
Posted By: D3D

Re: [Demo] A Database plugin for 3dgs!! - 10/09/06 13:52

Quote:

Encryption is not implemented yet




Would be nice to have a strong encryption method, although MD5 and SHA are not completely safe, it is always more secure then saving plain text passwords in the database.

Dusty
Posted By: Inestical

Re: [Demo] A Database plugin for 3dgs!! - 10/09/06 17:14

I think it has to be reversable? I'm thinking about one, but it'd only be too simple.. well.. nobody is perfect.. I ain't implementing it but I can tell you how it works?
Posted By: Sinthoras

Re: [Demo] A Database plugin for 3dgs!! - 10/09/06 19:31

MD5 is possible, I could implement it as a separate function. You can call it whenever you like to crypt a string.

As Inestical said - this method is not reversible.
@Inestical (and at all others): Whenever you've got an idea about improving something in the dll - just tell me!

Furthermore, I have written a short explanation for full version features > Link <.
Especially the new possibilities with the source code are very interesting.
I will release this version soon.

Regards
Sinthoras

PS: anyone had success with the demo version? I could upload a few examples, if you want them..

[EDIT] MD5 is implemented now (full version)! You just have to call
Code:
STRING* _md5(string) or
STRING* _md5File(filename)

and the hash is returned.
Posted By: Inestical

Re: [Demo] A Database plugin for 3dgs!! - 10/10/06 08:13

here is the basic algoritm for encrytping the password:

convert characters to integer
convert integers to hexadecimal
take the first character, add 2 to it and move it to a new array
take the third character, add 4 to it and move it to the other array
take the fifth character, add 6 to it and move it to the other array
..when reached to the end, there is still chars left:
take the first character, add 2 to it and move it to the other array
take the second character, add 5 to it and move it to the other array
take the third character, add 8 to it and move it to the other array

then reverse the new array and convert to string

I think it should keep the pass at least somehow undetectable

ps. you can also add some random integers to the end of the new array to make it bigger
ps2. characters can be 0-255 so if the number reaches to the 255, it should continue from 0
Posted By: D3D

Re: [Demo] A Database plugin for 3dgs!! - 10/10/06 14:14

Didn't have time to download the demo yet. But, i'm going to try now. My plan is to use MySQL for the database. However, for future projects the SpeedList plugin should be very useful too. Examples are always welcome

Dusty
Posted By: Sinthoras

Re: [Demo] A Database plugin for 3dgs!! - 10/10/06 14:24

Thanks for posting it!
But there are still some things left to think about:
- if I implement exactly this version, everyone can write a reverse-data-dll and read out the string again (thats not your fault, its the same with all 'known' crypting code)
- the speed to convert / reverse the data is decreased heavily, means saving a file lasts about three times longer
- if I convert the new array to a string and there are some \0 characters in, the string stops at this point (assuming I'll take strcpy or strcat)

However, good idea to start with

@dusts:
thanks for trying it, please post your feedback here, if you like
Posted By: Inestical

Re: [Demo] A Database plugin for 3dgs!! - 10/11/06 08:18

sinthoras: of course, you won't use exact that, but it was just a suggestion afterall
Posted By: Sinthoras

Re: [Demo] A Database plugin for 3dgs!! - 10/11/06 17:46

don't worry I will implement your encryption mode if I have the time.
At the moment, my Network.dll (working with this Database plugin!) has higher priority.

I wrote a small chat program demonstrating some of the Databases features (demo)
Chat program

It is not a 'real' chat, you only write text and it is drawn on the screen.
The difference to normal GameStudio-Projects:
your text remains on the screen, also if you restart the engine.

[additional example]
TestDummy wrote a plugin, the eLL alpha 0.01 dll. (also shown in this forum)
You can organize your entities in the Database in the same way as it is done there, you even can store
additional information about them in the next cells.

© 2024 lite-C Forums