add-loader

by kij336

add loader, fast loader, express loader. and add more fast loaders conjunction with bobsmod. now work with cargo-wagons(train)

Content
8 years ago
0.13 - 0.14
27
Transportation

i Ver 0.0.4 performance problem

8 years ago

After updating to 0.0.4 I had a significant drop in FPS on a large map that makes good use of loaders. Reverting to 0.0.3 fixed the issue.

Looks like it's the control.lua code to handle loading to/from trains. Suggestion: split that code into a separate mod (that depends on this one?) so they can choose to take the performance hit for the new feature.

8 years ago

Thanks for reporting, and now fixed on 0.0.6 ver.
Now looking for loaders that only nearby stoped wagons.

8 years ago

I tried 0.0.7, and it wasn't much better. Had a quick look at the code and have some suggestions:

  • keep a list of loaders currently pointing at stopped cargo wagons. This list is what you loop through in 'on-tick'
  • use the event 'on_train_changed_state' to find out when trains stop and start, and only search for loaders pointing to cargo wagons when they stop, adding to the above list, and remove from the list when trains start again.

This way, 'on-tick' will only have to do work when there are stopped cargo wagons with loaders. All other times, the list will be empty and it'll be very quick.

8 years ago
(updated 8 years ago)

ok, fixed them in 0.0.8 !
Now only search loaders when train stopped or built loaders or built cargo wagon.
'find_entities_filter' code caused lot of traffics.

8 years ago

thanks - that seems much better now.

New response