How many Strings are too many?

Started by wynni2, Tue 31/01/2017 17:15:23

Previous topic - Next topic

wynni2

I realize this is a silly question, but I'm new at this and trying to get a better handle on the AGS engine:

I'm making a game that randomly selects descriptions of Hotspots/Characters from arrays of Strings.  On game start I have a series of commands that populate the arrays, and the game will probably need at least 1,000 descriptor Strings to play the way I want it to.

I know Strings are "large" relative to other data types, but I assume that they're still tiny relative to the memory pool in a modern PC.  Is it possible to get performance issues with all of those strings sitting in the memory? 

In my day job I work with some statistical software that has serious issues with file bloating and memory use when it tries to load text, which put this question in my mind. 

Danvzare

As long as you aren't in the 100,000 range, I'm sure it'll be fine.
Computers nowadays have an abundance of memory.

Crimson Wizard

#2
Big number of objects may seem scary until you actually calculate what amount of memory they may require.
Let's assume each string is 100 characters long, for 8-bit ANSI strings this in total gives 100.000 bytes for characters + some extra memory stored per dynamically created object. This in total won't be even 0.2 MB of RAM.

With modern PCs having gigabytes of RAM, such amount of memory won't be noticeable.

In fact, most of game memory is usually taken by media resources, such as hi-resolution sprites and quality audio.

PS. I am more concerned with how many dynamically-created objects AGS can have in scripts, because it has some unexpected limits sometimes, but I do not think 1000 of them would cause any trouble.

wynni2

Thanks, CW, that's what I assumed.  One of the fun things about this whole process has been looking into design approaches from the 8- and 16-bit eras, but doing that gives you a slightly different view of memory limits. 

Also, to be clearer, the actual number of objects/characters in the game is going to be much smaller than the number of descriptions available for them, so that the descriptions change with each playthrough.  The real area of concern is whether anyone will play the game more than once.  :wink:

Slasher

QuoteThe real area of concern is whether anyone will play the game more than once. 
Unless it's addictive or people found it very enjoyable enough to play again, I doubt it...but it is possible...

Hope it's one of these ;)

Danvzare

Quote from: wynni2 on Tue 31/01/2017 20:00:52
The real area of concern is whether anyone will play the game more than once.  :wink:
Just put in a choice at the start of the game which determines which one of two possible endings you can get. And point out at the end of the game that you could have gotten a different ending if you had made a different choice at that point. And there you go, you've just gotten half of your audience to play the game a second time.
It'll also annoy everyone, but hey, it'll work. 8-)

SMF spam blocked by CleanTalk