The International Simutrans Forum

PakSets and Customization => Pak64 => Pak64 Bug Reports => Topic started by: z9999 on May 06, 2009, 06:40:07 am

Title: food-99-17-1 fish swarm break savegame with rotation
Post by: z9999 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).
Title: Re: food-99-17-1 fish swarm break savegame with rotation
Post by: prissi 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.
Title: Re: food-99-17-1 fish swarm break savegame with rotation
Post by: z9999 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.
Title: Re: food-99-17-1 fish swarm break savegame with rotation
Post by: z9999 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 ?
Title: Re: food-99-17-1 fish swarm break savegame with rotation
Post by: prissi 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.
Title: Re: food-99-17-1 fish swarm break savegame with rotation
Post by: VS 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.
Title: Re: food-99-17-1 fish swarm break savegame with rotation
Post by: z9999 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
Title: Re: food-99-17-1 fish swarm break savegame with rotation
Post by: VS on May 09, 2009, 07:17:07 pm
Do you want the 128 version sources?
Title: Re: food-99-17-1 fish swarm break savegame with rotation
Post by: prissi on May 09, 2009, 08:24:25 pm
Corrected in SVN too.
Title: Re: food-99-17-1 fish swarm break savegame with rotation
Post by: z9999 on May 09, 2009, 10:48:38 pm
Thank you prissi.
But unfortunately, your version is still asymmetric and it still caused to crash.
Title: Re: food-99-17-1 fish swarm break savegame with rotation
Post by: prissi 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.
Title: Re: food-99-17-1 fish swarm break savegame with rotation
Post by: z9999 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.
Title: Re: food-99-17-1 fish swarm break savegame with rotation
Post by: z9999 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. ****ume 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 (http://forum.simutrans.com/index.php?topic=3430.0). 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();
      }
      ****ert( !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

Title: Re: food-99-17-1 fish swarm break savegame with rotation
Post by: prissi on October 04, 2009, 10:18:18 pm
I forgot about the fish swarm. Will look at it right now. Thank you.