News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

Script-AI with railroad

Started by Andarix, August 01, 2020, 07:17:48 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andarix

sqai_rail v0.1

required Simutrans r9153 or higher

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


  • To use, unzip the file to simutrans/ai.
  • Start Simutrans with the package of your choice.
  • Start or load a map.
  • Choose a new Script AI player.
  • Choose sqai_rail from the selection.

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.

Andarix

sqai_rail v0.2

minor fixes
If the construction of a route fails, it is usually completely demolished.

Andarix

#2
sqai_rail v0.3

bugfixes
remove stucked road vehicles

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


Andarix

sqai_rail v0.4

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://github.com/Andarix/simutrans/releases
https://www.simutrans-forum.de/nightly/


  • To use, unzip the file to simutrans/ai.
  • Start Simutrans with the package of your choice.
  • Start or load a map.
  • Choose a new Script AI player.
  • Choose sqai_rail from the selection.

Dwachs

Wow! Got no error messages so far. It is great to the AI build these double-tracks.
Parsley, sage, rosemary, and maggikraut.

Andarix

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.

Andarix

#6
sqai_rail v0.5

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://github.com/Andarix/simutrans/releases
https://www.simutrans-forum.de/nightly/


  • To use, unzip the file to simutrans/ai.
  • Start Simutrans with the package of your choice.
  • Start or load a map.
  • Choose a new Script AI player.
  • Choose sqai_rail from the selection.

Andarix

sqai_rail v0.5.5

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://github.com/Andarix/simutrans/releases
https://www.simutrans-forum.de/nightly/


  • To use, unzip the file to simutrans/ai.
  • Start Simutrans with the package of your choice.
  • Start or load a map.
  • Choose a new Script AI player.
  • Choose sqai_rail from the selection.

Andarix


Isaac Eiland-Hall


Andarix

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.

Andarix

sqai_rail v0.5.7

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://github.com/Andarix/simutrans/releases
https://www.simutrans-forum.de/nightly/


  • To use, unzip the file to simutrans/ai.
  • Start Simutrans with the package of your choice.
  • Start or load a map.
  • Choose a new Script AI player.
  • Choose sqai_rail from the selection.

Dwachs

I think it should be possible to implement loading of language files from the ai directory. Lets see.
Parsley, sage, rosemary, and maggikraut.

Andarix

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

object selection: script_ai_text

The texts were added by someone there. These texts are also used in my nightlys.

Andarix

sqai_rail v0.5.8

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://github.com/Andarix/simutrans/releases
https://www.simutrans-forum.de/nightly/


  • To use, unzip the file to simutrans/ai.
  • Start Simutrans with the package of your choice.
  • Start or load a map.
  • Choose a new Script AI player.
  • Choose sqai_rail from the selection.

A little more feedback would be nice.

Andarix

sqai_rail v0.6

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://github.com/Andarix/simutrans/releases
https://www.simutrans-forum.de/nightly/


  • To use, unzip the file to simutrans/ai.
  • Start Simutrans with the package of your choice.
  • Start or load a map.
  • Choose a new Script AI player.
  • Choose sqai_rail from the selection.

A little more feedback would be nice.

Andarix

sqai_rail v0.6.1

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://github.com/Andarix/simutrans/releases
https://www.simutrans-forum.de/nightly/


  • To use, unzip the file to simutrans/ai.
  • Start Simutrans with the package of your choice.
  • Start or load a map.
  • Choose a new Script AI player.
  • Choose sqai_rail from the selection.

A little more feedback would be nice.

Andarix

sqai_rail v0.6.2

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://github.com/Andarix/simutrans/releases
https://www.simutrans-forum.de/nightly/


  • To use, unzip the file to simutrans/ai.
  • Start Simutrans with the package of your choice.
  • Start or load a map.
  • Choose a new Script AI player.
  • Choose sqai_rail from the selection.

A little more feedback would be nice.

Andarix

v0.6.4 include in simutrans r9742

Andarix

#19
sqai_rail v0.7.1

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 (select object script_ai_text).

required Simutrans r9912 or higher

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


  • To use, unzip the file to simutrans/ai.
  • Start Simutrans with the package of your choice.
  • Start or load a map.
  • Choose a new Script AI player.
  • Choose sqai_rail from the selection.

A little more feedback would be nice.

Andarix

#20
sqai_rail v0.7.2

bug fixes

include in simutrans r9934

Andarix

#21
sqai_rail v0.7.3

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 (select object script_ai_text).

required Simutrans r9960 or higher (include r9968)

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


  • To use, unzip the file to simutrans/ai.
  • Start Simutrans with the package of your choice.
  • Start or load a map.
  • Choose a new Script AI player.
  • Choose sqai_rail from the selection.

A little more feedback would be nice.

Andarix

sqai_rail v0.7.4

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.

Andarix

sqai_rail v0.7.7
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 (select object script_ai_text).

required Simutrans r9960 or higher (include r10343)

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


  • To use, unzip the file to simutrans/ai.
  • Start Simutrans with the package of your choice.
  • Start or load a map.
  • Choose a new Script AI player.
  • Choose sqai_rail from the selection.

A little more feedback would be nice.


iGi

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


Andarix

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.

Andarix

sqai_rail v0.7.8
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 (select object script_ai_text) or SimuTranslator Base texts (select object script_ai_text).

required Simutrans r9960 or higher (include r10359)

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


  • To use, unzip the file to simutrans/ai.
  • Start Simutrans with the package of your choice.
  • Start or load a map.
  • Choose a new Script AI player.
  • Choose sqai_rail from the selection.

Yona-TYT







 


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 =
      }

Andarix

What are you trying to tell me with a code snippet from an unknown source?

iGi

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...

Andarix

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.






Dwachs

It should be relatively simple to implement the change-climate tool for scripts.  I will try tonight.
Parsley, sage, rosemary, and maggikraut.

Andarix

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

Andarix

#34
sqai_rail v0.8.0

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 (select object script_ai_text) or SimuTranslator Base texts (select object script_ai_text).

required Simutrans r10379 or higher

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


  • To use, unzip the file to simutrans/ai.
  • Start Simutrans with the package of your choice.
  • Start or load a map.
  • Choose a new Script AI player.
  • Choose sqai_rail from the selection.