About Store Forum Documentation Contact



Post Reply 
Internal or External for stats data (Research)
Author Message
SamNainocard Offline
Bronze Supporter

Post: #1
Internal or External for stats data (Research)
I'm currently working on create stats for characters, items, etc.
But I'm not sure if I should create stats internally or externally. I'm thinking about pros and cons.

Internally
All data will be create as .h files and embedded in .exe on compile.

External
All data will be create as .obj (Game::ObjParams) or whatever suitable format and put them in .pak or folder.

These are narrowed down pros of each type I can think of.
Internal Pros:
  • Faster when initialize/create data.
  • Can updating stats without require .pak/data update.
External Pros:
  • No data redundancy if allowed player to change stats.
  • Can updating stats without require .exe update.
  • Smaller memory required for .exe
  • Faster compile time.

I'm leaning toward internal for performance, but I want to hear your opinion.

Edit: Seemingly using objParams have more overall advantage, right now.
(This post was last modified: 07-11-2012 04:51 PM by SamNainocard.)
07-11-2012 03:16 PM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #2
RE: Internal or External for stats data
I recommend using Game::ObjParams through World Editor object properties for item/char stats, you can use enum's there as well
07-11-2012 03:23 PM
Find all posts by this user Quote this message in a reply
SamNainocard Offline
Bronze Supporter

Post: #3
RE: Internal or External for stats data
Thank you, I forget about ObjParams, so that isn't internal pros now.

Still have a difficult to choose though.
07-11-2012 03:31 PM
Find all posts by this user Quote this message in a reply
Harry Offline
Member

Post: #4
RE: Internal or External for stats data
I have similar problem to your. I must create about 500 objects, everyone has the same features but with another parameters. All of them could be created dynamically during app live. Firstly I thought to make base class and inherit from it 500 times (with extra methods etc.). But I realised then it could create more disadvantages than advantages. Now I'm changing my codes to use ObjParams and I think that this is the easiest solution.

Anyway I think that better is to create a binary file (like .obj) than a text file.
(This post was last modified: 07-11-2012 03:47 PM by Harry.)
07-11-2012 03:46 PM
Visit this user's website Find all posts by this user Quote this message in a reply
SamNainocard Offline
Bronze Supporter

Post: #5
RE: Internal or External for stats data
I forget to mention that they will only load once and it will be store until no longer used.

In my case, all of them aren't inherit from base, they are much like constructor code. These .h don't have .cpp
Like example

PHP Code:
void Item(Int id)
{
   switch(
id)
  {
  case 
0item000(); break;
  case 
1item001(); break;
  }
}
// Example when want to create item data (either manually or dynamically)
item[0].create(0);
item[1].create(1); 

PHP Code:
//Item000.h
item000();
item[0].damage=100;
item[0].buycost=50

PHP Code:
//Item001.h
item001();
item[1].damage=175;
item[1].buycost=90

While .obj I think coding might become

item.create(objPath);

And then load and set according to params.

Another cons for internal properly be slower compile time.

Edit: I think I should use objparams for overall advantage than small performance. Thank you both of you.
(This post was last modified: 07-12-2012 05:17 AM by SamNainocard.)
07-11-2012 04:32 PM
Find all posts by this user Quote this message in a reply
Post Reply