Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 2 3 [4]

Author Topic: An alternative skill system  (Read 5225 times)

harborpirate

  • Bay Watcher
  • cancels eat: job item lost or destroyed.
    • View Profile
Re: An alternative skill system
« Reply #45 on: June 05, 2011, 11:14:05 pm »

  That data stack is going to be accessed very regularly.  Will it be stored in active memory then?  How much storage space are we looking at to store a full matrix of every skill for every dwarf in, say, a 200 dwarf fort?  If we don't store it in active memory, how frequently will it be accessed on the hard drive by the game as a dwarf goes through their everyday life?

  In essence I think the idea is really cool, but can it be reasonably implemented on today's machines, or are we looking at something Toady won't be able to implement for another 10 years?

The "full implementation" we've been discussing has seemed to settle on 8192 bits (1KB) per dwarf. So the total storage usage for 200 dwarves would be 200KB of active memory. Its not tiny, but it should be reasonable to work with on a modern machine.

This size gives over 100 bits of fidelity (103 "steps" on average) if each of the 98 game skills had 25% of its bits shared.

The brainmap could be considerably smaller if size turns out to be critical; I think even the 1024 bits (128 bytes) per dwarf that Counting noted could be made to work. If you went that small, 200 dwarves would fit in just 25.6KB of active memory.

The 1024 bit brainmap only gives you 13 bits per skill with 25% shared, so some sneaky tricks to make it work right would probably have to be used. Primarily this would mean that unimportant/unused skills would probably only get a few bits each and/or share most of their bits.
Logged

counting

  • Bay Watcher
  • Zenist
    • View Profile
    • Crazy Zenist Hospital
Re: An alternative skill system
« Reply #46 on: June 06, 2011, 02:42:04 am »

While trying to write some codes to confirm the ideas about the "decoration" property and subskills, I realize a "product skillbits" is always a subset of its related skills. And some products that can be made from many different skills (table, door, container etc). And these product subsets are exactly the part where these skills overlapped. So I think we can group these product related skillbits into productbits. And they can be stored using array, and later using to be used to describe a quality of that product. And it can also used to further restricted if only making those product, the skillbits related to are the only ones to be trained, you need to work more kinds of products to be good at every skillbits in that skill. (The none product related bits are the true core skillbits of the skill, and are the theoretical, or tool using skillbits, or quantity related skillbit, or functional skillbits (like fingers nerve).
Logged
Currency is not excessive, but a necessity.
The stark assumption:
Individuals trade with each other only through the intermediation of specialist traders called: shops.
Nelson and Winter:
The challenge to an evolutionary formation is this: it must provide an analysis that at least comes close to matching the power of the neoclassical theory to predict and illuminate the macro-economic patterns of growth

vintermann

  • Bay Watcher
    • View Profile
Re: An alternative skill system
« Reply #47 on: June 06, 2011, 08:34:26 am »

The complete brainmap wouldn't need to stay in cache very often. At any given point in time, a dwarf's level in a single skill can be given as a simple number as today, this would only have to be recalculated as the skill map changed (and this does not have to be every tick! it can be every day, or even every month. It actually makes more sense than an axedwarf "leveling up" like crazy in the middle of a fight.)

To calculate a dwarf's carpentry skill, for instance, you take the carpentry mask (an array of 8192 bits, where maybe 128 are set, with some overlap with the crossbow-making mask and the woodcrafting mask etc.), AND it with the dwarf's brain array, and use popcount-type bit tricks to sum the number of set bits really quickly. Then you store this number, and use it for some amount of time. At the end of the period, you look at all the learning opportunities the dwarf had in the period, do them, recalculate, store new levels.

The memory trait becomes meaningful, as dwarves with it could randomly drop more/fewer bits that weren't touched in the last period - possibly affected by the total number of bits that dwarf has set in his brain map (it's hard to be good at everything). Dwarves with intellectual curiosity could similarly have more/fewer bits randomly set.

Logged

counting

  • Bay Watcher
  • Zenist
    • View Profile
    • Crazy Zenist Hospital
Re: An alternative skill system
« Reply #48 on: June 06, 2011, 12:15:04 pm »

The complete brainmap wouldn't need to stay in cache very often. At any given point in time, a dwarf's level in a single skill can be given as a simple number as today, this would only have to be recalculated as the skill map changed (and this does not have to be every tick! it can be every day, or even every month. It actually makes more sense than an axedwarf "leveling up" like crazy in the middle of a fight.)

To calculate a dwarf's carpentry skill, for instance, you take the carpentry mask (an array of 8192 bits, where maybe 128 are set, with some overlap with the crossbow-making mask and the woodcrafting mask etc.), AND it with the dwarf's brain array, and use popcount-type bit tricks to sum the number of set bits really quickly. Then you store this number, and use it for some amount of time. At the end of the period, you look at all the learning opportunities the dwarf had in the period, do them, recalculate, store new levels.

The memory trait becomes meaningful, as dwarves with it could randomly drop more/fewer bits that weren't touched in the last period - possibly affected by the total number of bits that dwarf has set in his brain map (it's hard to be good at everything). Dwarves with intellectual curiosity could similarly have more/fewer bits randomly set.

Hey, we think alike, and you just describe my sleep/idle-learning system, update cache only when wake-up, and slowly writing-in the "potential points" gain during dwarf's awake, I've already even post how to implement it in C code :P, let us see if these kind of ideas have any room to be improved? or there are something we ignored?
Logged
Currency is not excessive, but a necessity.
The stark assumption:
Individuals trade with each other only through the intermediation of specialist traders called: shops.
Nelson and Winter:
The challenge to an evolutionary formation is this: it must provide an analysis that at least comes close to matching the power of the neoclassical theory to predict and illuminate the macro-economic patterns of growth
Pages: 1 2 3 [4]