GPWiki.org
GPWiki.org
It is currently Fri May 24, 2013 10:47 am

All times are UTC




Post new topic Reply to topic  [ 92 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next
Author Message
 Post subject:
PostPosted: Sun May 28, 2006 12:57 am 
Prolific Poster

Joined: Tue May 23, 2006 2:22 am
Posts: 21
Machaira wrote:
The player character will start with a 60 value for each stat, which can be customized by the player at the start of a game. A pool of < # > (probably 20-25) points will be given to allow the player to add to the character's stats. In addition, the player may decrease a stat by up to 6 points, although he will only gain 1 point added to the pool for every 2 points he decreases.


In general, I think that's a good system, though things may be a little high at start... Maybe give them 50 to start and pass off the things they adjust as the results of their training?... After all, just 20 stats gives someone the ability to be at olympic level in two areas, near olympic in another, and slightly above average in the rest... Starting out the game as the smartest, most strongly willed man alive who can shoot with near-perfect acuracy doesn't sound terribly exciting to me... So I'd say at least cap how much you can put into one stat. (at say, 68?)

Since there's little chance your stats would get below say 45 (I'm assuming certain things would give you stat penalties to drop you that far.) Why not just rename 45 or so to 1 and possibly scale things up a bit.... Or, if you feel like keeping he rough starting point, and doing something somewhat unique, why not call them percentile scores?... Said percentiles of course would take into account the existance of psionics and other strange results of the perception crash. It'd even an in-game reason for stats, in the beginning of the game, the government would keep logs of your preformance, and rank you.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 17, 2006 6:20 pm 
Paraskavedekatriaphobic

Joined: Sat Aug 27, 2005 12:24 pm
Posts: 1325
Location: aaaaaaaaaaaaaa
so
Code:
public float Strength;
public float Agility;
public float Dexterity;
public float Constitution;
public float Intelligence;
public float Will;
public float Charisma;

it is?
but one thing, I would prefer going without Charisma. Charisma skill tends to be one of those skills in games that isn't really useful for anything in the actual gameplay. And, besides, I'd like that to be based on player interaction rather than a number. I prefer going without it.

here's my suggestion for leveling-up:
Using skills improves them, but also after a certain point you level up, which gives you a few "stat points" that you can put into any skill, allowing you to improve skills that you otherwise wouldn't use because they're too weak for you (and therefore would be unable to improve because they're too weak).

_________________
aaaaaaaaaaaaaaaaaaa


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 17, 2006 8:15 pm 
P2k
User avatar

Joined: Tue Aug 23, 2005 5:11 am
Posts: 2145
T-1 wrote:
so
Code:
public float Strength;
public float Agility;
public float Dexterity;
public float Constitution;
public float Intelligence;
public float Will;
public float Charisma;

it is?
but one thing, I would prefer going without Charisma. Charisma skill tends to be one of those skills in games that isn't really useful for anything in the actual gameplay. And, besides, I'd like that to be based on player interaction rather than a number. I prefer going without it.

here's my suggestion for leveling-up:
Using skills improves them, but also after a certain point you level up, which gives you a few "stat points" that you can put into any skill, allowing you to improve skills that you otherwise wouldn't use because they're too weak for you (and therefore would be unable to improve because they're too weak).


I wouldn't use public fields for those (or just about anything). Make them private fields exposed via properties. I also wouldn't make them floats, use ints and you won't have precision issues.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 17, 2006 9:02 pm 
Paraskavedekatriaphobic

Joined: Sat Aug 27, 2005 12:24 pm
Posts: 1325
Location: aaaaaaaaaaaaaa
Struan wrote:
T-1 wrote:
so
Code:
public float Strength;
public float Agility;
public float Dexterity;
public float Constitution;
public float Intelligence;
public float Will;
public float Charisma;

it is?
but one thing, I would prefer going without Charisma. Charisma skill tends to be one of those skills in games that isn't really useful for anything in the actual gameplay. And, besides, I'd like that to be based on player interaction rather than a number. I prefer going without it.

here's my suggestion for leveling-up:
Using skills improves them, but also after a certain point you level up, which gives you a few "stat points" that you can put into any skill, allowing you to improve skills that you otherwise wouldn't use because they're too weak for you (and therefore would be unable to improve because they're too weak).


I wouldn't use public fields for those (or just about anything). Make them private fields exposed via properties. I also wouldn't make them floats, use ints and you won't have precision issues.

I disagree with the usage of private variables for any reason. ints makes sense though.

_________________
aaaaaaaaaaaaaaaaaaa


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 17, 2006 10:47 pm 
Babirusa
User avatar

Joined: Thu Aug 19, 2004 2:55 pm
Posts: 9241
Location: The Netherlands
I think floats of 0.1 always work better (somehow), especially with AI stuff. But that's just my opinion :).

_________________
Serious game developer

http://www.persistentrealities.com
http://www.persistentrealities.com/vbfibre
http://www.ambiances.nl


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 17, 2006 11:36 pm 
Paraskavedekatriaphobic

Joined: Sat Aug 27, 2005 12:24 pm
Posts: 1325
Location: aaaaaaaaaaaaaa
Machaira, speak up.

_________________
aaaaaaaaaaaaaaaaaaa


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 18, 2006 12:27 am 
P2k
User avatar

Joined: Tue Aug 23, 2005 5:11 am
Posts: 2145
T-1 wrote:
I disagree with the usage of private variables for any reason. ints makes sense though.


So you disagree with fundamental OO principles (namely encapsulation)?

If you don't encapsulate with properties then if you change your code it will break other classes.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 18, 2006 12:48 am 
P2k
User avatar

Joined: Tue Aug 23, 2005 5:11 am
Posts: 2145
float increments of 0.1 stored as ints.

Code:
    class Stats
    {
        private const float DENOMINATOR = 10;

        private int _Strength;
        private int _Agility;
        private int _Dexterity;
        private int _Constitution;
        private int _Intelligence;
        private int _Will;
        private int _Charisma;

        public float Strength
        {
            get { return _Strength / DENOMINATOR; }
        }
        public float Agility
        {
            get { return _Agility / DENOMINATOR; }
        }
        public float Dexterity
        {
            get { return _Dexterity / DENOMINATOR; }
        }
        public float Constitution
        {
            get { return _Constitution / DENOMINATOR; }
        }
        public float Intelligence
        {
            get { return _Intelligence / DENOMINATOR; }
        }
        public float Will
        {
            get { return _Will / DENOMINATOR; }
        }
        public float Charisma
        {
            get { return _Charisma / DENOMINATOR; }
        }
    }


If you make them properties, you can make them based on integers but return floats for the stat calculation. (You won't be free to change this later if you don't use properties) The calculations based on stats are presumably going to be read all over the place in the project, so its probably a good idea to make them read-only. You have to assume everyone else is a terrible coder and they will find every way possible to break your class (thats how you write good classes). This includes them setting the value of one of the stats in their code when they shouldn't. Then you can add functions like LevelUpStrength() that include error checking code for level caps.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 18, 2006 2:18 am 
Paraskavedekatriaphobic

Joined: Sat Aug 27, 2005 12:24 pm
Posts: 1325
Location: aaaaaaaaaaaaaa
Struan wrote:
T-1 wrote:
I disagree with the usage of private variables for any reason. ints makes sense though.


So you disagree with fundamental OO principles (namely encapsulation)?

If you don't encapsulate with properties then if you change your code it will break other classes.

I don't believe in forcing restrictions. I still think we should have the 'properties' as you refer to them, but making the variables private is pointless.
Struan wrote:
float increments of 0.1 stored as ints.

Code:
    class Stats
    {
        private const float DENOMINATOR = 10;

        private int _Strength;
        private int _Agility;
        private int _Dexterity;
        private int _Constitution;
        private int _Intelligence;
        private int _Will;
        private int _Charisma;

        public float Strength
        {
            get { return _Strength / DENOMINATOR; }
        }
        public float Agility
        {
            get { return _Agility / DENOMINATOR; }
        }
        public float Dexterity
        {
            get { return _Dexterity / DENOMINATOR; }
        }
        public float Constitution
        {
            get { return _Constitution / DENOMINATOR; }
        }
        public float Intelligence
        {
            get { return _Intelligence / DENOMINATOR; }
        }
        public float Will
        {
            get { return _Will / DENOMINATOR; }
        }
        public float Charisma
        {
            get { return _Charisma / DENOMINATOR; }
        }
    }


If you make them properties, you can make them based on integers but return floats for the stat calculation. (You won't be free to change this later if you don't use properties) The calculations based on stats are presumably going to be read all over the place in the project, so its probably a good idea to make them read-only. You have to assume everyone else is a terrible coder and they will find every way possible to break your class (thats how you write good classes). This includes them setting the value of one of the stats in their code when they shouldn't. Then you can add functions like LevelUpStrength() that include error checking code for level caps.

thanks for the code (I'll put it in minus the privateness). do we want to separate out class Stats from Pawn? I'll do it if you want, but I don't see many concrete advantages of doing so aside it being slightly cleaner.

_________________
aaaaaaaaaaaaaaaaaaa


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 18, 2006 3:04 am 
P2k
User avatar

Joined: Tue Aug 23, 2005 5:11 am
Posts: 2145
Why don't you want to use private fields? They increase the reliability and organization of your classes and improve encapsulation. OO turns to spaghetti code faster than non-OO if you don't use private variables.

Are all Pawns going to have stats? Is a crate a pawn? Should a crate have dexterity? There are lots of questions you need to ask before you write a lot of code.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 18, 2006 3:49 am 
Paraskavedekatriaphobic

Joined: Sat Aug 27, 2005 12:24 pm
Posts: 1325
Location: aaaaaaaaaaaaaa
Struan wrote:
Why don't you want to use private fields? They increase the reliability and organization of your classes and improve encapsulation. OO turns to spaghetti code faster than non-OO if you don't use private variables.

unreal engine proves you wrong.

Struan wrote:
Are all Pawns going to have stats? Is a crate a pawn? Should a crate have dexterity? There are lots of questions you need to ask before you write a lot of code.

yes, no, no.
A Pawn is a character. A crate will be some subclass of Actor, I forgot to mention Actor. Actor is everything not an NPC.

_________________
aaaaaaaaaaaaaaaaaaa


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 18, 2006 4:07 am 
P2k
User avatar

Joined: Tue Aug 23, 2005 5:11 am
Posts: 2145
T-1 wrote:
Struan wrote:
Why don't you want to use private fields? They increase the reliability and organization of your classes and improve encapsulation. OO turns to spaghetti code faster than non-OO if you don't use private variables.

unreal engine proves you wrong.


UnrealScript isn't OO.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 18, 2006 12:41 pm 
Paraskavedekatriaphobic

Joined: Sat Aug 27, 2005 12:24 pm
Posts: 1325
Location: aaaaaaaaaaaaaa
Struan wrote:
T-1 wrote:
Struan wrote:
Why don't you want to use private fields? They increase the reliability and organization of your classes and improve encapsulation. OO turns to spaghetti code faster than non-OO if you don't use private variables.

unreal engine proves you wrong.


UnrealScript isn't OO.

If UnrealScript isn't OO, then I don't know what OO is anymore.

_________________
aaaaaaaaaaaaaaaaaaa


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 18, 2006 3:14 pm 
King Code Monkey
User avatar

Joined: Wed Sep 01, 2004 3:05 pm
Posts: 11182
Location: Abingdon, MD
T-1 wrote:
I still think we should have the 'properties' as you refer to them, but making the variables private is pointless.

No, there is a point, it's encapsulation. What if someone does:

Code:
if (stat = < some value >)


Yes, that's bad code, but the point is a public variable won't protect you from it. If you have accessor functions and the stat is read-only, you're fine.

Variables should only be public if you don't care if code outside the class changes them to any value at all. This isn't the case with stats and just about every other member of the Entity. It's just good practice to protect class members from random changes.

T-1 wrote:
thanks for the code (I'll put it in minus the privateness). do we want to separate out class Stats from Pawn? I'll do it if you want, but I don't see many concrete advantages of doing so aside it being slightly cleaner.

Every entity will have stats. I still would have a stat class and a stat manager class, which allows you to apply modifications to stats without having to specifically know what those stats are. I'm slowly working on modifying the code that I have to fit PC.

Struan wrote:
You have to assume everyone else will make mistakes and they will find every way possible to break your class (thats how you write good classes).

QFT and fixed. :) I don't assume everyone is a terrible coder, just that we're human and will make mistakes. I know I make my share of them.

Side topic - I seriously dislike some of the Unrealscript class names (Pawn, Actor, etc.), but that's just me. I see "Pawn" and think "chess piece" and I'm left wondering what the heck that has to do with game programming. :) I see "Actor" and think "person" which isn't necessarily the case in UnrealScript. :(


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 18, 2006 3:28 pm 
Babirusa
User avatar

Joined: Thu Aug 19, 2004 2:55 pm
Posts: 9241
Location: The Netherlands
In Unreal, there are only very few objects which inherit from nothing afaik.

_________________
Serious game developer

http://www.persistentrealities.com
http://www.persistentrealities.com/vbfibre
http://www.ambiances.nl


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 18, 2006 3:35 pm 
Bibliotherapist
User avatar

Joined: Wed Dec 21, 2005 6:23 pm
Posts: 6210
Location: Manchester, UK
Tiak wrote:
Since there's little chance your stats would get below say 45 (I'm assuming certain things would give you stat penalties to drop you that far.) Why not just rename 45 or so to 1 and possibly scale things up a bit....


Bad idea... that would be assuming that the players lowest is the lowest that could possibly be in a stat. As an example where this isn't the case, think of (for example) just about any animal in the world. Their intelligence would be well below that of a human character in game terms, so having the pc start their stats off at 1 leaves no room to have lower without having ugly negatives that could mess things up.

_________________
God must love stupid people, he made so many.
theraje: 'God doesn't love stupid people, they're just easier to make'
http://sharedillusions.blogspot.com


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 18, 2006 6:55 pm 
Paraskavedekatriaphobic

Joined: Sat Aug 27, 2005 12:24 pm
Posts: 1325
Location: aaaaaaaaaaaaaa
Machaira wrote:
T-1 wrote:
thanks for the code (I'll put it in minus the privateness). do we want to separate out class Stats from Pawn? I'll do it if you want, but I don't see many concrete advantages of doing so aside it being slightly cleaner.

Every entity will have stats. I still would have a stat class and a stat manager class, which allows you to apply modifications to stats without having to specifically know what those stats are. I'm slowly working on modifying the code that I have to fit PC.

Struan wrote:
You have to assume everyone else will make mistakes and they will find every way possible to break your class (thats how you write good classes).

QFT and fixed. :) I don't assume everyone is a terrible coder, just that we're human and will make mistakes. I know I make my share of them.

Side topic - I seriously dislike some of the Unrealscript class names (Pawn, Actor, etc.), but that's just me. I see "Pawn" and think "chess piece" and I'm left wondering what the heck that has to do with game programming. :) I see "Actor" and think "person" which isn't necessarily the case in UnrealScript. :(

What is an entity by your definition? That's more unclear to me.
Actor == gameworld object. Actor tells me something that acts on the gameworld.
Pawn == object that can be controlled by intelligence (artificial or otherwise) in the form of a Controller class. It is very much like a chess piece. It's a playing piece, and not the chess board or the Chess player.
Controller == The 'brain' for a Pawn.

Almar Joling wrote:
In Unreal, there are only very few objects which inherit from nothing afaik.

Only the class named Object inherits from nothing. 90+% of the objects in the engine inherit from Actor. GUIs, Textures, Subsystem (editor vs. game), and Locale are among the few things that inherit from Object. A couple of things are just classes to get UCC to load up data files like Skaarj_rc.

_________________
aaaaaaaaaaaaaaaaaaa


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 18, 2006 7:42 pm 
King Code Monkey
User avatar

Joined: Wed Sep 01, 2004 3:05 pm
Posts: 11182
Location: Abingdon, MD
T-1 wrote:
What is an entity by your definition?

PC or NPC - basically anything living with any degree of intelligence. Actually you could just call the class Character and you'd be more correct, whether it's a player or non-player character. :)

T-1 wrote:
Actor == gameworld object. Actor tells me something that acts on the gameworld.

I think it's the inanimate objects as actors that gets to me. :confused


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 18, 2006 9:42 pm 
P2k
User avatar

Joined: Tue Aug 23, 2005 5:11 am
Posts: 2145
I would do the hierarchy something like this.

Entity (Base class for interactive elements, does collision detection, etc.)
-Character (Same for PC and NPC)
-Vehicle
-ItemPickup
-Projectile
-InanimateObject


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 18, 2006 9:50 pm 
A.I. Lifeform

Joined: Mon Apr 10, 2006 1:51 pm
Posts: 832
Location: Virginia
Model View Controller anyone, or am I the only one who uses that?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 92 posts ]  Go to page Previous  1, 2, 3, 4, 5  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group