Posted By
|
Message
|
tetsuya_shino
Registered 12/08/2004
Points 491
|
29th March, 2012 at 29/03/2012 06:19:15 -
Greetings. After wasting an absurd about of time trying to create an rpg while only using tgf's default 16 global values, I finally broke down and learned how to use an ini. (Yeah go ahead and laugh.) Anyways, ini are great. Not only can I have more then 16 values, but I can save and load. It's perfect for that I plan to do. So I am that more pumped up to work on my game.
I currently have a title screen that can load, save, and erase 40 different values. I have 3 different save slots each using their own ini. Everything is going great, but I wonder if there is anything I need to look out for. I have 40 different counters on this opening screen to test if the inis are working correctly. So far so good.
I'm sure using the ini I could store a million values, but I am mindful of tgf's 256 object limit, which I am sure applies to counters. I want to add more values, but I want to be able to test all the values at once. (In other words, I could store 300 different values in an ini, but because I couldn't have 300 counters on screen at once, I can't do that.)
I guess what I am asking is what is a good number to stop at? I have been avoiding putting too much code in one event.
(For example, I don't use a single 'start of level' event, but rather about 5 or 6 of them.) I also have a few 'when pressing the [a] key..' events... where I have a couple events that activate when the same key is pressed.
Basicly, I want to add as many values as I can, without risking the game becoming unstable. Since it's an rpg, a single value failing to load (or save) could ruin the whole game. Any ini advice would be welcome.
Edited by tetsuya_shino
n/a
|
Jon Lambert Administrator
Vaporware Master
Registered 19/12/2004
Points 8235
|
29th March, 2012 at 29/03/2012 06:31:23 -
I'm not sure I understand your reasoning behind not using more values than you can have objects. INIs are just text. Having one loaded up isn't nearly as strenuous as having 256 counters because the app isn't constantly monitoring each and every value, and just parses the file when you ask for a value or change a value. You could go ahead and throw in 1000 values and you'd be fine. You could open the INI in Notepad++ or something and monitor it that way (because Notepadd++ asks you if you want to reload an open file every time it is updated), if you really need proof that it works.
Sandwich Time!Whoo!
JoyCheck & KeyCheck Widgets
For easy implementation of customizable joystick and keyboard controls.
http://www.create-games.com/download.asp?id=8364
|
tetsuya_shino
Registered 12/08/2004
Points 491
|
29th March, 2012 at 29/03/2012 06:46:39 -
For testing purposes, I'd like to test all the values used at once in the title screen (which adds more like a debug screen for now.) In actual gameplay, you're right, I don't need to display all the counters and info at once. But for this opening level, I want to limit the total about of values used to those I can test/display at once. So for example, an ini can store 200 values easy. And 200 counters is under the 256 object limit. But has anyone loaded 200 values stored in an ini and loaded them into 200 different counters?
I guess I could just keep adding values and counters until tgf crashes or bugs out. But if anyone has already successfully dealt with loading and saving a large number of values to and fram an ini in tgf already.. I'd be a little worried about it.
n/a
|
Chris Burrows
Registered 14/09/2002
Points 2396
|
29th March, 2012 at 29/03/2012 07:14:17 -
I'm not sure if anybody has ever loaded 200 values from an ini file into counters before. It is possible and very easy to do, I just don't see why anybody would ever want to do it.
If you want to see your ini working you can simply run a loop to retrieve the data and then display it in a string or edit box or wherever you want. If you are using the Ini++ object, there is an option to retrieve the entire contents as a string. This way you can display thousands of values in a single object.
n/a
|
tetsuya_shino
Registered 12/08/2004
Points 491
|
29th March, 2012 at 29/03/2012 07:31:25 -
No, I'm using the normal ini object.
So I guess the point is, it's silly to create a ton of counters if I am only using them for purposes.
The reason I wanted to even show all this data at once was I wanted to show the stats of 12 different characters at once.
As a way of reminding the player which save file they used last. But now that I think about it, just showing their exp levels should be enough, that and the players last location.
Anywaysm thanks for your replies you two.
n/a
|
Alonso Martin
Registered 29/12/2010
Points 294
|
29th March, 2012 at 29/03/2012 12:48:30 -
Keep in mind that a normal ini file has a 128kb file-size limit (or something close to it). If you want ini files that are bigger than that, use the INI++ object, albeit unavailable for TGF.
Alternatively, you could use an array instead of an ini, which is not limited to that file-size. Why haven't you upgraded to MMF2?
Edited by Alonso Martin
www.hfalicia.com
www.alonsomartin.mx
|
Hagar Administrator
Old klik fart
Registered 20/02/2002
Points 1692
|
29th March, 2012 at 29/03/2012 14:25:30 -
I thought INI in TGF1 was limited to 2k ? (2k seems to ring a bell).
I seem to remember there being better extensions for writing/reading from files though. Also I seem to remember using a 1000 global value extension for TGF. Maybe worth looking around on extension sites if any exist for TGF1 still.
n/a
|
nim
Registered 17/05/2002
Points 7234
|
29th March, 2012 at 29/03/2012 15:55:27 -
Originally Posted by tetsuya_shino Any ini advice would be welcome.
One thing to make sure of is that you're using a relative path to the ini. eg. Apppath$ + "/data.ini"
//
|
nivram
Registered 20/07/2006
Points 171
|
29th March, 2012 at 29/03/2012 16:15:27 -
The INI limit is 64k.Take a look at the Technical Manual on my site. It is under Limitations.
Marv
458 MMF2 & CTF 2.5 examples and games
http://www.castles-of-britain.com/mmf2examples.htm
|
The_Antisony At least I'm not Circy
Registered 01/07/2002
Points 1341
|
30th March, 2012 at 30/03/2012 17:30:38 -
Nevermind. I found a nifty solution for MMF2, then noticed the OP is using TGF.
Edited by The_Antisony
ChrisD> Employer: Say, wanna see a magic trick?
ChrisD> Employee: Uhh… sure, boss.
ChrisD> Employer: Your job! It just disappeared! Pack your things and leave! Pretty good trick, huh?
|
|
|