Aller au contenu

Photo

Random character generator for BG 1 using Easy Tutu or BG 2


  • Veuillez vous connecter pour répondre
70 réponses à ce sujet

#1
corey_russell

corey_russell
  • Members
  • 5 289 messages
As the topic title suggests, I will be creating a random character generator to be used with EasyTutu for BG 1 or BG 2. When finished it will compose of 2 EXEs. When it's finished I will post a note here. Also, when it's ready for use, you might find bugs with it, post those here as well.

I'm not expecting any major hurdles in coding it, as I will be using the BG 2 program to guide the coding of it.

The intent of the generator is to generate randomly the race, class/kit, stats, racial enemy (rangers), and alignment. If I do run across any coding hurdles will post them here as well.

Also, if there's a feature that you think it would be either important or helpful for this generator to have, post those ideas here as well.

And if anyone else already has something of this nature, they can post the details of theirs here as well.

#2
Grond0

Grond0
  • Members
  • 6 487 messages

corey_russell wrote...

Grond0 - maybe the computer just keeps rolling until it does get 75 total. After all, that takes no time at all when the processor calculation is measured in gigahertz.

Just responding to this observation in the no-reload thread.

The computer might well do what you suggest. The reason I thought it might be an adjustment to the lowest scores is that my observations suggest that when you have a low overall score you are less likely than I would expect to have low individual scores (as you know I tend to spend quite a bit of time rolling for new characters).

#3
corey_russell

corey_russell
  • Members
  • 5 289 messages
Grond0 -- thinking about the rolls again, my most common roll is a roll that gives an average of 14 across all stats -- but 14 times the 6 categories (STR, DEX, CON, INT, WIS, CHA) is 84. While I have seen some bad, bad rolls before, I'm not certain I have ever seen a roll lower than 75 before (though I know I've played characters with a 79 score before). Re-rolling until the total is 75 or higher is simple enough for me to implement.

#4
Gate70

Gate70
  • Members
  • 3 208 messages
I've made a start on a spreadsheet to make sure I understand the rules before trying to code anything.

So far I have randomised sex, race and class (there are 54 class combinations for single & multi-class). I assume dual-class could be selected later if the initial race, class and stats are suitable.

Spreadsheet is currently 10.6k, racial enemy and alignment can be added relatively easily (I think).

Stats may be another matter as race/class limitations complicate matters. e.g. for a halfling thief vs halfling fighter str is 6-17 vs 9-17 and dex is 9-19 vs 8-19. Grond0, I'd be interested in your observations here based on your work so far.

#5
gunman78

gunman78
  • Members
  • 44 messages
I suggest the generator could be set a base alignment, and all the characters should have random alignments in range +1 / -1 centered around the base alignment, for those who do not want ridiculous situations, such as paladins together with chaotic evil characters. But setting the base alignment as true neutral will allow any alignment possible.

#6
corey_russell

corey_russell
  • Members
  • 5 289 messages
@Gate70: my intention is that if the random stats happen to be human and happen to have the stats that allow a dual class, you can dual class whenever you want - it would just be a "bonus" if it happens. It would be pretty complicated to actually intend the dual classes, as I have would to adjust the stats to allow for it not to mention figure out all the legal dual classes and stats required to do each.

@gunman78 -- Base alignments -- the generator should just be seen as a "guide" -- you by no means have to use the suggested random alignments -- if you want to make your entire party chaotic good, but still use the other random assignments, go for it. Same for the stats -- if you would rather BG 2/EasyTutu generate your random stats, by all means do so. This proposed generator will be extremely helpful to reduce the hassle of random races/classes.

Modifié par corey_russell, 22 février 2012 - 09:03 .


#7
Gate70

Gate70
  • Members
  • 3 208 messages
Good to see we agree with random ability for humans to dual.

I've added alignment (more complicated than I thought but once I mapped out the valid class combinations it was a single lookup). Also added racial alignments for the the ranger, 3 kits and one multi-class. I'm now up to 11.6kb spreadsheet size.

Might stop for the night while I think about the stats. Tabling the max/min of each value for every race/class combination might be the only way. This will take hours to map out.

gunman78, I'm tempted to allow alignment clashes. e.g. Frodo, Sam, Smeagol/Gollum.

Final consideration for me is where to stop. For example;
- Randomise the party size from 1-6 and generate that number of characters. Easy.
- Random name generator. Would think this is harder to do although I suspect a spreadsheet lookup to a web based generator might work.

EDIT
Mapped out half orc classes. All maximums are the same but minimums vary;
Str is 4, or 9 if fighter single/multi. (3+1 racial).
Dex is 3, or 9 if thief single/multi.
Con is 4. (3+1 racial).
Int is 1. (3-2 racial).
Wis is 3, or 9 if cleric single/multi.
Cha is 3.

So looks like minimums are 3 + racial modifier, or 9 for class modifier.

I then tried a dwarf.
Str is 8, or 9 if fighter single/multi.
Dex is 3, or 9 if thief single/multi.
Con is 12 regardless of class.
Int is 3.
Wis is 3, or 9 if cleric single/multi.
Cha is 2 (3-1 racial modifier).

So I think a full set of values by race/class are required. Avengers may complicate matters further.

Modifié par Gate70, 22 février 2012 - 10:12 .


#8
corey_russell

corey_russell
  • Members
  • 5 289 messages
I wasn't intending to do names, mainly because you need a portrait to go with it. However, if you had a text file with the names listed, each separated by a carriage return, it would be child's play for a program to read the file then generate a random number and voila there's your random name. If there's a lot of demand for this though, I might be able to find a list of names somewhere, put it in a text file as described in this post and generate a name.

The "gotcha" with this whole process is you don't want to assign a female name to a male character, and vice versa, so a list of names that isn't differentiated by gender would be pretty useless.

#9
corey_russell

corey_russell
  • Members
  • 5 289 messages
Gate70 -- if you happen to create a text file of said race/class minimums and e-mail coreypajajosh AT hotmail DOT com, that would be great. I would still have to enter said stats in my program, but at least I wouldn't have to go to BG 2 to find these values. A CSV file would work too, maybe even better actually.

In any case, it's good you did that, I knew about the class minimums but wasn't sure about racial minimums, apparently there are some.

#10
Gate70

Gate70
  • Members
  • 3 208 messages
Will do once I write them up. Findings so far;

Halflings are easy. 6, 8, 10, 6, 3, 3. Change to 9 for fighter strength, cleric wisdom and thief dexterity.

Gnomes are easy too. 6, 3, 8, 7, 2, 3. Change to 9 for fighter strength, cleric wisdom and thief dexterity. Change intelligence to 9 and dexterity to 16 for illusionist.

Elf is harder. 3, 7, 6, 8, 3, 8. Changes to 9 for fighter, cleric, thief and mage as above. Ranger minimums are 13, 13, 14, 8, 14, 8. Diviner requires 16 wis, enchanter 16 charisma.

Half-elf and human are left. I expect they are more complicated as a wider set of specialist mages come into play as well as the druid, paladin, monk and bard classes.

EDIT
Human is easy too. All 3's. Bump to 9 for fighter, thief, cleric, mage. Bard 12 str, 13 int, 15 cha. Monk has 9 for dex, con, wis. Druid is 12 wis & 15 cha (same for avenger). Paladin is 12 STR, 9 con, 13 wis, 17 cha. Abjurer 15 wis, illusionist dex 16, invoker 16 con, necromancer 16 wis,

Half elf is  3, 6, 6, 4, 3, 3. Bard 12 str, 13 int, 15 cha. Ranger 13 str, 13 dex, 13 con, 14 wis. Sorcerer 9 int and cha. Usual 9's for fighter/thief/cleric/mage single or multi. Conjurer 15 con. Transmuter 15 dex. Druid/avenger 12 wis and 15 cha.

Think that's it, have I missed any? Looks like the best solution is to start with the race traits then add class/kit modifiers.

Modifié par Gate70, 22 février 2012 - 11:03 .


#11
corey_russell

corey_russell
  • Members
  • 5 289 messages
Programmatically, I will separate them. That is, when I determine the race, I will load the racial minimums for the stats, and then when class gets determined, I will then load the class minimums. Then when the stats get rolled, if any is too low they get bumped up.

This research you are doing Gate70 will definitely speed up my development, as gathering the data is like 1/2 the battle.

#12
Gate70

Gate70
  • Members
  • 3 208 messages
A program should be easier to apply this sort of logic but I can see ways to do it in a spreadsheet. I would feel happier knowing how the game dealt with a roll of 70 for example. e.g. if it starts adding values then doing a re-roll wouldn't be a good solution, or vice-versa.

#13
Grond0

Grond0
  • Members
  • 6 487 messages
Sounds like you're making good progress. In my generator I complicated things rather by allowing each character a chance of a multi or dual class (depending on race). The initial character class was set and then chances for second class added depending on the first class (rather than just setting a % for every possible character class). I started off with quite a simple approach (for which If statements worked well), but didn't change the approach as I added more options. The use of look-ups would be far more efficient, although I'm not sure would achieve quite the same result.

In relation to stat rolls I'm also not sure how the game determines a roll when a higher minimum stat applies. If the minimum is 15 I might expect a random roll between 15 and 18, but I don't think there is actually an even distribution - results seem to be skewed towards the low end.

#14
corey_russell

corey_russell
  • Members
  • 5 289 messages
Grond0 -- I think the computer actually rolls 3 6 sided die then add/subtracts race bonuses/penalities, which is why Gate70 got 4 for a racial minimum in some cases and 2 in others. I suspect the computer does what I said about bumping it up to minimum if the roll wasn't high enough, not rolling 15-18 -- and yes doing that, will result in lots of 15s being rolled, but I don't see anything wrong with that. Btw, I am going to see if the roll is 75 BEFORE applying the class minimums...might help the player a little.

#15
Guest_Ivandra Ceruden_*

Guest_Ivandra Ceruden_*
  • Guests
This topic reminds me how I seriously need to do another play-through of the Baldur's Gate games when I got some spare time...

#16
Grond0

Grond0
  • Members
  • 6 487 messages

corey_russell wrote...

Grond0 -- I think the computer actually rolls 3 6 sided die then add/subtracts race bonuses/penalities, which is why Gate70 got 4 for a racial minimum in some cases and 2 in others. I suspect the computer does what I said about bumping it up to minimum if the roll wasn't high enough, not rolling 15-18 -- and yes doing that, will result in lots of 15s being rolled, but I don't see anything wrong with that. Btw, I am going to see if the roll is 75 BEFORE applying the class minimums...might help the player a little.

I agree that would seem reasonable, but I don't think it works like that.  Just rolling 3d6 would give you an 18 only 1 in 216 rolls and they're considerably more common than that (just not 1 in 4 if rolling between 15 and 18).

#17
corey_russell

corey_russell
  • Members
  • 5 289 messages
Gate70: Looks like you missed Barbarian -- which appears to use the fighter minimum (9 for STR) -- and I confirmed Grond0's assertion (I'm home now in front my laptop) that indeed you will always get no lower than a 75 roll.

Interestingly enough, a halfling can be a barbarian, never knew that.

#18
corey_russell

corey_russell
  • Members
  • 5 289 messages

Grond0 wrote...

corey_russell wrote...

Grond0 -- I think the computer actually rolls 3 6 sided die then add/subtracts race bonuses/penalities, which is why Gate70 got 4 for a racial minimum in some cases and 2 in others. I suspect the computer does what I said about bumping it up to minimum if the roll wasn't high enough, not rolling 15-18 -- and yes doing that, will result in lots of 15s being rolled, but I don't see anything wrong with that. Btw, I am going to see if the roll is 75 BEFORE applying the class minimums...might help the player a little.

I agree that would seem reasonable, but I don't think it works like that.  Just rolling 3d6 would give you an 18 only 1 in 216 rolls and they're considerably more common than that (just not 1 in 4 if rolling between 15 and 18).


Except Grond0, that if the computer really is re-rolling if you don't get 75, maybe the computer really did 300 rolls before you see your first numbers on the screen, so my conjecture still might be right, and wouldn't break those odds you quoted.

#19
Gate70

Gate70
  • Members
  • 3 208 messages
Sorry, should have said barbarian is same as fighter for stats.

I'm all done (apart from testing it in detail, tidying the tables up and forcing a 75 as I haven't decided what to do about that yet).

The spreadsheet is 13.8k in OpenOffice ODS/ODF format, 13k in Excel 2010 XLSX format if anybody wants a copy.

Edit, corey sent you a copy. Just bin it if you don't want it.

Modifié par Gate70, 23 février 2012 - 01:54 .


#20
corey_russell

corey_russell
  • Members
  • 5 289 messages
I got a ways to go still, but I thought it might be interesing to post what I have so far:

Image IPB

It should be noted that the labels at the top "Gender" and such will likely be removed when I'm done. But it's helpful at the moment so I know what "Undetermined" is referencing.

So far, the program will randomly generate a race, gender and in my tests so far, seems to correclty include the race min/max. As you can see, I've also made it keep rolling until the roll is at least 75 (this happens without user's intervention). One of the rolls was 100! I've never got that roll in BG 2 (best I think I've had is 96)...of course most rolls were much worse.

Totals doesn't need to be there, but seems everyone adds it up anyways so might as well have the computer tell us. : )

#21
corey_russell

corey_russell
  • Members
  • 5 289 messages

Gate70 wrote...

Will do once I write them up. Findings so far;

Halflings are easy. 6, 8, 10, 6, 3, 3. Change to 9 for fighter strength, cleric wisdom and thief dexterity.

Gnomes are easy too. 6, 3, 8, 7, 2, 3. Change to 9 for fighter strength, cleric wisdom and thief dexterity. Change intelligence to 9 and dexterity to 16 for illusionist.

Elf is harder. 3, 7, 6, 8, 3, 8. Changes to 9 for fighter, cleric, thief and mage as above. Ranger minimums are 13, 13, 14, 8, 14, 8. Diviner requires 16 wis, enchanter 16 charisma.

Half-elf and human are left. I expect they are more complicated as a wider set of specialist mages come into play as well as the druid, paladin, monk and bard classes.

EDIT
Human is easy too. All 3's. Bump to 9 for fighter, thief, cleric, mage. Bard 12 str, 13 int, 15 cha. Monk has 9 for dex, con, wis. Druid is 12 wis & 15 cha (same for avenger). Paladin is 12 STR, 9 con, 13 wis, 17 cha. Abjurer 15 wis, illusionist dex 16, invoker 16 con, necromancer 16 wis,

Half elf is  3, 6, 6, 4, 3, 3. Bard 12 str, 13 int, 15 cha. Ranger 13 str, 13 dex, 13 con, 14 wis. Sorcerer 9 int and cha. Usual 9's for fighter/thief/cleric/mage single or multi. Conjurer 15 con. Transmuter 15 dex. Druid/avenger 12 wis and 15 cha.

Think that's it, have I missed any? Looks like the best solution is to start with the race traits then add class/kit modifiers.


Ran into something strange. It's either a bug, or maybe some rule we don't know about. To interpret the class minimums I was initially just going to look for a keyword -- such as "illusionist" then apply the class minimum. But I found out I can't do that, e.g., if I create a cleric/illusionist, the dexterity minimum is 3, even though for a standard illusionist the minimum DEX is 16. So then I thought ok, perhaps the rule is you take the lowest minimum for multis. But that isn't the case either, as I then created a fighter/thief (gnome) and it enforced the STR 9 DEX 9 rules for fighters and thieves. Did I find a bug? Or is this 2nd ed. rule I haven't a clue about?

Anyone know anything about this?

#22
corey_russell

corey_russell
  • Members
  • 5 289 messages
I've made a lot of progress today. I finished adding all the legal alignments for all classes. I also added the ranger's racial enemy to the generator.

Question: Do people think random proficiencies is important, or at least will they ever do it? If so I should probably add that to the program. It's a bit tricky as various kits get both bonuses and penalties to pips, archer being a good example of that.

Barring any unforseen difficulties, I might be done with this little project by late tomorrow evening. Here's a screenshot of what I have now:
Image IPB

As for my previous post, I'm going to operate on the assumption that what I found is a bug, and finish putting in the class minimums.

Modifié par corey_russell, 23 février 2012 - 06:15 .


#23
Grond0

Grond0
  • Members
  • 6 487 messages

corey_russell wrote...

Grond0 wrote...

corey_russell wrote...

Grond0 -- I think the computer actually rolls 3 6 sided die then add/subtracts race bonuses/penalities, which is why Gate70 got 4 for a racial minimum in some cases and 2 in others. I suspect the computer does what I said about bumping it up to minimum if the roll wasn't high enough, not rolling 15-18 -- and yes doing that, will result in lots of 15s being rolled, but I don't see anything wrong with that. Btw, I am going to see if the roll is 75 BEFORE applying the class minimums...might help the player a little.

I agree that would seem reasonable, but I don't think it works like that. Just rolling 3d6 would give you an 18 only 1 in 216 rolls and they're considerably more common than that (just not 1 in 4 if rolling between 15 and 18).


Except Grond0, that if the computer really is re-rolling if you don't get 75, maybe the computer really did 300 rolls before you see your first numbers on the screen, so my conjecture still might be right, and wouldn't break those odds you quoted.

The frequencies I was referring to are the numbers you actually see.  If it was just a simple 3d6 and a minimum stat of 3 you would expect to see an 18 once in 216 times.  They are far more common than that - try just rolling a few stats to check.  However, low stats are far less common than high ones, which is why I thought that there is some form of bumping up going on (there is an alternative explanation - see below).


corey_russell wrote...
Ran into something strange. It's either a bug, or maybe some rule we don't know about. To interpret the class minimums I was initially just going to look for a keyword -- such as "illusionist" then apply the class minimum. But I found out I can't do that, e.g., if I create a cleric/illusionist, the dexterity minimum is 3, even though for a standard illusionist the minimum DEX is 16. So then I thought ok, perhaps the rule is you take the lowest minimum for multis. But that isn't the case either, as I then created a fighter/thief (gnome) and it enforced the STR 9 DEX 9 rules for fighters and thieves. Did I find a bug? Or is this 2nd ed. rule I haven't a clue about?

Anyone know anything about this?

Sounds like a bug to me.  Thinking about it as a result of these discussions I suspect that the game may be doing something like this:
1)  Checking to look-up tables for race and class to determine the maximum and minimum for each statistic.
2)  Referring to another set of look-up tables showing possible values within each possible maximum and minimum.
3)  Setting a % chance for each possible roll, e.g. a 3 might be set to 0.5%, 10 to 5%, 15 to 15% and 18 to 3%.
4)  Generating a random number between 0 and 1 to see which number is triggered.
5)  Bumping up the lowest stat in order to ensure the total is never less than 75 (this will happen fairly rarely anyway as the % chances for low stats to trigger are themselves set as small).

I would guess that the illusionist multi-classes have just been missed off the first set of look-up tables, so that the game uses the standard mage multi-class instead.  Possibly the decision to make gnomes multi-class to illusionist was made late in development and they never got round to implementing this properly.

#24
corey_russell

corey_russell
  • Members
  • 5 289 messages
Haha, seems the jokes on me. I forgot something kinda important -- quickbasic is 16 bit which Vista/Win 7 64 bit won't let run. Well, at least not unless you run it in Dosbox. If anyone wants try try it out so far, PM me with your e-mail address.

#25
Gate70

Gate70
  • Members
  • 3 208 messages

corey_russell wrote...
Ran into something strange. It's either a bug, or maybe some rule we don't know about. To interpret the class minimums I was initially just going to look for a keyword -- such as "illusionist" then apply the class minimum. But I found out I can't do that, e.g., if I create a cleric/illusionist, the dexterity minimum is 3, even though for a standard illusionist the minimum DEX is 16. So then I thought ok, perhaps the rule is you take the lowest minimum for multis. But that isn't the case either, as I then created a fighter/thief (gnome) and it enforced the STR 9 DEX 9 rules for fighters and thieves. Did I find a bug? Or is this 2nd ed. rule I haven't a clue about?

Anyone know anything about this?

I suppose we ought to check each combination out.

Gnome illusionist/thief and illusionist/fighter also reduce dexterity to 9 and 3 respectively. They also allow a wisdom of 2 (illusionist/cleric forces 9 wisdom so it looks like the rules are inconsistently applied).

Attempt 2 17 and a bit.


class/kit minimums and alignments (note "x" is an invalid selection flag).
Image IPB

Race minimum and maximum rolls.
Image IPB

Modifié par Gate70, 23 février 2012 - 06:57 .