News:

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

food-99-17-1 fish swarm break savegame with rotation

Started by z9999, May 06, 2009, 06:40:07 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

z9999

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

prissi

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.

z9999

Quote from: prissi on May 06, 2009, 09:31:28 PM
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.

z9999

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 ?

prissi

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.

VS

Mill is from Patrick and fishery from him or Napik, can't remember... but both are in the open part.

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

z9999

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

VS


My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

prissi


z9999

Thank you prissi.
But unfortunately, your version is still asymmetric and it still caused to crash.

prissi

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.

z9999

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.

z9999

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


prissi

I forgot about the fish swarm. Will look at it right now. Thank you.