[nfo] Random values in an action 0?
Moderator: Graphics Moderators
- andythenorth
- Tycoon
- Posts: 5658
- Joined: 31 Mar 2007 14:23
- Location: Lost in Music
[nfo] Random values in an action 0?
I am trying to find a way to randomise values for properties set by an Action 0.
Looks like Action 6 and Action D would be the best way to do that, but I can't see a way to get a random value for the Action D.
The use case is providing random values for cargo properties 10, 11 and 12. Random cargo rates would avoid the 'oh no, coal again' feeling when starting a game, and might provide a renewed challenge to players.
It's possible these values would be either entirely random, or from a range of pre-defined values to ensure the game is actually playable (in which case Action 7 randomly jumping to one of several labels might be more appropriate).
EDIT (Eddi pointed out that there is a problem maintaining these random rates across save game reloads).
Any ideas for solutions?
cheers,
Andy
Looks like Action 6 and Action D would be the best way to do that, but I can't see a way to get a random value for the Action D.
The use case is providing random values for cargo properties 10, 11 and 12. Random cargo rates would avoid the 'oh no, coal again' feeling when starting a game, and might provide a renewed challenge to players.
It's possible these values would be either entirely random, or from a range of pre-defined values to ensure the game is actually playable (in which case Action 7 randomly jumping to one of several labels might be more appropriate).
EDIT (Eddi pointed out that there is a problem maintaining these random rates across save game reloads).
Any ideas for solutions?
cheers,
Andy
FIRS Industry Replacement Set (released) | HEQS Heavy Equipment Set (trucks, industrial trams and more) (finished)
Unsinkable Sam (ships) (preview released) | CHIPS Has Improved Players' Stations (finished)
Iron Horse ((trains) (released) | Termite (tracks for Iron Horse) (released) | Busy Bee (game script) (released)
Road Hog (road vehicles and trams) (released)
Unsinkable Sam (ships) (preview released) | CHIPS Has Improved Players' Stations (finished)
Iron Horse ((trains) (released) | Termite (tracks for Iron Horse) (released) | Busy Bee (game script) (released)
Road Hog (road vehicles and trams) (released)
Re: [nfo] Random values in an action 0?
Perhaps if you ask nicely, you can get the OTTD map seed as an action 7/D variable?
Re: [nfo] Random values in an action 0?
Interesting idea. As far as I understand it, a callback that would allow changing those properties might be the best solution. You could then also, for example, make cargo payment rates dependent on the year.
And talking about callbacks, couldn't you just use callback 39 (custom profit calculation for cargoes)? I have never coded these things, so I'm not exactly sure how it works.
And talking about callbacks, couldn't you just use callback 39 (custom profit calculation for cargoes)? I have never coded these things, so I'm not exactly sure how it works.
Re: [nfo] Random values in an action 0?
Access to map seed should be possible.
However, it would not change if you play e.g. scenarios. Which I would not necessarily consider as "wanted behaviour".
However, it would not change if you play e.g. scenarios. Which I would not necessarily consider as "wanted behaviour".
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
- andythenorth
- Tycoon
- Posts: 5658
- Joined: 31 Mar 2007 14:23
- Location: Lost in Music
Re: [nfo] Random values in an action 0?
Actually it might be in theory...it would allow scenario designers to tweak a scenario according to payment rates, but I think it would be too random to be useful!frosch wrote:Access to map seed should be possible.
However, it would not change if you play e.g. scenarios. Which I would not necessarily consider as "wanted behaviour".
It might be nice to have different payment rates for every map, then again it might not
cheers,
Andy
FIRS Industry Replacement Set (released) | HEQS Heavy Equipment Set (trucks, industrial trams and more) (finished)
Unsinkable Sam (ships) (preview released) | CHIPS Has Improved Players' Stations (finished)
Iron Horse ((trains) (released) | Termite (tracks for Iron Horse) (released) | Busy Bee (game script) (released)
Road Hog (road vehicles and trams) (released)
Unsinkable Sam (ships) (preview released) | CHIPS Has Improved Players' Stations (finished)
Iron Horse ((trains) (released) | Termite (tracks for Iron Horse) (released) | Busy Bee (game script) (released)
Road Hog (road vehicles and trams) (released)
Re: [nfo] Random values in an action 0?
Well, for a scenario I can only imagine two useful cases:
- Randomised at game start like engine reliabilities and introduction dates, etc.
- Set by the scenario designer via grf parameters
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
- andythenorth
- Tycoon
- Posts: 5658
- Joined: 31 Mar 2007 14:23
- Location: Lost in Music
Re: [nfo] Random values in an action 0?
Thanks for the answers. So I am currently thinking of pre-defined sets of payment rates, the set to be chosen according to a parameter.frosch wrote:Well, for a scenario I can only imagine two useful cases:
- Randomised at game start like engine reliabilities and introduction dates, etc.
- Set by the scenario designer via grf parameters
Something between 8 and 256 different sets, depending on whether we choose the rates by hand (to ensure they are actually sane), or at random programmatically when the grf is built (which might produce some insane results).
The player would then have to set a parameter to set the rates. 0 would be default and closest to standard TTD. It would however be a nice alternative if it was possible to randomise the chosen set from the map seed, this would seem to also be a conveniently reliable way to preserve the random choice across save games
FIRS Industry Replacement Set (released) | HEQS Heavy Equipment Set (trucks, industrial trams and more) (finished)
Unsinkable Sam (ships) (preview released) | CHIPS Has Improved Players' Stations (finished)
Iron Horse ((trains) (released) | Termite (tracks for Iron Horse) (released) | Busy Bee (game script) (released)
Road Hog (road vehicles and trams) (released)
Unsinkable Sam (ships) (preview released) | CHIPS Has Improved Players' Stations (finished)
Iron Horse ((trains) (released) | Termite (tracks for Iron Horse) (released) | Busy Bee (game script) (released)
Road Hog (road vehicles and trams) (released)
Who is online
Users browsing this forum: No registered users and 31 guests