Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 4 5 [6]

Author Topic: Mersenne twister in df  (Read 10395 times)

Starver

  • Bay Watcher
    • View Profile
Re: Mersenne twister in df
« Reply #75 on: May 31, 2012, 09:42:25 am »

Ninjaed, but...

So the mersenne twister spits out a long string of bits wich is saved (cant see where) then used for everything, from world gen, history AND combat.
No.

The MT spits out a short(-enough) string of bits whenever a value is wanted.  Which is whenever the related worldgen component needs its next decision making in the geography, history, naming, interactions, whatever.  (I assume combat is just "a regular random result", or at least never with a set seed.  But in two identical embarks/adventurings the user is going to add their own alternate input, anyway, so that doesn't mean so much.)

Quote
or launching/stopping the twister whenever needed?
Well, I've already said how I wouldn't launch and stop (or consult) it.

Quote
wouldnt the same string make weird combat results? (During the siege of xor, 1487 elves were defeated by 1 human, one dwarf and an elf, no survivors)
Wut?  It would never "pre-queue" that "an elf takes part in the defeating of the next battle-force", and then once the battleforce is assembled find that it's also Elves.  Or pre-decide that side1 is beaten by side2, and then afterwards work out that side1 is huge and side2 is tiny.  But I really don't know what you're trying to say there.
Logged

BinaryBeast1010011010

  • Bay Watcher
    • View Profile
Re: Mersenne twister in df
« Reply #76 on: May 31, 2012, 09:55:34 am »

What is your theory on how battles are set and solved?
Logged
cant stop playing DF?
 : (){ :|:& };:

Starver

  • Bay Watcher
    • View Profile
Re: Mersenne twister in df
« Reply #77 on: May 31, 2012, 10:36:13 am »

My theories on that are pretty mundane.  Periodically during worldgen, the question is asked "Is this population centre going to attack this other population?"  A random value is requested and (according to how warlike the various parties are) may or may not exceed the threshold.  If it does, "a battle is arranged".  The invader population's details are used to provide the actual invading force, the defending population's details may involve a primary defence force but possibly all members get involved.

There's some quick 'rounds' where attacks and defending moves are compared (in both directions), as a war of attrition, until the attacking side is below a certain amount of attackers (and will retreat home), or the defending side is below a certain amount of defenders (and will flee, possibly to augment other settlements), or it goes down to the wire and the death of every individual on the losing side.

If the attacker succeeds, they are now left 'running' the attacked site, otherwise the (reduced?) defending population retains it.


Have you never played a table-top wargame?  It'll be something like that.  Only done very quickly inside the computer.


And as both the pre-cursor to the battle and the battle itself is dependant upon a seeded PRNG, the same seed (in a world with the same geology) will mean that the same battles occur and the same outcomes does, because each request for a random number made in a re-run is (on the spot) calculated in exactly the same way as the random number requested during the previous run.  I assume.  I've not messed with History Seeds much, for all I know other perturbations creep into this process.  Certainly if you changed the geology seed, I could see different battles being fought (with different physical distances between settlements, indeed, different settlements altogether!), and thus different choices needing resolving during the course of history.
Logged

BinaryBeast1010011010

  • Bay Watcher
    • View Profile
Re: Mersenne twister in df
« Reply #78 on: May 31, 2012, 10:53:42 am »

wars having an impact on populations... Did not think about it but that makes sense. About population centers, I gather from what I read around the threads since I lurk around here that it is mainly depending on the biome (as in forest, moutains...) Pop will "spawn" there, if you have a big forest, then in the center shall spawn the first elven retreat, same in mountains (though I think mineral ressources should introduce a modifier for everyone but elves)... But I would like to focus on elven and goblin civs, since both are immortals and goblins dont need to it, the questions that pop up are :
1st, about elves : how do the freaky tree huggers regulate their pop during world gen, since no one dies from old age and they are not as war like as goblins... I genned recently a world for the purpose of legends reading and in all the battles I randomly chose to view the elves were outnumbering everyone else... Are not they a little bit overpowered?
2nd, about gobbos : gobbo mac gobbo has two children, one born from his union with gobba mcgobbo and one stolen from, say, the neighbour civ, as only one of them needs to eat, raids should suffice to feed him (working from the assumptions that stolen children dont make the bulk of the goblin civilisation) when gobbo macgobbo junior comes of age he goes to the yearly siege to happily slaughter and get slaughtered by the neighbouring civ. My theory : gobbos regulate there pop waging war to others who are better fighter and have a better equipment, even if they win it will be at the cost of huge loss. The question being, what is wrong with this theory?
Logged
cant stop playing DF?
 : (){ :|:& };:

Thief^

  • Bay Watcher
  • Official crazy person
    • View Profile
Re: Mersenne twister in df
« Reply #79 on: May 31, 2012, 11:33:49 am »

Well that's not a question about random numbers any more. That's about the design of the DF races.

Really, you'd have to ask toady if you want specifics about the reasons behind things in DF.
Logged
Dwarven blood types are not A, B, AB, O but Ale, Wine, Beer, Rum, Whisky and so forth.
It's not an embark so much as seven dwarves having a simultaneous strange mood and going off to build an artifact fortress that menaces with spikes of awesome and hanging rings of death.
Pages: 1 ... 4 5 [6]