• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Generating strings and performance

Status
Not open for further replies.
Level 15
Joined
Aug 7, 2013
Messages
1,337
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