[GS] Renewed Village Growth 9.3 (RVG)

Discuss the new AI features ("NoAI") introduced into OpenTTD 0.7, allowing you to implement custom AIs, and the new Game Scripts available in OpenTTD 1.2 and higher.

Moderator: OpenTTD Developers

How would you rate this game script?

5★ Lev4 'Chimaera'
26
90%
4★ "AsiaStar"
2
7%
3★ Floss "47"
1
3%
2★ Ploddyphut Choo-Choo
0
No votes
1★ Kirby Paul Tank
0
No votes
 
Total votes: 29

User avatar
Firrel
Engineer
Engineer
Posts: 118
Joined: 13 Aug 2019 17:06

Re: [GS] Renewed Village Growth (RVG)

Post by Firrel »

d0mi3l wrote: 06 Jul 2020 15:33 When I build new city on map, GS stop work.
Thank you for the feedback. I missed to modify one function call when I changed function declaration of GoalTown(). I will fix it in the future release. For a quick fix if you want it to work, change in main.nut line 239 to this:

Code: Select all

this.towns.append(GoalTown(town_id, false, this.limit_growth));
d0mi3l wrote: 06 Jul 2020 15:33 What about industry spawn? Could you adds it to your script. Like in Villages is Villages.
8)
It is an interesting feature and I think it is possible to add it. When I will get some time to work on next release, I can look into it, but no promises.
User avatar
Firrel
Engineer
Engineer
Posts: 118
Joined: 13 Aug 2019 17:06

Re: [GS] Renewed Village Growth (RVG)

Post by Firrel »

New update for Renewed Village Growth 4.1 is available
Renewed_Village_Growth-4.1.tar
(110 KiB) Downloaded 127 times
Significant changes
- Randomization. In settings, there are several options to specify randomization of cargos per town. Each town will select random cargos per category and only those cargos are counted towards progress.
- Added support for FIRS 1.4, FIRS 4 and Improved Town Industries 1.3
- Reworked town texts
- Reworked cargo categories for every industry
- Modified default values of settings to have easy/medium/hard value - please adjust them based on your preferences
More information in changelog.txt or on first post of this thread.

RVG development is now on github: https://github.com/F1rrel/RenewedVillageGrowth

Hope you enjoy it and please let me know about any issues. These were significant changes to the code.
User avatar
Firrel
Engineer
Engineer
Posts: 118
Joined: 13 Aug 2019 17:06

Re: [GS] Renewed Village Growth (RVG)

Post by Firrel »

New update for Renewed Village Growth 4.2 is available in BaNaNaS
Renewed_Village_Growth-4.2.tar
(110.5 KiB) Downloaded 100 times
Changes
- new: added support for XIS 0.6: The Lot
- modified: updated ITI to 1.5 to allow recycling chain
- modified: all YETI game styles working except Simplified
- fix: randomization giving too few cargos when not all ECS vectors are enabled

If you want to use this version, please delete previous version so that this version is selected. Will look into it.
User avatar
Firrel
Engineer
Engineer
Posts: 118
Joined: 13 Aug 2019 17:06

Re: [GS] Renewed Village Growth (RVG)

Post by Firrel »

New update for Renewed Village Growth 4.3 is available in BaNaNaS
Renewed_Village_Growth-4.3.tar
(110 KiB) Downloaded 96 times
Changes
- fix: reworked GS versioning system, now the latest savegame compatible version should be correctly selected
User avatar
Firrel
Engineer
Engineer
Posts: 118
Joined: 13 Aug 2019 17:06

Re: [GS] Renewed Village Growth (RVG)

Post by Firrel »

Firrel wrote: 30 May 2020 10:03
djsider wrote: 21 May 2020 14:53 Having the goals just be what you can deliver to the town or at least having options to configure the cargos would be nice.
You can change the categories yourself, it is easy:
1. Start game with the industry you want to modify and Debug log: Cargo. This will print you into AI/GS Debug all cargo types and their indexes.
2. Go to (on Windows) /Documents/OpenTTD\content_download\game and uzip the RVG game script.
3. Open cargo.nut, find the industry you want to modify in function DefineCargosBySettings().
::CargoCat - each array represents one cargo category and numbers represent cargo indexes.
::CargoCatList - names associated with the category
::CargoMinPopDemand - at which population a category will be enabled
::CargoPermille - cargo demand per thousand population
::CargoDecay - percentage of cargo to be decayed per month
4. Save file and create new game with these settings
Configuration of custom cargo categories was already aswered on this forum. I think you saw it as you used the exact same wording. If you have problem with one of the steps, please let me know.
ilhamou13 wrote: 19 Sep 2020 18:18 Having the goals just be what you can deliver to the town or at least having options to configure the cargos would be nice.
The cargos that the city can accept can vary greatly: climates, newGRF towns (ITL), newGRF industries (FIRS). They can also change during the gameplay, like the town no longer accepting goods due to dissapearing of offices. So if you want a game with only accepted cargos, you need to create that cargo list based on what you are going to use.

As a side note, this is a snippet from OpenTTD wiki:
Sub Tropical
If the centre square of the town is in the desert, at least 1t of food and 1,000L of water per month must be delivered for the town to grow. The town information window will show whether food and water was delivered recently.
The towns will grow very slowly on their own, so in the case of small towns not large enough to accept food, it is simply a case of waiting for them to grow. As with any other cargo a station needs at least 8/8 of food acceptance in its coverage area before it accepts food.
Water must be delivered to a Water Tower industry. Water Towers may be generated automatically in towns, or a player may choose to fund one using the "Fund new industry" menu.
The way I play this game script is that I have industries at funding only or at very low (with ITI only primary industries spawn), which makes funding of industries mandatory. I use base cost mod to lower the cost of funding, so it is available sooner. This makes the game interesting in a way that you have to establish a functional passanger and mail network before the towns will start to require cargos accepted by funded industries.
User avatar
andythenorth
Tycoon
Tycoon
Posts: 5649
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: [GS] Renewed Village Growth (RVG)

Post by andythenorth »

Hi Firrel,

Wanted to let you know there's a FIRS 4 Alpha 3 https://grf.farm/firs/4.0.0-alpha-3/html/economies.html

Contains the final Steeltown cargos that will be in the v4 release, these won't change again before v4. :D

I've put the 'In A Hot Country' economy back into FIRS v4 also, but that's not in Alpha 3.
User avatar
Firrel
Engineer
Engineer
Posts: 118
Joined: 13 Aug 2019 17:06

Re: [GS] Renewed Village Growth (RVG)

Post by Firrel »

andythenorth wrote: 20 Sep 2020 11:01 Hi Firrel,

Wanted to let you know there's a FIRS 4 Alpha 3 https://grf.farm/firs/4.0.0-alpha-3/html/economies.html

Contains the final Steeltown cargos that will be in the v4 release, these won't change again before v4. :D

I've put the 'In A Hot Country' economy back into FIRS v4 also, but that's not in Alpha 3.
Thank you for the info. I already included FIRS v4 alpha 3 in RVG 4. I see it as mutually beneficial to include industry sets in development (FIRS4, XIS, ITI) so it can draw more people to test it. :)

I had to do special categories for the v4 Steeltown, because it did not fit with the current ones. I guess it was your goal to make it different :D I would like to extend the economies that use almost 64 cargos to more categories, but it is not possible right now. Also glad to hear "In a hot country" is getting back.

Screenshot from 2020-09-21 16-50-12.png
Screenshot from 2020-09-21 16-50-12.png (15.12 KiB) Viewed 6208 times
User avatar
andythenorth
Tycoon
Tycoon
Posts: 5649
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: [GS] Renewed Village Growth (RVG)

Post by andythenorth »

Firrel wrote: 21 Sep 2020 15:46 Thank you for the info. I already included FIRS v4 alpha 3 in RVG 4. I see it as mutually beneficial to include industry sets in development (FIRS4, XIS, ITI) so it can draw more people to test it. :)
Thanks :) I am always using a local dev build of FIRS, which RVG doesn't know about. Is there a way to force it? Happy to edit the GS directly... :)
I had to do special categories for the v4 Steeltown, because it did not fit with the current ones.
This is cool, and lines up with FIRS intended design :) Rebar is also a final products cargo in my opinion - goes to Builders Yards for town construction. :)
User avatar
Firrel
Engineer
Engineer
Posts: 118
Joined: 13 Aug 2019 17:06

Re: [GS] Renewed Village Growth (RVG)

Post by Firrel »

andythenorth wrote: 21 Sep 2020 19:40
Firrel wrote: 21 Sep 2020 15:46 Thank you for the info. I already included FIRS v4 alpha 3 in RVG 4. I see it as mutually beneficial to include industry sets in development (FIRS4, XIS, ITI) so it can draw more people to test it. :)
Thanks :) I am always using a local dev build of FIRS, which RVG doesn't know about. Is there a way to force it? Happy to edit the GS directly... :)
You can change the cargo list and categories, it is straightforward. The source code can be found in github. The cargo list is used to check if the cargos used for creating categories and in game match to ensure compatibility. Categories are defined as shown down. As side note, the number of categories and category names for an economy are now hardcoded, so should not be modified. To make it compatible, the cargo list must match and the correct cargo indexes must be used in the ::CargoCat list. I would gladly accept push request with updates to economies. :)

::CargoCat - each array represents one cargo category and numbers represent cargo indexes.
::CargoCatList - names associated with the category
::CargoMinPopDemand - at which population a category will be enabled
::CargoPermille - cargo demand per thousand population
::CargoDecay - percentage of cargo to be decayed per month
andythenorth wrote: 21 Sep 2020 19:40 Rebar is also a final products cargo in my opinion - goes to Builders Yards for town construction. :)
I agree with you, I have missed it. Thank you for pointing it out. :)
User avatar
andythenorth
Tycoon
Tycoon
Posts: 5649
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: [GS] Renewed Village Growth (RVG)

Post by andythenorth »

Thanks :)

I don't know if it's of use, but I've considered publishing a manifest of economies and cargos.

I could do this automatically in the FIRS docs. It could be JSON, YAML, or similar formats.

I could also try and provide hint information about the role of the cargo, e.g. public service, processed etc? That might need more discussion.

This might be of use generally for GS (I am thinking of writing a cargo goals challenge that would use it).
User avatar
Firrel
Engineer
Engineer
Posts: 118
Joined: 13 Aug 2019 17:06

Re: [GS] Renewed Village Growth (RVG)

Post by Firrel »

andythenorth wrote: 22 Sep 2020 20:27 I don't know if it's of use, but I've considered publishing a manifest of economies and cargos.
The information I am missing when adding new economy is assignment of cargo labels with cargos. Sometimes it is hard to guess them. This would be useful to have in docs or manifest. Being able to parse it from the manifest could speed it up.
andythenorth wrote: 22 Sep 2020 20:27 I could also try and provide hint information about the role of the cargo, e.g. public service, processed etc? That might need more discussion.
I would like to create a table of all so far existing cargo labels and their categorization in general categories (public service, raw goods, raw food, processed, final) so it will handle all economy grfs. This would be less precise, but it would make space for more specified economies, like FIRS4 Steeltown.

Also I did a playtest of FIRS4 Steeltown and RVG and found out that another categorization could be based on industries. Most of the industries accept 4 cargo types, so it would be better if the category was constructed from these 4 cargos. It would also prevent from having two towns next to each other with the same constructed industry and receiving just one specific cargo, because the town requires it. So basically instead of having cargo categories, the individual industries would be categorized.

So if you provide hint information on the cargo I would most probably use it. But as it only moves work from me to you, I will not ask it from you. :D
User avatar
2TallTyler
Route Supervisor
Route Supervisor
Posts: 490
Joined: 11 Aug 2019 18:15
Contact:

Re: [GS] Renewed Village Growth (RVG)

Post by 2TallTyler »

You may have found it already, but here is the cargo list for Improved Town Industries. I have some major changes coming in mid-October but the new cargos (Lumber, Uranium, Nuclear Fuel, and Nuclear Waste) would all be classified as Raw Materials, keeping only Food and Goods as Products delivered to houses.
User avatar
Firrel
Engineer
Engineer
Posts: 118
Joined: 13 Aug 2019 17:06

Re: [GS] Renewed Village Growth (RVG)

Post by Firrel »

Thank you for the heads up on new version.

I am usually getting the cargo list using GSCargoList, but from the github it will be faster. As I looked through it, I found the planned industries. This is how I categorize it: the raw is from a factory that does not require input to create output, processed is from factories that need input. This way I would categorize Uranium as raw, Nuclear Fuel and Nuclear Waste as processed and most probably timber is also processed. I also need to move food to the raw category as it comes from farms. I would also like to include waste in the public services and limiter (maybe combined with mail). Also it would be interesting to be able to distinguish passengers from workers that go to industries to promote serving them. But I would keep it as PASS cargo so cargo dist can do its thing. :D

I still have many ideas on how to improve this script, but I need to check if they are doable and find the time to work on it.
User avatar
2TallTyler
Route Supervisor
Route Supervisor
Posts: 490
Joined: 11 Aug 2019 18:15
Contact:

Re: [GS] Renewed Village Growth (RVG)

Post by 2TallTyler »

I will be adding a cargo flowchart, list of industries, and list of cargos to the documentation before release time. Enough things have changed from the vanilla industries that it would be helpful to have a visualization of the whole picture. I hope that will make your next update easier (and be a good reference for players in any case).
User avatar
Firrel
Engineer
Engineer
Posts: 118
Joined: 13 Aug 2019 17:06

Re: [GS] Renewed Village Growth (RVG)

Post by Firrel »

New update for Renewed Village Growth 5.0 is available in BaNaNaS

Changes
* Not compatible with previous versions
- new: French translation (rmnvgr)
- new: Added ToyLib support, might lead to something interesting
- modified: Updated ITI to version 1.6
- modified: Updated FIRS to version 4 alpha 4
- fix: When playing with 64 cargo economy, the loading of cargo hash now should work properly
- fix: Added initialization of random seed so restarting the game will lead to different cargos
- fix: Unused cargos should be properly removed from category list
Argus
Tycoon
Tycoon
Posts: 1203
Joined: 16 Oct 2018 08:31
Location: Heart of the Highlands. Not Scottish. Czech.

Re: [GS] Renewed Village Growth (RVG)

Post by Argus »

I recommend adding a warning that you can't turn off pause until the script has finished its setup. :) After a while, the script crashed with a message this script took is too long to save, same problem reported here : viewtopic.php?f=65&t=87268
User avatar
Firrel
Engineer
Engineer
Posts: 118
Joined: 13 Aug 2019 17:06

Re: [GS] Renewed Village Growth (RVG)

Post by Firrel »

I am not using JGR patch pack and I am not considering it when writing this GS. So take that into consideration.
Argus wrote: 08 Jan 2021 21:43 I recommend adding a warning that you can't turn off pause until the script has finished its setup.
The setup part is paused by the game script and it cannot be unpaused by the user. With a lot of towns it can take a lot of time that you just have to wait out. Also the game script values are saved only after the initialization is finished. So I dont think the warning is needed.
Argus wrote: 08 Jan 2021 21:43 After a while, the script crashed with a message this script took is too long to save, same problem reported here : viewtopic.php?f=65&t=87268
It was already discussed here and it is a correct behaviour. The game script had too much to save and it got aborted. There is a set amount of opcodes the game script is allowed to use in one tick. You can find the parameter in openttd.cfg "script_max_opcode_till_suspend".

The saving and loading of data uses a hardcoded maximum opcodes value of 100000. A 4096x4096 map with high number of towns can create 13500 towns, with JGR you can go even higher. Testing with RVG 5.0, each town takes 54 opcodes, so it is possible to have up to 1800 towns on a map and still successfully save it. The loading only takes like 1000 opcodes, so there is no issue.

But it is true this can get a warning at the start of the game when more than a predefined number of towns is created which would lead to failed saves. I might also look into optimising it, but I think 1000 towns is still more than enought for a proper gameplay.
Argus
Tycoon
Tycoon
Posts: 1203
Joined: 16 Oct 2018 08:31
Location: Heart of the Highlands. Not Scottish. Czech.

Re: [GS] Renewed Village Growth (RVG)

Post by Argus »

I only set the medium number of cities. I don't like it when they're crowded together. I'll take care of that, and I'll try to have fewer cities when using this script, as well as the other one. Thanks for the clarification. :) It is true that I did not look at the number of cities ...
Argus
Tycoon
Tycoon
Posts: 1203
Joined: 16 Oct 2018 08:31
Location: Heart of the Highlands. Not Scottish. Czech.

Re: [GS] Renewed Village Growth (RVG)

Post by Argus »

Now I'm looking, and even at "very low" I had 2560 cities there. So I'll try to set Custom and give some more reasonable value, I'll keep in mind :) It is clear that if the game thinks that the script is frozen, it will simply stop it. When I know that there is a limit, I will adjust my game to it. 8) Problem solved :)
User avatar
pr0saic
Engineer
Engineer
Posts: 5
Joined: 27 Jan 2021 12:33
Location: England
Contact:

Re: [GS] Renewed Village Growth (RVG)

Post by pr0saic »

Don't suppose I can add this to a current save?
Ayy Lmao
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 9 guests