DS Grids or File Processing for in game databases

Ggbah

Member
I've been thinking about this for some time now, and I would like your inputs and perspectives.

I was thinking, at the start of the game.. creating a DS grid which acts as a spreadsheet for items in game containing the pertinent and full list of all items per category.

Individual instances of chests/dropped items would then use this DS grid to populate its fields upon instantiation. (to then be passed on to the players individual inventory grid but that isnt relevant atm )

I want to know if it would be better to have the full item database be a file (ini or something) rather than a DS grid which would take up ram throughout the game. Or if DS grids are pretty much my best option.

the DS grid containing all data of items in game would probably be between 500-1000x20-30 cells, (10000-30000 individual cells) @ 8 bytes it could be 80kb-240kb of memory (just to keep the inventory list open and active)

I could always destroy it after pulling the items data, but each time I interact with item generating objects it would have to recreate the full item data list which would be a lot of processing.

Please provide sage wisdom,

Thank you,
 

jo-thijs

Member
I've been thinking about this for some time now, and I would like your inputs and perspectives.

I was thinking, at the start of the game.. creating a DS grid which acts as a spreadsheet for items in game containing the pertinent and full list of all items per category.

Individual instances of chests/dropped items would then use this DS grid to populate its fields upon instantiation. (to then be passed on to the players individual inventory grid but that isnt relevant atm )

I want to know if it would be better to have the full item database be a file (ini or something) rather than a DS grid which would take up ram throughout the game. Or if DS grids are pretty much my best option.

the DS grid containing all data of items in game would probably be between 500-1000x20-30 cells, (10000-30000 individual cells) @ 8 bytes it could be 80kb-240kb of memory (just to keep the inventory list open and active)

I could always destroy it after pulling the items data, but each time I interact with item generating objects it would have to recreate the full item data list which would be a lot of processing.

Please provide sage wisdom,

Thank you,
I would personally go for the ds_grid, just because having the data in a separate ini file feels like it'd make cheating too easy.
240kb of RAM doesn't sound too bad yet either.

I don't see why you would need to recreate the full grid every time though.
Don't you just have to recreate the part required for generating the new object?
 

Ggbah

Member
Don't you just have to recreate the part required for generating the new object?
Right.. If i were to keep it as a DS grid I could just leave it open as a reference, and not have to worry about recreating, since 240kb isnt that large anyways.
 

Hyomoto

Member
Answer: yes. Memory is fast, and you have a lot of it. Graphics and sound will almost assuredly outweigh your in-game variables. Modern games often take up only a few hundred megabytes, while their resources consume gigabytes.
 
Top