Transport Fever

Transport Fever

Painter (Experimental)
 This topic has been pinned, so it's probably important
GrandT  [developer] 24 May, 2018 @ 3:57am
Code Discussion
Use this thread to help me figure out ways to improve performance further. If you have further knowledge of how the API I'll gadly listen!
< >
Showing 1-6 of 6 comments
cpu | skully 26 May, 2018 @ 2:53am 
As you can imagine, i also investigated to make this faster. I came up with something that 'almost' works. Just to save you from the misused time:

The IDs of assets are not consistent. Caching the assets by ID seems to work, first, but after a short time, the IDs are reassigned. I will still borrow the idea with the distance from you for my other mods, in case that's ok.
GrandT  [developer] 26 May, 2018 @ 3:02am 
Thanks! It's a shame I had to go through the whole "why are the IDs changing". But, thanks for confirming they are not consistent. Sucks.

I've reached out to UG to hopefully allow us to have the last asset placed returned. That will allow us to always search within an area at least.

And you're welcome to incorporate my methods in to your ones too. I did however merge your Farmer textures in to this version. It could certainly prove useful for Forester and Streams!
cpu | skully 27 May, 2018 @ 12:15am 
I already suggested something similar to them. My idea was to introduce events like "onBuilt", "onDestroyed", "onSelected" and "onDeselected". I got an answer for that from UG, but it was nothing more like a "ok, we noticed that".
In fact I believe that our kind of mods are regarded as "hacky" and they're afraid of what's coming next when they extend the API.

Btw, in case you need help with the painter (e.g. translation), ask me. I think a parameter named 'plant' is a little bit funny for concrete fields :D
Last edited by cpu | skully; 27 May, 2018 @ 12:16am
cpu | skully 14 Dec, 2018 @ 8:47am 
With the next Patch they're going to introduce a function named game.gui.getTerrainPosition which returns the terrain mouse position. I've successfully tested this for a new aproach, which makes all lags in our mods disappear. In case you're OK with it, I'll publish something like my farmer, but also with concrete and cobblestones, including walls and other options.
GrandT  [developer] 14 Dec, 2018 @ 11:10am 
Oh nice! Sounds good to me. :)
GrandT  [developer] 2 Jul, 2019 @ 4:25am 
I've spent the day converting painter to use the new code you've created. I've renamed the script files as to not cause any issues with your mods should I decide to change them later. Hopefully this new Painter doesn't interfere with your mods.

Let me know if you have any objections with the code and/or if you notice any issues, I'll get them fixed ASAP! :)
< >
Showing 1-6 of 6 comments
Per page: 1530 50