[A16] Snowy Trees v0.1.0

Started by Nandonalt, January 06, 2017, 09:12:59 PM

Previous topic - Next topic

Harry_Dicks

Quote from: Alias on March 06, 2018, 07:13:19 AM
All the mod needed was a recompile to achieve b18 compatibility. I took the liberty of removing the HugsLib dependence because it is no longer necessary with Harmony (it is baked into the mod).

Hey! I really appreciate you helping to update this! However, when I view the updated version on GitHub, there is no "clone/download" button? Or do I have to "recompile" it myself? If that's the case, I have no idea (yet?) how to do this.. :-[

SzQ



Usually contemplating my personal spacetime reality at
stream

Alias

Quote from: Harry_Dicks on March 06, 2018, 07:38:10 AM
Hey! I really appreciate you helping to update this! However, when I view the updated version on GitHub, there is no "clone/download" button? Or do I have to "recompile" it myself? If that's the case, I have no idea (yet?) how to do this.. :-[

Sorry about that, linked to the wrong spot. SzQ has the right link, I also fixed the link in my post. Nah, you don't have to compile yourself (that's the part where the computer basically takes the c# code and packages it into something that the computer can read on a machine level), git/steam version should (knock on wood/ fingers crossed) be good to go.

wwWraith

#33
Quote from: Alias on March 06, 2018, 07:13:19 AM
All the mod needed was a recompile to achieve b18 compatibility.

Does it include fixes for textures errors mentioned on the first 2 pages?

Also I hope for a check so if there are no snowy textures for some modded plant it should use default ones rather than "undefined" purple rectangles.
Think about it. Think around it. Perhaps you'll get some new good idea even if it would be completely different from my words.

Harry_Dicks

From my first trial, pine trees are working properly in the Boreal Forest biome I tried. However, poplar and birch trees are using their leafless variant.

I'm wondering if I could just make the snowy version the same name as the leafless variant, so that will be swapped in instead.

However I'm curious of this: does this mod actually recognize when there is snow on the ground, and then apply the snowy texture? Or does it only change when they temperature drops low enough? For example, if I have a desert map and I (through mods) make the temperature very, very low, will I get any snowy trees then (assuming that I actually have the snowy texture for trees that are native to a desert)? Or would I just get the leafless variant (if such a texture exists)?

This questions sort of stems from the others: say for poplar trees, we've got the 3 versions. Normal, leafless, and snowy. When I have this mod enabled, and say I am in a temperate forest biome, so lots of poplar trees are around. When the weather gets cold enough, but it hasn't snowed yet, will the game still use the leafless variants? And then when it does eventually snow, swap to the snowy variants?

Harry_Dicks

#35
Here is what a cold bog looks like for me. If I play on a boreal forest, yeah it looks beautiful, but only the pines are working. I'm guessing that's because in vanilla there is no "leafless" variant of them? Meh.

Anyway, I was curious if there could also be "snowy" variants of things that are unselectable, such as brambles or chokevine? I checked the textures and there are none for those. But when I was looking around at the different biomes, I definitely think that we will need some sort of textures for these, at least, to make everything look proper. ;)

Again, thank you so much for updating this. It's like we are almost there, everything is almost perfect! :P

Unfortunately, I don't think I would be able to fix the mod to always have proper snowy graphics when it is just snow on the ground. Rather, I guess I would only be able to replace the "leafless" graphics with the snowy variants. But this could end up not looking great if the plant is actually just supposed to be leafless instead of cold, as I've mentioned in my previous post.

EDIT-Looks like we will also need to make textures for the cypress and willow snowy variants. Were there any other new trees introduced in B18, or other flora that should receive snowy variants?

Alias

Quote from: wwWraith on March 06, 2018, 09:32:45 AM
Does it include fixes for textures errors mentioned on the first 2 pages?

Also I hope for a check so if there are no snowy textures for some modded plant it should use default ones rather than "undefined" purple rectangles.

It should be fixed, but I haven't tested it with VG, Tejko redid the texture file structure and taught the mod to properly find the right sprites. If if the mod isn't told that there is a snowy version it shouldn't even try to replace the graphic.

Quote from: Harry_Dicks on March 06, 2018, 12:31:05 PM
From my first trial, pine trees are working properly in the Boreal Forest biome I tried. However, poplar and birch trees are using their leafless variant.
Yes, because there is no leafless snowy sprite, so the mod is coded it ignore them.

Quote from: Harry_Dicks on March 06, 2018, 12:31:05 PM
I'm wondering if I could just make the snowy version the same name as the leafless variant, so that will be swapped in instead.
I could, but my time would probably be better spent just making the missing sprites. (If it's not broken please don't make me fix it  :'()

Quote from: Harry_Dicks on March 06, 2018, 12:31:05 PM
However I'm curious of this: does this mod actually recognize when there is snow on the ground, and then apply the snowy texture? Or does it only change when they temperature drops low enough? For example, if I have a desert map and I (through mods) make the temperature very, very low, will I get any snowy trees then (assuming that I actually have the snowy texture for trees that are native to a desert)? Or would I just get the leafless variant (if such a texture exists)?
Yes the mod recognizes when there is actually snow on the ground, it does this on a case by case basis so if you clear the snow on a single tree tile the single sprite should revert to normal. It would depend on the conditions to get a leafless graphic, i'm not really sure how the game decides that (it may be seasonal or temperature based, I'd need to look at some more source code), but assuming that a texture exits1 and the mod knows to look for it (see above) it will try to replace it accordingly.

Quote from: Harry_Dicks on March 06, 2018, 12:31:05 PM
This questions sort of stems from the others: say for poplar trees, we've got the 3 versions. Normal, leafless, and snowy. When I have this mod enabled, and say I am in a temperate forest biome, so lots of poplar trees are around. When the weather gets cold enough, but it hasn't snowed yet, will the game still use the leafless variants? And then when it does eventually snow, swap to the snowy variants?
There are actually 3 versions in core: Plant, PlantImmature, and PlantLeafless. The mod attempts to add a snowy sprite for each, at the moment there is only an immature graphic for raspberry bushes, and a leafless version for regular bushes.1 As stated above the mod will make no attempt to replace until there is snow on the ground, so fall will still look like fall, or at least that's the hope...

Quote from: Harry_Dicks on March 06, 2018, 04:08:42 PM
Here is what a cold bog looks like for me. If I play on a boreal forest, yeah it looks beautiful, but only the pines are working. I'm guessing that's because in vanilla there is no "leafless" variant of them? Meh.
There's no picture there... Correct, there are no leafless pines in vanilla.

Quote from: Harry_Dicks on March 06, 2018, 04:08:42 PM
Anyway, I was curious if there could also be "snowy" variants of things that are unselectable, such as brambles or chokevine? I checked the textures and there are none for those. But when I was looking around at the different biomes, I definitely think that we will need some sort of textures for these, at least, to make everything look proper. ;)
1. There could be, and I was considering adding some more textures to flesh out the mod some more, but I'm a programmer not an artist, so don't expect it perfect and don't expect it tomorrow. With Tejko's version it's actually fairly trivial to add new art to the code, its just a matter or making said art...

Quote from: Harry_Dicks on March 06, 2018, 04:08:42 PM
Again, thank you so much for updating this. It's like we are almost there, everything is almost perfect! :P
Your welcome, but Tejko is the real MVP here, all I've done is download it, load it into visual studio, add/remove a line or two and click build.

Quote from: Harry_Dicks on March 06, 2018, 04:08:42 PM
Unfortunately, I don't think I would be able to fix the mod to always have proper snowy graphics when it is just snow on the ground. Rather, I guess I would only be able to replace the "leafless" graphics with the snowy variants. But this could end up not looking great if the plant is actually just supposed to be leafless instead of cold, as I've mentioned in my previous post.
Answered your previous post above

Quote from: Harry_Dicks on March 06, 2018, 04:08:42 PM
EDIT-Looks like we will also need to make textures for the cypress and willow snowy variants. Were there any other new trees introduced in B18, or other flora that should receive snowy variants?
Possibly, see 1

Harry_Dicks

#37
Whoops! Totally forgot to post the pic. But yes, you can see here in the cold bog how the brambles or tangleweed or whatever it is could look a lot better with the snowy variant.

Anyway, thanks for taking the time to respond to my post. This mod really adds just so much flavor for me, it's a bit silly but it really helps complete the aesthetic for a snowy environment. I freaking love it!

So, uh.. any artists out there want to make some snowy textures? I'll try to advertise around that we could use some. Maybe if we have a few people asking around we will get an artist sooner rather than later!


Harry_Dicks

Quote from: Alias on March 06, 2018, 07:35:03 PM
Yes the mod recognizes when there is actually snow on the ground
Hypothetically, could we ever extend this to buildings as well?

I'm thinking about how there are a few stereotypical buildings that always go outside, or more often than not, that would be really freaking awesome if they could get snowy textures too. Solar panels are the big ones that come to mind, maybe generators too? I guess any building that a player would build that could be reasonably expected to be built outside at some times. It would be really awesome of there was a sort of "snow brushed up against the walls" graphic. I saw mrofa's beautiful spider web atlas that he made, and I'm thinking something like this but with snow instead. Maybe the fences from the fences and floors mod would look really nice with snow on them. Maybe sandbags or turret bases?

I guess none of that will matter if it couldn't be applied to buildings, anyway. I'm not sure why, but I guess I've been trying to build the aesthetic more to my liking, now that I feel like I'm set on content.

Alias

Quote from: Harry_Dicks on March 06, 2018, 09:42:34 PM
Hypothetically, could we ever extend this to buildings as well?

I'm thinking about how there are a few stereotypical buildings that always go outside, or more often than not, that would be really freaking awesome if they could get snowy textures too. Solar panels are the big ones that come to mind, maybe generators too? I guess any building that a player would build that could be reasonably expected to be built outside at some times. It would be really awesome of there was a sort of "snow brushed up against the walls" graphic. I saw mrofa's beautiful spider web atlas that he made, and I'm thinking something like this but with snow instead. Maybe the fences from the fences and floors mod would look really nice with snow on them. Maybe sandbags or turret bases?

I guess none of that will matter if it couldn't be applied to buildings, anyway. I'm not sure why, but I guess I've been trying to build the aesthetic more to my liking, now that I feel like I'm set on content.

(We?)
So, before I end up committing myself a to-do list a mile long, I would like to kindly remind you that my time is not infinite and a read through of If You Give a Mouse a Cookie may be appropriate.

That said, yes, it would be possible to extend to buildings, it would be a similar harmony patch applied to a different section of source code (I think). However, just plants alone looks daunting, as of a17, there were 43 total plant asset types (between Plant, PlantImmature, and PlantLeafless), and b18 very likely added more, but I haven't been able to get a hold of a presorted copy of the textures. Tejko's update had 10, and I managed to draw 1 (it took me over an hour). So assuming I somehow find time or manage to get an artist(s) help to finish the plants, other things like solar panels and turrets could be possible.

As for Atlases, I haven't looked at the code the game uses to render them, so I have no idea how difficult it would be to conditionally swap the artwork, tiles with buildings don't seem to build up snow, so at the very least new logic would be required. On the art side, I'll quote the #rimworld-art discord here:
Quotedianne- Today at 8:20 PM
also atlases suck
do not recommend texturing them

I will have to draw the line at other mods though, if other modders want to collaborate that's one thing, but undertaking something like alone that feels like a path to diminishing returns.

As both the real and hypothetical scope of this project continues to escalate, I would like to note that I have absolutely no idea how performance would be affected by a mod that is essentially polling every item on the map and checking the square for snow, then checking if the def is in the approved list, and replacing the sprite. It could lead to a massive performance hit every time it snows or thaws.

Harry_Dicks

Quote from: Alias on March 07, 2018, 12:36:08 AM
before I end up committing myself a to-do list a mile long, I would like to kindly remind you that my time is not infinite
I never meant to imply that you owe the community any set amount of time, features, or content. I just get a little carried away with thinking about all of the possibilities of what could be ;)

Quote from: Alias on March 07, 2018, 12:36:08 AM
As both the real and hypothetical scope of this project continues to escalate, I would like to note that I have absolutely no idea how performance would be affected by a mod that is essentially polling every item on the map and checking the square for snow, then checking if the def is in the approved list, and replacing the sprite. It could lead to a massive performance hit every time it snows or thaws.
Couldn't this be highly mitigated with a proper code? Could the mod only check say once or twice a day if there is snow on the ground? And maybe only an additional check that is triggered if snow is cleared off of the cell? Further, couldn't the game make a sort of "pre-cached list" of what is out in the world that could be eligible for being swapped to a snow texture, given that everything so far that has a snowy texture is fairly static or takes awhile to grow? An analogy I can think of relates back to reading the description for Fluffy's Stack Merger, and his comparison to other stack merging mods:

Quote
When I was playtesting this, Stockpile Efficiency was brought to my attention. These mods do pretty much exactly the same thing (in fact we both use the same vanilla methods for the actual hauling). The main difference is in how we keep track of what can be merged. Stockpile Efficiency searches for stacks that can potentially be merged whenever a pawn is looking for something to merge. Stack Merger keeps a permanent cache of stacks that can be merged. I haven't run any benchmarks, but I expect my mod to have a mostly constant, relatively low cpu load. Stockpile Efficiency will have no load as long as pawns don't have time to do the hauling jobs, but when they search for things to merge the cpu load will most likely be considerably larger.
If possible, could something like the latter be implemented to reduce CPU load? Or would the former be better because of the rarity of the landscape changing from snowy to not snowy?

I'm thinking also that it really shouldn't have more than a few transitions per in game year. So if the mod could already have have a presorted list of all things that it could (meaning it already knows if these things are outside and if there is a possible snowy texture for them) change, could this possibly help cut down on any major performance hits? I'm thinking that this could help prevent the mod from having to do like you've said, which sounds like it could quickly escalate the CPU usage - and some of us might not have the extra cycles to spare! :-[

Alias

Quote from: Harry_Dicks on March 07, 2018, 01:20:02 AM
I never meant to imply that you owe the community any set amount of time, features, or content. I just get a little carried away with thinking about all of the possibilities of what could be ;)
No worries, I completely understand your desire to have a full on winter wonderland mod, its a neat idea and its something I haven't seen done since Nandonalt did it with just the trees. I appreciate your enthusiasm, I just wanted to have it noted that while I'm happy to have a project, things take time and the potential scope of the project appeared to be rapidly ballooning to meet/exceed my current capabilities (Not that I don't mind a challenge).

Quote from: Harry_Dicks on March 07, 2018, 01:20:02 AM
Couldn't this be highly mitigated with a proper code? Could the mod only check say once or twice a day if there is snow on the ground? And maybe only an additional check that is triggered if snow is cleared off of the cell? Further, couldn't the game make a sort of "pre-cached list" of what is out in the world that could be eligible for being swapped to a snow texture, given that everything so far that has a snowy texture is fairly static or takes awhile to grow? An analogy I can think of relates back to reading the description for Fluffy's Stack Merger, and his comparison to other stack merging mods:

Quote
When I was playtesting this, Stockpile Efficiency was brought to my attention. These mods do pretty much exactly the same thing (in fact we both use the same vanilla methods for the actual hauling). The main difference is in how we keep track of what can be merged. Stockpile Efficiency searches for stacks that can potentially be merged whenever a pawn is looking for something to merge. Stack Merger keeps a permanent cache of stacks that can be merged. I haven't run any benchmarks, but I expect my mod to have a mostly constant, relatively low cpu load. Stockpile Efficiency will have no load as long as pawns don't have time to do the hauling jobs, but when they search for things to merge the cpu load will most likely be considerably larger.
If possible, could something like the latter be implemented to reduce CPU load? Or would the former be better because of the rarity of the landscape changing from snowy to not snowy?

I'm thinking also that it really shouldn't have more than a few transitions per in game year. So if the mod could already have have a presorted list of all things that it could (meaning it already knows if these things are outside and if there is a possible snowy texture for them) change, could this possibly help cut down on any major performance hits? I'm thinking that this could help prevent the mod from having to do like you've said, which sounds like it could quickly escalate the CPU usage - and some of us might not have the extra cycles to spare! :-[

Computationally, checking snow on the ground is actually the easiest part (the processor does some subtraction and depending on if the value is positive negative or zero, it knows if the condition is met), if it fails the code just moves on and doesn't try to match the def. Its checking the def that takes the most time (essentially a character by character comparison is made against each element in the array until a match is found or there are no more elements to check (a presorted list here, isn't a bad idea though, you could squeeze in a binary search and cut out a number of string comparisons)).
I haven't read enough source code to know what causes the game to make checks for new graphics or how it changes them, I was just making notes for potential issues down the road. The game already seems to do the leafless thing well enough (and that's temperature related, on a whole map scale), so at the moment I don't think performance will be a huge issue. It it does become an issue, I can defiantly look into it.

Harry_Dicks

Awesome!

I am curious, would you have a rough ETA on when we might be able to have the rest of the variants, that we already have the snowy textures for, working as well? Instead of just the leafless versions? Thanks! ;D

Alias

Quote from: Harry_Dicks on March 07, 2018, 07:21:30 AM
I am curious, would you have a rough ETA on when we might be able to have the rest of the variants, that we already have the snowy textures for, working as well? Instead of just the leafless versions? Thanks! ;D

At the moment I've got 3 of the 7 leafless tree textures (Birch, Maple, and Poplar) and agave. I'm tentatively planning to knock out 1-2 textures a week (dependent on how much free time I've got), at this rate I expect to have the leafless update ready to go in at most 3 weeks. After that I'll spawn a random map and work on whatever looks most out of place after a couple hard snows.

Alias

#44
Today is a update day (sorry it's a week late)!
GitHub
Workshop

Changes:

       
  • Refactored the tree swap code, not that it was an issue, but it runs faster now
  • Added graphics for:

    •       
    • Leafless:

      •          
      • Birch Tree
      • Cypress Tree
      • Maple Tree
      • Oak Tree
      • Poplar Tree
      • Willow Tree
    • Regular

      •          
      • Agave
      • Willow Tree
Bugs:

       
  • One of the steam users reported that their pine trees are not switching over to the snowy variants, I suspect this is due to a mod conflict (as it does not occur when I test in a clean save) Fixed, turns out pine trees actually do have a leafless state, just not a leafless graphic
   If you encounter any bugs feel free to post something here and let me know.

Next update:
I'm going to be super busy for the next month I have no idea how much free time I'll have, but after that I should free to work on this mod some more. I think next up will be burned trees, brambles and other non-selectable plants (that are visible after it snows)