Open for input on a game concept, help needed

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

Moderator: OpenTTD Developers

Post Reply
GiaNN
Engineer
Engineer
Posts: 6
Joined: 29 Oct 2015 15:54

Open for input on a game concept, help needed

Post by GiaNN »

Dear OpenTTD users and developers.

My idea and aim is to create a 4096x4096 world that's a more realistic earth representation but is adapted to allow fair and smart gameplay in TTD. The scenario should become suitable for multiplayer or solo players. The goal of the game is to be the first company that funds two oil refineries in a world that starts in the year 1914 on the day the Panama Canal was opened.

I understand the following topics need to be addressed to make this scenario.

#0 known issues
#1 the map (in progress)
#2 a world before 1930 (import or include)
#3 game script (pending input required)
#4 making AI understand the game goal (pending input required)
#5 beta testing
#6 screenshots


In 2014 I have already started with the version 2 of the map with this goal in mind. I called it version 2 because it was a map based on Carst's [https://wiki.openttd.org/Scenario:CarstsWorldScenario]World map. I have converted, rotated, stretched and corrected it to look better in TTD. My 2014 version however was 2048x2048 tiles in size. Soon I discovered this is too small. It's fun playing alone for a while, but when the AI started building bridges between Korea and Japan I realized the map must be adapted more and enlarged.

The 2014 version 2.9.9 maps are heightmap: http://veemkade.xs4all.nl:88/openttd/Earth_2.9.9.hm.png and scenario with cities and industry: http://veemkade.xs4all.nl:88/openttd/Ea ... ar1918.scn

# issues I have discovered while working on version 2.

Some islands were to small. Enlarging the important islands about 30% relative to the size of the world and removing the really tiny ones in version 3 solved most of those problems.

Setting a limited bridge and tunnel length inside this scenario is still necessary. I am not sure how this is done in a way it overrides the standard game settings.

I found the original arctic tile set the best to represent a simplified version of the entire Earth. Placing mines, trees, oil wells, farms and industry in regions based on actual global resource data from the last century. However the issue I discovered there is the fact many industries disappear in the first years of the game because of insufficient supplies. The game script should allow a longer time before imminent closures occurs. I am not sure how this is done.

# the map version 3

In 2015 I went back to the drawing board creating the larger map. Now keeping in mind it must allow a more realistic game play.

# staring before 1930
In order to make the game start in 1914 some existing newgrf content such as "Earlier_Road_Vehicles-1.0" and "Early_Houses-2.0" must be included or supplied as automatic download dependencies. I am not sure how this can be done.

# game script
(waiting for your help)

# making AI understand the goal
(waiting for your help)

# beta testing
(can't wait to get there)

# screenshots
I am uploading new files as the project developes, you can see them at http://veemkade.xs4all.nl:88/openttd/
Attachments
Map 3.0.9 icon
Map 3.0.9 icon
Earth_3.0.9.icon.jpg (37.46 KiB) Viewed 4674 times
Last edited by GiaNN on 16 Mar 2018 16:25, edited 7 times in total.
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: Open for input on a game concept, help needed

Post by Zuu »

First, looks like an interesting project you got.
GiaNN wrote:# staring before 1930
In order to make the game start in 1914 some existing newgrf content such as "Earlier_Road_Vehicles-1.0" and "Early_Houses-2.0" must be included or supplied as automatic download dependencies. I am not sure how this can be done.
Add the NewGRF to your main game NewGRF dialog before creating the scenario. This is the safest way to include NewGRFs in scenarios and save games. A scenario is basically a save game with a different file extension.

If you just upload this to bananas, if users doesn't have the added NewGRFs, they can download it using the button to find missing NewGRFs via online content. But you can also make it better. If you upload your scenario using musa, you can mark that your scenario depend on the NewGRF so that the NewGRF will automatically be downloaded when users click to download your scenario in the in-game online content list. Since you are going to use a Game Script too, you rather like to go the musa-way as currently OpenTTD doesn't support automatically finding missing Game Scripts from online content.

I have published both the Split scenario and Beginner Tutorial the musa way with dependencies set. In the musa thread there is a post on how I have set up the musa configuration for the Beginner Tutorial which is a more complex case than yours.
GiaNN wrote:# game script
(waiting for your help)
If you want to announce that the game was completed when two oil refineries has been built, then that is not so complicated. There is an event for when an industry opens.

If you however also want to announce who did fund the oil refineries, then that is not possible to do reliably. The API for Game Scripts doesn't convey which company that did fund an industry in the event. Industries doesn't have owners, so it is also not possible to query that from the industry after it was built.

A not so reliable method is to monitor the finances of players from day to day. But even if you can use the industry open event, and with that check if it is the right industry type, you would between two checks of bank balance have the noise of all income and costs between those two moments.

An alternative path is to via NewGRF make it impossible to fund the industry as player, but instead provide a interface via the GS to tell the GS where to build the oil refinery. The GS would check that you have sufficent funds, reduce the cost from your bank balance and then build it for free. At the same time, it would record which company asked for and paid for it. The user interface would consist of perhaps that you place a sign with some code on the tile you like to build the oil refinery. You get a blue OK/cancel dialog where you can confirm. It is possible to include documentation in the story book on how this works and also auto-display this to companies when they join the game.
GiaNN wrote:# making AI understand the goal
(waiting for your help)
The GS can use the SCP library which allow AIs to communicate with the GS. This way the GS can expose that it is exactly your GS the AI plays against, and perhaps make it that generic that it give the AIs the industry type ID of oil refinery and the count required to complete the game. This will pollute the tile 1,0 (or was it 0,1?) with some signs as AI and GS talk with each other.

Adding SCP to GS is however only giving AIs the possibility to detect your GS. Each AI also need to be updated with code to handle your GS specifically. All AIs doing that will hardly happen. But one or two might do it.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
GiaNN
Engineer
Engineer
Posts: 6
Joined: 29 Oct 2015 15:54

Re: Open for input on a game concept, help needed

Post by GiaNN »

Thanks for your first feedback.

Does it mean, ts the maximum bridge and tunnel length are also saved into the scenario when this is set in the settings before making the scenario?
User avatar
Zuu
OpenTTD Developer
OpenTTD Developer
Posts: 4553
Joined: 09 Jun 2003 18:21
Location: /home/sweden

Re: Open for input on a game concept, help needed

Post by Zuu »

Some settings can be changed in a running game and others don't. To find that out, open the settings window from a running game or in the scenario editor and see.
My OpenTTD contributions (AIs, Game Scripts, patches, OpenTTD Auto Updater, and some sprites)
Junctioneer (a traffic intersection simulator)
krinn
Transport Coordinator
Transport Coordinator
Posts: 339
Joined: 29 Dec 2010 19:36

Re: Open for input on a game concept, help needed

Post by krinn »

Zuu wrote: A not so reliable method is to monitor the finances of players from day to day. But even if you can use the industry open event, and with that check if it is the right industry type, you would between two checks of bank balance have the noise of all income and costs between those two moments.
Also not that reliable, i would wait for the industry creation event to occurs, and check the monthly expense of players, if one has spent at least the amount of the industry, it should be him that build.
It's far from good, as if two players build one in the same month or a player spent more than the industry but not in it while another one did build one, you will have hard time to figure out who has made what.
Zuu wrote:
GiaNN wrote:# making AI understand the goal
(waiting for your help)
This will pollute the tile 1,0 (or was it 0,1?) with some signs as AI and GS talk with each other.
Only if player enable seeing sign of other :P
Zuu wrote:Adding SCP to GS is however only giving AIs the possibility to detect your GS. Each AI also need to be updated with code to handle your GS specifically. All AIs doing that will hardly happen. But one or two might do it.
The problem is not really handling such case, the problem is, do anyone wish to play with an AI handling that specific goal?
An AI playing with the only goal in mind to build two industries is a b****, while player will do his best to get the money, the AI can check every seconds if it have the money (and this include all its structures, vehicles cost and loan!).
If you need 120$ to build the two industries, and you have a bus of value 12$, a truck of 10$, a plane of 50$... only an AI could easy see the goal is done when you have only 48$ in bank, selling all vehicles and build the industries beating all humans that try to figure out their total value (while my example take only 3 vehicles, human will have hard time to calc this with a lot, and you need a lot to build an industry) or more probably, humans are just looking if they have the 120$ in their bank account only.

I don't think anyone would find fun to play against one in this case.
GiaNN
Engineer
Engineer
Posts: 6
Joined: 29 Oct 2015 15:54

Re: Open for input on a game concept, help needed

Post by GiaNN »

Zuu wrote:Some settings can be changed in a running game and others don't. open the settings window in the scenario editor and see.
O.k. I see, bridge and tunnel length are changeable during the game. meaning it should be scripted as well.

Since I have already altered the map to make it harder or nearly impossible to build bridges in untypical places. For example by shifting the tip of Gibraltar in Spain a bit more west, it now requires a 24 tiles bridge in stead of an 8 tile bridge to connect with Africa. The same I did for Hokkaido island (north) and the (main) island of Japan.

The fact the bridge length can be changed mid game, makes it thinkable to start with a bridge length of 3 in 1914 and increase it one step every 14 years. Unless serious landscaping is done by the players it would naturally allow a length of 9 tiles in the year 1998. Hence it becomes possible to connect Denmark with Sweden. This in fact is realistic, since the Øresund Bridge near Malmö was built between 1995 and 2000. Or a rail bridge can be made between the U.K. and France simulating the Eurotunnel that was finished in 1994. The tunnel length should maybe start with 4 and thereafter be increased one step every 7 years to be realistic. The longest tunnel in reality is expected to be completed in 2016. My calculation would allow a 19 tiles long tunnel in game year 2019. That's long enough to cut through parts of the Alps and Rocky Mountains, but definitely not through the Himalaya.

I will soon be done with the height map fine-tuning. Current version of the map is here: http://hellotomorrow.nl/openttd/Earth_3 ... ar1914.scn

In map version is 3.0.9, I have added random flares and patches of slight dithering in the heigh map areas that otherwise would be rendered as enormous perfectly flat plains. This is especially important in Africa, Australia, America and Russia. The dithering of both positive and negative pixels cause random strings of dunes or add craters. I know this is not actual geographic data anymore, but it will interfere with the building of an effective infrastructure network, thus enhances the game play. Without these flares and patches it would be too easy to built one straight line across an entire continent.
Attachments
example of dithering in e.g. Africa
example of dithering in e.g. Africa
DitheringFlares_v3.0.9.jpg (244.68 KiB) Viewed 473 times
GiaNN
Engineer
Engineer
Posts: 6
Joined: 29 Oct 2015 15:54

Re: Open for input on a game concept, help needed

Post by GiaNN »

Map version 3.1 is here. slightly more optimised for a better game experience.

All files are available again after the server disappeared for a year, data now accessible under http://veemkade.xs4all.nl:88/openttd/

:roll:
Post Reply

Return to “OpenTTD AIs and Game Scripts”

Who is online

Users browsing this forum: No registered users and 10 guests