Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411281 Posts in 69324 Topics- by 58380 Members - Latest Member: bob1029

March 28, 2024, 10:17:21 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)How to store/save datas in a big editor?
Pages: [1]
Print
Author Topic: How to store/save datas in a big editor?  (Read 1820 times)
Apprauuuu
Level 0
**



View Profile
« on: August 16, 2008, 12:42:23 AM »

Hi!!
First of all sorry for my bad english...
I'm currently working on a project like the RPG-Maker added with online features.
You can usw the maker to create Items, Spells, NPC's just by clicking (or with the help of LUA)...
I'm working with C#.
Now to my question. Currently I'm saving all the data per BinaryWriter in particular files so each spell has an own file. During the program runs there aren't any items in the memory space so the items just load if it is selected to edit.
But this method is a bit stressful to write each single int, string etc. with the BinaryWriter so is there a better way for such a maker? Should I use XML + Serializazion or better a database? There will be a second program which is the client (the game itself) which need to read all the data again.
Now a second question. Is it better to load the objects just then I need to edit it or to load all the items at the program start? There would be some advantages because some sort of objects can have dependancies (e.g. NPC's can drop Items). At the moment I have to save each names of the Objects in a name list to make for example the items for the NPC selectable. So which method is better? Would it be use too much memory to load ALL the content (except the maps)??.
How do you think they managed it all at the rpgmaker??

I hope someone understand my problem and can help me  Smiley

mfg Apprauuuu
Logged
synapse
Level 1
*



View Profile
« Reply #1 on: August 16, 2008, 08:14:37 AM »

You probably don't need to get fancy with memory management for things like item and spell data.  You can figure out how much memory all of this would take up.  If an item has like 16parameters * 4 bytes per parameter, you could fit 16,000+ item definitions in 1mb of memory.  I'd say store it all in one file unless you have a really good reason to do otherwise.
Logged
Apprauuuu
Level 0
**



View Profile
« Reply #2 on: August 17, 2008, 05:02:01 AM »

Ok thx!
I will store all datas in the memory
You are completely right
Logged
Zaknafein
Level 4
****



View Profile WWW
« Reply #3 on: August 17, 2008, 06:15:22 AM »

I highly suggest looking into some sort of serialization, it'll save you so much time... but it can be binary serialization too, not just XML.
Though XML is good to have because you can read the output files in clear-text and it's much easier to debug or make changes. Also XML is inherently more tolerant to versioning than usual binary formats because you can skip elements that don't mean anything to you.
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic