News:

Simutrans Tools
Know our tools that can help you to create add-ons, install and customize Simutrans.

Adapting the factory boost code from Standard

Started by jamespetts, May 29, 2011, 12:39:34 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jamespetts

I have started work on adapting the factory boost system (discussed here) from Standard into Experimental. My work so far is on the devel branch. The changes are far-reaching and complex, though, and I am getting some odd results, which I have had to fix in some cases with workarounds. I should be grateful for any pointers from those who were involved in writing this code in the first place.

Firstly, I seem to be getting frequent instances of target_factories.get_random_entry(); producing a valid entry with a NULL factory, causing crashes unless I put target_factories.get_random_entry(); in a while loop requiring it to return a valid factory before proceeding. This while loop is not necessary in Standard; yet I am not aware of any changes made to the code for populating target_factories between Standard and Experimental.

Secondly, new factories seem to be generated with implausibly high production numbers. I have not looked into this in detail, but, again, I did not think that the system for setting production numbers was much changed by Experimental.

Any assistance would be appreciated.
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.