Industry spawn rates

Discuss, get help with, or post new graphics for TTDPatch and OpenTTD, using the NewGRF system, here. Graphics for plain TTD also acceptable here.

Moderator: Graphics Moderators

Post Reply
User avatar
FulliAutomatix
Engineer
Engineer
Posts: 119
Joined: 24 Aug 2014 12:20
Location: Kaon Prison, Cybertron

Industry spawn rates

Post by FulliAutomatix »

So I'll go straight to the point: I'm developing a small chain of industries for the RUKTS extension set, only 2 new ones, and I cannot for the life of me figure out how the spawn rates work.
There's the 2 variables "prob_in_game" and "prob_random", both with maximum possible values of 255 iirc, but I don't understand how this works. Does higher mean more spawn? Does lower mean more spawn? In the 9 months I've had this lying around I've always had the same problem that the industries will just flood the map, with over 1000 nuclear sites one a 2k by 4k map, with every other industry barely having over 100 of each example (using FIRS Extreme economy).

I have also disabled industries closing for these two and I can't remember why, and they only spawn near water (see the repo for that code). I have also changed the behaviour of the power station, and also giving it new graphics, but it behaves normally.

The full repo can be found here

Here be the two items in question:
[+] Spoiler

Code: Select all

item(FEAT_INDUSTRIES, uran_mine){
	property {
		substitute            : 0x00 ;
		layouts               : [tilelayout_uran_mine] ;
		life_type             : IND_LIFE_TYPE_EXTRACTIVE ;
		fund_cost_multiplier  : 37 ;
		prod_cargo_types      : [cargotype("URAN")] ;
		accept_cargo_types    : [] ;
		conflicting_ind_types : [0x01] ;
		prod_multiplier       : [16] ;
		prob_random           : 7 ;
		prob_in_game          : 30 ;
		map_colour            : 255 ;
		spec_flags            : bitmask(IND_FLAG_BUILT_ONLY_AFTER_1960) ;
		new_ind_msg           : TTD_STR_NEWS_INDUSTRY_CONSTRUCTION ;
		name                  : string(STR_URANMINE_NAME) ;
		nearby_station_name   : string(STR_URANMINE_STATION_NAME) ;
	}
	graphics {
		produce_256_ticks			: uran_mine_produce_monthly ;
		location_check				: uran_mine_water_check ;
		monthly_prod_change			: sw_uran_monthly_change_check ;
		construction_probability	: sw_nuclear_build_date_check ;
		//random_prod_change    : nucrep_random_prod_change_switch ;
	}
}

item(FEAT_INDUSTRIES, nuclear_reprocessing_site){
	property {
		substitute            : 0x01 ;
		layouts               : [tilelayout_nucrep_site_a, tilelayout_nucrep_site_b] ;
		life_type             : IND_LIFE_TYPE_BLACK_HOLE ;
		fund_cost_multiplier  : 255 ;
		prod_cargo_types      : [] ;
		accept_cargo_types    : [cargotype("NWST")] ;
		conflicting_ind_types : [industry_type(IND_TYPE_OLD, 0x01), industry_type(IND_TYPE_NEW, 0), industry_type(IND_TYPE_NEW, 1)] ;
		prob_map_gen           : 10 ;
		prob_in_game          : 50 ;
		map_colour            : 208 ;
		//spec_flags            : bitmask(IND_FLAG_BUILT_ONLY_AFTER_1960) ;
		new_ind_msg           : TTD_STR_NEWS_INDUSTRY_CONSTRUCTION ;
		name                  : string(STR_NUCPROC_NAME) ;
		nearby_station_name   : string(STR_NUCPROC_STATION_NAME) ;
	}
	graphics {
		//produce_cargo_arrival		: nucrep_cargo_arrive_produce ;
		produce_256_ticks			: nucrep_produce_monthly ;
		location_check				: sw_nucrep_water_check ;
		//monthly_prod_change			: sw_nucrep_monthly_prod_change_check ;
		//random_prod_change			: sw_nucrep_random_prod_change_switch ;
		construction_probability	: sw_nuclear_build_date_check ;
		//colour                : sw_nucrep_colour_check ;
	}
}
Any help would be lovely, I can't get enough info out of the NML documentation.
User avatar
Pyoro
Tycoon
Tycoon
Posts: 2558
Joined: 17 Oct 2008 12:17
Location: Virgo Supercluster

Re: Industry spawn rates

Post by Pyoro »

As I understand, those values basically "don't mean anything" except whatever they are relative to other industries. ie if you have industry A with a prob of 1 and industry B with a prob of 2 it means you get twice as many of industry B (the total being controlled by the game settings and map size). But you also could have given them the values of 100 and 200 or 17 and 34 or whatever for the same result.

FIRS values are fairly low; so 30 and 50 are, yeah, about twice as high as anything else FIRS spawns. You can compare here:
https://dev.openttdcoop.org/projects/firs/files

Mill for example has 10/10. Lots of others have something like 5/3 or whatever.
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5602
Joined: 13 Sep 2004 13:21
Location: The Moon

Re: Industry spawn rates

Post by PikkaBird »

They're relative indeed, and the spawn rates may also be affected by location limits (eg needing a coastline, or needing to be a certain distance from other industries).
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: Industry spawn rates

Post by wallyweb »

FulliAutomatix wrote:Any help would be lovely, I can't get enough info out of the NML documentation.
Sometimes the original reference is handy. The GRF Specs might help you to fill in the blanks.
User avatar
FulliAutomatix
Engineer
Engineer
Posts: 119
Joined: 24 Aug 2014 12:20
Location: Kaon Prison, Cybertron

Re: Industry spawn rates

Post by FulliAutomatix »

Thanks for the help! I managed to fix all the issues I was having
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: GarryG, piratescooby and 65 guests