The International Simutrans Forum

 

Author Topic: Making Attractions 'Experimental'  (Read 2643 times)

0 Members and 1 Guest are viewing this topic.

Online Carl

  • Devotee
  • *
  • Posts: 1599
    • Website
  • Languages: EN
Making Attractions 'Experimental'
« on: September 22, 2011, 03:17:03 PM »
For a while I've formulating some ideas about how to improve the functionality of "attractions"/"curiosities" within Simutrans-Experimental. In my view, attractions are a relatively untapped resource which---if used properly---can be used to greatly enhance the realism of paksets. Many of the idea that follow have been nurtured through developing new attraction-sets for pak64.experimental.

Here are three ideas to improve the functionality of attractions, some of which should (I hope) be fairly easy to implement.


1. 'Upgrading'
Short version: Attractions should adopt a variant of the upgrading function of factories.

Longer version: Attractions are currently 'immortal'. But in reality, many attractions grow with the city they belong to. A small football field might, over time, grow into an international stadium. A small neighbourhood school might, as the neighbourhood grows, become a large school. By adopting a variant of the current factory upgrade behaviour, Experimental could simulate this behaviour.

This could be implemented as follows. In the .dat file for attractions, two new kinds of value would be specified: "upgrade_time" and "upgrades". For instance:

upgrade_time=5000
upgrade[0]=LargeStadium

This would indicate that when the city to which the attraction belongs reaches 5000 inhabitants, the attraction will be upgraded to a Large Stadium. (There could also be a further "upgrade_chance" parameter to introduce some unpredictability here.) Note that this would only be appropriate for city attractions -- that is, those which also specify a "build_time" parameter.


2. Dependence relations/prerequisites
Short version: allow for attractions whose appearance depends on the prior existence of another (specific) attraction.

Longer version: In the real world, some attractions won't appear unless another attraction are already present. That is, some attractions are pre-requisites for others. You might expect that a large science company would only set up a research lab in a city which had a university, for instance.

This can be simulated by specifying in the research lab's .dat file that it will appear only if the city already has a university. This means that the "chance=x" parameter for the research lab will be a conditional probability--it's the probability of its occurrence given that the city has a university.

Note that this would also allow for "sets" of attractions which, while in themselves unlikely to occur, will always occur together. For instance it might be the case that attraction A1 only occurs in 5% of cities -- but that the occurrence of an A1 will always (eventually) lead to the building of an attraction A2. This is currently not possible to simluate. If the "chance" parameters for A1 and A2 are both set to 5%, it's very improbable that they would ever occur together. But dependence relations will make this easy to simulate. The "chance=X" parameter for A2 will be 100, but its presence will depend on A1's presence. The two will always occur together---and if the chance of A1 occurring is 5%, this makes the probability of A2 occurring also 5%.


3. Multiple instances
Short version: allow attraction dat files to define multiple "build_time" parameters.

Longer version: An attraction's "build_time" parameter specifies how big a city has to be before that attraction can be built. But for the most part, a city will only contain one of each attraction, no matter how big it gets. However, some attractions occur multiple times in larger cities. For example: once a city reaches a certain size, it will need a second school---and then, eventually,  a third and fourth school. In order to simulate this, it would be useful to specify multiple build_time parameters, as follows:

Name=PrimarySchool
build_time[0]=5000
build_time[1]=12000
build_time[2]=20000
build_time[3]=29000

The same goes for all kinds of attractions.

Now this can be done under the current system, of course, by simply making several different attractions which are identical save for their build_times. But this can clutter up the list attractions which can be built, so this solution would be more elegant.

Offline The Hood

  • Devotee
  • *
  • Posts: 2889
  • pak128.Britain developer
Re: Making Attractions 'Experimental'
« Reply #1 on: September 22, 2011, 05:12:11 PM »
I like these ideas!

Offline ӔO

  • Devotees (Inactive)
  • *
  • Posts: 2345
  • Hopefully helpful
  • Languages: en, jp
Re: Making Attractions 'Experimental'
« Reply #2 on: September 22, 2011, 08:42:35 PM »
Do the attractions need to be the same size as the older one? or would they relocate if there's no free space around it?
As far as I'm aware, cities don't auto delete/destroy buildings or roads that have been already built.

It would seem a bit odd if they relocated, but it would be equally odd if the attraction reserves empty space around it.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18721
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Making Attractions 'Experimental'
« Reply #3 on: September 22, 2011, 08:44:56 PM »
Carl,

these are some interesting ideas indeed. One question on the first idea - do you imagine the attraction upgrading even if the newer attraction is a different size to the existing one? If so, that could be tricky to code. All the other things, at a glance, at least, seem possible: the issue is that there are a rather large number of higher priority things to do! Nonetheless, it's always helpful to have suggestions, even if they must remain suggestions for some time before being implemented. Of course, if somebody else were to code them, that would be another matter...

Thank you for your thoughts!

Offline greenling

  • Lounger
  • *
  • Posts: 1728
  • Simutransarchology it my hobby!
  • Languages: DE,EN
Re: Making Attractions 'Experimental'
« Reply #4 on: September 22, 2011, 08:49:37 PM »
Those Idea i like it.

Online Carl

  • Devotee
  • *
  • Posts: 1599
    • Website
  • Languages: EN
Re: Making Attractions 'Experimental'
« Reply #5 on: September 22, 2011, 09:00:33 PM »
Carl,

these are some interesting ideas indeed. One question on the first idea - do you imagine the attraction upgrading even if the newer attraction is a different size to the existing one? If so, that could be tricky to code. All the other things, at a glance, at least, seem possible: the issue is that there are a rather large number of higher priority things to do! Nonetheless, it's always helpful to have suggestions, even if they must remain suggestions for some time before being implemented. Of course, if somebody else were to code them, that would be another matter...

Thank you for your thoughts!

On the "different size" question. Am I right in thinking that town halls change size when they upgrade? Could this behaviour be adopted? Town halls do relocate sometimes when they upgrade, and maybe this would seem odd for attractions -- but equally it might in fact reflect real-life practice in many cases. Many kinds of institution outgrow their existing site and move to larger ones.

Alternatively, there could be a "same size" restriction on attraction-upgrading -- which would be restrictive, but better than no upgrading at all. (Just out of curiosity, how does this currently work for city factories?)

Obviously I appreciate that there are lots of higher-priority things to implement. I'd love to be able to help out in coding this, but my abilities simply aren't up-to-scratch. For instance, I can more or less decipher how the factory-upgrade code works by reading it---but I'd have no idea how to go about implement something similar for attractions.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18721
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Making Attractions 'Experimental'
« Reply #6 on: September 22, 2011, 09:04:54 PM »
Hmm - I don't think that town halls up-size when they upgrade: I've never seen it happen. Wouldn't they end up on the outskirts of a town if they did that, as there would be no space in the centre?

Online Carl

  • Devotee
  • *
  • Posts: 1599
    • Website
  • Languages: EN
Re: Making Attractions 'Experimental'
« Reply #7 on: September 22, 2011, 09:10:16 PM »
Having checked pak64's townhalls, they start at 1x1 squares and upgrade to 2x2 squares. Depending on the pakset's cityrules.tab, there may still be some free space in the centre of town---but I guess that sometimes town halls will have to relocate to the outskirts.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18721
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Making Attractions 'Experimental'
« Reply #8 on: September 22, 2011, 09:10:58 PM »
Hmm, interesting. That code could perhaps be re-used, in that case, but I've never really looked at the town hall code.

Offline The Hood

  • Devotee
  • *
  • Posts: 2889
  • pak128.Britain developer
Re: Making Attractions 'Experimental'
« Reply #9 on: September 22, 2011, 09:15:28 PM »
Or have them "consume" nearby citybuildings if possible?

Offline Junna

  • Devotee
  • *
  • Posts: 1082
Re: Making Attractions 'Experimental'
« Reply #10 on: September 22, 2011, 09:45:39 PM »
Having checked pak64's townhalls, they start at 1x1 squares and upgrade to 2x2 squares. Depending on the pakset's cityrules.tab, there may still be some free space in the centre of town---but I guess that sometimes town halls will have to relocate to the outskirts.

I have a custom town-hall set for 64 that has 3-tile town halls at the end of the spectrum, and they do indeed relocate if the upgrade does not fit.
Or have them "consume" nearby citybuildings if possible?

I think this would be more desirable (because it tends to look a bit off when the city-hall is on the very outskirts of a rather large city).

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9516
  • Languages: De,EN,JP
Re: Making Attractions 'Experimental'
« Reply #11 on: September 22, 2011, 09:51:39 PM »
The townhall will destroy houses to grow. But most often there is a road in the way and the townhall will relocate. This happens at 1500 inhabitants, thus towns grow happily even after.

It has also another effect: Since attractions want to be close to townhall, a relocated townhall will spread attraction more over the city.

However, replacing attractions with larger ones will be difficult; just assume there are two stop close to them, or they will destroy an important road in order to upgrade.

Offline wlindley us

  • Devotee
  • *
  • Posts: 975
    • Hacking for fun and profit since 1977
  • Languages: EN, DE
Re: Making Attractions 'Experimental'
« Reply #12 on: September 23, 2011, 12:51:15 AM »
I greatly support this, especially as I have been considering re-doing the Pak128.Britain church. Since I have to add snow to it anyway, I hope to create a 1x1 chapel, one or two 2x2 town churches, and a 3x3 cathedral. These suggestions would be splendid.