Jump to content
  • Advertisement
Sign in to follow this  

Auto-Selecting Optimal Citizens

This topic is 2024 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

So part of my upgrade to Majesty involves having multiple unit types per Order(Guild in Majesty). And also that they are not static types and they are selected from an educated populace. Educated populace is created Impressions style with high tier housing. Some low level heroes use regular population since you need some heroes during the process of advancing your early society.


Anyways because the game is a simulation and you are supposed to have only limited control you need to provide educated citizens nearby an order motherhouse.


I am trying to decide how to select citizens with stats suited for particular orders. I could assign stats based on the base class that are preferred and select citizens with the best match automagically when I initiate recruitment.


Alternatively I could let the player search through a list of in range and pick their own choice for a new ordermember.


A third more intensive option is to allow the guild to make its own choice and choose when to recruit a new member, that's simmier but farther outside the current scope of the game mechanics. It might take some work to make the AI smart enough to spend its money wisely.


The goal is basically to get the player to create several educated population centers and spread around various Orders and economic guilds and such. If I let them choose what citizen to use the goal would be for them to make smart choices about which people would be good at what kind of work. There may be motivation to spread top tier mages compatible citizens to different Orders or even pick a few good mages with high crafting for making an Order's special items.


Orders can choose to multi-class by reading special books of knowledge. Only the leader of the order, preceptor for military, high priest for church, and archmage for magic can read books. They can then enable their Motherhouse to train others in the guild. A leader would need high research skills to read diverse books and read them quickly for maximum knowledge gain. Crafters would need as previously mentioned high crafting and production related skills.


Equipping an Order with enough characters good at the right things is important to let them become powerful. You cannot directly control an Order member except in special cases. Perhaps assigning them to crafting or researching and special skills but otherwise they are autonomous. So they make their own decisions about fighting and buying items and patrolling and shit.


I'm trying to decide how much control in selecting initiates to give and such.

Share this post

Link to post
Share on other sites

Just off top of my head


You need a list of professions/'roles'/positions that need filling and for each in order of importance the attributes needed/useful for them  (if more than one NPC is needed for the role then a count has to be part of the data -  size of the organization that uses the role sets and how many in each is a seperate task that would have to be done first)


The roles (if multiple quantum positions in same profession exist) should be ordered highest expertise to lesser     (ie guildmaster first, guild members, apprentises, lackeys last)    Some numeric value is needed to force sorting by highest expertise needed to rank them for sorting



You will have a list of canidate NPCs with attributes determined (probably using bell curve to help create a reasonable set of variations)


Attributes might be predefined skills as well as the basic 'stats'


You calculate/score an attributes value (higher better...) required for a role   numerically as a multiplier or by a curve  (higher ability in skill most needed will generate higher attribute score than  ability in less important attribute or lower value in a attribute)


You would sum up all the scores for all the required attributes for the role


--- ---


Doing the assignment :


Loop - You work your way thru list of all roles (sorted by highest expertise needed (ie- all guild masters first))


 1) For all candidate NPCs you calculate (score and sum) and sort  by top "score for that role" order.    building a temp list


  2)You   assign the best available candidate to the role (highest score)

    (and closing out that role or decrementing number personnel needed for it)  

    (the one assigned candidate is removed/marked unavailable)


 IF there is no potential candidate then the role will have to be left unfilled  (or filled as much as they can be - some there may be no qualifying candidates - 0 score)


Endloop - You continue til all roles are processed




Some checking for ties may require random assignment  from set of  all who score a  tie for the  role (as current highest score)




If two attributes are equally needed  for a role you may have to normalize the  score calculation  multiplier values




if there are PreRequisits for a role (a minimum value for each of the  list of needed attributes)  you may need logic to discard/filter-out  candidates.




Can get uglier if your NPCs can hold more than one 'role'   then the whole process need to be done seperately for independant sets of 'roles')




Local variations


If you have alot of high skilled people for one possible industry/activitty (and the resources needed to scale it large( you might add logic to have that local group specialize with more emphasis in that particular industry  (assuming there is a need for the product  --- thats another seperate auto-decision mechanism...)  This usually has group teams which are set of roles which have to work as a complete group to operate correctly .  Elaborate on that  for you game later


^^^ this gets messy if you somehow have to figure out if what CAN be produced NEEDs to be produced (like if everyone makes it and the supply would greatly exceed demand --- you would need to prefigure   that demand which is hard to do when you havent yet defined which areas have the personnel to generate the output (using roles)    ---- chicken befor ethe egg problem that usually takes an organic stepwise growth buildup to allow the patterns to grow themselves (done before you reach the steady-state environment the player plays in)

Share this post

Link to post
Share on other sites

perhaps make a search function, letting you choose say citizens with an education between "here" and "there" among other things. 

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!