Skip to main content
Topic: Request for help in fixing bugs for 7.0 (Read 3265 times) previous topic - next topic

Request for help in fixing bugs for 7.0

I have spent some weeks now trying to track down and understand an obscure bug (or perhaps set of bugs) in Simutrans-Experimental that causes the game to crash after industries have been deleted. Some users have reported crashes in Simutrans-Experimental 6.8, too, after the deletion of industries; I am currently unsure whether the bug is something introduced by Simutrans-Experimental code, or a bug already present in the building deletion routine, but only revealed by the automatic deletion of industries. The problem is that, when the industry is being deleted, the routine that tries to find all the tiles belonging to that industry goes rather awry, and tries to delete buildings on the wrong tiles (I think). When it hits a slope tile, it ends up returning a null pointer for the ground tile that it is trying to obtain. Simply checking for a null pointer prevents a crash occurring there, but, shortly thereafter, a crash occurs elsewhere in the code, where some other part of the code (either a halt or the main simulation routines contained in simworld.cc) try to access that factory, which has evidently not been deleted properly, and find a bad pointer. I have commented the code (find "FIXME:") in the location where this occurs.

There are other bizarre symptoms relating to industries, too, that I cannot immediately relate to any specific changes that I have made, but which seem to be new to Simutrans-Experimental 7.0  (when used with a pakset compiled with the Makeobj for Simutrans-Experimental 7.0), and which I have not had any success in finding or solving. Firstly, with the exception of some end-consumer industries, clicking on industries produces no dialogue box. For the coal merchant in the version of Pak128.Britain-Ex that I have compiled with the latest Makeobj to test 7.0, it produces the dialogue box of a city building (the warehouse), not an industry. Secondly, the public player cannot delete industries. Thirdly, when industries are removed automatically when they close down, bits of the building are often left behind. This causes a crash when the game is saved and re-loaded.

I have uploaded the latest work-in-progress code to Github (please note that this is not the release version of 7.0). I should be very grateful if anyone could look over the code and try to find out what the problems are with it. It is currently synchronised with the latest stable release (102.2) of Simutrans-Standard: later versions have all the networking code, which will need very, very careful thought before it is integrated. I have also not yet integrated Bernd Gabriel's physics model, but may well do so before the release of 7.0.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Re: Request for help in fixing bugs for 7.0

Reply #1
I don't mean to see code, but can you upload some of industry pak(s) which you compiled and having problem ?

Re: Request for help in fixing bugs for 7.0

Reply #2
Z9999+,

thank you for your reply. I have uploaded the packaged industries us (site down, do not visit) ]/BritIndustry-Ex.zip]here (note that this only works with Simutrans-Experimental 7.0) for testing with the latest code.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Re: Request for help in fixing bugs for 7.0

Reply #3
Thank you.
One thing, but this is not related your problem.

building_writer.cc
Quote
   v16 |= EXP_VER;

This is not written in building_writer_t but in tile_writer_t.

So, your all buildings are not experimantal version.
And it may cause a problem in tile_reader_t.

Re: Request for help in fixing bugs for 7.0

Reply #4
Another off topic:
changing parenthesis "return ((way_constraints_permissive >> i) & 1 != 0);"
to parenthesis "return ((way_constraints_permissive >> i) & 1) != 0;"
removes warnings in weg.h and vehikel_besch.h
The journey is the reward!

Re: Request for help in fixing bugs for 7.0

Reply #5
Z9999+,

thank you very much for spotting that. Actually, that is the cause of all the trouble. Fixing that has fixed all the other problems that I described above. Thank you very much!

Bernd Gabriel,

ahh - thank you for your tip! I'll put that in.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.