Commit Graph

539 Commits

Author SHA1 Message Date
Gabda b870596f15 Add #6887: Option to show zone inside local authority boundary of towns
Can be found at town information > local authority window
Layout for button is same as Graph Keys
Turn on/off for every town individually
2019-08-17 21:45:20 +01:00
peter1138 c02ef3e456 Feature: Add NotRoadTypes (NRT) 2019-05-01 21:36:27 +02:00
Charles Pigott 5b34c8019f Codechange: Remove Company/OwnerByte types 2019-04-29 17:40:22 +01:00
Charles Pigott f20b75d712 Codechange: Remove TownLayoutByte type 2019-04-29 17:40:22 +01:00
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
Niels Martin Hansen cebdd72146 Fix #7440: Remove town sign when deleting town, not add it once more 2019-04-02 09:46:33 +02:00
Henry Wilson cc62f4163f Cleanup: Remove unused size template parameters from SmallMap and Auto[Free|Delete]SmallVector 2019-03-26 20:15:57 +00:00
Henry Wilson bfd79e59dc Codechange: Replace SmallVector::Clear() with std::vector::clear() 2019-03-26 20:15:57 +00:00
Gabda dea7f078f4 Codechange: Update town sign on population change only when population is shown (#7368) 2019-03-12 19:12:34 +00:00
Niels Martin Hansen e8d397e4ee Codechange: Make a merged k-d tree index of all viewport signs 2019-03-09 20:27:11 +01:00
Niels Martin Hansen d84b67e54d Codechange: Make a k-d tree index of stations 2019-03-09 20:27:11 +01:00
Niels Martin Hansen 7b56be0f3a Codechange: Make a k-d tree index of towns 2019-03-09 20:27:11 +01:00
Peter Nelson 8b1b3fd0f9 Feature: Non-rectangular sparse station catchment area. 2019-03-09 16:33:47 +00:00
Niels Martin Hansen 52572cafa6 Add: Option for population-linear town cargo generation
Introduce a new default algorithm for town cargo generation (passengers and mail), and a game setting to choose between the new and original algorithm.

The original town cargo generation algorithm has the property of the generated amount relating to the square of each building's population, meaning large towns easily produce more cargo than can realistically be transported. The problem is excessive cargo is amplified if playing with cargodist.

The new algorithm introduced instead has a linear relation to the population. The result is that smaller towns will produce slightly more cargo, while the largest towns will produce about a fourth of what they would with the original algorithm.

Existing savegames will use the original algorithm, while new games will default to the new algorithm.
2019-03-04 20:19:44 +01:00
PeterN ebc3934ee6
Fix #7043, Fix #7274: Delete town owned bridge based on adjacent tile ownership, not nearest town. (#7284)
This only affects failed town generation, as towns do not delete bridges under any other circumstances.

The existing test performed badly with a large number of towns due to having to calculate the
nearest town, and also by its nature assumed a bridge was built by the nearest town, leading
to bridges of nearby large towns be removed incorrectly.

If we gain the ability to quickly retrieve the correct town (which is _not_ the nearest town) from the bridge, this change should be reviewed.
2019-03-03 22:28:55 +00:00
SamuXarick 50a0cf1915 Change: Allow towns to build bridges over rails and one-way roads. (#7291) 2019-02-28 17:45:17 +00:00
Niels Martin Hansen 48b334cf97 Add: Houses can accept up to 16 different cargo types via NewGRF.
New Action0 property 23 for feature 07, variable length, format B n*(B B). Initial byte is number of structures following. First byte in structure is cargo id, second is acceptance level in 1/8 units.
2019-01-21 16:06:25 +01:00
nikolas d8ccad91f9 Fix: Some code and comment typos
Found with codespell
2019-01-17 22:01:07 +00:00
Joan Josep 9aecbac2b4 Codechange: Define INVALID_TOWN as a TownID (#7044) 2019-01-12 23:20:10 +00:00
Charles Pigott b5028efc1f Fix: Protect against a few out of bounds or uninitialised usage errors 2018-10-31 12:41:49 +01:00
Charles Pigott f5b1115039 Doc: Lots and lots of doxymentation fixes 2018-10-31 12:35:54 +01:00
Max Maton eed0da60a2 Fix #6622: Fixes empty company name in news when gamescript constructs a town 2018-09-18 18:35:26 +02:00
Pavel Stupnikov 9fc3212679 Feature #6397: Keep town growth rate in sync with house count
Takes some code and ideas from #6378 patch, but doesn't change anything GS-related.
2018-06-24 20:55:48 +02:00
PeterN 4cebebcf68
Change: Add CargoTypes type for cargo masks. (#6790) 2018-05-21 22:08:39 +01:00
Pavel Stupnikov fef8b831a9 Change: Switch town growth rate and counter to actual game ticks (#6763) 2018-05-02 21:01:30 +02:00
Pavel Stupnikov 8d8b9a026a Feature #6610: Allow towns to build houses on road turns (#6758) 2018-04-28 23:47:36 +02:00
frosch b4b98e5165 (svn r27893) -Codechange: Use fallthrough attribute. (LordAro) 2017-08-13 18:38:42 +00:00
frosch bcc2c7d06e (svn r27739) -Cleanup/Revert (r12162): Clearing MP_HOUSE with DC_EXEC always fails, so there is no effect in testing for houses first. (adf88) 2017-01-22 13:13:15 +00:00
frosch ab7ebdcfd9 (svn r27423) -Fix: When towns expanded single-bit roadtiles using a grid-layout, they used the layout position of the neighbouring tile. 2015-10-30 17:17:54 +00:00
frosch d626962a38 (svn r27420) -Fix [FS#6362]: GrowTownAtRoad sometimes returned false, even when a house was built. (_dp_) 2015-10-30 16:19:09 +00:00
frosch ab69952f2a (svn r27306) -Fix (r27305): Confused tiles. 2015-06-20 12:55:17 +00:00
frosch 0e378747db (svn r27305) -Fix [FS#6320]: Account for road-bridges and drive-through-stops in CanFollowRoad. 2015-06-20 12:40:04 +00:00
frosch 813e85f301 (svn r27260) -Fix (r27244): economy.allow_town_roads should not affect town placement during world generation. 2015-04-28 17:25:21 +00:00
frosch 5992f4fa1b (svn r27259) -Fix (r27244): Incorrect merge. (_dp_) 2015-04-27 21:40:46 +00:00
frosch 9aa0ba43f7 (svn r27249) -Fix [FS#6240]: In some cases town growth failure was considered as success. (_dp_) 2015-04-25 12:17:16 +00:00
frosch 9fb56ca02e (svn r27248) -Fix [FS#6257]: Town labels on smallmap and zoomed-out viewports were not centered. (_dp_) 2015-04-25 11:58:19 +00:00
frosch 93d7db0b36 (svn r27247) -Cleanup: Make GrowTownAtRoad return a bool. 2015-04-25 11:46:10 +00:00
frosch 915aad7603 (svn r27244) -Change [FS#6245]: Do not consider road junctions with trivial dead ends as branch points during town growth. (_dp_) 2015-04-25 11:12:47 +00:00
rubidium 30f778e933 (svn r27105) -Fix [FS#6195]: grow_counter was not properly bounded by growth_rate, but by some other value used to calculate growth_rate. 2015-01-01 21:25:42 +00:00
rubidium d534c80e94 (svn r27020) -Cleanup: some coding style consistency improvements (mostly spaces) 2014-10-15 18:31:37 +00:00
rubidium 9daf7e749c (svn r26879) -Codechange: remove most MayHaveBridgeAbove calls since the data is now always accessible 2014-09-21 11:24:51 +00:00
rubidium 9ed12b0f07 (svn r26509) -Codechange: replace strdup with stredup (the latter ensures the return is not NULL) 2014-04-25 15:40:32 +00:00
rubidium 0463dbdc9e (svn r26482) -Codechange: add an include that allows us to undefine/redefine "unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values 2014-04-23 20:13:33 +00:00
frosch 55502341ac (svn r26346) -Fix [FS#5870]: Call Layouter::ReduceLineCache from GenerateTownName in all cases. 2014-02-16 17:45:24 +00:00
frosch 20785c79fc (svn r26345) -Cleanup (r26310): Spawning towns does not touch persistent NewGRF storage. ClearPersistentStorageChanges is a dangerous/magic function which should not be called without reason. 2014-02-16 17:42:28 +00:00
rubidium 9f6b8aea49 (svn r26313) -Codechange: use a set for finding unique town names instead of iterating all just created town names (MJP) 2014-02-06 21:06:59 +00:00
rubidium d05ff6e77b (svn r26311) -Codechange: use a different method for finding whether there is a nearby town when the map has thousands of towns (MJP) 2014-02-06 21:01:50 +00:00
rubidium fcb122124b (svn r26310) -Codechange: clean up some caches during town generation to keep memory usage significantly lower (MJP) 2014-02-06 20:55:49 +00:00
rubidium 30a95966ec (svn r26308) -Fix-ish: do not try to build more towns/industries than the pool can hold (MJP) 2014-02-06 20:42:09 +00:00
rubidium c143ca729a (svn r26104) -Fix: do not attempt to do stuff with an invalid direction, especially using it as index into a table 2013-11-25 13:13:35 +00:00
rubidium 8e27031492 (svn r26051) -Fix: out of bounds access in CmdTownCargoGoal 2013-11-22 21:44:23 +00:00
frosch 9a41aefcc4 (svn r25968) -Add: [Script] ScriptTown::TOWN_GROWTH_NONE to indicate no town growth via ScriptTown::SetGrowthRate and GetGrowthRate. 2013-11-12 17:57:12 +00:00
frosch cef342d57c (svn r25931) -Fix [FS#5786-ish]: [NoGo] Preserve the relative town growth progress when changing the town growth rate. 2013-10-30 10:01:49 +00:00
frosch 12b30103b1 (svn r25922) -Codechange: Rename TOWN_IS_FUNDED to TOWN_IS_GROWING. It is not tied to funding a town. 2013-10-28 10:55:34 +00:00
zuu dfb5663313 (svn r25849) -Codechange: Introduce IsTileFlat to not compute full slope information for situations when we only want to know if a tile is flat or not (cirdan, LordAro) 2013-10-12 22:07:58 +00:00
frosch 6a0439a789 (svn r25838) -Codechange: Rename HOUSE_MAX to NUM_HOUSES. 2013-10-12 16:33:19 +00:00
frosch 35d7e8bca4 (svn r25833) -Codechange: Move ObjectType from map array into pool item. 2013-10-12 16:30:42 +00:00
zuu ffec9b41e8 (svn r25789) -Fix (r25783): Calling GSTown.FoundTown in world gen caused world gen to terminate and start the game 2013-09-21 15:09:00 +00:00
zuu 67ab3108d6 (svn r25785) -Feature: [Script] Allow AIs and GS to found towns. Allow GS to rename towns 2013-09-19 18:48:05 +00:00
frosch 87fae6ba57 (svn r25140) -Fix [FS#5519]: Towns are build as OWNER_TOWN, so they also need to be removed as OWNER_TOWN. 2013-04-03 20:24:10 +00:00
planetmaker c24374f99c (svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by Eagle_rainbow) 2013-01-08 22:46:42 +00:00
alberth 732e073261 (svn r24776) -Doc: Typo fixes, additions, and additional dots collected from various sources (including Eagle_rainbow, MinchinWeb) 2012-12-01 13:12:39 +00:00
frosch 6c2e201133 (svn r24391) -Change [FS#5229]: Disallow original and better road layouts to build roads under bridges along the bridge direction. 2012-07-09 19:43:22 +00:00
frosch 95d3d6fdef (svn r24291) -Add: [Script] ScriptEventRoadReconstruction. 2012-05-26 14:16:45 +00:00
frosch 8dc553a039 (svn r24290) -Add: [Script] ScriptEventExclusiveTransportRights. 2012-05-26 14:16:38 +00:00
frosch ec91dc5ffc (svn r24287) -Feature [FS#2688]: News item for exclusive transport rights. (based on patch by Grantovich) 2012-05-26 14:16:23 +00:00
frosch a8c88f43b6 (svn r24284) -Codechange: Remove NewsSubtypes and directly use NewsTypes and NewsFlag instead. 2012-05-26 14:16:03 +00:00
frosch a0be398da9 (svn r24283) -Codechange: Add AddTileNewsItem function to preemptively deduplicate code. 2012-05-26 14:15:57 +00:00
frosch 477a09d13e (svn r24205) -Feature [FS#5178-ish]: Show a hint in the supplies tab of station windows, if the station is affected by exclusive transport rights. 2012-05-06 11:38:52 +00:00
frosch cc1e4ca5ad (svn r24183) -Fix [FS#5169]: Town radii were not updated immediatelly after construction/destruction of houses, resulting in desyncs. 2012-04-26 21:04:18 +00:00
rubidium 41e5c839e0 (svn r24179) -Codechange: move some variables of Town to TownCache 2012-04-25 20:50:13 +00:00
alberth 0d74c074dd (svn r24105) -Feature: Be more careful with the population of a small town while placing a statue. 2012-04-08 17:30:20 +00:00
alberth 2911732841 (svn r24104) -Codechange: Output the resulting tile through the user data. 2012-04-08 17:29:00 +00:00
alberth a01948dbf3 (svn r24103) -Codechange: Handle clear tiles separately from house tiles. 2012-04-08 17:27:47 +00:00
alberth c876d18320 (svn r24102) -Codechange: Refactor tile clearability test out of the statue callback. 2012-04-08 17:26:59 +00:00
alberth f607538882 (svn r24101) -Codechange: Reverse a condition for increased readability. 2012-04-08 17:26:01 +00:00
rubidium c8ce0faca4 (svn r24064) -Fix [FS#5121]: make the full snowedness level of houses the same as roads and rails 2012-03-25 18:19:21 +00:00
frosch 5486e05f65 (svn r23953) -Fix [FS#5062]: When the population of a town changes the town view might even have to change size due to different cargo requirements. 2012-02-15 21:34:58 +00:00
frosch 2458a29fd0 (svn r23819) -Fix [FS#4951]: Removal of towns with 0 population failed during map generation. 2012-01-17 18:46:09 +00:00
rubidium 6d6be50ae0 (svn r23740) -Codechange: remove some 300 unneeded includes from the .cpp files 2012-01-03 21:32:51 +00:00
truebrain ad48ab9237 (svn r23626) -Add: ScriptTown::SetText, which adds custom text to the Town GUI 2011-12-19 21:00:55 +00:00
truebrain 77b7366c29 (svn r23622) -Add: a set of events to trigger in a GameScript 2011-12-19 20:59:36 +00:00
truebrain afcf07ac8a (svn r23620) -Add: ScriptTown::SetCargoGoal and ScriptTown::SetGrowthRate (GameScript only) 2011-12-19 20:59:19 +00:00
truebrain 5ff98b45c1 (svn r23617) -Add: ScriptTown::ExpandTown, to grow a town (GameScript only) 2011-12-19 20:57:51 +00:00
rubidium 3d88c74389 (svn r23526) -Codechange: unify cargos vs cargoes 2011-12-15 21:56:00 +00:00
rubidium 2bf0fc3c5c (svn r23476) -Codechange: use the error queue to replace switch mode error strings, again making it possible to return multiple errors 2011-12-10 15:16:58 +00:00
rubidium 58423b26d1 (svn r23474) -Codechange: move the declaration error related functions to error.h 2011-12-10 13:54:10 +00:00
terkhen de0bf0663a (svn r23407) -Codechange: Keep a bitmap of all cargos accepted by towns. 2011-12-03 22:23:10 +00:00
terkhen 59d8b0204f (svn r23405) -Codechange: Keep a matrix of cargos accepted by houses for each town (michi_cc). 2011-12-03 22:21:27 +00:00
truebrain 98103121d4 (svn r23355) -Codechange: rename all AI* to Script* (Rubidium) 2011-11-29 23:15:35 +00:00
rubidium 04c40aa04d (svn r23342) -Fix (r23300): for arctic and desert towns you were required to deliver more than 4 billion units, instead of one or more units 2011-11-27 11:42:52 +00:00
truebrain 7ff6daee80 (svn r23323) -Fix: when you fund a town, it should grow; goals reached or not 2011-11-25 11:35:15 +00:00
peter1138 3e1d070413 (svn r23319) -Fix (r23316): Offsets of viewport signs were not scaled up. 2011-11-24 17:37:20 +00:00
truebrain e30256692f (svn r23303) -Add: economy.fund_buildings, to disallow funding buildings 2011-11-23 16:10:18 +00:00
truebrain f906ebd2a5 (svn r23300) -Add: show on the GUI when a town grows and make a general framework to store goals of a town 2011-11-23 16:07:14 +00:00
truebrain 229e572663 (svn r23298) -Add: track statistics of all incoming and outgoing goods. Incoming based on TownEffect, outgoing based on CargoType (based on patch by Terkhen) 2011-11-23 16:05:19 +00:00
michi_cc 6548ec6e9e (svn r23233) -Codechange: Refactor maximum and actually transported cargo amount of towns into a reusable struct. 2011-11-15 20:47:53 +00:00
rubidium d4e1efc78b (svn r23183) -Codechange: merge BRIBE_FAILED and BRIBE_FAILED_2 messages (monoid) 2011-11-10 18:09:09 +00:00
yexo 6a272233b3 (svn r23160) -Fix: wrong comments in a lot of TileTypeProcs definitions 2011-11-08 17:37:32 +00:00
frosch 30874b5e81 (svn r23147) -Change: [NewGRF v8] Unify the return values of boolean callbacks, and check the results for validity. 2011-11-08 17:26:49 +00:00