World of Banished

MODS Garage => Tips and Help => Topic started by: Necora on March 21, 2017, 03:56:43 PM

Title: Changing trees in the naturalresourcetree file... animations??
Post by: Necora on March 21, 2017, 03:56:43 PM
Good eve all (at least, those on the Atlantic seaboard).

I am trying to replace the vanilla trees with my own, by modifying the NaturalResourceTree.rsc to link to my meshes rather than the vanilla meshes. It seems to work fine, for about 20 seconds into a new game when I get a crash. The first crash, something about not enough nodes to update. I figured it was something to do with tree animations, so took that line out of the template file. Same timing for a crash, but this time a fatal access violation with little information. The crashes seem to occur when the leaves are due to appear, but that might be just coincidental.

My tree files have no animation in them, because I could not figure out how to do it from the fig example. Is this why they will not work as natural resources? They work as decorations just fine, and they work when spawned by the forester just fine, but not as a replacement for vanilla trees.

Any help would be appreciated...
Title: Re: Changing trees in the naturalresourcetree file... animations??
Post by: kid1293 on March 21, 2017, 05:29:25 PM

No help, just sympathy.
I've been there for a long time. I was making trees and many times,
again and again I tried to adopt the fig tree animation to my trees.
I tried to remodel the fig tree. I edited the crap out of the rsource files.
Same experience - 20 seconds then crash.
There is something with animation that I don't understand.
There was a mod that made the trees not animate. I didn't test it but I thought about it.
Maybe the animation of an old tree falling down can be somewhere in the code.
Maybe just my bewildered brain playing tricks but I have no solution.  :(
Title: Re: Changing trees in the naturalresourcetree file... animations??
Post by: Necora on March 21, 2017, 05:33:11 PM
@kid1293 thanks, it is so annoying! The strange thing is that the animations code in the NaturalResouceTree.rsc is calling only for the oak mesh for all trees... so I don't know why it doesn't work just replacing my own mesh in there, but why it works for the vanilla pine and birch. Unless it is one of those things that we're not aloud to do anything with. I tried using the wake particle from the trader boat for something else once but it would either refuse to build, even if I copied all files into my own folder, or eventually crash in game.
Title: Re: Changing trees in the naturalresourcetree file... animations??
Post by: kid1293 on March 21, 2017, 05:37:08 PM

;D I thought of making a glowing magical house with crop infestion.
We're crazy, you know. Trying to make a game real.


I bid you good night. Tomorrow is UV mapping and AO mapping (thanks)

Title: Re: Changing trees in the naturalresourcetree file... animations??
Post by: RedKetchup on March 21, 2017, 05:51:01 PM
you took that line out .... but did you closed the animations from your resource file ?

   bool _animated = false;


because if you let the animations ON then you ll need to make all the animations: from frame 1 to 80 the tree is falling one side till at 75 degrees and then from 81 to 150 the trees go down under the ground line level.

you cant let it ON and not ask certain trees have some anim and some doesnt have.
Title: Re: Changing trees in the naturalresourcetree file... animations??
Post by: Necora on March 21, 2017, 06:30:48 PM
@kid1293 sorry about that, or maybe not...  ;)

@RedKetchup you are a GENIUS. Thank you. Now my trees are taking over the map!!!

Title: Re: Changing trees in the naturalresourcetree file... animations??
Post by: RedKetchup on March 21, 2017, 06:38:09 PM
Quote from: Necora on March 21, 2017, 06:30:48 PM
@kid1293 sorry about that, or maybe not...  ;)

@RedKetchup you are a GENIUS. Thank you. Now my trees are taking over the map!!!

np :)
we help each other all the time :)

your forest is looking so great !!!
can you tell me each tree has how many poly and triangles ?

they are looking so awesome , i dont see the purpose anymore of all my things i am making lately... (out of learning) ^^
mine have all between 1500 and 5000 :(
Title: Re: Changing trees in the naturalresourcetree file... animations??
Post by: Necora on March 21, 2017, 07:25:08 PM
@RedKetchup  Well let's have a look... I have not yet gone through and seen if i can reduce them in anyway, that needs to be done now I've got them looking OK.

Small maple variant = 488 faces/952 triangles
Large maple variant = 401 faces/790 triangles

Birches range from 410 faces/796 triangles to 616 faces/1,220 triangles

Aspens range from 308 faces/610 triangles to 546 faces/1,068 triangles

All 4 firs have the same, 343 faces/676 triangles

Spruce range from 205 faces/400 triangles to 325 faces/640 triangles

And the white pines 720 faces/1,386 triangles to a whopping 1,916 faces/3,706 triangles.

Most are OK, I would aim for less than 500, but would not mind a few bellow 1,000. Most need some pruning, especially that monster of a white pine.
Title: Re: Changing trees in the naturalresourcetree file... animations??
Post by: RedKetchup on March 21, 2017, 07:31:37 PM
maybe the 1,916 faces/3,706 triangles....

everything else dont touch them that more less than expected !!
mine have 1500-5000 !! and i cannot do better . i see nothing cause all these stupid planes. i get headache asap i try to understand what i am seeing :(

so if these number are ... thats super fine and in game they look gorgeous :)
i guess i ll go do something else ^^

but still happy of all these testings :)
Title: Re: Changing trees in the naturalresourcetree file... animations??
Post by: Necora on March 21, 2017, 07:58:23 PM
@RedKetchup how do you make yours? The maples initially were a real pain, I want crazy on the leaves and so had so many faces I ended up scrapping the whole thing and starting again.

The way I did this version, was to start off with a simple 6 sided cylinder extended a few times to make the trunk.

Then I put that to the side, and made a new object that consisted of 1 face, loop cut a few times for a but of curve, then give it a branch texture. Those trees you made and showed, the high def willow, I made the same thing using the sap generator in blender. I gave it a bark texture, then rendered it for the image which I use as the branch texture in this tree. I then put a few simple faces around it, for leaves.

Then, in object mode, I take the branch/leaf object, duplicate it, and each time arrange it around the trunk. I find it easier to keep all branches in objects, then join them all together at the end when they are in the right place. That way you don't get overwhelmed by hundreds of faces in 1 object and can easily adjust individual branches when they are separate objects. Unfortunately, I forgot to save these when I joined them all together, so pruning now will be a headache  :-[

I could probably save some triangles by merging the leaves and branch into 1 texture, then just subdividing it a few times, but that might loose too much of the definition in the tree. It just doesn't look so good when all of the branches are relatively flat.


Title: Re: Changing trees in the naturalresourcetree file... animations??
Post by: RedKetchup on March 21, 2017, 10:00:44 PM
bah i was using a special feature in 3dsmax to make foliage. that tool is great but does alot of poly. i deleted everything i made. really not satisfied.

or i abandon all that or i decide to make a pack which we can call it "high rez" i think with meshes between 3500 and 5000. and it would ask to warn people they need a very good computer to handle these :P
i cannot do better. the thing is i am getting headach with all these stupid planes everywhere. if at least they would show only the leaves and let the transparent parts of the .png being invisible.... maybe i would see something :P
Title: Re: Changing trees in the naturalresourcetree file... animations??
Post by: kid1293 on March 21, 2017, 11:48:36 PM
Good Morning!

Yes @RedKetchup I took that line out and I have made several trees with billboards
that replace the vanilla trees. No crash, but they are not animated!  >:(
That was what I tried to say. I simply can not make ANY animation work in Banished.
It won't compile, or if it does there's been so much editing of the mesh that it does not work.
Title: Re: Changing trees in the naturalresourcetree file... animations??
Post by: RedKetchup on March 22, 2017, 02:32:44 AM
i think it has to do with a root thing. it seems to call** the "root" instead of "mesh"
maybe it can be the problem ?


** EDIT : fixed a typo sorry happends to me too often
Title: Re: Changing trees in the naturalresourcetree file... animations??
Post by: Bartender on March 23, 2017, 09:41:36 AM
@kid1293 are you using Blender by chance? I have noticed that blender does not import and/or export the animations correctly with fbx files. It's probably something with the settings, but I have no idea how to fix it.
Title: Re: Changing trees in the naturalresourcetree file... animations??
Post by: kid1293 on March 23, 2017, 11:29:29 PM

@Bartender - Yes I use Blender and I have had several problems
which I have found ways to go around, but animations...
That's a completely different thing. It is not Blender only who is to blame.
It seems like Luke has his very own approach to animations.
I can not rig a mesh, but with already set models the modkit does not compile the code.

There are different ways to animate. Luke uses a bottom plane (or planes)
to have as reference points for motion. And somehow the root bone is not standard.
That can be Blender. I have no experience.
You are welcome to try. Even the smallest progress with animations can clear the way
for using them in Banished. First I'm thinking windmills and water mills. And a lot of
animals waiting to come alive.

Another thing is where to put the code. Luke has not left any insert points so we are
probably left with animating things all the time. There are no on/off switches.
I wish for a script language to be used with Banished where things could be called based
upon certain criteria.
Title: Re: Changing trees in the naturalresourcetree file... animations??
Post by: RedKetchup on March 23, 2017, 11:51:34 PM
Luke had no idea to make animations ^^

he did a certain way and made the code to make work his attempts lol
Title: Re: Changing trees in the naturalresourcetree file... animations??
Post by: kid1293 on March 24, 2017, 01:54:51 AM
Yes, you're right. He wrote the graphics code himself,
that's why we can't get standard stuff into it. Sad facts.  :(
There are so many nice animated models out there I want to use.
Title: Re: Changing trees in the naturalresourcetree file... animations??
Post by: RedKetchup on March 24, 2017, 05:40:33 AM
Quote from: kid1293 on March 24, 2017, 01:54:51 AM

There are so many nice animated models out there I want to use.

no kidding :(
all the animated animals !!
Title: Re: Changing trees in the naturalresourcetree file... animations??
Post by: kid1293 on March 24, 2017, 08:40:40 AM
Can we mail Luke and ask for advice?
Title: Re: Changing trees in the naturalresourcetree file... animations??
Post by: RedKetchup on March 24, 2017, 08:49:15 AM
Quote from: kid1293 on March 24, 2017, 08:40:40 AM
Can we mail Luke and ask for advice?

oh try !

support@shiningrocksoftware.com
Title: Re: Changing trees in the naturalresourcetree file... animations??
Post by: embx61 on March 24, 2017, 11:42:30 AM
Hi guys
long time not see.

Had a long break from modding but I am slowly trying to come back to it.

ShockPuppet did some animations on some animals in CC so there must be a way to do it with a purchased animal. ( I guess that BL bought the animals)
I purchased an animated wild boar mesh a good while ago but was not able to make chocolate out of it so send the files to Kralyerg so BL could use it but it seems like they not get it to work. (yet) as it is months ago I send the files and did not hear anything yet.

No big deal as the mesh was pretty cheap but my guess is that Shock must have found a way to put some animated animals in the game.
Title: Re: Changing trees in the naturalresourcetree file... animations??
Post by: RedKetchup on March 24, 2017, 12:37:17 PM
Quote from: embx61 on March 24, 2017, 11:42:30 AM
Hi guys
long time not see.

Had a long break from modding but I am slowly trying to come back to it.

ShockPuppet did some animations on some animals in CC so there must be a way to do it with a purchased animal. ( I guess that BL bought the animals)
I purchased an animated wild boar mesh a good while ago but was not able to make chocolate out of it so send the files to Kralyerg so BL could use it but it seems like they not get it to work. (yet) as it is months ago I send the files and did not hear anything yet.

No big deal as the mesh was pretty cheap but my guess is that Shock must have found a way to put some animated animals in the game.

oh yeah but he had to delete everything but the animal and redo everything, like the cows i bought. was animated, got to delete and redo the skellie (bones) and then redo the animations frames.

yes it is possible but the way it works for banished is not the same as usual
Title: Re: Changing trees in the naturalresourcetree file... animations??
Post by: Bartender on March 24, 2017, 03:18:08 PM
So essentially, unless Shock decides to sit down for a week to write us an extensive tutorial, we're not going to get anywhere?
Title: Re: Changing trees in the naturalresourcetree file... animations??
Post by: RedKetchup on March 24, 2017, 03:20:56 PM
Quote from: Bartender on March 24, 2017, 03:18:08 PM
So essentially, unless Shock decides to sit down for a week to write us an extensive tutorial, we're not going to get anywhere?

we are not going anywhere :(

unless you are enough intelligent to understand how luke make it work (and shock succeed to make it work as Luke did)
personally my IQ is not enough big to understand ^^
Title: Re: Changing trees in the naturalresourcetree file... animations??
Post by: RedKetchup on March 26, 2017, 01:43:38 AM
so since i am making some trees for the asian theme....

and i was looking at the animation part...



so far personally ....

the toolkit accept my code... the toolkit doesnt bug me but .... the falling animation isnt happening in game

oh and in my resource file the animation is ON:

ModelDescription model
{
    MeshGroup _meshes
    [
        {
            AnimationGroup _animations = "Models\JapaneseBambooTree1Anims.rsc";
            GraphicsMesh _mesh [ "Models\JapaneseBambooTree1Mesh.rsc" ]
        }
    ]

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


and



    bool _animated = true;
    Time _preAnimateTime = 6.0;
    Time _postAnimateTime = 3.0;   
    ToolType _toolType = Axe;






my tree anim file set 3 points:

AnimationGroup resource
{
    Animation _animations
    [
        {
            String _meshName = "Models\JapaneseBambooTree1Mesh.rsc"; String _sourceName = "Models\JapaneseBambooTree1.fbx";
            String _name = "Fall";
            int _startFrame = 0;
            int _endFrame = 60;
            float _rate = 15.000000;
            bool _looping = false;
        }
        {
            String _meshName = "Models\JapaneseBambooTree1Mesh.rsc"; String _sourceName = "Models\JapaneseBambooTree1.fbx";
            String _name = "Sink";
            int _startFrame = 60;
            int _endFrame = 150;
            float _rate = 15.000000;
            bool _looping = false;
        }
        {
            String _meshName = "Models\JapaneseBambooTree1Mesh.rsc"; String _sourceName = "Models\JapaneseBambooTree1.fbx";
            String _name = "Remove";
            int _startFrame = 0;
            int _endFrame = 150;
            float _rate = 15.000000;
            bool _looping = false;
        }
    ]
}



it find the Fall and the Remove at 0 , and the Sink at 60.
and this is probably why it doesnt bug me when i compile but ....


in game ... the tree disappear and it is not actually falling



for info at 60 = screen 2 , at 90 = screen 3 and at 150 = screen 4.



i dunno what i am missing
Title: Re: Changing trees in the naturalresourcetree file... animations??
Post by: Necora on March 26, 2017, 05:23:17 AM
@RedKetchup  that is similar to what I did for my first bunch of trees, linked them to my own anims file. I think the maple tree I made was using the fig example and still had the camera and things from that. This meant it didn't crash, but wasn't animated.
Title: Re: Changing trees in the naturalresourcetree file... animations??
Post by: Bartender on March 31, 2017, 12:47:18 AM
I applaud your bravery for trying to figure this out @RedKetchup  ;).

I expect that the only way it will work is if you use the exact same way of animating as Luke used in the originals. I don't understand much of 3DSMax, but it seems that your models don't have a bone structure? From what I could see in the FigTree.fbx, his trees seem to have bones.


Title: Re: Changing trees in the naturalresourcetree file... animations??
Post by: RedKetchup on March 31, 2017, 08:29:37 AM
Quote from: Bartender on March 31, 2017, 12:47:18 AM
I applaud your bravery for trying to figure this out @RedKetchup  ;).

I expect that the only way it will work is if you use the exact same way of animating as Luke used in the originals. I don't understand much of 3DSMax, but it seems that your models don't have a bone structure? From what I could see in the FigTree.fbx, his trees seem to have bones.

i dont know, when i load figtree.fbx i dont see bones. usually 3dsmax should show them to me :S
unless it is again a non conventionnal .... bones :S
Title: Re: Changing trees in the naturalresourcetree file... animations??
Post by: Bartender on March 31, 2017, 09:11:37 AM
That's odd, when I load it in Blender it does show me an armature (see the screenshot).
Title: Re: Changing trees in the naturalresourcetree file... animations??
Post by: RedKetchup on March 31, 2017, 09:38:27 AM
i dont :(

certainly not a conventionnal one
Title: Re: Changing trees in the naturalresourcetree file... animations??
Post by: Necora on March 31, 2017, 07:24:23 PM
When I open in Blender I see everything but also get this error...

No idea what any of it means.