• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Combining Strings

Neptune

Member
Is it proper to combine strings like this:

string1 = "7";
string2 = "3";
string3 = "8";
string4 = "7";

new_string = string(string1)+string(string2)+string(string3)+string(string4);

So new_string = "7387";

Also is it safe to assume that a .ini file containing one string can be written/read in 1 step of the game without a hiccup?

Any information is appreciated :)
Thanks
 

jo-thijs

Member
Yup and yup.

Though, if you know stringX is a string, you don't need to convert them to a string again by using string(...).

Whether a hiccup would occur depends on how heavy the operations are that you perform and how frequently you perform them.
Usually, you won't get a hiccup though.
 

Mike

nobody important
GMC Elder
Also is it safe to assume that a .ini file containing one string can be written/read in 1 step of the game without a hiccup?
Nope. You have no idea how fast a users machine is, how fast the HD is, how fragmented it is, if it has errors, if your saving to a USB drive, network drive, if the OS is busy with things.....etc,

Basically, reading/writing files is a slow process, and while PCs are incredibly quick these days - especially with SSDs, you just don't know. You should think of all file access as though it was going to TAPE recorder! If it finishes quickly, great, if it doesn't then you were expecting it to be bad anyway.

This forces you to think about where your saving; where there is a "lull" in gameplay, or waiting for a user selection. A natural pause is a good time to do something that "might" stall the game.
 
Top