News:

Welcome to World of Banished!

Main Menu

Creating a 3d model house in blender and making it available in game

Started by Discrepancy, June 26, 2016, 09:24:38 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

RedKetchup

an .fbx doesnt contain any image files inside its .fbx. banished only use the "name" of the .png that is written inside your "light brown boxes" ( inside your screenshot. )


this name should be wriiten exactly the same as you textured your mesh with. In the present case, it suggests you textured your mesh with a .png named Pit_House.png

if the name of your .png isnt really that, this is because you didnt put the good name in the light brown box. Or you rename your .png or you rename your light brown boxes.



and then for making your .png work in banished you need 2 files to tell the toolkit "How to make it work" your .png

here in this case you should have a Pit_House.rsc and a Pit_HouseTexture.rsc that will tell the toolkit how to handle your Pit_House.png
(just take the 2 files from apiary/model/materialinstance and rename those and change the lines inside those to files to match your Pit_House.png)


also in your model/Pit_HouseMesh.rsc and Pit_HouseBuild02Mesh.rsc and Pit_HouseBuild01Mesh.rsc files, there are links too that need to point to your Pit_House.png file. make sure those are renamed properly. Make sure the paths are always good.
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

hadrian900

The mesh uses proper texture that is present in the mod, and files link to it properly.
No .rsc file is suposed to be in folder "model", no file has a link to .rsc file into that folder.

It has following structure: "mod"/models/zem(this is where pit house model and its material are)

I have brushed through .rsc files to see any of them linking to another .rsc in models folder, none has it.

RedKetchup

Quote from: hadrian900 on June 24, 2018, 06:17:21 PM
The mesh uses proper texture that is present in the mod, and files link to it properly.
No .rsc file is suposed to be in folder "model", no file has a link to .rsc file into that folder.

It has following structure: "mod"/models/zem(this is where pit house model and its material are)

I have brushed through .rsc files to see any of them linking to another .rsc in models folder, none has it.

no they should be in the mod/models/MaterialInstance. they cannot be anywhere else, the game will search there by default and no way can be placed elsewhere. (internal link)
make a copy paste of your 3 files (.rsc, Texture.rsc and .png) where the toolkit look for it.


like another example. in my RK Ed , i put all models in /Models/Buildings/folder ( like /Models/Buildings/Lumbermill/ folder, or /Models/Buildings/WoodHouse/ folder)
the toolkit will still look for it at /Models/Buildings/MaterialInstance/ folder no matter what i ll try to put those elsewhere.

the internal link hidden in the game will do a .. go back up 1 folder before and search for a /MaterialInstance/ folder there.
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

hadrian900

But the game is made that specific way.

https://prnt.sc/jz5gur

Where from does the compiler even gets Pit_House.rsc in the first place since NOTHING links to it, nor contains Pit_House.rsc in its code. Aren't we supposed to look at source files and repeat after that?

MaterialInstance resource
{
Material _material = "Material\OpaqueSnow\OpaqueSnowMaterial.rsc";
Texture _textures
[
{
String _name = "diffuse";
ImageBuffer _texture = "Models\Buildings\Chapel\MaterialInstance\ChapelTexture.rsc";
}
{
String _name = "snow";
ImageBuffer _texture = "Terrain\TerrainSnowTexture.rsc";
}
]
}


I have managed to get mod compiled and working At last, but i still don't get many of things.



However the build02 of the new house shows incorrect map or incorrect UV, despite FBX and source file being set correctly

This is how it look like in game


And this is how it looks in 3ds max


.FBX file attached so that you can see the model in editor.

RedKetchup

Quote from: hadrian900 on June 25, 2018, 08:15:41 AM

Where from does the compiler even gets Pit_House.rsc in the first place since NOTHING links to it, nor contains Pit_House.rsc in its code. Aren't we supposed to look at source files and repeat after that?

MaterialInstance resource
{
Material _material = "Material\OpaqueSnow\OpaqueSnowMaterial.rsc";
Texture _textures
[
{
String _name = "diffuse";
ImageBuffer _texture = "Models\Buildings\Chapel\MaterialInstance\ChapelTexture.rsc";
}
{
String _name = "snow";
ImageBuffer _texture = "Terrain\TerrainSnowTexture.rsc";
}
]
}



i know you figured it out, but since you dont get the thing...
you stated in your .FBX  Pit_House (Pit_House.png) as texture !! not Chapel (Chapel.png)

like i said, or you rename your light brown boxes, or you rename your .png

> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

RedKetchup

btw while we are there... Chapel.png is a very very bad name, you will conflict with any Chapel.png that already exist. find a better personalized name for it. like Hadrian900Chapel.png

> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

hadrian900

Quote from: RedKetchup on June 25, 2018, 02:03:18 PM
btw while we are there... Chapel.png is a very very bad name, you will conflict with any Chapel.png that already exist. find a better personalized name for it. like Hadrian900Chapel.png
This is piece of code from game's resource folder. It's the very same chapel that is in the game. I have brought it as example of what would be intuitive to look at to learn how buildings are put into the game.

Why following the game's original files would not work making mod?

RedKetchup

Quote from: hadrian900 on June 25, 2018, 02:17:11 PM
Quote from: RedKetchup on June 25, 2018, 02:03:18 PM
btw while we are there... Chapel.png is a very very bad name, you will conflict with any Chapel.png that already exist. find a better personalized name for it. like Hadrian900Chapel.png
This is piece of code from game's resource folder. It's the very same chapel that is in the game. I have brought it as example of what would be intuitive to look at to learn how buildings are put into the game.

ah ok. did you saw it in your .fbx software ? the Pit_House names ?


redo your AO files have do 1 for your mesh, do 1 for your build02 and do 1 for your build01. 3 seperated AO.png files. and inside your Mesh.rsc, Build01Mesh.rsc, and Build01Mesh.rsc do the links properly in your .rsc to link the new AO.png , Build02AO.png and Build02AO.png
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

RedKetchup

Quote from: hadrian900 on June 25, 2018, 02:17:11 PM
Why following the game's original files would not work making mod?

bah because you dont really know how the chapel.png is.

do you want it ?
this is how it looks:
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

RedKetchup

so if you made a new Chapel.png it will conflict with the real Chapel.png in game. when you will build the real chapel in game, it will use your texture.
i dunno if it can make sense for you.
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

hadrian900

Quote from: RedKetchup on June 25, 2018, 02:30:51 PM
Quote from: hadrian900 on June 25, 2018, 02:17:11 PM
Why following the game's original files would not work making mod?

bah because you dont really know how the chapel.png is.

do you want it ?
this is how it looks:

No, this is not what i was meaning.

The game's original files point to texture files in a SPECIFIC folder, unique to this building, that folder contains only those file that are related to the building. Why following the same instruction, pointing to .rsc file at a chosen folder, would result in an error. Why do we even point to those files to begin with, if builder ignores those instructions and searches for files where it was hardcoded to look for.

RedKetchup

you are drawing your mesh and you apply your own textures. you need to point and use your own modified .rsc files to begin with and that use your own textures !!
or you are running into problems :)
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

hadrian900


Alright, let's try tuning in again.

The game originally has the following structure:

models/building/chapel/materialinstance

Chapel folder would contain .rsc files that refer to those in MaterialInstance which is contained in the same folder.

When you try to make a mod and try to do as the GAME FILES SHOW you to do, it would end up with error.
Why, despite we point inside .rsc files to the SPECIFIC location of textures builder ignores it? Why we even need to do so in the first place if builder is hardcoded to seek for files and textures in only folders it's coded to do.

RedKetchup

the models/building/chapel/materialinstance folder only contain the footprints and the AO files. not the texture.
the game will search the textures there : models/building/materialinstance (it go up 1 dir and check for a /materialinstance/ folder there.)


there is 2 folders named materialinstance and it is messing with you :)
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

hadrian900

Still, why does my model shows wrong UV\texture despite being set correctly?