The International Simutrans Forum

Community => Social & Contests => Scenarios and Challenges => Topic started by: isidoro on January 07, 2014, 01:24:54 AM

Title: Growth scenario
Post by: isidoro on January 07, 2014, 01:24:54 AM
I would like to try the scenario feature of ST.  My idea is quite different from the examples given and I don't know if it is ever possible.  The public service would play an important role and make strategic decisions on where to build new industries/attractions and make cities grow:
What do yo think?

About the technical issues:
Title: Re: Growth scenario
Post by: Dwachs on January 07, 2014, 02:27:18 PM
Quote from: isidoro on January 07, 2014, 01:24:54 AM
What do yo think?
This is a great idea! I would really like to see this taking off!

Now to answer your questions:
Quote
I would also like to include certain rules about consuming industries: a dairy will provide protein levels for a city not only if it consumes milk but also if provided with passengers (but I guess that this is difficult)...
The script can query most of the in-game statistics, among them consumption and passenger support of factories, http://dwachs.github.io/simutrans-sqapi-doc/classfactory__x.html
Quote

       
  • I've seen that the squirrel function start() is called at the beginning of the scenario.  Is there another function that is called at the beginning of each month and after all industry/city statistics are computed?
Not yet, can be added with ease.
Quote

       
  • I've also seen that certain buttons of the gui can be turned on and off.  Moreover, when the player builds something, it can be prevented with a message or allowed.  Does the latter apply to the public service as well?  Does the relevant function receive the data of the item that the player wants to build (for instance, the production/consumption of a new factory)?
The checks happen on the script side, see http://dwachs.github.io/simutrans-sqapi-doc/classrules.html and http://dwachs.github.io/simutrans-sqapi-doc/api__skeleton_8cc.html#a67f167f50ac44e2affeec9b47fd76093 . This means, the script can be adjusted to allow everything for public player but restricting the human players.

These methods cannot check for the precise item (which type of road, building etc).
Quote

       
  • Any other pitfalls that make this impossible?
Scripts cannot built anything yet. Which should not restrict you now in planning your scenario. Any serious effort on  scenarios also is a *big* motivation to work on the scripting interface. Adding functions to build factories and attractions at/near particular spots is not that difficult, the functionality is in the code already, only the interface is missing.
Title: Re: Growth scenario
Post by: isidoro on January 08, 2014, 01:19:06 AM
Thanks, Dwachs.

I've working on it a bit, and it is quite nice and I think that it opens a lot of possibilities for not-so-expert programmers to adapt the game to their preferences.

The main limitation I can see so far for my scenario to come true is that of knowing in advance the properties of the "thing" the player wants to build.  Apart from that, the feature would also be interesting for preventing to build certain factories away from rivers or similar questions posed in other threads that would not need to be hard-coded in the main exe, but could be solved in the scripting side.

But let's see where I can get...

At the moment, there seems to be a bug in file script/api_param.cc, lines 305 and 306:

                        i = param<sint16>::get(vm, -1);
                        sq_pop(vm, 1);


Squirrel kept on giving me errors whenever I asked a factory about the consumed amount of an input product.  If I deleted those two lines, everything seemed to go fine.  But I don't know for sure if it is a bug since I don't know anything about the Squirrel interface...

Title: Re: Growth scenario
Post by: Dwachs on January 08, 2014, 07:58:34 AM
This is indeed a bug! Thanks for spotting this.

In which ways would you like to limit payers to build certain things? You can password-protect public player, forbid building of industries, for instance.
Title: Re: Growth scenario
Post by: isidoro on January 08, 2014, 04:44:01 PM
You're welcome.

I'd like to be able to be more selective: whenever the (public) player builds an industry, attraction, etc. now I can know the coordinates and general type of building (industry, attraction,...) and can allow or deny it.  What would be great is to have some extra information about the specific kind of industry, attraction, etc. and its max. production the (public) player intends to build.  That way, I can selectively allow or deny certain kinds of industries.  Or some of them near others, or near certain places, or in some periods (for example in a historical war)...

This way it is not necessary for the scripts to be able to build things themselves, but suffices to allow/deny the player's initiative based on certain rules.

Title: Re: Growth scenario
Post by: prissi on January 08, 2014, 11:20:09 PM
While implementation is possible, such a behaviour is extremely frustrating. Do not build here but five tile to the left ... Then I would rather go for skripted building. Actually, the code for this is almost there (the command system was build with also this in mind, even though no scripting existed back then). In principle the type of command, the number of the command and the command string (which can be obtianed also from -log 3 messages) are the only input parameter needed.
Title: Re: Growth scenario
Post by: isidoro on January 09, 2014, 12:10:05 AM
In the scenario I proposed I need to selectively allow/deny certain buildings due to their size, for instance.  For example, a city may have enough materials to build a church, but not so many to build a cathedral.  A message like: "you don't have enough materials to build this building" would appear whenever the (public) player wants to build the cathedral in that city.

Up to know, the progress is quite straight forward although I have to play the game while designing to see the effects and it takes time.  BTW, thanks Dwachs for implementing the new month and new year callbacks.

I have encountered two problems so far: 1) when loading a game with an scenario back, there appears an error, something about a userdefinedstring problem.  I guess it has to do with a wrong use of the persistent table. 2) I don't know why, today it didn't allow me to switch players back and forth again.  I had to temporarily use the brute-force...  :police:
Title: Re: Growth scenario
Post by: Dwachs on January 09, 2014, 06:50:41 AM
Your proposal sounds like you want to limit only the public player to build attractions, factories etc. This can certainly be done. The hooks have to be placed in different routines, as cities build things directly without using the tool-framework (simwerkz.cc).

Quote from: isidoro on January 09, 2014, 12:10:05 AM
I have encountered two problems so far: 1) when loading a game with an scenario back, there appears an error, something about a userdefinedstring problem.  I guess it has to do with a wrong use of the persistent table. 2) I don't know why, today it didn't allow me to switch players back and forth again.  I had to temporarily use the brute-force...  :police:
1) If you upload script + savegame I can help with debugging. There is still the chance that something is wrong in the code.

2) Switching players is disallowed by default, see lines 34-51 in script/scenario_base.nut
Title: Re: Growth scenario
Post by: isidoro on January 10, 2014, 12:19:01 AM
Not quite.  What I intend to do is that the player, switching to the public service and using its map editing tools, is the one building the factories and linking them.  And that the script be able to control what is allowed and what is denied and why.

This way, the player has to develop not only a good and profitable traffic network, but alto take strategic decisions about how to develop the map (where to place factories, new cities and attractions).

Quote from: Dwachs on January 09, 2014, 06:50:41 AM
1) If you upload script + savegame I can help with debugging. There is still the chance that something is wrong in the code.

At the moment, I'm focused in seeing what is available and what can be done.  When the script has something more mature to show, I'll upload it and try to deal with those other problems.

BTW, is there a way I can show text in colors (specially red and green) in the Progress tab?

Title: Re: Growth scenario
Post by: Dwachs on January 10, 2014, 06:24:33 AM
Quote from: isidoro on January 10, 2014, 12:19:01 AM
BTW, is there a way I can show text in colors (specially red and green) in the Progress tab?
You can use all the pseudo-html tags simutrans uses to display in-game help text:
http://dwachs.github.io/simutrans-sqapi-doc/api__skeleton_8cc.html#a706b5bd21f80fc116a158dc964a5cfed
Title: Re: Growth scenario
Post by: Dwachs on January 10, 2014, 09:10:53 AM
Sorry for double-post:

Regarding debugging: I am curious how you managed to find the bug in api_param.cc above, I could not trigger an error with my nut scripts.

Quote from: isidoro on January 10, 2014, 12:19:01 AM
Not quite.  What I intend to do is that the player, switching to the public service and using its map editing tools, is the one building the factories and linking them.  And that the script be able to control what is allowed and what is denied and why.
I see. This would require to map parts of the werkzeug_t class hierarchy to squirrel classes. Quite some bit of work. It is possible. And may pay-off in the long-run (as enabling scripting for AI is still a long-term goal).
Title: Re: Growth scenario
Post by: prissi on January 10, 2014, 11:53:06 PM
To built something a squirrel script would only need three functions for general tools, one click tools and dialoge tools, and then a position and a string. That should be quite easy and straight forward. Or did I misunderstood something?

However, to allow or deny something, almost any tool needs to be filtered by squirrel. That seems indeed like an effort.
Title: Re: Growth scenario
Post by: isidoro on January 11, 2014, 01:54:40 AM
@Dwachs: thanks for the tip.  Now I have red to mark a deficit.
Quote from: Dwachs on January 10, 2014, 09:10:53 AM
Regarding debugging: I am curious how you managed to find the bug in api_param.cc above, I could not trigger an error with my nut scripts.

I am trying first to get the maximum information available.  I made a loop to show each factory information.  Something like: theFactory.input.["bricks"].get_consumed()[0].  I run the script and got the error.  Looked for the possible places where the error could come and set a breakpoint there and looked at the variables stepping line by line.  Before those two lines, the variable was correct.  After them, incorrect.  I tried and erased the lines and everything seemed to work alright (checked with the information given in the dialogue of factory information).

Quote
I see. This would require to map parts of the werkzeug_t class hierarchy to squirrel classes. Quite some bit of work. It is possible. And may pay-off in the long-run (as enabling scripting for AI is still a long-term goal).

The ability of a script to build something may be interesting in general, but not so for my script (as far as I understand it).

Now I have more or less all the information I need from the objects.  I know now how many building points and food and clothes a given city has.  Now I need to restrict what the player can build with the public player tool.  I can see two options:
I'll keep you informed of my progress here and eventually show the code, when there is something worth to be shown.

Title: Re: Growth scenario
Post by: isidoro on January 13, 2014, 12:33:12 AM
I've nearly achieved the first part of the scenario:  building construction limitation.  However, I've stumped into a small problem: attractions.

In the squirrel's API, there are factory_list_x and the corresponding factory_x that allows you to easily iterate over all factories.  But there is not an attraction_list_x and the corresponding attraction_x to do the same.  Although I have tried to iterate over all tiles in the map and get the information, the thing gets complicated with multi-tile attractions.  Would it be possible to have that information available directly from the game engine, à la factory style?

Title: Re: Growth scenario
Post by: Dwachs on January 13, 2014, 11:06:33 AM
It is possible to export a list of all build attractions. The list would contain all tiles of an attraction individually (instances of building_x). This is due to the fact that simutrans internally has no abstraction for multi-tile buildings. All tiles of buildings are treated individually, each tile knows that is is a sub-tile of a multi-tile building. But the is no multi-tile building has no representation itself.

Edit: I guess you would then need a function to decide whether two given building tiles actually belong to the same multi-tile building?
Title: Re: Growth scenario
Post by: isidoro on January 13, 2014, 04:02:30 PM
Not really.  It is better to have the proper list attraction_list_x and the proper object attraction_x.  Just the same that happens with factories.  And I guess that that behavior is inside the engine since if you press the lists button and, then, list of tourist destinations, there appears one entry for each attraction.

Moreover, if you click on any of the tiles of an attraction with the information tool, the window that appears have the same coordinates no matter what tile of the attraction you press.  This behavior is just like with factories.

To know if two building tiles belong to the same attraction, in this case, I could do the same I do with factories:  ask for the get_pos() method of factory_x and compare the values.

Title: Re: Growth scenario
Post by: Dwachs on January 13, 2014, 07:40:50 PM
Here is a patch.

Usage:

local attraction_list = get_attraction_list()
foreach(att in attraction_list ) {
...
}

Is this what you wanted?
Title: Re: Growth scenario
Post by: isidoro on January 13, 2014, 11:53:31 PM
Thank you indeed!  It works like charm.

Only to get a taste of the WIP, I attach the present state.  You need a nightly of Pak128.Britain and a savegame named "test.sve".  Better if it has some Building Yards well provided.  You can see the building materials accumulate in the relevant city.

Comments and guidelines are welcome.

Title: Re: Growth scenario
Post by: Yona-TYT on January 14, 2014, 03:30:38 AM

Big ..! the first scenario for pak128.Britain  ;D


Just have time I test.. :thumbsup:
Title: Re: Growth scenario
Post by: isidoro on January 15, 2014, 12:01:36 AM
In fact, it is just work in progress.  Nothing really playable yet.  I'll post more versions when some progress is made.

Title: Re: Growth scenario
Post by: Dwachs on January 17, 2014, 08:21:55 PM
Implemented the attraction list slightly different:
local list = world.get_attraction_list()
// list is now of type attraction_list_x
foreach(att in list) {
     ... // att is an instance of the building_x class
}


Quote from: isidoro on January 13, 2014, 04:02:30 PM
To know if two building tiles belong to the same attraction, in this case, I could do the same I do with factories:  ask for the get_pos() method of factory_x and compare the values.
No, get_pos will return the position of the individual tile, thus it will differ for different tiles of the same multi-tile building. I added building_x::is_same_building for this purpose.

Moreover

a.get_pos() == b.get_pos()

wont work, as squirrel does not check the members of instances/arrays/tables. It only checks whether the references (or pointers) to these objects are the same.
Title: Re: Growth scenario
Post by: isidoro on January 18, 2014, 01:37:39 AM
Thanks again, Dwachs for the inclusion of get_attraction_list.

Attached is the current state of the scenario.  I solved the multi-tile building issue by checking the relevant object (factory, attraction, etc.) instead.  In order to check for equality, I was aware of the issue you mention about coord and check the components instead, as you can see in the code.

Now the first issue I have is that I can check building of factories with tool_build_factory, building of houses with tool_build_house, but I don't have the equivalent: tool_build_attraction

In the scenario attached, there is a lot of debug information, but the main items of the first parts (building materials) is more or less done.

If anyone wants to check it, a nightly nightly of ST and pak128.Britain are needed.  But no serious game can be played now.

Please comment.
Title: Re: Growth scenario
Post by: Dwachs on January 18, 2014, 09:15:54 AM
There is no separate tool to build attractions, it is included in tool_build_house.

If you set

map.file = "<attach>"

then the scenario can be started in an already existing game.

You record calls to tool_remover. However, the removing may fail even if the scenario allows it. In this case you need to check that the building is indeed deleted.
Title: Re: Growth scenario
Post by: isidoro on January 19, 2014, 02:02:36 AM
Thanks.  I have corrected that and now the tool_build_house also triggers "possible construction of attractions".

Regarding your remark about the tool_remover, there is no problem with the false positives, since that only triggers the update of the data cached to speed up presentation.  Some extra calculations are done, but nothing that really alters the final outcome.

Now, I'll go for the food+clothes issue.  When I have that part done, I'll post the scenario file again.
Title: Re: Growth scenario
Post by: isidoro on January 26, 2014, 12:33:43 AM
Self-reply.  ;)
I feel like John the Baptist preaching in the desert...  This time food is nearly done.  Next, clothes.

One question: is it possible to know in what fraction of the month the game is?
Title: Re: Growth scenario
Post by: Dwachs on January 26, 2014, 01:41:01 PM
world.get_time() now (r7040) also returns ticks. hope this helps

http://dwachs.github.io/simutrans-sqapi-doc/classworld.html#a36b9c287660443552fc7438df7d36b11

http://dwachs.github.io/simutrans-sqapi-doc/classtime__ticks__x.html
Title: Re: Growth scenario
Post by: isidoro on January 27, 2014, 12:43:43 AM
Thanks, Dwachs.  I plan to use it to give a better estimate of present state in the progress window.

In this version, clothes are more or less included.  Some interface polish too.  You can see now your cities grow or shrink depending on whether you adequately supply them or not.
Title: Re: Growth scenario
Post by: isidoro on January 27, 2014, 11:52:47 PM
I would like to make the demand of clothes depend on climate, so that in colder places more clothes are needed.

But I don't understand very well the climate system.  In the map I am using (double heights), the settings were that winter snowline was height 7 and summer snowline was height 10.  When I run the game, those figures are not followed and have a summer snowline at -11...

Title: Re: Growth scenario
Post by: kierongreen on January 31, 2014, 07:07:08 PM
That shouldn't happen...
Title: Re: Growth scenario
Post by: prissi on January 31, 2014, 09:10:35 PM
What is the groundwater level? If this is at 4 then 11 is equal to 7 ...
Title: Re: Growth scenario
Post by: isidoro on February 01, 2014, 12:36:56 AM
That's certainly the reason.  Thanks, prissi.

Here's a new version.  In this one, natural resources and factory production depends on location on the map and date.  Unfortunately, with today's Squirrel interface I haven't been able to enforce that and the player is asked to follow that rule.

A function that made possible to change the maximum production of an industry from Squirrel would alleviate that somewhat.

Please comment.

Title: Re: Growth scenario
Post by: isidoro on February 03, 2014, 12:24:20 AM
In this version, a bug is mended.  A custom map, based on the Swiss scenario, is also included.  In order to try it, please use a nightly both of simutrans and pak128.Britain.  Make a directory named scenario in the directory of the pak and unzip the growth directory inside it.

http://simutrans-germany.com/files/upload/growth.zip (http://simutrans-germany.com/files/upload/growth.zip)

I've been playing with it for some time and, although quite difficult to manage, I like the dynamics...

Comments, bugs, etc. are welcome.
Title: Re: Growth scenario
Post by: Yona-TYT on February 03, 2014, 12:36:35 AM
Very nice... ;D
Title: Re: Growth scenario
Post by: isidoro on February 03, 2014, 11:21:37 PM
I'm glad you like it!  Here is my attempt to start with it.  I started to develop three zones where iron and coal were readily available:
http://simutrans-germany.com/files/upload/utopia07.sve (http://simutrans-germany.com/files/upload/utopia07.sve)


I would like to try and polish the scenario before considering how to improve it.  One thing would be a minimum separation between cities and a range for vehicles, so that they cannot travel forever but has to stop at intermediate halts.
Title: Re: Growth scenario
Post by: Dwachs on February 07, 2014, 07:31:12 PM
Quote from: isidoro on February 03, 2014, 12:24:20 AM
http://simutrans-germany.com/files/upload/growth.zip (http://simutrans-germany.com/files/upload/growth.zip)
The file already vanished :(
Title: Re: Growth scenario
Post by: Yona-TYT on February 07, 2014, 07:46:18 PM
Try using this... ;)


http://www.mediafire.com/download/c8e6px1yqu7tsq0/growth.zip
Title: Re: Growth scenario
Post by: isidoro on February 10, 2014, 01:05:51 AM
I've been away all weekend.  Before leaving, when syncing my laptop, all the scenario files and versions vanished (my fault).  I could get growth.zip back from simutrans.germany.com, fortunately.  Not everything was lost!

I was lucky in my misfortune, since now the file is gone.  I wonder why it is gone.  Isn't the default time to stay there 60 days?
Title: Re: Growth scenario
Post by: Yona-TYT on February 10, 2014, 01:32:21 AM
That is why I trust mediafire... ;)
Title: Re: Growth scenario
Post by: isidoro on February 11, 2014, 01:27:51 AM
Thanx for uploading again.
Title: Re: Growth scenario
Post by: isidoro on February 16, 2014, 11:40:16 PM
This is version 0.6.  It now includes furniture and hardware, which are demanded when the towns grow to a certain size.

I hope the link work.  I would use mediafire, but you have to sign up:
http://simutrans-germany.com/files/upload/growth.zip (http://simutrans-germany.com/files/upload/growth.zip)

Just in case, I also attach the .nut file.

Title: Re: Growth scenario
Post by: isidoro on February 23, 2014, 01:52:10 AM
This is the state of the game I'm playing with the current version of the scenario:
http://simutrans-germany.com/files/upload/utopia19.sve (http://simutrans-germany.com/files/upload/utopia19.sve)

Up to this point, even with all the industries needed for each town, the game is behaving quite well in my computer and keeping up with the load.

Regarding the state of the game itself (year 1759):
The game seems interesting to me, but maybe it has some micro management, but the growth is very organic and well organized.  The cities develop near rivers and other water ways, since water transportation has no direct competitor at this time, which seem natural and realistic to me.

Since I'm building all infrastructure with the public service, some strategy is missing.  Specially since you can always build canals to reach everywhere and ships don't occupy space and don't have traffic jams (they are perfect).  Nonetheless, I play to have fun and don't abuse of canals: I only build them on preexisting rivers or on short segments.

To play/see the game, you need a nightly of pak128.Britain, the scenario .nut file in a folder name scenario inside the pak directory and the savegame itself.

Title: Re: Growth scenario
Post by: IgorEliezer on February 23, 2014, 01:54:49 AM
Quote from: Dwachs on February 07, 2014, 07:31:12 PM
The file already vanished :(
The file won't vanish if the uploaded set 0 in "Days valid".
Title: Re: Growth scenario
Post by: isidoro on February 23, 2014, 01:59:40 AM
The strange thing is that I left the default (60 days), but it vanished much before.  My only guess is that I didn't password protect it and anyone can have deleted it.  Is that possible?

But if it is, I wouldn't understand the reason...

Title: Re: Growth scenario
Post by: IgorEliezer on February 23, 2014, 02:05:34 AM
Quote from: isidoro on February 23, 2014, 01:59:40 AMBut if it is, I wouldn't understand the reason...
I always upload with password and set 0 if I don't want it to be deleted.

Hmm, something might have changed. Now I see there's a 3 years limit, but still I can find some old files with no expiration date. ???
Title: Re: Growth scenario
Post by: isidoro on October 17, 2014, 10:46:37 PM
Version 0.6.3 of the scenario.  Nothing important new, but starting date is now 1800, instead of 1750.

http://simutrans-germany.com/files/upload/growth.0.6.3.zip (http://simutrans-germany.com/files/upload/growth.0.6.3.zip)
Title: Re: Growth scenario
Post by: ny911 on October 18, 2014, 08:06:31 PM
Thanks ididoro, that's a great scenario script.

I was so free to change (look to source):
- version number is now a number and not part of the translation text
- moved text to files to enable translation
- create en.tab and filled up width text for translation
- add function get_about_text() ; for translation
- used include() to split script in files (just to get a overview)

Hopefully I didn't make an big error finding all text parts in the script.

Version 0.6.04 : http://simutrans-germany.com/files/upload/growth.0.6.4.zip (http://simutrans-germany.com/files/upload/growth.0.6.4.zip)

What kind of image do you like to have for your scenario to be placed at the scenarios on http://scenarios.simutrans.com ? Making a image from the Stonehenge at xy? Or just a minimap picture?

Title: Re: Growth scenario
Post by: isidoro on October 19, 2014, 12:36:16 AM
I'd rather say that the Stonehenge image.  Reason is that those attractions were placed in suitable places to start new cities (near rivers and natural resources).

Thanks.

Title: Re: Growth scenario
Post by: ny911 on October 19, 2014, 08:59:00 PM
The scenario is now also online at the scenario page.
Direct link:
http://scenarios.simutrans.com/scenario/pak128_britain/growth
Title: Re: Growth scenario
Post by: Aquin on November 12, 2014, 06:10:43 PM
I just tried out your scenario, and I really liked it.

Yet there are some problems:
One the first try I started with creating a city and then placed a Building Yard and after that all material counters were negative, so I coudn't build even a simple sawmill.
On the next try I started with building all the building materials industry plus some food chains before founding the first city. I don't know if this is the intended way.

Even without that being allowed, well actually forced to, place all factories yourself made me place them in a fashion that optimizes the transportation routes. It somewhat inverts the idea of finding a nice network to service the industries.
It also invites to do all the infrastructure work with the public service, eliminating the maintenance burden.

At some point it happened that something was built that consumed steel before I was able to even build a steel mill, effectively preventing all future building.

Also I would like to make some suggestions for future improvements:
I would group the building materials in 3 groups:
Beams: Planks, Wrought Iron and Steel
Stone: Stone, Brick
Mortar: Clay, Cement
Where planks would give less "Beams" points than steel.

The food section is really nice.

All the other products I would group into 3 groups "Energie", "Essentials" and "Luxuries"
Energie would be coal to coal merchants or gasworks, or petrol to gasstations. Maybe also stuff delivered to power plants.
Essentials would be stuff like clothes, newpapers, medicine,...
Luxuries is the rest.
Or there could also be percentages to divide stuff between essentials and luxuries.
And all this sutff should be consumed in the same fashion as food.

I think 1800 is still a very early start, there is not so much land based transportation available at that time. If you call the land "Utopia" I don't expect a map of swiss and north italy.

I would suggest a artificial map, with some premade cities that already have some industry for building materials and a few food chains. Such that it is possible to get a some towns growing using factories nearby, other towns should require some longer distance transportation before they become independent.
Ideally future growth could be scripted such that manual placement of industries can be avoided. A town that reaches the trigger for industry growth would spawn or extend a chain for any resource, food, energy or other good.

Title: Re: Growth scenario
Post by: isidoro on November 13, 2014, 11:49:18 PM
Thank you, Aquin.  Your comments are much appreciated.

Note that some of the features of the scenario are planned that way on purpose, but some are the result of the limited interface that is available to script programmers.  Changing it is out of my reach, since it would involve to change the source code of the game.

For instance, the maximum amount of products a new factory can produce I want to be dependant on date and location, but that feature is not available from the script interface.  The only solution I envisioned was to "ask" the player to follow that limitation.

I'll try to answer some of your questions:

Quote from: Aquin on November 12, 2014, 06:10:43 PM
One the first try I started with creating a city and then placed a Building Yard and after that all material counters were negative, so I coudn't build even a simple sawmill.
On the next try I started with building all the building materials industry plus some food chains before founding the first city. I don't know if this is the intended way.

Yes.  That is intended.  You need building materials to produce building materials.  One way is as you said.  Another is to found cities for the only purpose of producing iron, and with no growth.  Also notice that each new city, besides having "credit" for the first industry, also adopts other cities industries that are nearer at no cost.

Quote
Even without that being allowed, well actually forced to, place all factories yourself made me place them in a fashion that optimizes the transportation routes. It somewhat inverts the idea of finding a nice network to service the industries.
It also invites to do all the infrastructure work with the public service, eliminating the maintenance burden.

I'm sorry, but that is intended.  It all depends where you place the border of the simulation.  In real life, transportation is built to serve preexisting industries, but some times, industries are built near preexisting transport infrastructure.

I don't know if you realize that you cannot build industries wherever you like.  You have to first check the scenario information for the production at that site (even it can be zero and you are forbidden to build it at that place).  But, as I said before, unfortunately, that can't be enforced.

Quote
At some point it happened that something was built that consumed steel before I was able to even build a steel mill, effectively preventing all future building.

That is certainly a bug.  My main concern there is that the first steel mill would require steel to be built, but I have not been able to check it.  I played till 1800 more or less.

Quote
Also I would like to make some suggestions for future improvements:
I would group the building materials in 3 groups:
Beams: Planks, Wrought Iron and Steel
Stone: Stone, Brick
Mortar: Clay, Cement
Where planks would give less "Beams" points than steel.

That is not intended in the scenario.  The idea is that new buildings would require steel so that the player is forced to build steel mills.  If we group them, you would be able to build the newest buildings with no steel...

Quote
All the other products I would group into 3 groups "Energie", "Essentials" and "Luxuries"
Energie would be coal to coal merchants or gasworks, or petrol to gasstations. Maybe also stuff delivered to power plants.
Essentials would be stuff like clothes, newpapers, medicine,...
Luxuries is the rest.
Or there could also be percentages to divide stuff between essentials and luxuries.
And all this sutff should be consumed in the same fashion as food.

The idea here was for these goods to be required only when a city reaches a certain size.  But it is something I left for later work.

Quote
I think 1800 is still a very early start, there is not so much land based transportation available at that time.

That is exactly the point!  The idea is to force the player to found industries and cities near rivers and sea, even to build canals, in the early times.  And see how the railroad changes the scene, just as it happened in real life.  The Stonehenge monuments in the initial map are placed in suitable sites to build in early times.  But playability can be an issue here in all this.

Quote
If you call the land "Utopia" I don't expect a map of swiss and north italy.

That was simply because it was a very nice map at hand.  You have a lot of sea and rivers and a natural wall that splits the map in two.  Only when technology is good enough, that natural barrier would be overcome.

Quote
I would suggest a artificial map, with some premade cities that already have some industry for building materials and a few food chains. Such that it is possible to get a some towns growing using factories nearby, other towns should require some longer distance transportation before they become independent.
Ideally future growth could be scripted such that manual placement of industries can be avoided. A town that reaches the trigger for industry growth would spawn or extend a chain for any resource, food, energy or other good.

That is nice, but it will be certainly another scenario.  One of the main features intended is that the player "develops" the whole map: transportation, but also resources.  But if you know programming, feel free to write your own, based on mine.
Title: Re: Growth scenario
Post by: anp on November 14, 2014, 06:21:29 PM
Hello!

Long time lurker here. I play mostly Simutrans Experimental with pak128 Britain exp.

I am interested in this scenario but i cannot seem to get it to work. I have installed latest simutrans nightly (120.0-7371) and pak128 Britain (1493), created a scenario folder in the pak128 britain directory, but when i try to load the scenario from the main menu i get script errors.
[class tile_object_list_x not found]

Loading the utopia.sve as a save worked but i can't seem to find any information about scenario goals/rules anywhere and as Public Service player i seems to be able to found and grow cities as much as i want.

I am not sure how this scenario is supposed to work other than that you can only found new industries in, or grow cities when you have supplied enough building materials to that citys Builder's Yard.

Is there anywhere else i can find information about this scenario and how to get it to work?
Title: Re: Growth scenario
Post by: ny911 on November 14, 2014, 10:32:30 PM
QuoteI am interested in this scenario but i cannot seem to get it to work. I have installed latest simutrans nightly (120.0-7371) and pak128 Britain (1493), created a scenario folder in the pak128 britain directory, but when i try to load the scenario from the main menu i get script errors.
[class tile_object_list_x not found]
use directory ../pak128.britain/scenario/growth
inside the folder "growth" the scenario has 5 files and one subfolder "en"
don't use a subfolder like ../scenario/growth/growth

QuoteLoading the utopia.sve as a save worked but
well that's only the savefile without any scenario script, so you can't find anything

QuoteIs there anywhere else i can find information about this scenario and how to get it to work?
If you load the scenario correct it shows up all informations. Also possible, but not
use able if you like to play, are all the txt files in the subfolder "en" and the en.tab file in the main scenario folder. Just use a simple text editor to open.
Title: Re: Growth scenario
Post by: anp on November 15, 2014, 06:41:31 AM
I got it to work by reinstalling simutrans. I think it might have conflicted with some simutrans experimental config files.

I'm not sure i understand the production limitations for industries. I just started a game (1800) and it says "production per tile 20" in the goal tab of the scenario window. Does that mean i can only set a Builder's Yard to demand 40 per month? Or have i understood it wrong? Is it possible to alter the production/demand of industries as the production limitations decreases?
Also i can't find places for quarries and clay pits. The only raw materials spots that are defined seem to be for coal and iron.
Title: Re: Growth scenario
Post by: isidoro on November 16, 2014, 01:51:06 AM
The limitation per tile is a general one.  It means that in 1800, if an industry has four tiles, when you build it with the public player, you have to manually set the max production to 80.  But that general limitation can be more restrictive for some products.  In that case, that is also indicated in the scenario information.

Once the industry is built, the production can be changed by the game, but not by you (public service).  Some of the industry will grow on demand and won't respect the initial limitation (wood plantation, for instance), but that is done by the game, not the script and cannot be prevented.

Clay pits and quarries are very dependant on height.  For quarries, just look for rocky places, near the snowline.  For clay pits, look for sandy places near rivers.  In this case, you can even have to dig.

Hope it helps.