The International Simutrans Forum

Development => Scripting Scenarios and AI => Topic started by: Andarix on August 01, 2020, 07:17:48 PM

Title: Script-AI with railroad
Post by: Andarix on August 01, 2020, 07:17:48 PM
sqai_rail v0.1 (https://github.com/Andarix/simutrans-scenarios/releases)

required Simutrans r9153 or higher

https://nightly.simutrans.com/en/ (https://nightly.simutrans.com/en/)
https://github.com/Andarix/simutrans/releases (https://github.com/Andarix/simutrans/releases)
https://www.simutrans-forum.de/nightly/ (https://www.simutrans-forum.de/nightly/)


It is possible that signals are set incorrectly or not at all. not all testet

If a route fails, none of it will be removed. This function is not yet available for Script AIs.
Title: Re: Script-AI with railroad
Post by: Andarix on August 14, 2020, 12:16:39 AM
sqai_rail v0.2 (https://github.com/Andarix/simutrans-scenarios/releases)

minor fixes
If the construction of a route fails, it is usually completely demolished.
Title: Re: Script-AI with railroad
Post by: Andarix on August 28, 2020, 04:08:45 PM
sqai_rail v0.3 (https://github.com/Andarix/simutrans-scenarios/releases)

bugfixes
remove stucked road vehicles

I tested pak64.german and pak64. Other sets can cause errors.

Title: Re: Script-AI with railroad
Post by: Andarix on September 04, 2020, 11:11:09 PM
sqai_rail v0.4 (https://github.com/Andarix/simutrans-scenarios/releases)

bugfixes

I tested pak64.german and pak64. Other sets can cause errors.

I think this release is bug free to the point that it can be used.

Of course, errors can still occur because not all of the many options have been tested yet.

required Simutrans r9210 or higher

https://nightly.simutrans.com/en/ (https://nightly.simutrans.com/en/)
https://github.com/Andarix/simutrans/releases (https://github.com/Andarix/simutrans/releases)
https://www.simutrans-forum.de/nightly/ (https://www.simutrans-forum.de/nightly/)

Title: Re: Script-AI with railroad
Post by: Dwachs on September 05, 2020, 02:18:23 PM
Wow! Got no error messages so far. It is great to the AI build these double-tracks.
Title: Re: Script-AI with railroad
Post by: Andarix on September 06, 2020, 10:03:09 AM
Quote from: Dwachs on September 05, 2020, 02:18:23 PM
Wow! Got no error messages so far. It is great to the AI build these double-tracks.

Unfortunately, harbors are often not built at combined stations because the field is already built on.
Title: Re: Script-AI with railroad
Post by: Andarix on September 18, 2020, 05:28:10 AM
sqai_rail v0.5 (https://github.com/Andarix/simutrans-scenarios/releases)

The bugfix version 0.5.1 include in Simutrans Nightly r9248+.

bugfixes

I tested pak64.german and pak64. Other sets can cause errors.

I think this release is bug free to the point that it can be used.

Of course, errors can still occur because not all of the many options have been tested yet.

required Simutrans r9242 or higher

https://nightly.simutrans.com/en/ (https://nightly.simutrans.com/en/)
https://github.com/Andarix/simutrans/releases (https://github.com/Andarix/simutrans/releases)
https://www.simutrans-forum.de/nightly/ (https://www.simutrans-forum.de/nightly/)

Title: Re: Script-AI with railroad
Post by: Andarix on January 03, 2021, 11:26:46 PM
sqai_rail v0.5.5 (https://github.com/Andarix/simutrans-scenarios/releases)

Bugfixes
Improvements to line construction and cost reviews.

The zip file contains a script_ai_text.dat. Add these texts to the simutrans/text/[lang].tab to have a translated output in the game.

required Simutrans v122.0/r9274 or higher

https://nightly.simutrans.com/en/ (https://nightly.simutrans.com/en/)
https://github.com/Andarix/simutrans/releases (https://github.com/Andarix/simutrans/releases)
https://www.simutrans-forum.de/nightly/ (https://www.simutrans-forum.de/nightly/)

Title: Re: Script-AI with railroad
Post by: Andarix on January 06, 2021, 09:58:44 AM
sqai_rail v0.5.6 (https://github.com/Andarix/simutrans-scenarios/releases)

minor change

ADD tree removal costs
Title: Re: Script-AI with railroad
Post by: Isaac Eiland-Hall on January 06, 2021, 05:34:32 PM
Quote from: Andarix on January 06, 2021, 09:58:44 AMADD tree removal costs

Capitalists boo, environmentalists cheer :)
Title: Re: Script-AI with railroad
Post by: Andarix on January 06, 2021, 05:56:29 PM
The costs are defined in the paksets. The construction costs of the Script AI have not taken these costs into account.

Depending on the route, up to 30,000 Cr can be incurred as additional expenditure when building a route.
Title: Re: Script-AI with railroad
Post by: Andarix on January 15, 2021, 04:13:28 PM
sqai_rail v0.5.7 (https://github.com/Andarix/simutrans-scenarios/releases)

Bugfixes
Improvements to line construction and cost reviews.

The zip file contains a script_ai_text.dat. Add these texts to the simutrans/text/[lang].tab to have a translated output in the game.

de
#________________________________script_ai_text_________________________________
#________________________________script_ai_text_________________________________
%s build additional convoy to line: %s
%s erhöht die Fahrzeugzahl der Linie: %s
%s build rail line from %s (%s) to %s (%s)
%s baut Eisenbahn-Linie von %s (%s) nach %s (%s)
%s build road line from %s (%s) to %s (%s)
%s baut Lkw-Linie von %s (%s) nach %s (%s)
%s build ship line from %s (%s) to %s (%s)
%s baut Schiffslinie von %s (%s) nach %s (%s)
%s extends the route from %s (%s) to %s (%s)
%s baut die Strecke von %s (%s) nach %s (%s) aus
%s optimize way line from %s (%s) to %s (%s)
%s optimiert Strecke von %s (%s) nach %s (%s)
%s removes convoys from line: %s
%s reduziert die Fahrzeugzahl der Linie: %s


required Simutrans r9560 or higher

https://nightly.simutrans.com/en/ (https://nightly.simutrans.com/en/)
https://github.com/Andarix/simutrans/releases (https://github.com/Andarix/simutrans/releases)
https://www.simutrans-forum.de/nightly/ (https://www.simutrans-forum.de/nightly/)

Title: Re: Script-AI with railroad
Post by: Dwachs on January 15, 2021, 04:44:39 PM
I think it should be possible to implement loading of language files from the ai directory. Lets see.
Title: Re: Script-AI with railroad
Post by: Andarix on January 15, 2021, 05:08:01 PM
Quote from: Dwachs on January 15, 2021, 04:44:39 PM
I think it should be possible to implement loading of language files from the ai directory. Lets see.

Which leads to the texts being distributed further. It is easier to add the texts to the base texts.

you can translate here (https://simutrans-germany.com/wiki/wiki/en_translate_base_texts)

object selection: script_ai_text

The texts were added by someone there. These texts are also used in my nightlys.
Title: Re: Script-AI with railroad
Post by: Andarix on January 23, 2021, 12:21:03 PM
sqai_rail v0.5.8 (https://github.com/Andarix/simutrans-scenarios/releases)

Bugfixes
Improvements to line construction and cost reviews.

The zip file contains a script_ai_text.dat. Add these texts to the simutrans/text/[lang].tab to have a translated output in the game.

required Simutrans r9575 or higher (include Simutrans r9580)

https://nightly.simutrans.com/en/ (https://nightly.simutrans.com/en/)
https://github.com/Andarix/simutrans/releases (https://github.com/Andarix/simutrans/releases)
https://www.simutrans-forum.de/nightly/ (https://www.simutrans-forum.de/nightly/)


A little more feedback would be nice.
Title: Re: Script-AI with railroad
Post by: Andarix on February 20, 2021, 04:17:07 PM
sqai_rail v0.6 (https://github.com/Andarix/simutrans-scenarios/releases)

In addition to bug fixes, this version also integrated extensions.

- Vehicles: If there are vehicles of different speeds on a line, the slower (mostly older) ones are taken out of service.
- Ways: If there are vehicles faster than the route speed, the routes of the line will be expanded (if own or public). Rail track not testet

Problems
With larger maps and more complex industrial chains, the chains are not fully developed. This results from the amount of the starting capital.

If a player goes bankrupt, his streets become public. However, this does not apply to bridges, these will be removed. This means that lines can be broken. This currently has to be fixed manually by the.




The zip file contains a script_ai_text.dat. Add these texts to the simutrans/text/[lang].tab to have a translated output in the game.

required Simutrans r9641 or higher

https://nightly.simutrans.com/en/ (https://nightly.simutrans.com/en/)
https://github.com/Andarix/simutrans/releases (https://github.com/Andarix/simutrans/releases)
https://www.simutrans-forum.de/nightly/ (https://www.simutrans-forum.de/nightly/)


A little more feedback would be nice.
Title: Re: Script-AI with railroad
Post by: Andarix on February 23, 2021, 03:31:42 PM
sqai_rail v0.6.1 (https://github.com/Andarix/simutrans-scenarios/releases)

bug fixes

Problems
With larger maps and more complex industrial chains, the chains are not fully developed. This results from the amount of the starting capital.

If a player goes bankrupt, his streets become public. However, this does not apply to bridges, these will be removed. This means that lines can be broken. This currently has to be fixed manually by the.




The zip file contains a script_ai_text.dat. Add these texts to the simutrans/text/[lang].tab to have a translated output in the game.

required Simutrans r9641 or higher (include simutrans r9649)

https://nightly.simutrans.com/en/ (https://nightly.simutrans.com/en/)
https://github.com/Andarix/simutrans/releases (https://github.com/Andarix/simutrans/releases)
https://www.simutrans-forum.de/nightly/ (https://www.simutrans-forum.de/nightly/)


A little more feedback would be nice.
Title: Re: Script-AI with railroad
Post by: Andarix on February 26, 2021, 04:49:40 PM
sqai_rail v0.6.2 (https://github.com/Andarix/simutrans-scenarios/releases)

bug fixes

Problems
With larger maps and more complex industrial chains, the chains are not fully developed. This results from the amount of the starting capital.

If a player goes bankrupt, his streets become public. However, this does not apply to bridges, these will be removed. This means that lines can be broken. This currently has to be fixed manually by the.




The zip file contains a script_ai_text.dat. Add these texts to the simutrans/text/[lang].tab to have a translated output in the game.

required Simutrans r9641 or higher (include simutrans r9649)

https://nightly.simutrans.com/en/ (https://nightly.simutrans.com/en/)
https://github.com/Andarix/simutrans/releases (https://github.com/Andarix/simutrans/releases)
https://www.simutrans-forum.de/nightly/ (https://www.simutrans-forum.de/nightly/)


A little more feedback would be nice.
Title: Re: Script-AI with railroad
Post by: Andarix on April 24, 2021, 12:52:18 PM
v0.6.4 include in simutrans r9742
Title: Re: Script-AI with railroad
Post by: Andarix on June 27, 2021, 04:36:41 PM
sqai_rail v0.7.1 (https://github.com/Andarix/simutrans-scenarios/releases)

bug fixes
change the line management

Unfortunately, earlier games no longer work from this version onwards.

Problems
With larger maps and more complex industrial chains, the chains are not fully developed. This results from the amount of the starting capital.

If a player goes bankrupt, his streets become public. However, this does not apply to bridges, these will be removed. This means that lines can be broken. This currently has to be fixed manually by the.




The zip file contains a script_ai_text.dat. Add these texts to the simutrans/text/[lang].tab or save [lang].tab in script folder sqai_rail to have a translated output in the game.
You can translate on this page (https://simutrans-germany.com/wiki/wiki/tiki-index.php?page=en_translate_base_texts) (select object script_ai_text).

required Simutrans r9912 or higher

https://nightly.simutrans.com/en/ (https://nightly.simutrans.com/en/)
https://github.com/Andarix/simutrans/releases (https://github.com/Andarix/simutrans/releases)
https://www.simutrans-forum.de/nightly/ (https://www.simutrans-forum.de/nightly/)


A little more feedback would be nice.
Title: Re: Script-AI with railroad
Post by: Andarix on July 07, 2021, 08:04:42 PM
sqai_rail v0.7.2 (https://github.com/Andarix/simutrans-scenarios/releases)

bug fixes

include in simutrans r9934
Title: Re: Script-AI with railroad
Post by: Andarix on July 23, 2021, 10:23:52 PM
sqai_rail v0.7.3 (https://github.com/Andarix/simutrans-scenarios/releases)

bug fixes
change the line management

Unfortunately, earlier games (< r.0.7.0) no longer work from this version onwards.

Problems
With larger maps and more complex industrial chains, the chains are not fully developed. This results from the amount of the starting capital.

If a player goes bankrupt, his streets become public. However, this does not apply to bridges, these will be removed. This means that lines can be broken. This currently has to be fixed manually by the.




The zip file contains a script_ai_text.dat. Add these texts to the simutrans/text/[lang].tab or save [lang].tab in script folder sqai_rail to have a translated output in the game.
You can translate on this page (https://simutrans-germany.com/wiki/wiki/tiki-index.php?page=en_translate_base_texts) (select object script_ai_text).

required Simutrans r9960 or higher (include r9968)

https://nightly.simutrans.com/en/ (https://nightly.simutrans.com/en/)
https://github.com/Andarix/simutrans/releases (https://github.com/Andarix/simutrans/releases)
https://www.simutrans-forum.de/nightly/ (https://www.simutrans-forum.de/nightly/)
https://github.com/aburch/simutrans/releases (https://github.com/aburch/simutrans/releases)


A little more feedback would be nice.
Title: Re: Script-AI with railroad
Post by: Andarix on July 25, 2021, 03:31:01 PM
sqai_rail v0.7.4 (https://github.com/Andarix/simutrans-scenarios/releases)

include in Simutrans r9971

bug fixes
FIX search place for rail stations - more railroads should be built
ADD City vehicles are included in the route evaluation (alpha)
FIX when removing railroads, there should be fewer interrupted routes

Problems still arise from crossing railroad lines.
Title: Re: Script-AI with railroad
Post by: Andarix on January 10, 2022, 10:45:59 AM
sqai_rail v0.7.7 (https://github.com/Andarix/simutrans-scenarios/releases)
include in the next Simutrans Release (123.0.1)

This revision should be suitable for long-term games. Unfortunately I wasn't able to test everything extensively (runtime, different packages), but this revision should get quite good results in games.

It will often not be possible for a single AI to completely open up industrial chains. But the AI is renewing its vehicles and expanding its routes. What I haven't been able to test so far is expanding platforms. So the platform smaller 5 fields can be extended to up to 5 fields, provided the route allows it.

To put it right away and not arouse false hopes. The AI is designed in such a way that it can survive in the various packages (at least I hope because not every package has been tested by me). She's not a perfect player in every packset. Finer adjustments to different packages will be possible in the future. That depends on whether players give feedback or not.

bug fixes
change the line management

Unfortunately, earlier games (< r.0.7.0) no longer work from this version onwards.

Problems
With larger maps and more complex industrial chains, the chains are not fully developed. This results from the amount of the starting capital.

If a player goes bankrupt, his streets become public. However, this does not apply to bridges, these will be removed. This means that lines can be broken. This currently has to be fixed manually by the.

Problems can arise when railroad lines cross.




The zip file contains a script_ai_text.dat. Add these texts to the simutrans/text/[lang].tab or save [lang].tab in script folder sqai_rail to have a translated output in the game.
You can translate on this page (https://simutrans-germany.com/wiki/wiki/tiki-index.php?page=en_translate_base_texts) (select object script_ai_text).

required Simutrans r9960 or higher (include r10343)

https://nightly.simutrans.com/en/ (https://nightly.simutrans.com/en/)
https://github.com/Andarix/simutrans/releases (https://github.com/Andarix/simutrans/releases)
https://www.simutrans-forum.de/nightly/ (https://www.simutrans-forum.de/nightly/)
https://github.com/aburch/simutrans/releases (https://github.com/aburch/simutrans/releases)


A little more feedback would be nice.

Title: Re: Script-AI with railroad
Post by: iGi on January 11, 2022, 08:37:36 PM
I really like this AI.

I have a small error regarding map boundaries.
It seems it built right at the edge of the map and this causes out-of-bounds issues.
The mapsize is 255,255.

used version: v0.7.7

https://ibb.co/TYDH6mL
https://ibb.co/QKHLtrW
Title: Re: Script-AI with railroad
Post by: Andarix on January 11, 2022, 10:56:35 PM
the test tile is out of map

https://simutrans-germany.com/files/upload/sqai_rail_0.7.7-fix.zip (https://simutrans-germany.com/files/upload/sqai_rail_0.7.7-fix.zip)
Title: Re: Script-AI with railroad
Post by: Andarix on January 15, 2022, 11:58:08 AM
Quote from: iGi on January 11, 2022, 08:37:36 PM
...
I have a small error regarding map boundaries.
It seems it built right at the edge of the map and this causes out-of-bounds issues.
The mapsize is 255,255.
...

Can you please provide the savegame.
Title: Re: Script-AI with railroad
Post by: Andarix on January 15, 2022, 07:48:51 PM
sqai_rail v0.7.8 (https://github.com/Andarix/simutrans-scenarios/releases)
include in the next Simutrans Release

This revision should be suitable for long-term games. Unfortunately I wasn't able to test everything extensively (runtime, different packages), but this revision should get quite good results in games.

It will often not be possible for a single AI to completely open up industrial chains. But the AI is renewing its vehicles and expanding its routes. What I haven't been able to test so far is expanding platforms. So the platform smaller 5 fields can be extended to up to 5 fields, provided the route allows it.

To put it right away and not arouse false hopes. The AI is designed in such a way that it can survive in the various packages (at least I hope because not every package has been tested by me). She's not a perfect player in every packset. Finer adjustments to different packages will be possible in the future. That depends on whether players give feedback or not.

bug fixes
change the way management (bridges)

Unfortunately, earlier games (< r.0.7.0) no longer work from this version onwards.

Problems
With larger maps and more complex industrial chains, the chains are not fully developed. This results from the amount of the starting capital.

If a player goes bankrupt, his streets become public. However, this does not apply to bridges, these will be removed. This means that lines can be broken. This currently has to be fixed manually by the.

Problems can arise when railroad lines cross.




The zip file contains a script_ai_text.dat. Add these texts to the simutrans/text/[lang].tab or save [lang].tab in script folder sqai_rail to have a translated output in the game.
You can translate on this page (https://simutrans-germany.com/wiki/wiki/tiki-index.php?page=en_translate_base_texts) (select object script_ai_text) or SimuTranslator Base texts (https://makie.de/translator/script/directions.php) (select object script_ai_text).

required Simutrans r9960 or higher (include r10359)

https://nightly.simutrans.com/en/ (https://nightly.simutrans.com/en/)
https://github.com/Andarix/simutrans/releases (https://github.com/Andarix/simutrans/releases)
https://www.simutrans-forum.de/nightly/ (https://www.simutrans-forum.de/nightly/)
https://github.com/aburch/simutrans/releases (https://github.com/aburch/simutrans/releases)

Title: Re: Script-AI with railroad
Post by: Yona-TYT on January 16, 2022, 12:27:33 AM






 


I see some variables with operators with empty values.

I don't know if this is allowed in squirrel.

         build_bridge = 1
        } else if ( (tile_1.get_slope() == 12 && tile_2.get_slope() == 28 && tile_1.x > tile_2.x) || (tile_1.get_slope() == 28 && tile_2.get_slope() == 12 && tile_1.x < tile_2.x) ) {
          build_bridge = 1
        }

        build_tile =
      }
Title: Re: Script-AI with railroad
Post by: Andarix on January 16, 2022, 10:22:01 AM
What are you trying to tell me with a code snippet from an unknown source?
Title: Re: Script-AI with railroad
Post by: iGi on January 16, 2022, 11:28:18 PM
Quote from: Andarix on January 15, 2022, 11:58:08 AMCan you please provide the savegame.

Sorry, I don't have it anymore.
I just recreated the map and realized too late that I should probably keep the save...
Title: Re: Script-AI with railroad
Post by: Andarix on January 17, 2022, 09:22:05 PM
For some time now, when land has been lowered to water level, water has formed instead of land. This leads to previously unsolved problems in the script AI.

This feature change is a bit dubious as many paksets are not able to turn water into land due to undefined climate tools or lack of player access. Conversely, it is possible to build channels in almost every pakset.

(https://www.simutrans-forum.de/mybb/attachment.php?aid=17752)

(https://www.simutrans-forum.de/mybb/attachment.php?aid=17751)

(https://www.simutrans-forum.de/mybb/attachment.php?aid=17743)
Title: Re: Script-AI with railroad
Post by: Dwachs on January 18, 2022, 07:24:43 AM
It should be relatively simple to implement the change-climate tool for scripts.  I will try tonight.
Title: Re: Script-AI with railroad
Post by: Andarix on January 18, 2022, 01:53:47 PM
Quote from: Dwachs on January 18, 2022, 07:24:43 AM
It should be relatively simple to implement the change-climate tool for scripts.  I will try tonight.

The climate tool raises other problems. For one, it's not defined in every paksets. Secondly, if the script AI can use it even if it is not available to the player, it might confuse the players.

Currently, a previous test of what is happening would be sufficient. Then you can cancel the action.

I am also currently missing the construction tool for overhead lines.
https://github.com/Dwachs/simutrans-scenarios/issues/5 (https://github.com/Dwachs/simutrans-scenarios/issues/5)
Title: r0.8.0 - Script-AI with railroad
Post by: Andarix on January 20, 2022, 03:24:36 PM
sqai_rail v0.8.0 (https://github.com/Andarix/simutrans-scenarios/releases)

Pre-Release -> debug messages output
Not all functions have been tested because it has not occurred in the test games so far.

To put it right away and not arouse false hopes. The AI is designed in such a way that it can survive in the various packages (at least I hope because not every package has been tested by me). She's not a perfect player in every packset. Finer adjustments to different packages will be possible in the future. That depends on whether players give feedback or not.

Railway lines are being expanded for multi-train operation with sidings. The number depends on the length of the route and the terrain.
From 1935, railway lines longer than 80 tiles can be electrified and use electric vehicles.

For long connections, a higher capital is required. Therefore these connections are discarded if the existing capital is not high enough.

There are several runs for route optimization. Bridges and incisions are built. Tunnel not supportet by script AI. Level crossings are also replaced by road bridges if the number of road vehicles exceeds 100 per month and the course of the road permits.

If the maximum speed of vehicles increases, routes are expanded to the necessary speed.

Road conversions always require suitable owners.

Unprofitable and incomplete routes/connections will be removed again.

When traffic jams occur, empty vehicles will be removed after a while to clear the jam.

Unfortunately, earlier games (< r.0.7.0) no longer work from this version onwards.

Problems
With larger maps and more complex industrial chains, the chains are not fully developed. This results from the amount of the starting capital.

If a player goes bankrupt, his streets become public. However, this does not apply to bridges, these will be removed. This means that lines can be broken. This currently has to be fixed manually by the.

When land has been lowered to water level, water has formed. Not yet decided what solution there will be.

Problems can arise when railroad lines cross.

Connections that require more than 3 sections are not completely built.

When removing routes, remnants may remain.

When converting electrified routes, the overhead line may not be closed again.




The zip file contains a script_ai_text.dat. Add these texts to the simutrans/text/[lang].tab or save [lang].tab in script folder sqai_rail to have a translated output in the game.
You can translate on this page (https://simutrans-germany.com/wiki/wiki/tiki-index.php?page=en_translate_base_texts) (select object script_ai_text) or SimuTranslator Base texts (https://makie.de/translator/script/directions.php) (select object script_ai_text).

required Simutrans r10379 or higher

https://nightly.simutrans.com/en/ (https://nightly.simutrans.com/en/)
https://github.com/Andarix/simutrans/releases (https://github.com/Andarix/simutrans/releases)
https://www.simutrans-forum.de/nightly/ (https://www.simutrans-forum.de/nightly/)
https://github.com/aburch/simutrans/releases (https://github.com/aburch/simutrans/releases)

Title: r0.8.1 - Script-AI with railroad
Post by: Andarix on January 25, 2022, 07:01:49 AM
sqai_rail v0.8.1 (https://github.com/Andarix/simutrans-scenarios/releases)

To put it right away and not arouse false hopes. The AI is designed in such a way that it can survive in the various packages (at least I hope because not every package has been tested by me). She's not a perfect player in every packset. Finer adjustments to different packages will be possible in the future. That depends on whether players give feedback or not.

Railway lines are being expanded for multi-train operation with sidings. The number depends on the length of the route and the terrain.
From 1935, railway lines longer than 80 tiles can be electrified and use electric vehicles.

For long connections, a higher capital is required. Therefore these connections are discarded if the existing capital is not high enough.

There are several runs for route optimization. Bridges and incisions are built. Tunnel not supportet by script AI. Level crossings are also replaced by road bridges if the number of road vehicles exceeds 100 per month and the course of the road permits.

If the maximum speed of vehicles increases, routes are expanded to the necessary speed.

Road conversions always require suitable owners.

Unprofitable and incomplete routes/connections will be removed again.

When traffic jams occur, empty vehicles will be removed after a while to clear the jam.

Unfortunately, earlier games (< r.0.7.0) no longer work from this version onwards.

Problems
With larger maps and more complex industrial chains, the chains are not fully developed. This results from the amount of the starting capital.

If a player goes bankrupt, his streets become public. However, this does not apply to bridges, these will be removed. This means that lines can be broken. This currently has to be fixed manually by the.

Problems can arise when railroad lines cross.

Connections that require more than 3 sections are not completely built.

When removing routes, remnants may remain.




The zip file contains a script_ai_text.dat. Add these texts to the simutrans/text/[lang].tab or save [lang].tab in script folder sqai_rail to have a translated output in the game.
You can translate on this page (https://simutrans-germany.com/wiki/wiki/tiki-index.php?page=en_translate_base_texts) (select object script_ai_text) or SimuTranslator Base texts (https://makie.de/translator/script/directions.php) (select object script_ai_text).

required Simutrans r10408 or higher

https://nightly.simutrans.com/en/ (https://nightly.simutrans.com/en/)
https://github.com/Andarix/simutrans/releases (https://github.com/Andarix/simutrans/releases)
https://www.simutrans-forum.de/nightly/ (https://www.simutrans-forum.de/nightly/)
https://github.com/aburch/simutrans/releases (https://github.com/aburch/simutrans/releases)

Title: r0.8.2 - Script-AI with railroad
Post by: Andarix on January 29, 2022, 11:46:56 AM
sqai_rail v0.8.2 (https://github.com/Andarix/simutrans-scenarios/releases)

Line management changes and bug fixes

Unfortunately, earlier games (< r.0.7.0) no longer work from this version onwards.

Problems
With larger maps and more complex industrial chains, the chains are not fully developed. This results from the amount of the starting capital.

If a player goes bankrupt, his streets become public. However, this does not apply to bridges, these will be removed. This means that lines can be broken. This currently has to be fixed manually by the.

Problems can arise when railroad lines cross.

Connections that require more than 3 sections are not completely built.

When removing routes, remnants may remain.




The zip file contains a script_ai_text.dat. Add these texts to the simutrans/text/[lang].tab or save [lang].tab in script folder sqai_rail to have a translated output in the game.
You can translate on this page (https://simutrans-germany.com/wiki/wiki/tiki-index.php?page=en_translate_base_texts) (select object script_ai_text) or SimuTranslator Base texts (https://makie.de/translator/script/directions.php) (select object script_ai_text).

required Simutrans r10408 or higher

https://nightly.simutrans.com/en/ (https://nightly.simutrans.com/en/)
https://github.com/Andarix/simutrans/releases (https://github.com/Andarix/simutrans/releases)
https://www.simutrans-forum.de/nightly/ (https://www.simutrans-forum.de/nightly/)
https://github.com/aburch/simutrans/releases (https://github.com/aburch/simutrans/releases)

Title: r0.8.4 - Script-AI with railroad
Post by: Andarix on March 06, 2022, 12:20:16 PM
sqai_rail v0.8.4 (https://github.com/Andarix/simutrans-scenarios/releases)

includ in Simutrans r10537
Title: r0.8.5 - Script-AI with railroad
Post by: Andarix on March 27, 2022, 07:38:09 AM
sqai_rail v0.8.5 (https://github.com/Andarix/simutrans-scenarios/releases)

This version has the following features


The Script AI won't play perfectly, but it should survive and not go bankrupt in most cases. However, the larger (distances between industries) and mountainous (restrictions on terrain construction and no tunnels) the maps are, the more difficult it is for them. The biggest problem will be when industrial chains are not fully developed.

I mainly tested with pak64.german. Optimizations for other packages are possible after feedback. It is also possible that there are still errors in relation to 2 heights. Especially when building bridges that may only have height 1 although height 2 is required.

Unfortunately, earlier games (< r.0.7.0) no longer work from this version onwards.

Problems
With larger maps and more complex industrial chains, the chains are not fully developed. This results from the amount of the starting capital.

If a player goes bankrupt, his streets become public. However, this does not apply to bridges, these will be removed. This means that lines can be broken. This currently has to be fixed manually by the.

Problems can arise when railroad lines cross.

Connections that require more than 3 sections are not completely built.

When removing routes, remnants may remain.

When loading a map with script AI, the AI players may not load properly (see player list). Then the AI players have to be reactivated.




The zip file contains a script_ai_text.dat. Add these texts to the simutrans/text/[lang].tab or save [lang].tab in script folder sqai_rail to have a translated output in the game.
You can translate on this page (https://simutrans-germany.com/wiki/wiki/tiki-index.php?page=en_translate_base_texts) (select object script_ai_text) or SimuTranslator Base texts (https://makie.de/translator/script/directions.php) (select object script_ai_text).

required Simutrans r10421 or higher (include in r10592)

https://nightly.simutrans.com/en/ (https://nightly.simutrans.com/en/)
https://github.com/Andarix/simutrans/releases (https://github.com/Andarix/simutrans/releases)
https://www.simutrans-forum.de/nightly/ (https://www.simutrans-forum.de/nightly/)
https://github.com/aburch/simutrans/releases (https://github.com/aburch/simutrans/releases)




Testsave
Simutrans 123.0.2 r10592 pak64.german 0.123.0.0.4 script ai r0.8.5
https://simutrans-germany.com/files/upload/1936_256x256-1983.sve (https://simutrans-germany.com/files/upload/1936_256x256-1983.sve) (until 22. Mar 2023)
Title: Re: Script-AI with railroad
Post by: Andarix on February 04, 2023, 09:59:45 PM
sqai_rail v0.8.7 (https://github.com/Andarix/simutrans-scenarios/releases)

Different changes for build double ways and create convoys.

Unfortunately, earlier games (< r.0.7.0) no longer work from this version onwards.

Problems
With larger maps and more complex industrial chains, the chains are not fully developed. This results from the amount of the starting capital.

If a player goes bankrupt, his streets become public. However, this does not apply to bridges, these will be removed. This means that lines can be broken. This currently has to be fixed manually by the.

Problems can arise when railroad lines cross.

Connections that require more than 3 sections are not completely built.

When removing routes, remnants may remain.

When loading a map with script AI, the AI players may not load properly (see player list). Then the AI players have to be reactivated.



The zip file contains a script_ai_text.dat. Add these texts to the simutrans/text/[lang].tab or save [lang].tab in script folder sqai_rail to have a translated output in the game.
You can translate on this page (https://simutrans-germany.com/wiki/wiki/tiki-index.php?page=en_translate_base_texts) (select object script_ai_text) or SimuTranslator Base texts (https://makie.de/translator/script/directions.php) (select object script_ai_text).

required Simutrans r10842 or higher

https://nightly.simutrans.com/en/ (https://nightly.simutrans.com/en/)
https://github.com/Andarix/simutrans/releases (https://github.com/Andarix/simutrans/releases)
https://www.simutrans-forum.de/nightly/ (https://www.simutrans-forum.de/nightly/)
https://github.com/simutrans/simutrans/releases (https://github.com/simutrans/simutrans/releases)


Title: Re: Script-AI with railroad
Post by: Andarix on February 05, 2023, 01:22:22 PM
minor bug (https://github.com/Andarix/simutrans-scenarios/commit/a62f1a60f17169b9d9d053453d878a4ed0ab4cb9)

edit or replace the file industry_manager.nut

Title: Re: Script-AI with railroad
Post by: Andarix on February 12, 2023, 07:32:02 AM
example stations built by sript AI

(https://forum.simutrans.com/index.php?action=dlattach;attach=32205;image)

(https://forum.simutrans.com/index.php?action=dlattach;attach=32207;image)
Title: Re: Script-AI with railroad
Post by: prissi on February 21, 2023, 08:58:02 AM
Apart from the strange bridge this is very impressive. I think it is time to make the script AI rather the default AI.
Title: Re: Script-AI with railroad
Post by: Andarix on February 21, 2023, 09:18:11 AM
Quote from: prissi on February 21, 2023, 08:58:02 AMApart from the strange bridge this is very impressive. I think it is time to make the script AI rather the default AI.

Route finding is still not very good in mountainous terrain. The ability to adapt terrain is missing here.

Another problem is larger maps. Without adjusting the starting capital to the map size, the script AI is rather useless on large maps. In other words, it would only use road traffic, if at all. Or build incomplete chains that lead to bankruptcy.

The selection of industries is also not good. On my current test maps (around 384x448), I sometimes turn on all players as AI to achieve full chains.

Another problem is the oil rig with identical industrial connections. The 2nd route ensures that the first route comes to a standstill.

Since my own tests mostly run with pak64.german (single high set), I don't have any feedback from other sets.

I also see the lack of tunnels as a limitation for the AI.



I am currently trying to optimize the route and the passing points. There are still a few things wrong and the left-hand traffic has not yet been expanded/tested.

The focus is also on developing industrial chains. So before parallel connections are built, the chain as such is opened up.

This is also the reason why the current versions are not included in SVN.
Title: Re: Script-AI with railroad
Post by: Andarix on February 22, 2023, 06:24:47 PM
pak128
example failed upgrade road

Screenshot 2023-02-22 192104.png
Title: Re: Script-AI with railroad
Post by: Andarix on February 22, 2023, 08:04:01 PM
Quote from: prissi on February 21, 2023, 08:58:02 AMApart from the strange bridge this is very impressive. I think it is time to make the script AI rather the default AI.

Another problem is road bridges. When an AI goes bankrupt, road bridges are removed as opposed to roads becoming public. Such interruptions cannot be located from the script at the time.
Title: Re: Script-AI with railroad
Post by: Andarix on February 27, 2023, 01:36:36 PM
sqai_rail v0.8.8 (https://github.com/Andarix/simutrans-scenarios/releases)

FIX bridge error pak128 (double high sets)
FIX select catenary pak128.german



I strongly doubt whether it makes sense to support pak128 (test with version 2.8.1). Pure freight transport is hardly possible there. Maybe by road, but impossible by train. Especially with the railways, the profits are very small in relation to the vehicle costs.

testgame

Simutrans 123.0.2 r10855
sqai_rail 0.8.8
pak128 2.8.1

pak128_AI_test.sve (https://simutrans-germany.com/files/upload/pak128_AI_test.sve) ~ 1 MByte (60 days)
Title: Re: Script-AI with railroad
Post by: Yona-TYT on February 27, 2023, 01:50:23 PM

Do your scripts fit each pakset? , interesting.. 8)
Title: Re: Script-AI with railroad
Post by: Andarix on February 27, 2023, 02:15:54 PM
Quote from: Yona-TYT on February 27, 2023, 01:50:23 PMDo your scripts fit each pakset? , interesting.. 8)

Yes, there are a few customizations for sets built in so far. That's why it needs feedback from other sets. Testing is very time-consuming because chance plays a major role and certain situations rarely occur.

Since the sets are different, this requires such adjustments. Among other things, the speed bonus and industry balancing play a role. Vehicle selection also plays a role.

So far, the AI has had a hard time coping with low production rates. The production rates for the pak128 and pak128.german are very low. This means that there are many low-volume connections. With the pak128, there is also the fact that rail freight transport is hardly feasible.

But pak128 has always been very street-heavy. And it's designed for mass passenger traffic. Maps with low passenger traffic (small towns) are also difficult to play.

The more mountainous a map is, the more difficulties the AI gets. This applies above all to the way search.

The map size also plays a role in connection with the starting capital.
Title: Re: Script-AI with railroad
Post by: Yona-TYT on February 27, 2023, 06:45:16 PM
QuoteThe map size also plays a role in connection with the starting capital.
Wouldn't it be nice to make a player's starting capital proportional to the size of the map?. 
Title: Re: Script-AI with railroad
Post by: Andarix on March 05, 2023, 12:12:32 PM
sqai_rail v0.8.9 (https://github.com/Andarix/simutrans-scenarios/releases)


Mainly changes in road traffic.

The script seems to hang from time to time. Then disable and re-enable the AI players in the player list.
This can be seen from the fact that the player balance sheet is not issued at the beginning of the month. And no other action messages are issued.

Messages for scenarios must of course be activated. The Script AI runs under Scenarios and not under AI.

If there are no bug reports, I think this version can then be added back to Simutrans.

Title: Re: Script-AI with railroad
Post by: Andarix on March 20, 2023, 06:41:06 AM
Now expanding stations also works at the end. It took a long time for this case to occur.

left before, right after


(https://www.simutrans-forum.de/mybb/attachment.php?aid=17802)
Title: Re: Script-AI with railroad
Post by: Andarix on March 21, 2023, 09:32:57 PM
sqai_rail v0.8.10 (https://github.com/Andarix/simutrans-scenarios/releases)


bugfix version
Title: Re: Script-AI with railroad - 0.8.11
Post by: Andarix on April 17, 2023, 12:04:32 PM
sqai_rail v0.8.11 (https://github.com/Andarix/simutrans-scenarios/releases)


bugfix version
Title: Re: Script-AI with railroad
Post by: Andarix on April 19, 2023, 07:47:04 PM
current status

The code from the repo also has the convoy yo-yo a bit softened now. So the constant buying/selling of convoys at short intervals with lines (water, railway).

Otherwise I consider the script AI to be 80% working with trains.

The remaining 20% includes the following issues:

and


There is still plenty of room for improvement.

range of functions

Title: Re: Script-AI with railroad
Post by: Andarix on April 28, 2023, 06:28:04 PM
sqai_rail v0.8.12 (https://github.com/Andarix/simutrans-scenarios/releases)

Other player's bridges are now saved with the lines. However, they will not be rebuilt once they have been removed.

Terrain changes are now applied to the grid. This has not yet been fully tested and has not yet been tested for double heights. There are also checks on the field outside the map and which player the path belongs to.

The latter requires Simutrans r10894 or higher.

Tryouts should have a monthly autosave. If errors occur, please make the last automatic save available.

Unfortunately, earlier games (< r.0.7.0) no longer work from this version onwards.

Problems
With larger maps and more complex industrial chains, the chains are not fully developed. This results from the amount of the starting capital.

If a player goes bankrupt, his streets become public. However, this does not apply to bridges, these will be removed. This means that lines can be broken. This currently has to be fixed manually by the.

Problems can arise when railroad lines cross.

Connections that require more than 3 sections are not completely built.

When removing routes, remnants may remain.

When loading a map with script AI, the AI players may not load properly (see player list). Then the AI players have to be reactivated.



The zip file contains a script_ai_text.dat. Add these texts to the simutrans/text/[lang].tab or save [lang].tab in script folder sqai_rail to have a translated output in the game.
You can translate on this page (https://simutrans-germany.com/wiki/wiki/tiki-index.php?page=en_translate_base_texts) (select object script_ai_text) or SimuTranslator Base texts (https://makie.de/translator/script/directions.php) (select object script_ai_text).

required Simutrans r10894 or higher

https://nightly.simutrans.com/en/ (https://nightly.simutrans.com/en/)
https://github.com/Andarix/simutrans/releases (https://github.com/Andarix/simutrans/releases)
https://www.simutrans-forum.de/nightly/ (https://www.simutrans-forum.de/nightly/)
https://github.com/simutrans/simutrans/releases (https://github.com/simutrans/simutrans/releases)


Title: Re: Script-AI with railroad
Post by: Andarix on June 11, 2023, 05:08:11 AM
sqai_rail v0.8.13 (https://github.com/Andarix/simutrans-scenarios/releases)

include in simutrans r10924
Title: Re: Script-AI with railroad
Post by: prissi on June 11, 2023, 09:32:42 AM
IN the svn, the *.tab files need an update too?
Title: Re: Script-AI with railroad
Post by: Andarix on August 16, 2023, 10:24:59 AM

sqai_rail v0.8.15 (https://github.com/Andarix/simutrans-scenarios/releases)

bugfix version

include in simutrans r10967
Title: Re: Script-AI with railroad
Post by: Andarix on October 01, 2023, 11:46:32 PM
sqai_rail v0.9.0 (https://github.com/Andarix/simutrans-scenarios/releases)

This is a beta release.There are many expenses for control purposes.

The latter requires Simutrans r10894 or higher.


Now when an AI player is activated, the script version is displayed in the message window.

The management for the connections has been changed. Building behavior should now be slower.


Tryouts should have a monthly autosave. If errors occur, please make the last automatic save available.

Games with previous versions (< r0.9.0) may not be compatible with this version.

Problems
With larger maps and more complex industrial chains, the chains are not fully developed. This results from the amount of the starting capital.

If a player goes bankrupt, his streets become public. However, this does not apply to bridges, these will be removed. This means that lines can be broken. This currently has to be fixed manually by the.

Problems can arise when railroad lines cross.

If a rail station is located in an double-way area, it will be demolished if the route is demolished.

When removing routes, remnants may remain.

When loading a map with script AI, the AI players may not load properly (see player list). Then the AI players have to be reactivated.



The zip file contains a script_ai_text.dat. Add these texts to the simutrans/text/[lang].tab or save [lang].tab in script folder sqai_rail to have a translated output in the game.
You can translate on this page (https://simutrans-germany.com/wiki/wiki/tiki-index.php?page=en_translate_base_texts) (select object script_ai_text) or SimuTranslator Base texts (https://makie.de/translator/script/directions.php) (select object script_ai_text).

required Simutrans r10894 or higher

https://nightly.simutrans.com/en/ (https://nightly.simutrans.com/en/)
https://github.com/Andarix/simutrans/releases (https://github.com/Andarix/simutrans/releases)
https://www.simutrans-forum.de/nightly/ (https://www.simutrans-forum.de/nightly/)
https://github.com/simutrans/simutrans/releases (https://github.com/simutrans/simutrans/releases)


Title: Re: Script-AI with railroad
Post by: Andarix on October 15, 2023, 11:51:54 AM
sqai_rail v0.9.1 (https://github.com/Andarix/simutrans-scenarios/releases)

bugfix version

include in simutrans r10986
Title: Re: Script-AI with railroad
Post by: Andarix on October 27, 2023, 10:12:09 AM
Script-AI has connected 39 of 41 industries. I connected the one oil pump because it was inside the houses and I had to remove a townhouse. However, the connection is now at a standstill because the refinery is constantly overcrowded from the other side.

However, the map is road-heavy. Probably due to the topography.

Simutrans 123.0.0.2 r10987+
pak64 123 r2102
Script AI Rail r0.9.2 (https://github.com/Andarix/simutrans-scenarios/releases)

pak64_512x448_1943_ski.sve (https://simutrans-germany.com/files/upload/pak64_512x448_1943_ski.sve) 850 kByte (until July 21, 2026)


The current 9 versions of the script AI can lead to errors in older versions. However, you don't have to.

The most important changes are:

Most of the debug messages have also been removed.

There can still be errors at double ways (incorrectly constructed signals). Especially in left-hand traffic, because I haven't tested it yet.

More mountainous maps are still problematic. Large industrial distances are also likely to cause problems.

Maps with a lot of water are also critical because many bridges will be built there. Or small areas of water get a ship connection. But ships are usually expensive and so bring capital into the red relatively quickly. If capital is in the red, no routes will be built. The exception is combined routes that have been started and should be completed.



some more feedback would be very welcome


For script AI games it would be helpful if monthly autosave was activated. Because in the event of errors, a real-time score is available that can help me correct the error.