TeamPorcupine / ProjectPorcupine

Project Porcupine: A Base-Building Game...in Space!
GNU General Public License v3.0
484 stars 279 forks source link

Basic character statistics #1035

Closed mbstraus closed 8 years ago

mbstraus commented 8 years ago

Different astronauts should have different things they specialize in and are capable of. For instance, one astronaut may be better at manual labor and moving off to mine asteroids and what-not, while another may be more suited to maintenance of machinery and is more capable of repairing broken things or manufacturing new machines.

I was thinking about the technology research feature that was on the list, and I think in order to really properly handle research, there should be stats on the PCs that dictate how well they are able to do things.

The basic plan here would be to have a system set up with a few stats, proof of concept sort of thing. I guess as a base, the stats system could work in a similar fashion to Rim World in that each character would get a random distribution of their stat points, and maybe have a few that they are particularly good at.

To start, there could be a "Mining" stat, a "Hauling" stat, a "Construction" stat, and maybe a "Research" stat. The stats themselves could then be incorporated later into the various systems to improve / decrease the speed that a particular job would be performed.

To make things dynamic, the stats can be read via XML / LUA in the same style as how some of the other things are read in. Then, once a character is spawned, the stats are rolled randomly for that character and applied. Various properties can be stored in the file that dictate what the stat governs, although how that would work exactly would require more thought, the hope being to avoid having to hard-code behavior related to the stats (making it easier to apply the stat to a particular action / job).

So basically, what I am proposing, is to build a framework into the character that will support basic statistics. For the first iteration, these stats would just be values and wouldn't be applied to anything. However, the framework would be established to make it easy to apply these stats to whatever, which may or may not include the ability to research.

Thoughts?

koosemose commented 8 years ago

I'd personally like to see stats broken down into attributes and skills, as some things (unskilled labor) by definition isn't going to use a skill, such as hauling. Being good at hauling is a matter of three things (that I can think of), if you're strong enough to carry heavier loads (carry more items at once), how fast you are (so you can move what you can carry to where it's going faster), and how much stamina you have (so you're made less tired from carrying loads).

Skills can change at a relatively fast rate (akin to Rimworld's skills), whereas attributes either don't change at all, or slowly change by doing activities that make use of that attribute (and maybe increasing one attribute or not using an attribute often can potentially lower other attributes/the attribute not being used), or be raised only by activities specifically dedicated to that purpose (Strength training for strength, studying for Intelligence).

Note: any actual attribute names I used for example aren't necessarily suggestions for what attributes we have, they're just pulled from my background in Tabletop RPGs.

mbstraus commented 8 years ago

It wouldn't be a bad setup to define the stats akin to a tabletop RPG... Strength, Dexterity, Intelligence, etc. and those would dictate how the character can perform tasks associated to those stats. Like, perhaps, the amount of things a character can carry is based on Strength such that - 1 strength = 10 pounds of carrying capability, and maybe 1 piece of steel = 5 pounds... thus a character with 1 strength could carry 2 pieces of steel per load (numbers completely arbitrary, of course).

I kind of like that... would make things simple from a stats perspective.

In your example... your 3 items would cover basically:

koosemose commented 8 years ago

The main reason I suggest Stamina (to steal from D&D, Constitution can be used as well, but may be less immediately understandable to some) as an attribute, rather than a need is that I'm assuming needs are a flat scale (I haven't looked at it in detail), so everyone has the same amount of any given need ( say the main one involved in carrying things would be a need for sleep, and maybe comfort (to represent just wanting to sit down and relax)), and rather than people having a higher cap for that need (which seems odd to me), someone with a high stamina would lose less of that need than someone with a low Stamina.

mbstraus commented 8 years ago

So wouldn't it make sense, in that situation, to have it so that a stat would determine the speed at which something degrades / fills up? Like, for instance, the need to sleep after exhausting stamina may be determined by, maybe constitution? So someone with a higher constitution would regain their stamina faster. Similarly, the draining of stamina could scale with the character's strength or dexterity. They would all start at 100 / 100 stamina, or whatever, but perhaps at strength 10, it would degrade at 10 per tick (middle ground), while strength 20 would degrade at 5 per tick, and strength 1 would degrade at 20 per tick. In that regard, that would still be a need, but the need would be altered based on that character's stats.

Perhaps also a need like Oxygen would be altered by the character's stats... like the stronger the character is, the less oxygen they consume or the like. That would alter the pace at which the Oxygen degrades, but it would still be a 0 - 100 scale?

vogonistic commented 8 years ago

Wouldn't a stronger character use more oxygen while high stamina reduces the %-base of how much was used.

mbstraus commented 8 years ago

image

Well here's the basic stats displayed in the character selection... really basic. It just randomizes the stats from a 1 - 20 range to give a little variety. Isn't being used by anything and I haven't tried plugging it into the saving or whatever. Doing the code changes in this branch here...

https://github.com/mbstraus/ProjectPorcupine/tree/BasicStats1035

koosemose commented 8 years ago

@vogonistic Quite probably. Once we have some basic stats in we can start looking at how/where they're utilized.

@mbstraus that looks good for now, but in the future we'll probably want more detailed information in a dedicated character screen, that could show attributes, skills, traits (if we have them), and their needs along with anything else we think of.

mbstraus commented 8 years ago

Yeah, for sure... that small little box will get overflowed very quickly (in fact, it is already full just showing what is there).

koosemose commented 8 years ago

@mbstraus I missed one of your comments in the middle about something like stamina/constitution making certain things decrease more slowly, and that's basically what I was talking about at the beginning. Obviously not all needs will be affected directly by stats, and not all effects will be positive (An intelligent person may get bored more easily, i.e. Entertainment need goes down). And they won't only interact with needs, such as with strength maybe increasing how much you can carry.

mbstraus commented 8 years ago

I went ahead and put up the pull request for this. The stats are being loaded in and generated for the character, and plugged up to the save / load system. If / when that is in, then the stats can start being applied to actual actions. You know, keeping things small.

Side note - I followed the same style as what was done for Needs, as getting everything hooked up was basically the same as what was done there. However, I see a few issues with that implementation. But I didn't want to try and fix that as part of this.

mbstraus commented 8 years ago

Pull request was merged, so closing this issue out.

vogonistic commented 8 years ago

For next time, you can put fixes #1035 in the body of the PR message and it will be closed automagically.