Well at least for the city you're showing, it is normal that there is not any cargogoal indications. You need to exchange passengers before goals are calculated. When you start exchanging passengers, calculations starts and you will have goals (indicated in the city popup). Same for BCG.MrRB wrote:Hey Keoz,
Here are a screenshot and a savegame.
I've had to make one, because I didn't start an actual game yet with your GS, because I immediately stumbled onto this glitch.
Thanks for your time!
[GS] RCG - A city growth GameScript for OTTD
Moderator: OpenTTD Developers
Re: [GS] RCG - A new city growth GS for OTTD/FIRS
Patch - Let's timetable depot waiting time with the Wait in depot patch.
GameScript - Searching a new way to make your cities growing ? Try the Renewed City Growth GameScript.
My screenshots thread.
GameScript - Searching a new way to make your cities growing ? Try the Renewed City Growth GameScript.
My screenshots thread.
Re: [GS] RCG - A new city growth GS for OTTD/FIRS
Wow, thanks for the insight! I'm sorry for wasting your time. That did the trick 

Re: [GS] RCG - A new city growth GS for OTTD/FIRS
Neighbours are important uses the some 2000 ticks with (almost) free DoCommand calls that GS get in during word generation to set up all towns. If you start a large map with many towns, you'll see that world generation takes some time at the script step at the end. This is NAI setting up all towns. Then when the game starts and a company joins (human company or MP companies), the story book and company specific information will be set up quite quickly as there is not that much company specific stuff in NAI.MrRB wrote:This is the same problem I've addressed with some other GS (except Neighbours Are Important). It may well be me, but I don't see what I'm doing wrong in that case...
But it is all up to the script author to use this or not. It also depends on what the script tries to do if this is a workable solution or not. If town management is very CPU intensive, it might make sense to have towns at some idle state until you start to do work there. Though it might then be wise to append some help text to the town info window during the 2000 ticks startup to inform players about this, as most users don't read the Readme even how well things are explained there.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
Re: [GS] RCG - A new city growth GS for OTTD/FIRS
I played on multiplayer server and suddenly script paused and stick into paused state.
rcon pausing/unpausing of course didn't affect this state.
Any idea, what goes wrong?
rcon pausing/unpausing of course didn't affect this state.
Any idea, what goes wrong?
- Attachments
-
- RCGstopped.sav
- (597.35 KiB) Downloaded 229 times
Re: [GS] RCG - A new city growth GS for OTTD/FIRS
Does the readme say anything about it?
There is a Pause command to stop the game http://nogo.openttd.org/api/trunk/class ... c36daa6eaa
My guess is that the script used it.
There is a Pause command to stop the game http://nogo.openttd.org/api/trunk/class ... c36daa6eaa
My guess is that the script used it.
Re: [GS] RCG - A new city growth GS for OTTD/FIRS
If the script uses the pause command, it is important that the setting about what is allowed to do in paused mode is respected and that the GS doesn't try to do anything that is not allowed. Failing to do so will make the game locked in pause forever. This is documented in FS#5283.
Neighbours are important did earlier trigger this bug, but have been reworked to not trigger the bug.
If you have a specific save game that you want to unlock, you can still do that, but it will involve compiling OpenTTD yourself and hack OpenTTD source code to forcefully remove the pause bit set by the GS. After doing that it will probably work in non-modified OpenTTD as long as you either disable the script or that the script at least don't pause the game again.
Neighbours are important did earlier trigger this bug, but have been reworked to not trigger the bug.
If you have a specific save game that you want to unlock, you can still do that, but it will involve compiling OpenTTD yourself and hack OpenTTD source code to forcefully remove the pause bit set by the GS. After doing that it will probably work in non-modified OpenTTD as long as you either disable the script or that the script at least don't pause the game again.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
Junctioneer (a traffic intersection simulator)
Re: [GS] RCG - A new city growth GS for OTTD/FIRS
OK, but it is my server settings fault, or game script bug?Zuu wrote:If the script uses the pause command, it is important that the setting about what is allowed to do in paused mode is respected and that the GS doesn't try to do anything that is not allowed.
Re: [GS] RCG - A new city growth GS for OTTD/FIRS
I'll have a look at that, when I find time (sorry, I'm quite busy atm).McZapkie wrote:OK, but it is my server settings fault, or game script bug?Zuu wrote:If the script uses the pause command, it is important that the setting about what is allowed to do in paused mode is respected and that the GS doesn't try to do anything that is not allowed.
What I can say for now, is that the script uses the pause command, at least the initial version on Bananas (I removed it in the last version, to have a smoother game). But, normally, the GS doesn't build things.
But I'll have a better look.
Patch - Let's timetable depot waiting time with the Wait in depot patch.
GameScript - Searching a new way to make your cities growing ? Try the Renewed City Growth GameScript.
My screenshots thread.
GameScript - Searching a new way to make your cities growing ? Try the Renewed City Growth GameScript.
My screenshots thread.
Re: [GS] RCG - A new city growth GS for OTTD/FIRS
The formatting of the cities requirements are kind of awfull : l
I was using the Real growth GS before and now Im trying this one out, but this one might benfit from some creative borrowing. As its far more clear what a city needs/Wants. With this script.
http://i1335.photobucket.com/albums/w67 ... 2e3c94.png
Just my 2 cents.
Gl : ]
I was using the Real growth GS before and now Im trying this one out, but this one might benfit from some creative borrowing. As its far more clear what a city needs/Wants. With this script.
http://i1335.photobucket.com/albums/w67 ... 2e3c94.png
Just my 2 cents.
Gl : ]
Re: [GS] RCG - A new city growth GS for OTTD/FIRS
A new relase of Renewed City Growth is now ready: version 2, available on Bananas.
Among the lot of changes:
- some bugs solved
- some calculations have been reworked
- the Script Game doesn't trigger Pause state anymore at each month, only when the game starts. That should avoid the problem described over by McZapkie and also, the game is more fluid.
Damrus: I'll give a thought about your suggestion.
Among the lot of changes:
- some bugs solved
- some calculations have been reworked
- the Script Game doesn't trigger Pause state anymore at each month, only when the game starts. That should avoid the problem described over by McZapkie and also, the game is more fluid.
Damrus: I'll give a thought about your suggestion.
Patch - Let's timetable depot waiting time with the Wait in depot patch.
GameScript - Searching a new way to make your cities growing ? Try the Renewed City Growth GameScript.
My screenshots thread.
GameScript - Searching a new way to make your cities growing ? Try the Renewed City Growth GameScript.
My screenshots thread.
Re: [GS] RCG - A new city growth GS for OTTD/FIRS
Programmer here. Was using your script and soon noticed it was broken. I've no idea about OpenTTD scripting, but I managed to find this anyway:
Looking at the last line I'd say your scipt only uses the delivered amount of a single company (the one with the highest cid) for everything. I guess you're only testing with a single one...
The old Balanced Growth script has the correct "+=" in the code:
Unless I'm mistaken, you may be slightly ashamed now. And again for not using English but French in your comments and debug text.
If everything else is balanced around this broken code you'll want to consider if cities will grow much too quickly once you fix it.
Code: Select all
for (local cid = GSCompany.COMPANY_FIRST; cid <= GSCompany.COMPANY_LAST; cid++)
{
if (GSCompany.ResolveCompanyID(cid) != GSCompany.COMPANY_INVALID)
{
TownSupplied[i] = GSCargoMonitor.GetTownDeliveryAmount(cid, ::CargoList[i], this.id, true);
..etc...
The old Balanced Growth script has the correct "+=" in the code:
Code: Select all
this.TownSupplied[i] += GSCargoMonitor.GetTownDeliveryAmount(....)
If everything else is balanced around this broken code you'll want to consider if cities will grow much too quickly once you fix it.
Re: [GS] RCG - A new city growth GS for OTTD/FIRS
Thank you for reporting this ! You're perfectly right about that wrong line. It is fixed in the last revision (see initial post). I just could have a fast check on the fix and since I'm never playing with companies, I'd be glad if someone can confirm that it fixes the problem.megbal wrote:[...]Looking at the last line I'd say your scipt only uses the delivered amount of a single company (the one with the highest cid) for everything. I guess you're only testing with a single one...
The old Balanced Growth script has the correct "+=" in the code:[...]
Well, some comments are in english.megbal wrote:Unless I'm mistaken, you may be slightly ashamed now. And again for not using English but French in your comments and debug text.

But you're still right. This script tend to look a little bit as a warzone. Hopefully, that also will be progressively fixed.
I think this souldn't be an issue. There is, in any case, a max possible city growth rate for cities (which is related to their size: a city of 10000 cannot grow more than 5 houses/month). Thus, if cities are overwhelmed by supplies, that will not trigger an extremely fast growth. Also, the settings are necessarily adapted to a specific gameplay style (mine), which is: working with one company on one map. But if several companies/players are on the same map, it is possible to adapt the gamescript by changing the difficulty setting (100 being the default).megbal wrote:If everything else is balanced around this broken code you'll want to consider if cities will grow much too quickly once you fix it.
Last edited by keoz on 13 Aug 2014 13:30, edited 2 times in total.
Patch - Let's timetable depot waiting time with the Wait in depot patch.
GameScript - Searching a new way to make your cities growing ? Try the Renewed City Growth GameScript.
My screenshots thread.
GameScript - Searching a new way to make your cities growing ? Try the Renewed City Growth GameScript.
My screenshots thread.
Re: [GS] RCG - A new city growth GS for OTTD/FIRS
You can discard many towns quick with GSTown::GetLastMonthTransportedPercentage
mytownlist.Valuate(GSTown.GetLastMonthTransportedPercent, thecargoidofpax)
mytownlist.RemoveValue(0);
If a town have 0 transportedpercent of pax cargo, you don't need to check any companies presence... and can discard the town just by that answer as you discard town that didn't supply any pax to a company in your MonthlyManageTown()
So MonthlyManageTown can only be call because at least a company has transport pax from that town this month, removing all the checks for town with no activities (and you can then also ease the checks in the function now you now at least one company is doing pax activity if the function is run).
You will each month reduce call to the cycle expansive MonthlyManageTown function by a huge amount (until your players actually really use all towns).
Right now, if a town get monitored because one company deliver 1 pax cargo one time, you set the this.MonitorCheck and the town goal/transported cargo... will always be monitored and update even nobody use that town again (company collapse, player remove bus...). If i'm right, your goal doesn't need any update if no company have done something better than previous check no?
ps: moi il ne me gène pas tes commentaires en français
mytownlist.Valuate(GSTown.GetLastMonthTransportedPercent, thecargoidofpax)
mytownlist.RemoveValue(0);
If a town have 0 transportedpercent of pax cargo, you don't need to check any companies presence... and can discard the town just by that answer as you discard town that didn't supply any pax to a company in your MonthlyManageTown()
So MonthlyManageTown can only be call because at least a company has transport pax from that town this month, removing all the checks for town with no activities (and you can then also ease the checks in the function now you now at least one company is doing pax activity if the function is run).
You will each month reduce call to the cycle expansive MonthlyManageTown function by a huge amount (until your players actually really use all towns).
Right now, if a town get monitored because one company deliver 1 pax cargo one time, you set the this.MonitorCheck and the town goal/transported cargo... will always be monitored and update even nobody use that town again (company collapse, player remove bus...). If i'm right, your goal doesn't need any update if no company have done something better than previous check no?
ps: moi il ne me gène pas tes commentaires en français

Re: [GS] RCG - A new city growth GS for OTTD/FIRS
Code: Select all
function GoalTown::CheckEvents()
{
while (GSEventController.IsEventWaiting())
{
local event = GSEventController.GetNextEvent();
local eventType = event.GetEventType();
switch (eventType)
{
case GSEvent.ET_TOWN_FOUNDED:
event = GSEventTownFounded.Convert(event);
if (GSTown.IsValidTown(event)) this.towns.append(GoalTown(event));
break;
}
}
}
Re: [GS] RCG - A new city growth GS for OTTD/FIRS
Hello, krinn 
For your other suggestion, I still have to see in details. What I can say so far, is that the reason for which the check on cities is so bloated, is that very very little cities have extremely poor pax echanges. Thus, it is not enough to check on town deliveries, but I also need to check town supply to make them grow.

I'm glad to know that. And obviously, I understand you.krinn wrote:ps: moi il ne me gène pas tes commentaires en français

Always getting useful comments from your part. Thank you *very much* for your peace of code, which pointed me out to the right way to deal with that. I had to do some changes, (such as extracting the town id before calling GoalTown), but it works fine now. No more crashes on town founding.krinn wrote:Didn't test it, but this should fix your issue with new town.Code: Select all
function GoalTown::CheckEvents() { while (GSEventController.IsEventWaiting()) [...] }
For your other suggestion, I still have to see in details. What I can say so far, is that the reason for which the check on cities is so bloated, is that very very little cities have extremely poor pax echanges. Thus, it is not enough to check on town deliveries, but I also need to check town supply to make them grow.
Patch - Let's timetable depot waiting time with the Wait in depot patch.
GameScript - Searching a new way to make your cities growing ? Try the Renewed City Growth GameScript.
My screenshots thread.
GameScript - Searching a new way to make your cities growing ? Try the Renewed City Growth GameScript.
My screenshots thread.
Re: [GS] RCG - A new city growth GS for OTTD/FIRS
Answer continuation.
About the discarding in MonthlyManegeTown, keep in mind that this additional check (and hence, the call to GSCargoMonitor.GetTownPickupAmount), is only performed in a really rare case: when cities who are already under monitoring (MonitorCheck flag true) have no pax supply for one month. That's actually a corner case and the call is not performed often at all.
Anyway, as a matter of fact, this function needs to be optimized. I'll see if your suggestions can help to that.
Edit. As additional note, I just tested the functions GSTown.GetLastMonthTransportedPercentage, as also GSTown.GetLastMonthSupplied and quite surprisingly, those functions are more time-consuming than is checking with a for loop the CargoMonitor on a per company basis.
I've been looking a little more into this. Some precisions:krinn wrote:You can discard many towns quick with GSTown::GetLastMonthTransportedPercentage
mytownlist.Valuate(GSTown.GetLastMonthTransportedPercent, thecargoidofpax)
mytownlist.RemoveValue(0);
The problem is that I don't want to discard towns just because they don't transport anything in one month. I want to discard them when there is not anymore transportation over a long time (the limit is now 6 months). That's to avoid big gaps/fast changes in town growth rates, which I try to smoothen.krinn wrote:If a town have 0 transportedpercent of pax cargo, you don't need to check any companies presence... and can discard the town just by that answer as you discard town that didn't supply any pax to a company in your MonthlyManageTown()
About the discarding in MonthlyManegeTown, keep in mind that this additional check (and hence, the call to GSCargoMonitor.GetTownPickupAmount), is only performed in a really rare case: when cities who are already under monitoring (MonitorCheck flag true) have no pax supply for one month. That's actually a corner case and the call is not performed often at all.
MonthlyManageTown is called each month for each town, but all the inactive cities are not fully checked. At the moment, the unmonitored cities (MonitorCheck flag false), are only checked each month for their passengers delivery and if there is no delivery from the city, the function is returned before making all the other checks. So basically an inactive town is out extremely fast from the function.krinn wrote:So MonthlyManageTown can only be call because at least a company has transport pax from that town this month, removing all the checks for town with no activities (and you can then also ease the checks in the function now you now at least one company is doing pax activity if the function is run).
Actually, at the moment, a monitored town is discarded from monitoring after 6 months of total inactivity. But still, I think that cities who used to exchange passengers and suddendly lose all pax service are essentially a corner case.krinn wrote:Right now, if a town get monitored because one company deliver 1 pax cargo one time, you set the this.MonitorCheck and the town goal/transported cargo... will always be monitored and update even nobody use that town again (company collapse, player remove bus...). If i'm right, your goal doesn't need any update if no company have done something better than previous check no?
Anyway, as a matter of fact, this function needs to be optimized. I'll see if your suggestions can help to that.
Edit. As additional note, I just tested the functions GSTown.GetLastMonthTransportedPercentage, as also GSTown.GetLastMonthSupplied and quite surprisingly, those functions are more time-consuming than is checking with a for loop the CargoMonitor on a per company basis.
Patch - Let's timetable depot waiting time with the Wait in depot patch.
GameScript - Searching a new way to make your cities growing ? Try the Renewed City Growth GameScript.
My screenshots thread.
GameScript - Searching a new way to make your cities growing ? Try the Renewed City Growth GameScript.
My screenshots thread.
Re: [GS] RCG - A new city growth GS for OTTD/FIRS
Oops sorry so, didn't test it, but i was thinking it would be faster a one function run than the loop on all companies. I'm a bit surprise by your result.keoz wrote:Edit. As additional note, I just tested the functions GSTown.GetLastMonthTransportedPercentage, as also GSTown.GetLastMonthSupplied and quite surprisingly, those functions are more time-consuming than is checking with a for loop the CargoMonitor on a per company basis.
Re: [GS] RCG - A new city growth GS for OTTD/FIRS
I guess I already did a test once and I was really surprised by that.krinn wrote:Oops sorry so, didn't test it, but i was thinking it would be faster a one function run than the loop on all companies. I'm a bit surprise by your result.keoz wrote:Edit. As additional note, I just tested the functions GSTown.GetLastMonthTransportedPercentage, as also GSTown.GetLastMonthSupplied and quite surprisingly, those functions are more time-consuming than is checking with a for loop the CargoMonitor on a per company basis.
I suppose the reason could be in the fact that the GetLastMonthSupplied() function itself runs some loop to addition company supply.
Patch - Let's timetable depot waiting time with the Wait in depot patch.
GameScript - Searching a new way to make your cities growing ? Try the Renewed City Growth GameScript.
My screenshots thread.
GameScript - Searching a new way to make your cities growing ? Try the Renewed City Growth GameScript.
My screenshots thread.
Re: [GS] RCG - A new city growth GS for OTTD/FIRS
Work is going on fast these days on the RCG script.
There is now a public repository for the script, with the help of planetmaker (thanks !). To checkout for last revisions, just:
The last revision (r25) includes:
- fix: the script now correctly counts the deliveries from all companies
- fix: game is no more crashing when new towns are founded. Thanks to krinn.
- fix: game is no more crashing when saving immediately after loading
- reviewing calculations
- savegame code completely rewritten and simplified
- a lot of code cleanup, including additional comments
With all those changes ... Well. Please report (eventual) bugs, either here on the topic, either on http://dev.openttdcoop.org/projects/gs-rcg/repository.
There is now a public repository for the script, with the help of planetmaker (thanks !). To checkout for last revisions, just:
Code: Select all
hg clone http://hg.openttdcoop.org/gs-rcg
- fix: the script now correctly counts the deliveries from all companies
- fix: game is no more crashing when new towns are founded. Thanks to krinn.
- fix: game is no more crashing when saving immediately after loading
- reviewing calculations
- savegame code completely rewritten and simplified
- a lot of code cleanup, including additional comments
With all those changes ... Well. Please report (eventual) bugs, either here on the topic, either on http://dev.openttdcoop.org/projects/gs-rcg/repository.
Patch - Let's timetable depot waiting time with the Wait in depot patch.
GameScript - Searching a new way to make your cities growing ? Try the Renewed City Growth GameScript.
My screenshots thread.
GameScript - Searching a new way to make your cities growing ? Try the Renewed City Growth GameScript.
My screenshots thread.
Re: [GS] RCG - A new city growth GS for OTTD/FIRS
Still some changes on RCG (now: revision 41)
Apart the fact that there aren't known bugs anymore, the major evolution is that I included now support for other industry sets. Namely:
I still don't want to upload that on bananas (as upcoming version 3), until recent changes have been well tested. For those interested in testing, see attachment for the last revision.
Note that this last versions needs GS Superlib v. 38 (downloadable on bananas).
Apart the fact that there aren't known bugs anymore, the major evolution is that I included now support for other industry sets. Namely:
- Baseset (temperate, arctic, tropical, toyland)
- All Firs economies (FIRS general, temperate basic, arctic basic, tropic basic, Hearth of Darkness)
- ECS (all vectors)
I still don't want to upload that on bananas (as upcoming version 3), until recent changes have been well tested. For those interested in testing, see attachment for the last revision.
Note that this last versions needs GS Superlib v. 38 (downloadable on bananas).
Last edited by keoz on 21 Aug 2014 12:26, edited 11 times in total.
Patch - Let's timetable depot waiting time with the Wait in depot patch.
GameScript - Searching a new way to make your cities growing ? Try the Renewed City Growth GameScript.
My screenshots thread.
GameScript - Searching a new way to make your cities growing ? Try the Renewed City Growth GameScript.
My screenshots thread.
Who is online
Users browsing this forum: No registered users and 13 guests