If I understand correctly, the building utility goes through a list of all specials in some set order, right ? Let’s say it goes like: beehive, cathedral, fema camp, mall. Now, when selecting a special, could we add a random roll and compare it to a building-specific threshold ? In that case it could go: If the RND > Building_threshold then place special; else next special.
Then, having different layouts would be just the question of adjusting thresholds so that mall1_thresh + mall2_thresh+… = x, with x detemrining the actual chance of encountering ANY type of mall. Would something like this work ?[/quote]
Not really. The way special placement in overmap generation works (I’m assuming this is what you mean by building utility, and not acidia’s utility) is it splits the map up into an N x N grid, then it picks a grid entry and selects a random point within that grid. After that, it makes a list of overmap specials it is allowed to place there based on the location that is selected. Next, it splits that list up into specials that it MUST place (specials that have not met their minimum amount set in the definition), and specials that it CAN place (specials that have met their minimum but not their maximum). If it has any in the must place, it picks one of those at random, otherwise it picks one at random from the can place list. After that it goes into the actual placement, where it applies rotation, road connections, etc. The correct way to do it would be to separate the definition of the special’s layout from the rest of the special. That way instead of how it is now where it is:
[tt]
{
type: special,
id: mall,
layout: { point:[0,0,0], mall_0_0_0, etc}
occurrences: [0,4],
etc…
}
[/tt]
it would be something more like:
[tt]
{
type: special,
id: mall,
layouts: [ mall_layout_1, mall_layout_2, etc ]
occurrences: [0,4],
etc…
}
{
type: special_layout,
id: mall_layout_1,
layout: { point:[0,0,0], mall_layout1_0_0_0, etc}
etc…
}
{
type: special_layout,
id: mall_layout_2,
layout: { point:[0,0,0], mall_layout2_0_0_0, etc}
etc…
}
[/tt]
This would also solve the problem quite well - the question is how the editing of individual tiles works (as in, is keeping all the walls lined properly on a, say 3x3 special, be difficult/arduous or is it just a case of "plot it in excel and off you go" ?).
It shouldn’t be too difficult as long as you can easily see what tiles it may be connecting to, but the more variations you have, the more opportunities you have for error.
[quote="vache, post:54, topic:7085"]Location handling in particular would require a rework of how it places specials entirely though.[/quote]Here I must admit to a total lack of knowledge - are the map features not actually treated as entities at all ?
See above for how it handles locations. If you wanted to place something in a very specific area, like a small marina on a river bank, you would have to get very lucky and have the game randomly select a point on a river bank when it is picking places to plop a building down. Having control over things like that would require a new way of selecting where to place specials that could examine the list of specials and determine what locations to select, rather than selecting a location and picking a special that fits.