• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Generating strings and performance

Status
Not open for further replies.
Level 15
Joined
Aug 7, 2013
Messages
1,338
Hi,

I dug up this old post: http://www.hiveworkshop.com/forums/world-editor-help-zone-98/what-how-do-strings-leak-241093/

I would just like confirmation of how many new strings it would take to notice a performance effect on the game.

I'm going to have a multiboard that is constantly updated, and also a way for players to view the stats of their heroes in a text based format (requires a string). The heroes' stats are volatile and change as they level up.

Would I run into any trouble with this?
 
In practical cases, it is insignificant. If you want to conserve memory, you should generally try to limit how much precision you have. For example, there are some maps that'll add an elapsed timer and update it every few milliseconds (which is rather useless). Instead, you could just update it by seconds, or by 10th's of a second (that would still be fine).

Wc3 can handle quite a bit of memory load. Just make sure your strings aren't super long, and you should read up on the string documentation (in that thread) if you are interested in how strings are generated in the table. For example, you wouldn't want to write an incredibly long paragraph and then append something to it constantly, because it would keep entering new strings (the paragraph with the appended string) into the table, which can take up quite a few bytes. Design around that.
 
Status
Not open for further replies.
Top