World of Banished

MODS Garage => Tips and Help => Topic started by: Voeille on May 21, 2018, 01:05:57 PM

Title: Decorative plants
Post by: Voeille on May 21, 2018, 01:05:57 PM
I want to slowly add the plants I made for Cities Skylines as a decorative plants set (4 plants, each one with F key variants). What I want to achieve at the end is:
At the moment, I just wanted to import one plant and see it in the game, it should appear directly under the community toolbar without my section yet (just for testing, I'd add the section later), and have the apiary icon. The mod compiled just fine without errors, I can enable it in game, but nothing shows up in the menu. I must've done something wrong, but I don't know what. Here (https://mega.nz/#!LQZi3KpI!hr40xOu6DM4_EnX015AmzCfmtDNdk_Cw6DAilEi7hqA) are the files, the compiled .pkm is inside the folder.

If someone is curious, here are pictures of the plants I want to add, I think they fill fit into Banished aesthetics:
Except for the ferns textures are handmade, so not photo-realistic ;)
Title: Re: Decorative plants
Post by: RedKetchup on May 21, 2018, 04:53:29 PM
Quote from: Voeille on May 21, 2018, 01:05:57 PM
I want to slowly add the plants I made for Cities Skylines as a decorative plants set (4 plants, each one with F key variants). What I want to achieve at the end is:

  • Ghosted plants that can be put anywhere, with 0 build cost
  • They should be immune to fires and tornadoes

for ghosted, you need to set up your createplaced, map and build paragraphs like this:
[/list]
CreatePlacedDescription createplaced
{
PathBits _placeBits = Normal | Obstacle;

int _width = 0;
int _height = 0;
int _footprintRotation = 0;

PathBits _placeBitArray
[
Normal | Obstacle,
Normal | Obstacle | Fast | Faster,
]
String _placeBitmap =
"";

ComponentDescription _allowAndRemove = "Template/Clear.rsc";
}
MapDescription map
{
PathType _pathType = Immovable;
String _pathBitmap =
"";

bool _addToOverhead = true;
Color _mapColor = 0xFF545454;
}
BuildDescription build
{
int _workRequired = 0;
}


they will eventually be immune to fire/tornados.

oh and about "F" variant is set by the number of items in the decal, picking, model and highlight paragraphs. in your case you said 4 "F" then each of those will have 4 items in each like:


PickingDescription picking
{
MaterialInstance _selectMaterial = "Material/SelectionMask/SelectionMask.rsc";
PickingGroup _meshes
[
{
PickingMesh _mesh
[
"Models\NaturalResource\DecoTrees\DecorativeCedar1Picking.rsc"
]
}
{
PickingMesh _mesh
[
"Models\NaturalResource\DecoTrees\DecorativeCedar2Picking.rsc"
]
}
{
PickingMesh _mesh
[
"Models\NaturalResource\DecoTrees\DecorativeCedar3Picking.rsc"
]
}
]
}

ModelDescription model
{
MeshGroup _meshes
[
{
GraphicsMesh _mesh
[
"Models\NaturalResource\DecoTrees\DecorativeCedar1Mesh.rsc"
]
}
{
GraphicsMesh _mesh
[
"Models\NaturalResource\DecoTrees\DecorativeCedar2Mesh.rsc"
]
}
{
GraphicsMesh _mesh
[
"Models\NaturalResource\DecoTrees\DecorativeCedar3Mesh.rsc"
]
}
]

int _displayIndex = 0;
int _subIndex = 0;
bool _randomIndex = false;
}

HighlightDescription highlight
{
EdgeGroup _meshes
[
{
EdgeMesh _mesh
[
"Models\NaturalResource\DecoTrees\DecorativeHighlightMesh.rsc:edge"
]
}
{
EdgeMesh _mesh
[
"Models\NaturalResource\DecoTrees\DecorativeHighlightMesh.rsc:edge"
]
}
{
EdgeMesh _mesh
[
"Models\NaturalResource\DecoTrees\DecorativeHighlightMesh.rsc:edge"
]
}
]

// materials for drawing selection with no mesh
MaterialInstance _maskMaterial = "Material/SelectionMask/SelectionMask.rsc";
MaterialInstance _edgeMaterial = "Material/SelectionEdge/SelectionEdge.rsc";
}


my example has 3 "F" , you , you need 4 of those.


Quote from: Voeille on May 21, 2018, 01:05:57 PM
  • They should have the tree animation

what you mean by tree animations ? because trees can have animations but i am pretty sure it is not what you think, the trees animations are the part where they fall to the ground and then disappear. and not the part where they have their leaves moving, changing colors and disappear in winter.


Quote from: Voeille on May 21, 2018, 01:05:57 PM
  • I want them to change leaf colour for autumn, but I don't want the leaves to vanish in winter, just cover with snow

it is set inside your leaves texture files in Models/MaterialInstance. instead of:    Material _material = "Material\Opaque\OpaqueMaterial.rsc";
you will use :   Material _material = "Material\Billboard\BillboardMaterial.rsc";

i am not sure if you can add snow on it in winters because as soon you use ModelAlpha function it tends to imunne it to snow unless you find a way to do it with your AO file.

the turn to orange is set by the billboard Material
while the 3rd channel wrap up is set in your 3D model fbx and it decides the fact it shrink to nothingness (disappearing) in winter. you will need to check the tutos in tuto section to how to do it in blender.


Quote from: Voeille on May 21, 2018, 01:05:57 PM
  • They should appear in my section under the common toolbar

when you've set your section under common toolbar, did you set all your categories at begining ? like the examples i did in the common toolbar tuto. i ve shown i prepared in advance all the category i wished... RKfood.. RKresources... RKservices... RKdecorations... and inside my decoration, i set in advances some of sub categories like RKfences... RKtrees.... RKanimals....

i explained you need to set your toolbar structure in advance (even if you wont use it) because the first mod in your list need to have all sub categories or they wont show up
Title: Re: Decorative plants
Post by: Voeille on May 21, 2018, 05:03:04 PM
Thanks! I'll try to set the categories and see if that will make it appear in the game.
Title: Re: Decorative plants
Post by: elemental on May 21, 2018, 07:03:03 PM
Looking forward to seeing them (and using them).

Do you plan to make them non ground-flattening? It makes them easier to use with other mods if ghost decos don't flatten ground.
Title: Re: Decorative plants
Post by: Voeille on May 21, 2018, 07:44:57 PM
Yes, that would be good, I also prefer when ghosted deco doesn't flatten terrain.

I set up the toolbar like in the example from the tutorial, but the model still doesn't appear anywhere in the menu in game, so I must've done something else wrong.

New files (https://mega.nz/#!TVw3EBZY!Yq-MIdQ59TH9_Yc7JLKdzXeh7cAs_FJidiM8yfWgmF4)
Title: Re: Decorative plants
Post by: RedKetchup on May 21, 2018, 08:04:28 PM
Quote from: Voeille on May 21, 2018, 07:44:57 PM
Yes, that would be good, I also prefer when ghosted deco doesn't flatten terrain.

I set up the toolbar like in the example from the tutorial, but the model still doesn't appear anywhere in the menu in game, so I must've done something else wrong.

New files (https://mega.nz/#!TVw3EBZY!Yq-MIdQ59TH9_Yc7JLKdzXeh7cAs_FJidiM8yfWgmF4)

ok gonna go check. btw sorry i just saw you posted the files in the 1st post
Title: Re: Decorative plants
Post by: RedKetchup on May 21, 2018, 08:28:26 PM
Quote from: RedKetchup on May 21, 2018, 08:04:28 PM
ok gonna go check.

ok first i didnt want to go explore everything and let you fix things :)

but i checked what you asked : the missing icons

first thing i've done, i fixed the mess about the Build.bat.. the Package.rsc... and your resources root file.


there is no need to "call" your root DecorativePlants.rsc file 2 times. since you want to use a DecorativePlantsResources.rsc root file (which i prefer you do and work properly...)
so i deleted your external list from your package. you dont need that. and in your .bat i called directly your resources root file:

Build.bat :

..\..\bin\x64\Tools-x64.exe /build DecorativePlantsResources.rsc /pathres ../example/DecorativePlants /pathdat ../example/DecorativePlants/bin
..\..\bin\x64\Tools-x64.exe /mod Package.rsc:DecorativePlants /pathres ../example/DecorativePlants /pathdat ../example/DecorativePlants/bin


Package.rsc :

PackageFile DecorativePlants
{
String _name = "Fern1";
String _author = "Voeille";
String _description = "x";
String _icon = "icon.png";
String _preview = "preview.jpg";
int _userVersion = 1;

// all files in resource directory
String _includeList
[
"*"
]

// exclude package files, mod files, file used for building packages
String _excludeList
[
"Package_*.crs"
"*.pkg"
"*.pkm"
]
}


then your missing icons :
you are missing 2 lines in your DecorativePlants.rsc toolbar root file :

Toolbar DecorativePlants
{
Toolbar _parent = "Game\VToolbar.rsc:Vdecorations";
int _sortPriority = 700;

SpriteSheet _spriteSheet = "UI/Fern1SpriteSheet.rsc";
StringTable _stringTable = "UI/Fern1StringTable.rsc";

Action _action = Tool;
ComponentDescription _tool = "Template/Fern1.rsc";

bool _autoHotKey = true; 
}

explanations: your toolbar file doesnt know where to find your icon, so it doesnt search for it.


i ve put a copy of the files in the attachments and also a screenshot to prove your icons are there thenafter :) (Build.bat and Package.rsc and DecorativePlants.rsc) in an attached .zip below.
you will see your next challenge in that screenshot that you will need to fix :)
Title: Re: Decorative plants
Post by: Voeille on May 21, 2018, 08:40:39 PM
Wow that's quite an explosive model! Could it be that Banished doesn't support rectangle texture files? E.g. 512x1024 instead of full 1024x1024. The model looks completely different too, and there's no alpha. Thanks for the help with files :)
Title: Re: Decorative plants
Post by: RedKetchup on May 21, 2018, 08:43:15 PM
Quote from: Voeille on May 21, 2018, 08:40:39 PM
Wow that's quite an explosive model! Could it be that Banished doesn't support rectangle texture files? E.g. 512x1024 instead of full 1024x1024. The model looks completely different too, and there's no alpha. Thanks for the help with files :)

oh they do support those number. but i wont recommend it, the things should be too small to see any difference. we cannot zoom enough in the game we can see a difference. you will eat memory for nothing. but it does handle those 512 and 1024 numbers.

you mesh hasnt been exported in your .fbx with the good "units". if you keep the same units, then you will have to rescale down your mesh to maybe ... 5% of original scale.
about the alpha, you dont even use the "Texture/ModelAlphaTexture.rsc" material in your /Models/MaterialInstance/Fern1Texture.rsc
Title: Re: Decorative plants
Post by: Voeille on May 21, 2018, 10:35:44 PM
I fixed the alpha, but the model is still massive and with wrong shape despite scaling it down according to the apiary building (I deleted the apiary parts after that to leave just the fern parts). Also, when I actually click on the ground to place it, the game crashes with a division by 0 error, so I suppose I must have something else wrong, maybe in Template\Fern1.rsc? I used the well template and removed some things from it, so maybe I removed too much.

(https://i.imgur.com/4DZyrxt.png)

Files again (https://mega.nz/#!6Yox3QQa!6kCNzrqO0Kgmk-R2KtMjDNmbXDm1lQvrfVIBvHmiWFU)
Title: Re: Decorative plants
Post by: RedKetchup on May 21, 2018, 10:46:33 PM
ok :) gonna check
Title: Re: Decorative plants
Post by: RedKetchup on May 21, 2018, 10:56:09 PM
i compiled and put the .pkm in WinData folder. the screenshot is what it gave me. it didnt crashed at all but the units are still bad.
each time you compile, make sure you delete everytime the bin and build folders it create each time you compile. that way you are sure everything has been updated.
Title: Re: Decorative plants
Post by: RedKetchup on May 21, 2018, 11:14:48 PM
i imported your fbx in my 3dsmax and re-exported... is the supposely the good size ?
Title: Re: Decorative plants
Post by: RedKetchup on May 21, 2018, 11:21:44 PM
not sure how you did it... it is weird in my 3dsmax
Title: Re: Decorative plants
Post by: Tom Sawyer on May 22, 2018, 12:59:05 AM
Hi @Voeille, nice to see a new modelmaker on board. :)

From your picture in Blender it looks to me like a missing game tile scaling factor. The thing is that a banished game tile is not 1 meter but a citizens height. I use 1.66666666667 m for it to have a simple factor of 0.6 when modeling in real size and scaling it to the game. So if your original fern model was made in meters then just scale it down this way and it will keep its proportion.

In your fern1.rsc are a couple of wrong things. One that will crash the game is adding happiness around an item placed on 0 x 0 tiles. That probably causes your /0 exception. You have copied the well.rsc and not cleaned it up fully. I send you a file from a ghosted bench including its upgrade item which is necessary to get rid of it in game. So you can look at it or just copy and alter.
Title: Re: Decorative plants
Post by: Voeille on May 22, 2018, 06:48:32 AM
@RedKetchup
That size is realistic comparing it with the citizen next to it, but I think I'd like it a bit bigger. I was thinking about two size variants for it, one small (bit a bit larger than yours), and one big, comparable to CC bushes with respect to width. Is one of these (FBX (https://mega.nz/#!OBYUlbyC!_OegnDvhPPg8_phst1Og5m-yJHvgJuTDP7_yy4ZlDig) and OBJ (https://mega.nz/#!qJxwQQJa!LR0teiZ0lPDucn5NtYf90-qTdkJGQsw9oP8YHfkRzfE)) models fine? Those are versions before I edited it for Banished. For all I remember, OBJ is exported straight from a format used for The Sims 2 (it's a custom one, not one of the standard 3D formats), and it has different normals. It was made in Milkshape 3D, the UV map was made using UV Mapper and adjusted in Milkshape. To make the fern look properly in Cities Skylines, I had to export from the Sims format to OBJ, import that to Blender, fix normals, and then export it as FBX.

@Tom Sawyer
Thanks for the bench file, I'll look at it and I hope I can stop the game for dividing by 0.
Title: Re: Decorative plants
Post by: RedKetchup on May 22, 2018, 07:14:53 AM
your obj file is a lot better, not corrupted with all strange fbx settings that can comes from blender.
it is just a little too big (maybe 60-70% would be good)

and yeah 4-5 different models would be good as alternate (some differents... some placed different so they dont all fall in the exact center of the tile)
Title: Re: Decorative plants
Post by: Voeille on May 22, 2018, 07:47:31 AM
That does look a lot better indeed, so I think I'll just use the OBJ and scale it properly.

I used that Billboard material thing you mentioned before (it was in the files I sent), does it make the plants sort of wave like trees, or is it just for the autumn colours?
Title: Re: Decorative plants
Post by: RedKetchup on May 22, 2018, 07:55:34 AM
Quote from: Voeille on May 22, 2018, 07:47:31 AM
That does look a lot better indeed, so I think I'll just use the OBJ and scale it properly.
indeed
maybe you will have to import the OBJ. scale it properly. export to another name.OBJ and go back import back the new.OBJ. thats what i do with all my scaling so the real world coords get updated.

Quote from: Voeille on May 22, 2018, 07:47:31 AM
I used that Billboard material thing you mentioned before (it was in the files I sent), does it make the plants sort of wave like trees, or is it just for the autumn colours?
BillboardMaterial.rsc make swing with the wind, change color in autumn, disappear in winter

BillboardEvergreenMaterial.rsc the other option will make it swing with the wind but wont change color and wont disappear in winter
Title: Re: Decorative plants
Post by: RedKetchup on May 22, 2018, 08:14:11 AM
btw, if you think you see too much "white pixels" in game... this is because your alpha .png has some ghosted half pixels in it.

i ve checked you png. i selected all your pixels with the fast select tool and then i intervene the selection (to select everything but your pixels) and then i painted everything in green.
in the screenshot you will see some ghost pixels.
Title: Re: Decorative plants
Post by: Voeille on May 22, 2018, 08:30:44 AM
Yeah I know I about the pixels, I should've used the .dds file with alpha channel I have, that's what I did for Sims (CSL has separate files for alpha and diffuse), but I wasn't sure if Banished can understand .dds. However, when I was messing around with my texture replacement I tried .dds and and it compiled and worked in the game just fine.

I'll try to fix the model now, try .dds (but smaller, not 512x1024), and post the results. I will have to use Blender for FBX, so hopefully it won't be corrupted again.

Edit: I forgot to ask, does Banished support any kind of normal maps? I know a normal map is used for water (I tried to replace it but the one I had didn't look good), but what about models? I don't think I've seen it on any vanilla models though.
Title: Re: Decorative plants
Post by: RedKetchup on May 22, 2018, 08:41:11 AM
Quote from: Voeille on May 22, 2018, 08:30:44 AM
I will have to use Blender for FBX, so hopefully it won't be corrupted again.

i dunno. i say "corrupted" this is because my 3dsMax doesnt like the .fbx made with Blender, some time it catch some... bacteries lol that mess up all my 3dsMax settings. the only way i can get rid of those "bacteries" is by wiping all my settings files and force the program to setup a new batch of settings by default.


Quote from: Voeille on May 22, 2018, 08:30:44 AM
Edit: I forgot to ask, does Banished support any kind of normal maps? I know a normal map is used for water (I tried to replace it but the one I had didn't look good), but what about models? I don't think I've seen it on any vanilla models though.

no the game doesnt handle the other maps like bumping... etc the only one it accept is the diffuse one.
supposely it can but supposely it would be very complicated.
Title: Re: Decorative plants
Post by: Voeille on May 22, 2018, 09:14:57 AM
OK this is quite strange. Now the model isn't huge and with weird shape, and I can click and place it without dividing by 0 (yay!), but I can't see it, and the little tooltip is always at the top of the screen instead of following my mouse.

(https://i.imgur.com/9gOwTsG.png)

Files (https://mega.nz/#!2IoCAT6R!Yg-Jp7FdutKDvdDMh-_Xa3ic5CWyY-Eu2qLvzUilEtg)
Title: Re: Decorative plants
Post by: kid1293 on May 22, 2018, 09:43:10 AM
You have a problem with points
I recognize it from earlier when I had a building that way.

I always scale to 0.01 to avoid such problems.
I use Blender and scale around zero. NO apply. And save to fbx.

Title: Re: Decorative plants
Post by: Voeille on May 22, 2018, 10:10:09 AM
I copied points from the apiary building, and deleted all of them except build_001. Do I need more? Or less? There isn't going to be any interaction with the plant, not even putting resources in as it required none.

To scale it, I imported the apiary building and resized the fern appropriately, I didn't input any numbers anywhere. I'm quite unfamiliar with Blender, I've only used it to export FBX for CSL.
Title: Re: Decorative plants
Post by: Voeille on May 22, 2018, 02:26:03 PM
I tried again, I imported the OBJ, exported as FBX without changes, imported the FBX with 0.01 scale, added points (but without the build_001), and it sort of worked :) Now I need to rotate it so it isn't upside-down.

(https://i.imgur.com/xOeN3EP.png)
Title: Re: Decorative plants
Post by: kid1293 on May 22, 2018, 02:58:54 PM
Hey! You will make it!
It is maybe tedious but it is an amazing feeling when things fall into place.

Good work! :)
Title: Re: Decorative plants
Post by: RedKetchup on May 22, 2018, 03:48:02 PM
yeah you need to give yourself a good month or 2 for learning the 3D process of Banished
but good job!
Title: Re: Decorative plants
Post by: Voeille on May 22, 2018, 05:10:13 PM
Thanks! I rotated it (which took a few tries, for some reason it needs to be sideways to look normally, which I suppose is because the original OBJ is sideways), but there are other issues (of course ;)). Despite using the Billboard material, it doesn't change colour or vanish, and doesn't have that wave animation like trees. Also, for some reason it gets brighter during the rain and darker with sunny weather.

(https://i.imgur.com/hHm45pf.png)

(https://i.imgur.com/Mpzb8vF.png)

Files (https://mega.nz/#!WV4lnT6b!VzXNs6MSfOtXn11me64pbo8pxxu0A1E_ALDYcYh9ro8)
Title: Re: Decorative plants
Post by: Voeille on May 22, 2018, 06:34:28 PM
I fixed the lighting, it was a problem with normals like in Cities Skylines. It looks like other games don't like normals from Milkshape like in The Sims 2.

So, this is how it looks now:

(https://i.imgur.com/IZN6xeY.png)

(https://i.imgur.com/bTArcD5.png)

So the problem that remains is that Billboard material. Also, how and where do I tell it what part of the model should be affected? For the ferns it's the whole plant, but for a tree the trunk should stay untouched. Do I need more groups than just 'mesh'?
Title: Re: Decorative plants
Post by: RedKetchup on May 22, 2018, 06:50:00 PM
just rotating to make "F" variants is useless (if thats what you did) because in game we can just hit "R" or "T" and we can rotate it free.

now for the swing with the wind you will need to learn a new thing :) ask you blender to create a third UV map with blender.
we had a tuto on this where blender modder were explaining how to do it with blender but didnt found the post yet ...

maybe @kid1293  can answer about this



but in your pictures it looks so awesome !!
Title: Re: Decorative plants
Post by: elemental on May 22, 2018, 07:38:26 PM
They look great. A few different sizes would be good as variants.
Title: Re: Decorative plants
Post by: Discrepancy on May 22, 2018, 08:11:07 PM
Quote from: RedKetchup on May 22, 2018, 06:50:00 PM
now for the swing with the wind you will need to learn a new thing :) ask you blender to create a third UV map with blender.
we had a tuto on this where blender modder were explaining how to do it with blender but didnt found the post yet ...

I think the discussion was over on BlackLiquid website: http://blackliquidsoftware.com/index.php?/topic/1147-moving-with-the-wind/ (http://blackliquidsoftware.com/index.php?/topic/1147-moving-with-the-wind/)


and great looking ferns @Voeille :)
Title: Re: Decorative plants
Post by: RedKetchup on May 22, 2018, 09:23:41 PM
Quote from: Discrepancy on May 22, 2018, 08:11:07 PM

I think the discussion was over on BlackLiquid website: http://blackliquidsoftware.com/index.php?/topic/1147-moving-with-the-wind/ (http://blackliquidsoftware.com/index.php?/topic/1147-moving-with-the-wind/)


and great looking ferns @Voeille :)

oh ya right! this is why i couldnt find it !!
Title: Re: Decorative plants
Post by: Voeille on May 22, 2018, 10:04:51 PM
Thanks! I haven't made F key variants yet, firstly I want the moving, then add a remove button, and then the variants (I'm thinking 3 more, different size and rotation). Later I'll make proper icons and add more plants.

Edit: I never remember to ask – what is the purpose of the AO map exactly? Is it just a shading layer, or does it affect other things like how a model covers with snow? (The fern doesn't but that's probably because I used the Billboard material, and it'll vanish in snow after I do it properly anyway). I haven't seen it in other games I've modded, shading is done directly on the texture.
Title: Re: Decorative plants
Post by: RedKetchup on May 23, 2018, 12:25:55 AM
it is for controling the shadows on the mesh.

there should be a tuto how to do AO files with blender. (i only know to do it on 3dsmax)
Title: Re: Decorative plants
Post by: Voeille on May 23, 2018, 12:45:08 AM
It seems it also does affect snow, there is a bit less of it near the roots and that is consistent with the AO. I made the AO manually (a simple gradient as you probably saw in the file), because Blender came up with something quite strange with the baking (and it's wrong size anyway, I forgot to set it to a rectangle).

(https://i.imgur.com/Sgh2MRl.png)

Anyway, I added the UV channels (they are all the same as I want the whole plant to be affected), but I can't use the Billboard material. Not only does it change the colour in autumn and add the animation, but also makes the leaves always face the camera, which looks wrong with this model, as it wasn't designed for that. So, I used the Foliage material instead. It adds a nice delicate animation, but no colours or vanishing. I guess I can't have the autumn change but no facing the camera?

This is how it looks in winter. Sort of OK for this plant, but it'll be less nice with the other plants that have flowers. Still better than the camera thing for a model not designed for it though ;)

(https://i.imgur.com/fgws7hq.png)
Title: Re: Decorative plants
Post by: Tom Sawyer on May 23, 2018, 01:06:31 AM
That's true. The darker the UV the less snow on it. Your fern model looks really great. Looking at it in blender it is a little poly monster and adding UV increases the size a lot then. For small items I sometimes just add a blank light grey uv image. It already has a nice effect in game and costs almost no space. But that's up to you how detailed or optimized you want it. I think it will not be a problem if not used as auto spawned wild plant and only placed here and there with full control by the player. Also I would think of smaller at least F variants. To me they look a bit unnaturally big. :)
Title: Re: Decorative plants
Post by: Voeille on May 23, 2018, 01:24:36 AM
Yes I'll definitely add smaller sizes (I'm thinking of making 4 size and rotation variants for each plant; I think it'll be more convenient to have colour variants listed as separate plants in the toolbar than having 20 F-key variations), I just wanted one big for covering larger areas :)

If you think that the fern is a poly monster, what about the tree whose larger variation has over 2500 polys? ;) But yes, they are designed as decorations to be placed manually by the player. Incidentally, what is the recommended poly count for Banished? Of course, the fewer the better is always true, but are there any explicit numbers? For Cities Skylines it's 1000 so I try to only go over that if a model really needs it (like for the tree, it's huge and it was supposed to be lush and detailed, not designed to cover a map in any game, the smaller version is slightly better for it), and for Sims 2 it's 800 per tile. So for example, you'd want your armchair to have 800 polys, but your 2-tile wide sofa counts as fine with 1600.
Title: Re: Decorative plants
Post by: Tom Sawyer on May 23, 2018, 02:04:48 AM
Haha, this I would call a big poly monster then.^^ As you say it depends very much on the use in game. As a single deco mod for manually placed items I find it ok. As part of a main mod it already can be a mess since the player cannot pick and all these little monsters in summary end up in endless loading time and slow game speed. Where we really have to be careful are crops and wild plants, also trees. Everything that is spawned over the map. In general I think it's an underestimated aspect of modding to keep things small, clean and fast.

We don't have a rule or so and it is hard to make something like that because of the things above. I for myself have some rules like a texture resolution of about 128 px per game tile and 64 in terrain footprints. For buildings a poly count of about 100 per tile is a good number. That's sometimes hard to keep with deco items or plant models. Also and of course poly count is not everything. Some of the materials are slower than others. You can make a very low poly tree with transparent billboard material and it will be slower than a tree with more poly but simple opaque material. Also, there are a lot small things which can be done for optimizing. I may be a puristic freak but it pays off. The north mod with all its stuff and game overhaul has still only 140 MB and loads in a few seconds. :)
Title: Re: Decorative plants
Post by: Voeille on May 23, 2018, 02:42:39 AM
I've never made a building yet (in general I don't think I've even made 10 models so far, so I'm still in the very beginner stage), but for what I can tell by just looking at things in the game it definitely does seem easier to balance the polys/size ratio than for plants, because there are a lot of cubes and the like, and not the more curved shapes (or a large bunch of planes) like for plants. My main fault with respect to making 'heavy' things is textures – I'm familiar with that as retexturing existing models (especially clothes) was a very common form of modding Sims 2 back in 2007 (and it's still a thing, but less common, mesh edits are more popular for clothes nowadays for all I've seen), so I've learnt a lot since then, and I've grown as a perfectionist for textures – everything needs to be just right even if it involves moving things by one pixel and previewing, there needs to be proper shading, textures need to be seamless where applicable (and using mirroring to make them seamless is a texture crime!), and preferably have a lot of detail. And, to show that detail I can go overboard with texture sizes, I often use larger than recommended so nice details are visible from close up. I know that in Banished the default zoom isn't much, but I personally use the zoom hack and like looking at things closer, so with the ferns I went with 256x512, the original 512x1024 would be definitely too much. We're missing out a lot by not having normal maps in Banished (an example (https://i.imgur.com/8mHBaTF.png) of normal map detailing), but that makes texturing more challenging. My ultimate goal for texturing is to reach complete independence of stock images (everything handmade), but I'm far from that ;) All I can do is some plants (ferns weren't one of them, I used brushes from ObsidianDawn.com).
Title: Re: Decorative plants
Post by: Voeille on May 23, 2018, 02:02:02 PM
OK I've run into another problem. I want to add a remove button so the player can delete them. I used the files provided by @Tom Sawyer but there's a reference to Dialog/Remove.rsc:removeButton2, which is not in the mod kit resources, so I assume it's custom. I tried to use Dialog/Upgrade.rsc from the mod kit, but then the mod fails to compile, so I guess I need that Remove.rsc file. What should be in it?

Edit: I also have a question for you @RedKetchup : you made a PNG sprite sheet using my icon (thanks!) and you put 7 of them in the image. In the Dialog folder folder there are 8 of them (decorations, empty, food, housing, resources, services, storage, and toolbar). Which one isn't included in the sheet? I would like to make proper icons for each category, in what order would I put them on the sheet, is it alphabetical like they are listen in the folder? Also, how exactly do I place them, right next to each other, with some spacing, or it doesn't matter at all?
Title: Re: Decorative plants
Post by: Tom Sawyer on May 23, 2018, 02:44:29 PM
That's true. It's easier to keep poly counts low with a building. I think, making good plant models is more challenging in general. I made some crops but not satisfied with their performance in game and want to remake them one day. The remove button is defined by the following code. Makes more sense to copy it here since my file contains a lot of buttons. Just copy this into your own Dialog/Remove.rsc and add a RemoveItemTip to your own string file.

ButtonDescription removeButton : "SharedElements.rsc:borderButton"
{
   int _topPad = 4;
   int _leftPad = 200;
   int _bottomPad = 4;
   Alignment _alignment = TopLeft;
   ElementDescription _content = "imageUpgrade";
   Dialog _toolTipDialog = "ToolTipUpgrade.rsc";
   StringTable _toolTipStringTable = "Dialog/StringTable.rsc:objects";
   String _toolTipText = "RemoveItemTip";
}

ImageDescription imageUpgrade
{
   int _leftPad = 8;
   int _rightPad = 8;
   int _bottomPad = 8;
   int _topPad = 8;
   int _width = 32;
   int _height = 32;
}

Title: Re: Decorative plants
Post by: Voeille on May 23, 2018, 02:58:53 PM
Thanks, I'll add the code and see if it works :) I wouldn't be surprised if I broke something else though, that happens a lot ;) Reminds me of my fights with pointers in C++. You forget an & somewhere, and the whole thing collapses. Java is much more user friendly by automatically managing all the memory, and in assembly even hello world is quite a challenge ;) No wonder it's not used for complex programming and people settle for C++ for games.

For now a building seems more challenging for me as I've never made one yet, but once I do I'll probably change my mind. Flat-plane based plants seem easy to make, but it's likely to go overboard with polys for a large and dense model.
Title: Re: Decorative plants
Post by: RedKetchup on May 23, 2018, 04:32:23 PM
Quote from: Voeille on May 23, 2018, 02:02:02 PM
Edit: I also have a question for you @RedKetchup : you made a PNG sprite sheet using my icon (thanks!) and you put 7 of them in the image. In the Dialog folder folder there are 8 of them (decorations, empty, food, housing, resources, services, storage, and toolbar). Which one isn't included in the sheet? I would like to make proper icons for each category, in what order would I put them on the sheet, is it alphabetical like they are listen in the folder? Also, how exactly do I place them, right next to each other, with some spacing, or it doesn't matter at all?

i am so sorry @Voeille  i have absolutely no idea of what you are talking. i didnt put anything of 7 of them of image. i dunno to what you are refering to.
and i dont understand neither the question about how exactly do you place them, place what and where ?



-------------

about your trash icon.

you will need to go in the Resource/Dialog folder and pickup the Upgrade.rsc and copy paste it in your Dialog folder of your mod. and rename it DecorativePlantsUpgrade.rsc
inside you will change a couple of names to reflect your mods:

ButtonDescription upgradeButton : "SharedElements.rsc:borderButton"
{
int _topPad = 4;
int _rightPad = 2;
Alignment _alignment = TopRight;
ElementDescription _content = "imageUpgrade";

Dialog _toolTipDialog = "ToolTipUpgrade.rsc";
StringTable _toolTipStringTable = "UI\Fern1StringTable.rsc";
String _toolTipText = "DecorativePlantsUpgradeTip";

}

ImageDescription imageUpgrade
{
int _leftPad = 4;
int _rightPad = 4;
int _bottomPad = 4;
int _topPad = 4;

int _width = 32;
int _height = 32;
}


you need to add that option in your decorative plant UI of your decorative plant template (Template/Fern1.rsc) and refering the upgrade button to that new file renamed :

{
ObjectType _type = UpgradeUI;
ElementDescription _element = "Dialog/DecorativePlantsUpgrade.rsc:upgradeButton";
String _insertAt = "userButton0";
DialogControllerConfig _config = "upgradeConfig";
}


and at the bottom of your template  (Template/Fern1.rsc) you add the explanation of that UI:


UpgradeUIConfig upgradeConfig
{
ComponentDescription _upgradeTo = "Template/DecorativePlantsTrash.rsc";
}



then you will create that template called : DecorativePlantsTrash.rsc

// layout of the entity
ComponentDescription resource
{
// how often to update
UpdatePriority _updatePriority = Fourth;

// declare types that will be used
Description _descriptions
[
"toolbar",
"map",
"work",
"destroy",
]
}

ToolbarDescription toolbar
{
SpriteSheet _spriteSheet = "UI/Fern1SpriteSheet.rsc";
String _spriteName = "DecorativePlantsTrash";

StringTable _stringTable = "UI/Fern1StringTable.rsc";
String _stringName = "DecorativePlantsTrash";
String _stringNameLwr = "DecorativePlantsTrashLwr";
String _toolTip = "DecorativePlantsTrashTip";

String _statusStrings
[
"CreateOk",
"CreateBlocked",
]

int _group = 1;
}

MapDescription map
{
PathType _pathType = Normal;
bool _addToOverhead = true;
Color _mapColor = 0xFF80694D;
}

WorkDescription work
{
int _defaultWorkers = 1;
}

DestroyDescription destroy { }



then you will add these info in your UI/Fern1SpriteSheet.rsc

{ String _name = "DecorativePlantsTrash"; String _source = "UI/Sprite/DecorativePlantsTrash.png"; }


then you will add these info in your UI/Fern1StringTable.rsc

{ String _name = "DecorativePlantsTrash"; String _text = "Trash"; }
{ String _name = "DecorativePlantsTrashLwr"; String _text = "trash"; }
{ String _name = "DecorativePlantsTrashTip"; String _text = "Trash this plant and remove it."; }
{ String _name = "DecorativePlantsUpgradeTip"; String _text = "Trash this plant and remove it."; }


then you will pickup this icon below in attachment and put it in your UI/Sprite folder
Title: Re: Decorative plants
Post by: Voeille on May 23, 2018, 05:02:51 PM
I'm sorry, I probably wasn't clear. I tend to say things in a convoluted way, add to that the fact that I'm not a native speaker, and I can be incomprehensible sometimes. Hopefully not too often ;)

Also, it turns out I was wrong! I thought sprite sheet is made manually, but it looks like it's generated. I've updated a few of my icons, and the sprite sheet added them automatically when I compiled the mod.

(https://i.imgur.com/vzZ00t7.png)

I managed to get the removal working a moment before you posted it, but thanks anyway, it helped me to fix the tooltip as I was referring to a wrong thing in my files :)

(https://i.imgur.com/irKzFKe.png)

So now the next step is making the F-key variants. I hope it'll go smooth if I have the main thing working now.
Title: Re: Decorative plants
Post by: RedKetchup on May 23, 2018, 05:12:12 PM
yeah they are generated by the toolkit. thats the purpose of the 2 other spritesheet files in your UI folder (or the Dialog folder in case of your common toolbar / personnal toolbar.)

bah about the explanation of how to do it (add a trash icon) can be used as tutorial for any of the other new fans of trying to make mods ^^.
Title: Re: Decorative plants
Post by: RedKetchup on May 23, 2018, 05:16:41 PM
maybe one day you can add a special model for the selecting option called highlight (which i do sometimes on some models) because sometimes playing with semi transparent texture does some weird ugly thing (doing a yellow line around the physical plane instead or the physical pixels) :)
Title: Re: Decorative plants
Post by: Voeille on May 23, 2018, 05:30:51 PM
That would be nice, it'd look much better for the fern to be selected with alpha considered. But that sounds like something to do later after I have more experience :)

I have a question about the toolbar. I want to add a subsection for plants. Now the location for the fern is in common toolbar/me/decorations/fern, but I want it to be under common toolbar/me/decorations/plants/fern. If my decorations section is defined as follows:

Toolbar Vdecorations : "base"
{
Toolbar _parent = "Game/VToolbar.rsc:Vtoolbar";
int _sortPriority = 650;

String _toolTip = "VdecorationsTip";   
String _image = "Vdecorations";
Action _action = ShowGroup;

bool _autoHotKey = true;
Keys _hotKey = Toolbar1;
}


Would it be enough to add:

Toolbar Vplants : "base"
{
Toolbar _parent = "Game/VToolbar.rsc:Vdecorations";
int _sortPriority = 650;

String _toolTip = "VplantsTip";   
String _image = "Vplants";
Action _action = ShowGroup;

bool _autoHotKey = true;
Keys _hotKey = Toolbar1;
}


And change this line:
Toolbar _parent = "Game\VToolbar.rsc:Vdecorations";
To:
Toolbar _parent = "Game\VToolbar.rsc:Vplants";

I think it would work, but my university tasks and projects taught me that if I have an idea for code and I think it should work as intended right away, I'm wrong 90% of the time ;)

And I'd say this whole thread would be useful for a newbie to read over, as there are a lot of basic questions answered here. And there will be more to answer until I'm done with the mod.
Title: Re: Decorative plants
Post by: RedKetchup on May 23, 2018, 05:41:12 PM
everything depends if you think and you plan to share those new toolbar with other mods you can do... maybe later ?
if you plan to make another mod that will link things on those new toolbars (then do it in dialog) or it will be the only mod that will use those new toolbars (then do it in UI)

all the toolbars planned to be shared through your 324 future mods, need to be set in dialog and everything of those toolbars need to be included in your next 324 future mods even if you wont use it because it is an house and not a decoration.... because the mods at top of that mod list need to be aware they exist.^^
when i mean by "everything of those toolbars" i mean only the toolbars, not the ferns items :P

and yeah then the anchor will be changed to the new sub toolbar
Title: Re: Decorative plants
Post by: Voeille on May 23, 2018, 05:57:07 PM
324 mods, that sounds ambitious :) Maybe I'll manage that in my lifetime, who knows. I have a short attention span and I switch between the games a lot, usually every few months. For all I've noticed I always come back though, even if it's after a long time. My most recent mod for Sims 2 (it's hardly to call a house built in game a mod, but whatever) was made in July 2017, but it's definitely not the last one and sooner or later I'll go back and make more. And then, after a few months, I'll feel the call to switch games again, and the cycle repeats. Each game I've modded taught me something that is usable in others (or usable in general, like having more experience with 3D modelling), so I think it's overall beneficial :)

What if, say during making my 10th mod, I come up with another general subcategory? Like food/vegan/raw or resources/mines. Do I need to update and recompile all the previous mods?
Title: Re: Decorative plants
Post by: RedKetchup on May 23, 2018, 06:02:38 PM
Quote from: Voeille on May 23, 2018, 05:57:07 PM

What if, say during making my 10th mod, I come up with another general subcategory? Like food/vegan/raw or resources/mines. Do I need to update and recompile all the previous mods?

yes. it needs to be included inside both mods, will need to update old ones because you dont know which mod will be at top in x player name mod list.
he can get some missing icons depending which one on top of the list
Title: Re: Decorative plants
Post by: Voeille on May 24, 2018, 08:03:54 AM
Well, I tried to add the subcategory and one F-key variant. The subcategory works fine, but the F-key variant doesn't, it just isn't in the game. I think I added all needed references but I must've missed something.

Files (https://mega.nz/#!uFgEnBib!-_9P2hREqhYQgeOMLbXc2yIaCymHbzjlH-5nCnVnDdE)
Title: Re: Decorative plants
Post by: Gatherer on May 24, 2018, 08:43:49 AM
I'm just stopping by to say I don't understand half the stuff you people are talking about but I do understand there is progress happening and the pics of these ferns are lovely. When this mod is finished I will definitely download and use it.

Big support from a deco fanatic!
:)
Title: Re: Decorative plants
Post by: Voeille on May 24, 2018, 09:11:58 AM
Thanks! Looking forward to see the plants in your town pictures :)
Title: Re: Decorative plants
Post by: RedKetchup on May 24, 2018, 02:09:21 PM
are you sure you are deleting the /Bin/ and /Build/ folders before EACH time you double click on the Build.bat ?

because i cant even check, cant even compile : it doesnt find the .dds
Title: Re: Decorative plants
Post by: Voeille on May 24, 2018, 02:18:59 PM
I do always delete Bin, and the PKM file in the WinData folder, I didn't know I also need to delete the Build folder.

It compiles fine for me, it finds all the files, it's just that there is only one variant in the game.

Maybe something went wrong with the upload and you have files missing? I deleted it and reuploaded again here (https://mega.nz/#!qNpDkI5C!zwNfXmtnGU9irOhsKStnBtt4OFDkZx_hOuHOxACS2QU).
Title: Re: Decorative plants
Post by: RedKetchup on May 24, 2018, 02:33:59 PM
i saw the .dds in there but it wasnt finding it. i didnt checked the new package yet... but i have a question: di you made a real new mesh for the alternate or you only rotated at your screen and saved ? (if the case , how you sure you did rotated the real world coordinates or just the screen virtual coordinates ? because both exists) (you would have been more sure about your moves if they were really 2 different meshes.)

btw at the begining of your .bat, you can add those 2 lines: (just a fair warning for any other poeple... dont use those if you arent sure you know what you are doing LOL because thats powerful commands and if you arent using those properly, you can delete files that doesnt even go to the recycle bin)


rmdir bin /S /Q
rmdir build /S /Q




like this (your new .bat) :

rmdir bin /S /Q
rmdir build /S /Q
..\..\bin\x64\Tools-x64.exe /build VDecorativePlantsResources.rsc /pathres ../example/VDecorativePlants /pathdat ../example/VDecorativePlants/bin
..\..\bin\x64\Tools-x64.exe /mod Package.rsc:VDecorativePlants /pathres ../example/VDecorativePlants /pathdat ../example/VDecorativePlants/bin
Title: Re: Decorative plants
Post by: RedKetchup on May 24, 2018, 02:39:03 PM
it still doesnt even find the .dds with your new zip files.
gonna change it to a png so i can compile
Title: Re: Decorative plants
Post by: Tom Sawyer on May 24, 2018, 02:42:29 PM
Maybe you did not apply scale after scaling down your F variant and both models are shown in game but just looking the same.
Title: Re: Decorative plants
Post by: Voeille on May 24, 2018, 02:45:44 PM
I rotated it in Blender and scaled it down a bit. To make sure they're really different, I imported the original FBX, then imported the variant FBX on top of it and it's indeed smaller and rotated. (I didn't save that, I just did it to take a look.) I also thought that maybe the mod isn't updating (my laptop is sometimes funny about mods in the mod kit version, I remember with the forest mod I had to reboot the laptop to make it work; but when I added the subcategory it showed properly in game, so I guess it is updating it).

@RedKetchup
Maybe it does need the DDS Utility to be installed to work? But yeah just try PNG, alpha isn't important just for testing the variants.
Title: Re: Decorative plants
Post by: RedKetchup on May 24, 2018, 02:49:34 PM
Quote from: Tom Sawyer on May 24, 2018, 02:42:29 PM
Maybe you did not apply scale after scaling down your F variant and both models are shown in game but just looking the same.

i compiled with the .png version, cant do it with dds

and yeah in game screen both are same. no difference. i think you only scaled / rotated only the virtual screen coords and not the real world in game coords. in 3dsmax we have both, i guess blender can have both too (in 3dsmax i can move it at my screen rotate it , spreading things apart everywhere in my screen without touching the real physical coords and will still the same in the game :P)

as Tom says, probably didnt apply the changes.
Title: Re: Decorative plants
Post by: RedKetchup on May 24, 2018, 02:51:40 PM
Quote from: Voeille on May 24, 2018, 02:45:44 PM
@RedKetchup
Maybe it does need the DDS Utility to be installed to work? But yeah just try PNG, alpha isn't important just for testing the variants.

if some player will use your mod.. will they have to install your .dds utility to use your mod ??
Title: Re: Decorative plants
Post by: Voeille on May 24, 2018, 02:56:43 PM
I don't think they need it just for the mod to work. Could you please test the PKM file (https://mega.nz/#!uQxxACha!7YdG4PRyhWpzNhwEMMj7pfIICUNh2R5lptFj6GO0iOs)? It should work fine except for the variant.

I now suspect that the problem is that I edited the FBX and exported it again. When I was trying to find the right rotation so it didn't show upside-down in the game, no matter how I rotated it it never changed, and I had to edit the OBJ to make it understand I actually did something. I forgot about that. I'll edit the OBJ and see if that works.
Title: Re: Decorative plants
Post by: kid1293 on May 24, 2018, 03:02:35 PM
He did a virtual rotate so -


You HAVE two plants but the reference rotation rotates it back to original position. No change.

First zero out x and y (picture)

Press R (rotate) and press Z (lock to Z axis) and rotate some.
Then Press Control-A and apply rotation. Now the model is rotated for real.
Export and it works (picture2)
Title: Re: Decorative plants
Post by: kid1293 on May 24, 2018, 03:08:13 PM
The same with scale. Assuming you start with scale 1.0

FIRST scale to 0.7. Then APPLY scale. Then make it scale 0.01 and export

Your first fern is 0.010 (correct - goes to scale 1 in game)
Your second is 0.007 (makes it go back to scale 1 in game - no change)
Title: Re: Decorative plants
Post by: RedKetchup on May 24, 2018, 03:11:17 PM
in 3dsmax i always always always export in .obj before i re-import it in the scene to be sure everything fine before exporting to .fbx. (i always use that feature also to help me quickly to merge all my pieces in one single mesh)

this is how i can do such files ( you will see all houses are everywhere but in game they are all at real 0,0,0 )



but you have more control of coords with blender. follow what kid said :)
Title: Re: Decorative plants
Post by: kid1293 on May 24, 2018, 03:15:26 PM
If you want to fix a broken model.

First scale second fern from 0.007 to 0.01 - Goto EDIT MODE and (press S) rescale to what you want
This is immediately applied to model. No need to APPLY after. Export and run

You may have to reposition the model a bit after scaling since it is done around models center
If you scale down the bottom is lifted a bit.
Title: Re: Decorative plants
Post by: Voeille on May 24, 2018, 03:32:45 PM
Thanks, that worked :)

(https://i.imgur.com/KG6Ip8f.png)
Title: Re: Decorative plants
Post by: kid1293 on May 24, 2018, 03:34:09 PM
 :)
Title: Re: Decorative plants
Post by: Voeille on May 24, 2018, 04:23:45 PM
OK I have all the variants :) Now to move on to the next plant.

(https://i.imgur.com/HWrHmyP.png)
Title: Re: Decorative plants
Post by: RedKetchup on May 24, 2018, 04:49:58 PM
sweet awesome :)

good work and good learning :)
Title: Re: Decorative plants
Post by: Voeille on May 24, 2018, 05:30:04 PM
Thanks :)

I have a problem with the other fern (and it could be the case with the first one too but it'd be harder to see on that model). They are both made out of modified double sided planes, but in the game only one side is visible. In Blender both sides are visible normally.
Title: Re: Decorative plants
Post by: Voeille on May 24, 2018, 05:45:41 PM
I think I don't sound clear. This is how it is in Blender:

(https://i.imgur.com/zrY2jaf.png)

(https://i.imgur.com/3XatNpf.png)

And this is how it is in game:

(https://i.imgur.com/Lb1Q3Yz.png)

(https://i.imgur.com/jg0YcFD.png)
Title: Re: Decorative plants
Post by: RedKetchup on May 24, 2018, 06:32:17 PM
planes are always one side, the backhand doesnt count. if your real sides arent on the good sides... you need to "flip" them. if i say "flip" this is because the operation is really called flip :) or at least this is how the action is called in 3dsmax.

so you need to pick up the planes that arent good side and search your menus and ask to do the action to flip them :)
Title: Re: Decorative plants
Post by: Voeille on May 24, 2018, 06:44:47 PM
I already did that when making the model. I started with a plane (single sided, 2 faces), duplicated and flipped it (so it became double sided, 4 faces), and made the model using that. It looks fine in both Sims 2 (https://78.media.tumblr.com/c0a1c411464aa8eefae4ad32abc6ffd2/tumblr_inline_p7t3rvKQfE1udms44_1280.jpg) and CSL (https://steamuserimages-a.akamaihd.net/ugc/863992365462867740/393A67326BD33BA8E0A74395C3C0C874FBE23834/), so the original model is fine. (Those games don't have anything that would automatically fix it, if I imported a model made with one sided planes, then it'd look one sided.) I must've done something wrong while importing it to Banished.

Files (https://mega.nz/#!OBAXSIjI!fYhPPLvoPJTitS8zUL7BsH31ymfmJM2AqKOf8iR_3OU) (It includes the original OBJ before any editing.)

Edit: The original OBJ is straight from Milkshape 3D, so if you open it somewhere, the normals might look off.
Title: Re: Decorative plants
Post by: Voeille on May 24, 2018, 07:06:11 PM
It's the Foliage material. When I changed it to BillboardEvergreen, the model is fine, but for all I can tell there's no wavy animation (which is strange, I thought evergreen has it too), and no snow. I can't tell if the other one had proper snow though (I haven't checked snow after I added UV channels). Will test BillboardEvergreen on the other fern, that one does have AO map working.

(https://i.imgur.com/OpRmTMd.png)

(https://i.imgur.com/aA9KugM.png)
Title: Re: Decorative plants
Post by: Voeille on May 24, 2018, 08:45:19 PM
Right, I think I solved it. I tested the BillboardEvergreen material on the first fern, and that was a no-go. It transformed my model completely:

(https://i.imgur.com/TYcLw6O.png)

And it looked really weird if you rotated the camera. And, no snow.

So the conclusion was:
I wanted proper rendering from evergreen, and snow and no transformation from foliage. So I experimented a bit with the materials and made a custom one that is a mash-up of evergreen and foliage (4 lines from evergreen, 4 lines from foliage), and I ambitiously called it FoliageMaterial1. And it works as intended! I get the animation, snow, and the model without holes.
So this is how the first fern looks now:
(https://i.imgur.com/zrcsO5h.png)

However, in a certain moment of the animation, it moves too much to one side and the shadows look weird:
(https://i.imgur.com/VM0ksCa.png)

I guess I can't do anything about it? Or should I try to apply the normal fix again?

Also, I want to edit the materials even more to get autumn colours from billboard non-evergreen, but keep the rest from foliage. Has it been done? I have a feeling it has, because I think the Tall Greenboy Tree from CC doesn't rotate with the camera (that's the result of the mesh transformation from billboard), but gets the autumn colours.
Title: Re: Decorative plants
Post by: kid1293 on May 24, 2018, 10:04:41 PM
Good Morning! :)
I am sorry but I can not help you with material files. I simply do not understand them.
The weird shadows maybe comes from moving too much? Try a less violent movement.
Change the size of third UV-map. Maybe a little smaller will let you have waves but not too much.

I am very glad you are experimenting with materials. They do give us more options.
Title: Re: Decorative plants
Post by: RedKetchup on May 24, 2018, 11:20:45 PM
only @Bartender was loving to experiment with materials and .srsl files
but didnt mod or came here since a while.
Title: Re: Decorative plants
Post by: Tom Sawyer on May 24, 2018, 11:33:11 PM
I also appreciate working at materials. We have a couple of customs for transparent window glass, moving water and more snow on buildings but as far as I know nothing for better or special plants and there is a lot more to invent for sure.

What I don't understand is what for you want double sided leaves. Nobody can see the bottom in game and removing these faces would optimize your model by incredible 50%. Or do I miss something? Sometimes I add a face on the bottom to solve shadow glitches but I don't see a purpose here.
Title: Re: Decorative plants
Post by: Voeille on May 24, 2018, 11:38:51 PM
It's morning here too, but I stayed up for the whole night (that's completely normal for me, so don't worry), so it's basically evening for me ;)

I played around with the .srsl files (but I definitely wouldn't claim I loved that, and the files wouldn't claim they loved what I tried to do to them ;)), and now I've got what I wanted :) No holes, there's the wavy animation, the model isn't transformed, and the plants change colour in autumn and vanish in winter (they're completely invisible so it's not a good idea to try to place them when there aren't leaves on trees). I might try to experiment with the UV map so there is at least a tiny bit at the bottom left instead of completely invisible.

I paid attention to that shadow and it wasn't just animation, it kind of depended on the camera position, and looked bad in general. I got rid of it in the material code.

(https://i.imgur.com/gFI6Vog.png)

(https://i.imgur.com/hQD2YPz.png)

@Tom Sawyer
The second fern has much taller leaves and they are visible from both sides. So with just one side it really looked broken. I don't have it properly done in Banished yet (it's still sideways), so here (https://steamuserimages-a.akamaihd.net/ugc/863992365462867740/393A67326BD33BA8E0A74395C3C0C874FBE23834/) is a picture from CSL.
Title: Re: Decorative plants
Post by: Voeille on May 24, 2018, 11:41:52 PM
Also, I can influence the animation strength in the code, is it OK or should it be more subtle? Here (https://mega.nz/#!KNJFFKJZ!9FGZ-gIth_t0q60ij98709KW5JmH9yDsMsSa94wRFF0) is the PKM file.
Title: Re: Decorative plants
Post by: Tom Sawyer on May 24, 2018, 11:49:58 PM
Wow, they look nice in autumn. Actually a pity to not have them naturally grown in the forest. I will look at it in game.
Title: Re: Decorative plants
Post by: Nilla on May 25, 2018, 12:36:41 AM
Quote from: Tom Sawyer on May 24, 2018, 11:49:58 PM
Wow, they look nice in autumn. Actually a pity to not have them naturally grown in the forest.

Agree! (And they look great in summer, too. Adds deapth to the picture, even when the color is the same)
Title: Re: Decorative plants
Post by: Voeille on May 25, 2018, 12:02:54 PM
Thanks :) It would be nice to have them generated on the map indeed, however it'd probably impact performance because of the polys.

This is how they look now, with the other model:

(https://i.imgur.com/LX2iOnU.png)

And I decided I'll actually let them vanish completely in winter. The other plants don't have any kind of bottom part so vanishing completely is the other option for them, so the ferns don't need to be different.

Now I'll add the icon and it's time for hydrangea :)
Title: Re: Decorative plants
Post by: Voeille on May 25, 2018, 06:35:43 PM
Hydrangea is ready :) I found it quite annoying that the texture is dependent on what is set in Blender – all colour versions use exactly the same model, yet I had to copy it for each colour separately, change the material name and link to each colour.

(https://i.imgur.com/bMrB5rO.png)

(https://i.imgur.com/P8Hzvn8.png)
Title: Re: Decorative plants
Post by: RedKetchup on May 25, 2018, 07:51:48 PM
they looks great !!!! you are talented :)
Title: Re: Decorative plants
Post by: galensgranny on May 25, 2018, 09:41:55 PM
I'm loving the Hydrangea! The ferns came out great.  :)
Title: Re: Decorative plants
Post by: Voeille on May 25, 2018, 09:44:02 PM
Thanks :)

I have a problem with my tree. I resized the part of the UV map representing the trunk to just a tiny dot like mentioned in this (http://blackliquidsoftware.com/index.php?/topic/1147-moving-with-the-wind/) thread, but it doesn't stop it from disappearing in winter. I want just the leaves to disappear.
Title: Re: Decorative plants
Post by: kid1293 on May 25, 2018, 10:24:13 PM
You have to separate leaves texture with one material and
then have the trunk texture with another material (Foliage?).
Title: Re: Decorative plants
Post by: RedKetchup on May 25, 2018, 10:25:55 PM
the trunk should not swing, not change color, not disappear

what i do, i dont include them in the UV map 3
when i do my UV3, i select all the leaves and fruits and then launch the UV3 mapping

also what Kid said is a very more easy way to do. the trunk texture you keep it opaque material
Title: Re: Decorative plants
Post by: Voeille on May 25, 2018, 11:38:29 PM
How do I go about using a separate material? Do I need to have another group beside 'mesh' with just the trunk? What about .rsc files?

Edit: Meanwhile I finished importing hibiscus (except for icons). There is also a variant without flowers but I forgot to place it. The tree will have more size variants like the rest of the plants after I fix the winter behaviour, and I'll add the large high poly model too.

(https://i.imgur.com/1ugoy5I.png)
Title: Re: Decorative plants
Post by: RedKetchup on May 26, 2018, 12:06:29 AM
no , it needs to form only 1 mesh. banished doesnt accept multi-mesh but accept multi-mat
you will need to have 2 Image.rsc and 2 ImageTextures.rsc like you already do ... but 2 of those (1 for the trunk, 1 for the leaves)
Title: Re: Decorative plants
Post by: Voeille on May 26, 2018, 12:18:51 AM
Let's say I have PongamTree.rsc and PongamTreeTexture.rsc. I will make PongamTreeTrunk.rsc to use a different material, but do I need to have PongamTreeTrunkTexture.rsc if I'm going to refer to the same texture anyway? Or do I need two separate textures, one with invisible leaves and one with invisible trunk? I suppose I also need to create an actual additional material in Blender?

Also, the only reference to PongamTree.rsc is in mesh files:


GraphicsMesh resource
{
String _meshName = "Models\PongamTreeSmall.fbx";
int _instanceCount = 5;

DetailLevel _detailLevel
[
{
float _transitionDistance = 10000.0;
String _subObject = "mesh";
ImageBuffer _image = "Models\MaterialInstance\HydrangeaAO.rsc";
}
]

Skin _skins
[
{
MaterialInstance _materials
[
"Models\MaterialInstance\PongamTree.rsc:damage"
]
}
]
}

(I know it's referring to hydrangea AO, but that's on purpose, they just share the same white file.)

Do I need to change it to:

GraphicsMesh resource
{
String _meshName = "Models\PongamTreeSmall.fbx";
int _instanceCount = 5;

DetailLevel _detailLevel
[
{
float _transitionDistance = 10000.0;
String _subObject = "mesh";
ImageBuffer _image = "Models\MaterialInstance\HydrangeaAO.rsc";
}
]

Skin _skins
[
{
MaterialInstance _materials
[
"Models\MaterialInstance\PongamTree.rsc:damage"
]
}
                {
MaterialInstance _materials
[
"Models\MaterialInstance\PongamTreeTrunk.rsc:damage"
]
}
]
}
Title: Re: Decorative plants
Post by: Tom Sawyer on May 26, 2018, 01:26:45 AM
To have a separate material for parts of your model it should look in blender like this. In a separate mesh added to the main mesh as parent (Ctrl+P) and with its own material. I would make a separate texture file for this material, also for performance reasons.
Title: Re: Decorative plants
Post by: Voeille on May 26, 2018, 01:59:49 AM
Thanks, that worked :)

(https://i.imgur.com/FPlh5AS.png)

(https://i.imgur.com/y3dADY8.png)
Title: Re: Decorative plants
Post by: Nilla on May 26, 2018, 02:37:11 AM
The trees look lovely in summer but strange in winter.
Title: Re: Decorative plants
Post by: Voeille on May 26, 2018, 02:46:26 AM
I know, they'd look much better if I had branches done similarly to birch and oak trees (i.e. some of the foliage planes have bare branches without leaves that stay there for the whole year), but when I was making the model I didn't design it for that, so I'd need to redo it (probably from scratch, because I don't think I have a version with planes still completely separated; for all I remember I made a cluster out of some, regrouped that and used it to make the model), so I'll leave it like that. Or should I make it evergreen? It's a tropical tree so it'd be nice if it stayed evergreen when using CC tropical starts.

Side question – would it be possible to replace the birch tree with my model? I'd like that for the aforementioned tropical starts.

Edit: I think I'll just make separate versions: everything seasonal (like now), everything evergreen, and only with the tree being evergreen (which will probably be default, I'll see how it looks with snow first).
Title: Re: Decorative plants
Post by: kid1293 on May 26, 2018, 03:12:37 AM
It is okay to replace birch. But you have to change some places to get rid of animation or the game crashes.

When you do, try to change only 'ModelDescription model'  and  'NaturalResourceDescription naturalresource'
in NaturalResourceTree.rsc. That way other mods like New Flora can still spawn resources.

Title: Re: Decorative plants
Post by: Voeille on May 26, 2018, 03:44:16 AM
Thanks. I'll take a look at it when I'm finished with the plants :)

I think I'm mostly done. For all I remember I should still have the models for hydrangea and hibiscus with flowers separated, so I think for the evergreen version I'll still make flowers disappear.
Here are the small plants:

(https://i.imgur.com/Xh727Ri.png)

Here are the trees:

(https://i.imgur.com/7dDVcRs.png)

And this is how the trees look in winter without losing leaves. I think it's a lot better than those strange bare models. And they cover with snow, so it's not like they're glaringly bright green.

(https://i.imgur.com/AJzZ6Jh.png)
Title: Re: Decorative plants
Post by: kid1293 on May 26, 2018, 03:56:14 AM
Nice touch!
Winter is so naked otherwise.

I like that snow :)
Title: Re: Decorative plants
Post by: RedKetchup on May 26, 2018, 10:43:31 AM
looking nice :) @Voeille !

i wish to have a very talented henchmen for a model ^^^
it has been a week i am trying to make an orchard, hops plant that is looking not so bad as i tried 2 times so far... but they are ugly as shit^^
Title: Re: Decorative plants
Post by: Willows on May 26, 2018, 12:33:14 PM
I like the idea of pretty snow covered and evergreen trees in the winter. Like kid1293 said earlier, winter looks so bare and lonely with all the dead trees.

Title: Re: Decorative plants
Post by: Voeille on May 26, 2018, 01:01:30 PM
Thanks :) I wish I had thought of making an evergreen version of everything earlier. It will take a while to import all the models with flowers separated.

@RedKetchup
It can't look that bad ;) The problem with crops is that you get a lot of copies of the model placed, so it can't be too high poly. But too low poly doesn't look good for some plants (some are OK, flowerless hibiscus is only 138 polys for all I remember, compared to around 1000 with flowers), and after looking at google images I'd say hops might need a lot (for a crop) to look truly good. I plan to make this (https://www.3dmk.com.au/wp-content/uploads/2015/10/3dmk-TreeLine-Plumeria-rubra-Frangipani_EPR1.jpg) at some point. My model of course won't be as detailed as that example, because a) there's still a lack of skill, and b) the poly count needs to be sane instead of going for a few thousands ;) The large tree in this set has 2586 polys, designed to use sporadically. The less wide one has 1086, so it's a bit better.
Title: Re: Decorative plants
Post by: Voeille on May 26, 2018, 02:44:41 PM
I started making the evergreen version. I wish we could have leaves that turn brown in autumn, but don't vanish, and cover with snow. Maybe it's possible to reach that with the material files.

Anyway, it looks like I need light grey AO instead of white. I'm relying a lot on on-texture shading, and when the texture is covered it looks quite weird. Flowers disappear just fine.

(https://i.imgur.com/eIdzuAt.png)

(https://i.imgur.com/A1bOmym.png)
Title: Re: Decorative plants
Post by: RedKetchup on May 26, 2018, 03:33:39 PM
i dont want it a crop but an orchard that comeback every year, swing with the wind, change color and lose his leaves in winter
Title: Re: Decorative plants
Post by: Voeille on May 26, 2018, 04:36:33 PM
You have a larger more reasonable poly count range for orchards I think. Experiment :)

I think this looks better:
(https://i.imgur.com/3U3NcW3.png)

And even better while snowing, because shadows aren't that strong. I wish we could change shadow opacity. The ones cast on the model are just too strong.

(https://i.imgur.com/x7dNO9K.png)
Title: Re: Decorative plants
Post by: Voeille on May 27, 2018, 06:38:30 AM
Well I think I'm done with the evergreen version. Only flowers disappear, the rest stays for the whole year and covers with snow.

(https://i.imgur.com/NdQszfb.png)

(https://i.imgur.com/1dk2ins.png)

(https://i.imgur.com/nmNNQOa.png)

(https://i.imgur.com/5XT3aqL.png)

(https://i.imgur.com/pOhyfUk.png)
Title: Re: Decorative plants
Post by: Gatherer on May 27, 2018, 06:51:55 AM
Really, really nice.

I prefer the evergreen versions. Will be included in my next town for sure.
Title: Re: Decorative plants
Post by: Voeille on May 27, 2018, 07:12:05 AM
Thank you :) I think I also prefer the evergreen version, might make it default. It's much nicer when winter isn't so barren :)

I edited the ferns a bit, they were too bright with snow.

(https://i.imgur.com/1tqOeZM.png)

(https://i.imgur.com/A57iiuo.png)
Title: Re: Decorative plants
Post by: Voeille on May 27, 2018, 08:04:36 AM
Question – I want to share the mod as 3 PKM files including 3 versions. Here I can I just pack them into a zip, but what about steam? Is it possible to share multiple files as one workshop entry?
Title: Re: Decorative plants
Post by: Tom Sawyer on May 27, 2018, 08:39:36 AM
One pkm = one workshop item on Steam. Maybe to make a decision about your favored variant and write a download link there to alternative versions here or on another website.
Title: Re: Decorative plants
Post by: Voeille on May 27, 2018, 08:53:48 AM
I see. I'll go with the evergreen version as default on steam then.
Title: Re: Decorative plants
Post by: Voeille on May 27, 2018, 02:02:00 PM
Well, I finished everything and shared it here (http://worldofbanished.com/index.php?action=downloads;sa=view;down=434) :) Thanks everyone for your help and patience! My next mod should go more smooth, but I will probably still have questions. I will create another thread for it when needed.

If someone is interested, here are the drawings I made to make textures from (except for ferns, those textures are made with Obsidian Dawn brushes, I linked to them in the download page):

(https://i.imgur.com/Qj6skUq.png)(https://i.imgur.com/d7nNwgQ.png)(https://i.imgur.com/pYn3f1r.png)(https://i.imgur.com/WXiwLZK.png)(https://i.imgur.com/IuJBZgx.png)

They resemble images from google as I can't draw from imagination yet.
Title: Re: Decorative plants
Post by: Willows on May 27, 2018, 02:17:31 PM
I have an idea..if it's not too forward.....

Any interest in making decorative POTTED plants and trees?
Title: Re: Decorative plants
Post by: Voeille on May 27, 2018, 02:23:20 PM
Why not, I might try it at some point :) I've never made a pot, so don't expect wonders though. Well, I've never made anything except those plants, a lamp, a stool and an unfinished chair, so basically everything is going to be new ;)

Another random image – this is how the tree looked initially. Awesome, I know. I should've kept it as the final version.

(https://i.imgur.com/1n9QRqK.png)
Title: Re: Decorative plants
Post by: galensgranny on May 27, 2018, 03:39:09 PM
@Voeille , you drew those from scratch!  Wow!  You are an artist!  :)
Title: Re: Decorative plants
Post by: Voeille on May 27, 2018, 03:45:32 PM
Quote from: galensgranny on May 27, 2018, 03:39:09 PM
Voeille, you drew those from scratch!  Wow!  You are an artist!  :)
I wish to become one eventually :) Now my scope is very limited, and I'm really bad at shapes. Even while looking at an image it can go all wrong. Leaves and flowers are not so bad (especially if I do look at images), but anything more complex is a no-go for now. I hope that eventually I'll be able to draw anything I want, and without looking at any pictures for guidance.
Title: Re: Decorative plants
Post by: Antiligent on June 02, 2018, 03:32:56 AM
Some shadow issues in each versions.
(https://c.radikal.ru/c00/1806/c1/7ca111a81819.png) (https://radikal.ru)
Title: Re: Decorative plants
Post by: Voeille on June 02, 2018, 09:28:12 AM
@Antiligent
Take a look at this (http://worldofbanished.com/index.php?topic=2434.0) thread, the shadow problem is discussed there (page 3 probably).
Title: Re: Decorative plants
Post by: Antiligent on June 04, 2018, 01:33:20 AM
Quote from: Voeille on June 02, 2018, 09:28:12 AM
@Antiligent
Take a look at this (http://worldofbanished.com/index.php?topic=2434.0) thread, the shadow problem is discussed there (page 3 probably).

Your mod isn't working with the Direct X11. Do you have a plan to fix this problem?
Title: Re: Decorative plants
Post by: Voeille on June 04, 2018, 02:36:05 AM
I have no idea how. I suppose the problem is related to custom material files, but my changes were minor and I don't know how they could possibly make the mod dependent on the DX version (there wasn't anything explicit about it in the code), but apparently they did. I'd like to fix it but I'm unable to do so.
Title: Re: Decorative plants
Post by: Antiligent on June 04, 2018, 04:18:23 AM
Quote from: Voeille on June 04, 2018, 02:36:05 AM
I have no idea how. I suppose the problem is related to custom material files, but my changes were minor and I don't know how they could possibly make the mod dependent on the DX version (there wasn't anything explicit about it in the code), but apparently they did. I'd like to fix it but I'm unable to do so.

I wonder how to use this mod with CC? (Which requires DX11 version)
Title: Re: Decorative plants
Post by: elemental on June 04, 2018, 04:36:20 AM
Quote from: Antiligent on June 04, 2018, 04:18:23 AM
I wonder how to use this mod with CC? (Which requires DX11 version)

CC works fine for me with DX9.
Title: Re: Decorative plants
Post by: Voeille on June 04, 2018, 08:02:44 AM
I also use CC (and plenty of other mods, I have 80-100 now), all of them with DX9, no problems noticed. Do I miss anything by not using DX11 in Banished? It was there by default and I just left it, I'm just wondering if there's any significant advantage over DX9 in the game.
Title: Re: Decorative plants
Post by: Tom Sawyer on June 04, 2018, 08:10:45 AM
The significant advantage of DX11 is speed but probably doesn't matter on your machine. :)
Title: Re: Decorative plants
Post by: RedKetchup on June 04, 2018, 12:15:41 PM
i know you want every pixel perfect.... maybe need to find a median setup between pixel perfect and no bug for nobody :)
Title: Re: Decorative plants
Post by: Voeille on June 04, 2018, 12:29:40 PM
But using standard materials either renders models with holes (foliage) or transform the model completely and it doesn't look like what I made any more (billboard). So it'd basically still look like a bug, just a bit different. I'd fix the shadow bug if I only knew how.
Title: Re: Decorative plants
Post by: RedKetchup on June 04, 2018, 12:38:50 PM
Quote from: Voeille on June 04, 2018, 12:29:40 PM
But using standard materials either renders models with holes (foliage) or transform the model completely and it doesn't look like what I made any more (billboard). So it'd basically still look like a bug, just a bit different. I'd fix the shadow bug if I only knew how.

yeah maybe after that fixed...