The International Simutrans Forum

 

Author Topic: food-99-17-1 fish swarm break savegame with rotation  (Read 8265 times)

0 Members and 1 Guest are viewing this topic.

Offline z9999

  • Devotees (Inactive)
  • *
  • Posts: 848
food-99-17-1 fish swarm break savegame with rotation
« on: May 06, 2009, 06:40:07 AM »
I'm not sure this is a known problem or not.
Fish swarm on pak64-addon-food-99-17-1 break savegame with rotation.
I tried with both v102 and r2448.

How to reproduce:
1. Open factory builder and select fish swarm
2. Change rotation as 0 and build fish swarm.
3. Rotate the map once.
4. Open factory builder and select fish swarm
5. Change rotation as 0 and build fish swarm.
6. Save the map
7. Reload the saved map.

Result:
Savegame is broken. I can't read it anymore.


Another problem.
Dims of grain_windmill is 1,3,2, but image is only (0,0). No images at (0,1) and (0,2).
« Last Edit: May 06, 2009, 06:46:39 AM by z9999 »

Online prissi

  • Developer
  • Administrator
  • *
  • Posts: 9561
  • Languages: De,EN,JP
Re: food-99-17-1 fish swarm break savegame with rotation
« Reply #1 on: May 06, 2009, 09:31:28 PM »
It is known that the old fish swarm is broken. However, if not done manually, simutrans will always rotate map to zero position before building new industries. I just had no time left to convert everything yet and release it OpenSource.

Offline z9999

  • Devotees (Inactive)
  • *
  • Posts: 848
Re: food-99-17-1 fish swarm break savegame with rotation
« Reply #2 on: May 07, 2009, 07:46:00 AM »
However, if not done manually, simutrans will always rotate map to zero position before building new industries.

I tested that.
 
As you said map will rotate but it also broke the game.
I tested with none-square map and I used only "Grow city" tool.
So, it should be the same as in game, but I couldn't save this game.

Offline z9999

  • Devotees (Inactive)
  • *
  • Posts: 848
Re: food-99-17-1 fish swarm break savegame with rotation
« Reply #3 on: May 07, 2009, 04:46:16 PM »
One question.

I made a patched version of fish_swarm and grain_windmill.
Can I upload it here ? Or that should be forbidden because of copyright problem ?

Online prissi

  • Developer
  • Administrator
  • *
  • Posts: 9561
  • Languages: De,EN,JP
Re: food-99-17-1 fish swarm break savegame with rotation
« Reply #4 on: May 07, 2009, 08:17:11 PM »
Im not sure where pak128 mill is from whom. But if it is in the OpenSOurce pak128 to be, then I can release whole chain too. But a patch is fine too.

Offline VS

  • Senior Plumber (Devotee)
  • Devotee
  • *
  • Posts: 4855
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: food-99-17-1 fish swarm break savegame with rotation
« Reply #5 on: May 07, 2009, 09:24:34 PM »
Mill is from Patrick and fishery from him or Napik, can't remember... but both are in the open part.

Offline z9999

  • Devotees (Inactive)
  • *
  • Posts: 848
Re: food-99-17-1 fish swarm break savegame with rotation
« Reply #6 on: May 09, 2009, 05:43:33 PM »
Thank you. I attached an unofficial one.

grain_windmill: changed dims from 1,3,2 to 1,1,1
fish_swarm: filled empty 6 tiles with 1 dot image

Offline VS

  • Senior Plumber (Devotee)
  • Devotee
  • *
  • Posts: 4855
  • Vladimír Slávik
    • VS's Simutrans site
  • Languages: CS,EN
Re: food-99-17-1 fish swarm break savegame with rotation
« Reply #7 on: May 09, 2009, 07:17:07 PM »
Do you want the 128 version sources?

Online prissi

  • Developer
  • Administrator
  • *
  • Posts: 9561
  • Languages: De,EN,JP
Re: food-99-17-1 fish swarm break savegame with rotation
« Reply #8 on: May 09, 2009, 08:24:25 PM »
Corrected in SVN too.

Offline z9999

  • Devotees (Inactive)
  • *
  • Posts: 848
Re: food-99-17-1 fish swarm break savegame with rotation
« Reply #9 on: May 09, 2009, 10:48:38 PM »
Thank you prissi.
But unfortunately, your version is still asymmetric and it still caused to crash.

Online prissi

  • Developer
  • Administrator
  • *
  • Posts: 9561
  • Languages: De,EN,JP
Re: food-99-17-1 fish swarm break savegame with rotation
« Reply #10 on: May 10, 2009, 09:10:30 PM »
Asymmetric should not matter, as long as there is tile [0,0] defined. How did you crash the game? I tried hard but I could not.

Offline z9999

  • Devotees (Inactive)
  • *
  • Posts: 848
Re: food-99-17-1 fish swarm break savegame with rotation
« Reply #11 on: May 11, 2009, 07:11:26 AM »
How to reproduce:
1. Open factory builder and select fish swarm
2. Change rotation as 1 and build fish swarm.
3. Rotate the map once.
4. Open factory builder and select fish swarm
5. Change rotation as 1 and build fish swarm.
6. Save the map
7. Quit simutrans
8. Run simutrans
7. Load the saved map.

Result:
Savegame is broken. I can't read it anymore.

Offline z9999

  • Devotees (Inactive)
  • *
  • Posts: 848
Re: food-99-17-1 fish swarm break savegame with rotation
« Reply #12 on: October 04, 2009, 09:28:18 AM »
I finally found why this food set force savegame broken.

- fish_swarm (99-17-1) 3 of 4 direction is nosave because of missing 0,0 tile and asymmetry
- fish_swarm (SF svn) 3 of 4 direction is nosave because of asymmetry
- grain_farm 2 of 4 direction is nosave because of dims=2,1,1

1. First time when a fish_swarm or a grain_farm is build, 3 of 4 direction will become nosave.
2. Assume player rotate this map 90 degree.
3. Second time when a fish_swarm or a grain_farm is build by factory chain extended, map rotation doesn't happen because of a bug which I reported here. So, 4 of 4 direction will be nosave. This game can't save anymore because of this code.

Quote
   if(nosave) {
      dbg->error( "karte_t::speichern()","Map cannot be saved in any rotation!" );
      create_win( new news_img("Map not saveable in any rotation!"), w_time_delete, magic_none);
      return;
   }

4. Third time when fish_swarm or a grain_farm is build by new consumer, this map can't rotate anymore and quit this game because of this code.

Quote
   // rotate until we can save it, if one of the factory is non-rotateable ...
   if(welt->cannot_save()  &&  parent==NULL  &&  !can_factory_tree_rotate(info)  ) {
      org_rotation = welt->get_einstellungen()->get_rotation();
      for(  int i=0;  i<3  &&  welt->cannot_save();  i++  ) {
         pos->rotate90( welt->get_groesse_y()-info->get_haus()->get_h(rotate) );
         welt->rotate90();
      }
      assert( !welt->cannot_save() );
   }

My only wish is, please don't limit saveable direction for nothing.

grain_farm: change from dims=2,1,1 to dims=2,1,2 and add tile will solve the problem
fish_swarm: Set number of tiles from 4 or 6 and arrange symmetrically will solve the problem


Online prissi

  • Developer
  • Administrator
  • *
  • Posts: 9561
  • Languages: De,EN,JP
Re: food-99-17-1 fish swarm break savegame with rotation
« Reply #13 on: October 04, 2009, 10:18:18 PM »
I forgot about the fish swarm. Will look at it right now. Thank you.