Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / DATA vs Arrays

Author
Message
Lucavi
19
Years of Service
User Offline
Joined: 28th Nov 2005
Location: England
Posted: 30th Nov 2005 00:23
I'm going to be storing the statistics such as Health, Status Ailments, Name etc for use in my game. As it is an RTS format, I will probably be needing alot of values to store. I have already derived a method to cut-down on system memory (my referencing generic stats specific to certain classes eg, warrior strength = 5, knight strength = 9), but I want to reserve as much as possible, to get the unit counts higher. So, would I need to be using DATA or Arrays to store the unit information? As in, which would be faster?
It seems that reading data requires mroe commands and might use more memory, yet Arrays have to be indexed etc to find the values I need. It's a tough one, so I put it to you
SimSmall
20
Years of Service
User Offline
Joined: 7th Aug 2004
Location: United Kingdom
Posted: 30th Nov 2005 00:48
for my FPS
Everything's stats
Health
Armour
Speed(for characters)
Health Damage(bullets/rockets)
Armour Damage(bullets/rockets)
character speech bank
Object type(player/pickup/weapon/critical object)

are stored in arrays...
Everything character-related stored in one
Damage related in another
and so on...
Just might be a large index... it'll help to write them down somewhere

...maybe one day I'll finish a project
TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 30th Nov 2005 04:36
It sounds like you might be confused with the term 'DATA'.

Data statements in your program are read in using the READ command - but they are read only so no use for what you want to do.

Your program also creates data which is stored in arrays that you can save out to disk so the next time the game is played, the player can load the data back in and carry on from where they left off.

Storing data in arrays is definitely the best way to go.

TDK_Man

Login to post a reply

Server time is: 2025-05-22 20:30:27
Your offset time is: 2025-05-22 20:30:27