Jump to content
  • Advertisement
Sign in to follow this  

Creating a utility program to randomise a world

This topic is 1471 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

There is this game called Crusader Kings 2. I am making a mod for it. How is the game set up:


The gamemap is divided into provinces(regions).



I cropped it a lot.


Each province is the smallest divisible portion of map. There are three types of provinces. Land, water and wasteland provinces. There is no need to worry about water and wasteland provinces. Wasteland cannot be interacted with in any way and water cannot be owned, but only used for naval transports.



I colored all wasteland provinces black and all water provinces white. I'll write about the red line in a bit.


In addition the game has characters. Each characters can hold a title. Several titles even. However, titles =/= provinces. There are 5 levels of titles. From lowest titles to highest: Barony, County, Duchy, Kingdom, Empire. We don't need to concern ourselves with barony titles, so lets assume that the lowest title is County.


County title is the only title that is tied to provinces permanently. So, we can make an exception here that county level title == province. 


A character that holds a county title, owns the corresponding province. A character must hold at least one county title to be able to hold any of the above titles.


Lets say that our character has, in addition to county title, a duchy title too. A character who hold a duchy title can have vassals. But the vassals can only be lower titles than a duchy. Vassals are essentially separate factions inside your own country. Your vassals can wage wars among each other but not with you(except if the war is for independence, against tyranny or a conspired coup of vassals'). Anyone who is not your vassal cannot wage war with your vassals. Inter-country wars can only be waged between the top title holders.


Other titles (kingdom, empire) work the same way. Kingdoms can have vassals who are duchy level or lower. Empires can have vassals who are kingdom level or lower.


One character can also hold multiple same level titles. For example a character can hold the titles of Kingdom of England, Kingdom of Wales, Kingdom of Scotland and the Kingdom of Ireland at the same time or any combination of any of the titles.




What I want? I want to make an utility program to set up a scenario for the provinces that I circled with the red line. Making any combination appear in the game is easy since game uses txt files for setting up the scenarios. All I need to do is to program the utility to write the appropriate txt files and dump them in correct folders. That I can manage.


But I cannot figure out how do I make the program decide semi-randomly of how to hand the titles out. There can be as many characters as there are provinces(if I give 1 province to 1 char). But it would better if some characters hold more that 1 province. And I also need something to decide who gets a deuchy titles and who not and who are vassals and who are not.


Ask if there is something that can't understand?

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!