Upward limit on imports into script header?

Started by bspeers, Sun 17/07/2005 18:34:47

Previous topic - Next topic

bspeers

I dunno if this is beginner or normal, but something tells me it may be in a part of the manual I just haven't found.  And I am just beginning this project after all.

Firstly, for those who may chide me for making a long game as my first AGS project, this is definately not my first project.

Now questions:

Is there an upward limit on imports into the script header before the game will start to slow down?

Reason being that I am working on an RPG and I have already set aside all 500 global ints for statistics (most of which will be invisible to the character, but are necessary for the skill/experience gaining systems for each of the characters)--in fact, I may theoretically need more than 500 stats.  On top of that, I will need several dozen other minor properties (I suppose these will be ints for the header) and then I will need more ints to store everything that changes in each room (such as treasures taken, characters whose diolog changes as the plot proceeds, etc).  I have calculated that I may be importing several hundred ints to the script header--is this going to be a problem, and if so, is there an easier way?

Also, I am going to have a group inventory which will allow characters to hold a maximum of 99 of each item, allowing for numerous potions, or extra helmets to sell, or what have you. I think I know how to script this (just to a check of number of items and an if statement/else, right?) but will this push the limits of the run-time?  Is there any problem with memory should a character have say, 99 of every item and say 300 different items?  This is unlikely to happen, even if I do get the game finished, as there will be many items of which there is only one, but I may as well find out now what hidden limits there are.  I have already abandoned a very long game before nearly 90% through because of AGS limits (that have since been increased, but then, it's a long story).
I also really liked my old signature.

RickJ

Quote
Is there an upward limit on imports into the script header before the game will start to slow down?
I don't know that there is a hard limit.  If there is it's quite high as I have never encountered it.   In any case it won't have any afect on game speed unless you consume too much memory, cpu, and/other other resources at run time.

Quote
Reason being that I am working on an RPG and I have already set aside all 500 global ints ... I may be importing several hundred ints to the script header--is this going to be a problem, and if so, is there an easier way?
If it were me I would make a script module to do this.  It's easier and cleaner.

Quote
Also, I am going to have a group inventory which will allow characters to hold a maximum of 99 of each item...
From what you describe it sounds like you are going to have 99 seperate inventory items for each article such as a helmet or whatever.    Each inventory item a character can carry is represented by an int variable which can be set to whatever value you wish.  See "Character.InventoryQuantity" in the manual. 



bspeers

Quote from: RickJ on Mon 18/07/2005 16:22:51
Quote
Is there an upward limit on imports into the script header before the game will start to slow down?
I don't know that there is a hard limit.  If there is it's quite high as I have never encountered it.   In any case it won't have any afect on game speed unless you consume too much memory, cpu, and/other other resources at run time.

Good, that pretty much answers it, thanks.

Quote
Quote
Reason being that I am working on an RPG and I have already set aside all 500 global ints ... I may be importing several hundred ints to the script header--is this going to be a problem, and if so, is there an easier way?
If it were me I would make a script module to do this.  It's easier and cleaner.


Well, I am terrible at complicated scripting (I can never remember even the simplest of commands, my help-file is always open), but I have looked into modules.  They're relatively new, I'm guessing? 

You seem to be suggesting here,however that modules would help me store stats, and that would be cleaner than global ints.  I can see how they would allow me to process stats, say in a battle system, or how they could allow me to adjust stats within the game, but I'd still be saving those stats to either globalints or my own declared variables, wouldn't I?  Presumably when it isn't something like a battle system that requires global functions, it shouldn't matter where I declare my variables, or am I wrong?

Thanks for your advice so far :), the more I glean from these forums the easier it will be :D.
Quote
Quote
Also, I am going to have a group inventory which will allow characters to hold a maximum of 99 of each item...
From what you describe it sounds like you are going to have 99 seperate inventory items for each article such as a helmet or whatever.    Each inventory item a character can carry is represented by an int variable which can be set to whatever value you wish.  See "Character.InventoryQuantity" in the manual. 


Thanks for the heads up.  I don't think I was quite clear enough about my question, I did know how to add in various quantities, I'm just used to character[blah].inv += stuff, not the object orientated way.  I was just asking if having say 99 quantity of a large number of inventory items would be a memory issue.  I definately did not know about character.inventoryQuantity in the new language, and I wouldn't have necessarily understood it's functionality for stores and things, if you hadn't pointed it out, thanks muchly.
I also really liked my old signature.

RickJ

The module you create would consist of a struct definition containing all the variables and or functions you will need for each character.   The result is a custom data type such as bsRpg that you would use to declare global variables for each character.   For example...

// Global Script
bsRpg  MainChar;
export MainChar;

// Scirpt Header
import bsRpg  MainChar;

// Any Script
MainChar.Health = 200;  // Assuming that a health variable
                                        // is defined in the bsRpg struct

MainChar.Attack(int CharId, int Weapon);

Here is a link to my first module and some standards documentation.   If the module you make won't ever be released then it's not necessary to follow the standards.  However, you may wish to do so anyway in case you change your mind at some point in time.   If you need some help getting started just ask.

Module: IniFile


bspeers

Wow, I've done a lot of stuff with Global ints, that I can recognize, and the idea behind having script modules I understand, but most of the language here is waayyy over my head.  I am familiar with the terms, struct, module, function, in relation to AGS, but I have no idea how they work or how to make them do things (apart from the absolute basic that modules are like stapled papers of code, structs store things and functions perform actions).

Is there a guide to all this for absolute idiots that somehow relates to AGS?  Something that I could use as a reference as much as anything?  I see nothing in the Knowledge base (though I may not be searching right) and very little in the instructions.

Thank you and any help is appreciated. :)
I also really liked my old signature.

strazer


bspeers

Yes, it should--I actually found it after my last post.  I have a better idea of how these things work after reading your explanation, although it still seems as if there is a lot for me to learn.

Thanks for all the help, I think I can proceed now. :)
I also really liked my old signature.

SMF spam blocked by CleanTalk