The International Simutrans Forum

 

Author Topic: [idea] Load multiple maps  (Read 754 times)

0 Members and 1 Guest are viewing this topic.

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1193
    • Simutrans-BLOG
  • Languages: ES
[idea] Load multiple maps
« on: November 11, 2018, 02:48:11 PM »

I was thinking of creating a story mode for simutrans, now that I have more experience with the script.

I really like the approach that "The Battle for Wesnoth" has, where the scenarios can have large amounts of maps as they advance in level.


In simutrans, you could add a button that says, "finalize scenario", by pressing this button the script will load a new map inside the same script.

I would like to dedicate time to the creation of a story / campaign mode.

What do you think of my idea?

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4587
  • Languages: EN, DE, AT
Re: [idea] Load multiple maps
« Reply #1 on: November 12, 2018, 07:24:07 AM »
Yes, this could be done. My proposal would be to load a new scenario script plus map (with possibly transfering some data like with the persistent structure). Then there is a clean separation between chapter, which is easier for implementing and debugging. Common functions can be loaded by include command.

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1193
    • Simutrans-BLOG
  • Languages: ES
Re: [idea] Load multiple maps
« Reply #2 on: November 13, 2018, 01:24:53 AM »

In Wesnoth , when the chapter comes to an end, a button appears saying "finish scenario".


It occurs to me to simutrans a similar button in the window of fines, in this way the player is given the option to advance the chapter or continue playing.

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1193
    • Simutrans-BLOG
  • Languages: ES
Re: [idea] Load multiple maps
« Reply #3 on: November 13, 2018, 01:44:55 AM »

There is something very important that we should also consider, (I hope I do not get out of the subject  :P [size=78%]).[/size]


The problem of compatibility with different pakset.


Currently I have this problem with the tutorial, since the savegame is only compatible with the pak128, therefore to port the script to another pakset I must create a new savegame and place all the objects, roads, stations etc. manually and it's a tedious job.


What if it were possible to control the map generator used scripts ?.




This will allow me to configure everything, the climate, number of cities, number of factories, and choose their respective locations.




All this allows a scenario to be compatible with any pakset. 8)

Offline Leartin at

  • Devotee
  • *
  • Posts: 1250
  • PAK-DEV P192C
  • Languages: DE, EN
Re: [idea] Load multiple maps
« Reply #4 on: November 13, 2018, 07:08:53 AM »
All this allows a scenario to be compatible with any pakset. 8)
In order for that to work, a scenario could only use elements that exist in all paksets. You'd be limited to
- road and rail (cannot expect ships or planes of all types to be available; an island map won't be playable in every pakset)
- no double height
- no specific industry (even if coal is available everywhere, the objects (goods and factories) likely have different names)
- no climates (you can set them, but what's the point if you don't know if "tropic" is middle germany, osaka region, brazil or the same as every other climate?)

On the other hand, the things you do mention you want to control seem to me as if they were great features for extended heightmaps. As in, load a map of a country, get rivers and cities generated in the right places with correct names provided in some xml file or something.


---


I guess the idea here is to just complete a map and start the next map under different conditions depending on how successful you were?

I wonder if it was possible to have different maps between which you can switch, and which affect each other in some way. For example, have a tropical island map with a lot of plantation, transporting it all to an end-consumer-airport. The amount transported to the airport would be stored, and when you switch to an european map, you'd have those goods in a producing airport, with the production rates depending on the numbers you got back from the other scenario. In this case, you'd only allow the player to reach the same year in the european map they already played to in the tropical map.
Could work with pax as well. Have airports on two maps, at each a building acting as hub. Whenever you switch map, count how many pax are connected to the airport, and set the pax of the hub in the other map to a percentage of that number. Time is not an issue in this case, since the player themself would be eager to switch back and forth often to increase the number of pax on both sides.

Just to make it perfectly clear: I don't mean for both maps to run at the same time, more like the simcity approach of parallel cities. Essentially, each map would be it's own savegame, and the "switch"-button only saves the current map, closes it, and opens the other map with some extra variables to affect the game state.

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4587
  • Languages: EN, DE, AT
Re: [idea] Load multiple maps
« Reply #5 on: November 13, 2018, 07:43:08 AM »
Generation of maps from heightfields and custom settings is possible to implement. Only someone has to do this.

There is already the possibility to put a scenario on top of an already running game: just set map.file="<attach>". This way you could test if your scenario runs on rather arbitrary maps and with different pakses, where you cannot control every detail beforehand.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9511
  • Languages: De,EN,JP
Re: [idea] Load multiple maps
« Reply #6 on: November 13, 2018, 12:46:05 PM »
You could also load the map with the pakset you are targeting. Usually many objects should survive. But factories tend to be quite different sizes in different pak sets. The only set made for exchange are pak64 to pak64.german.

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2890
  • D'oh
    • by An_dz
  • Languages: pt, en, it, (de)

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1193
    • Simutrans-BLOG
  • Languages: ES
Re: [idea] Load multiple maps
« Reply #8 on: November 14, 2018, 01:06:09 AM »



Generation of maps from heightfields and custom settings is possible to implement. Only someone has to do this. There is already the possibility to put a scenario on top of an already running game: just set map.file="". This way you could test if your scenario runs on rather arbitrary maps and with different pakses, where you cannot control every detail beforehand.

The parameters that I would like to configure are:
Map number
Map size
Number of cities
Number of industrial chains.
Height of the mountains




The rest of the objects can be placed with commands once the map is generated. ;)

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1193
    • Simutrans-BLOG
  • Languages: ES
Re: [idea] Load multiple maps
« Reply #9 on: November 14, 2018, 01:21:05 AM »
In order for that to work, a scenario could only use elements that exist in all paksets. You'd be limited to - road and rail (cannot expect ships or planes of all types to be available; an island map won't be playable in every pakset) - no double height - no specific industry (even if coal is available everywhere, the objects (goods and factories) likely have different names) - no climates (you can set them, but what's the point if you don't know if "tropic" is middle germany, osaka region, brazil or the same as every other climate?) On the other hand, the things you do mention you want to control seem to me as if they were great features for extended heightmaps. As in, load a map of a country, get rivers and cities generated in the right places with correct names provided in some xml file or something. --- I guess the idea here is to just complete a map and start the next map under different conditions depending on how successful you were? I wonder if it was possible to have different maps between which you can switch, and which affect each other in some way...

The idea is to reduce the manual placement of objects, there are always going to be some exceptions ... The important thing is to make the scripts work in the most complete pakset (pak64, pak128, pak128.britain).

You can also get the name of the pakset with a function and in this way you can decide which parameters to use for certain pakset, but that is to discuss in another topic. ;)



You could also load the map with the pakset you are targeting. Usually many objects should survive. But factories tend to be quite different sizes in different pak sets. The only set made for exchange are pak64 to pak64.german.



When I try to load a savegame from pak128 in pak64, most of the time it generates a fatal error in simutrans.  :o

« Last Edit: November 14, 2018, 01:53:49 AM by Yona-TYT »

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1193
    • Simutrans-BLOG
  • Languages: ES
Re: [idea] Load multiple maps
« Reply #10 on: November 14, 2018, 01:52:14 AM »

It would be good to divide this topic.




I apologize for the double messages, it is difficult to publish from a mobile device. :-[

Offline Yona-TYT ve

  • Devotee
  • *
  • Posts: 1193
    • Simutrans-BLOG
  • Languages: ES
Re: [idea] Load multiple maps
« Reply #11 on: November 28, 2018, 01:30:30 AM »
Yes, this could be done. My proposal would be to load a new scenario script plus map (with possibly transfering some data like with the persistent structure). Then there is a clean separation between chapter, which is easier for implementing and debugging. Common functions can be loaded by include command.
This seems to me very well, the only detail that is missing is the interface that shows the list of chapters. It occurs to me to use a window similar to the one seen when loading a server and that it shows the list of all the unlocked chapters.  :D