Jan 7, 2012

As I wrote before, faction semi-randomness wasn't something hard to create.
I got wolfs at first level of Broken Sepulcher. Also, funny bug occurred, wolfs armed themselves with urns, chests and barrels. It isn't new created bug, just item equipment method bug with animal gear. There wasn't any  animal dungeon with standing items beforehand. I'll fix it, of course.
But it isn't that cool, as I thought, I have an idea how to improve this, but later.

Right  now, I working on semi-random content of houses and dungeon rooms, when finished, it would change FFHtR gameplay tremendously, especially if a good list of random canvases would be created.
How it would work?
Lets see, on semi random maps or completely random dungeons some floor tiles would be marked as "random room tiles". If generator would meet such tile, it would use flood fill algorithm to get coordinated of such tiles unit, rooms and would create table of such rooms. Then, game would check every such room and put there something from one of the preset random variants.
For example, our old good hamlet of Hallowel has 10 empty houses, this houses would be filled with  "random room tiles". Generator would form 10 rooms to fill.
Also, Hallowel config file would have something like that:

RANDOM_ROOM:CIVIL_HOUSE_POOR,1,4,200;
RANDOM_ROOM:SHOP_FOOD_RICH,0,2,500;
it means, that Hallowel has two configs for random rooms CIVIL_HOUSE_POOR and SHOP_FOOD_RICH.
Of course, we need really big list, if we want it to interesting, but its just an example.
First number, 1 for CIVIL_HOUSE_POOR means, that Hallowel should have at least one of this, and second number 4, means maximal number of such houses in this hamlet (it is poor hamlet, but it isn't so bad).
And the last one, 200 means, that when guarantied quantity of such sites would be placed, there is 200 of 1000 chance, that random generator would try to select another type of canvas if randomly select that.
The same is for SHOP_FOOD_RICH.

Good, then we open file named CIVIL_HOUSE_POOR.
it looks like this:
NAME:house;
MIN_SIZE:2;
MAX_SIZE:5;

CONTENT;
CIVIL:RANDOM,500;
CIVIL:RANDOM,500;
CIVIL:BEGGAR,1000;

ITEM:TRASH,100;
FURNITURE:PLAIN_BED,800;

well, it is enough for poor house, I think ^_^.
MAX_SIZE and MIN_SIZE would control size of used room, and would tell generator to try another one, if requirements doesn't meet. It would prohibit beggars shacks in palace big rooms and palaces in carton boxes -_-.

So, you understand next, it would add 3 creatures. Persons with random civil profession with chance 500 of 1000 and one guarantied creature with beggar "profession", chance 1000 of 1000 ^_^.
And two items, trash and bed.
FURNITURE and ITEM constants would tell generator, how this items should be placed.

Of course, such system doesn't respect compatibility of room, so we can have shack near palace or thiefs den next to guard station, but it isn't concern of my current work. I need to make it runing smoothly. Compatibility would be future goal. Yeah, it would be nice to have bad, rich, merchant or docks districts, but ok, lets do what we plan first!

2 comments:

  1. Wow, you really expanded that "random rooms" idea! Now it seems perfectly realistic, good luck in implementation.

    ReplyDelete
  2. Thank you! It just a matter of time, we would have this in FFHtR!

    ReplyDelete