Author Topic: Creating a 3d model house in blender and making it available in game  (Read 70441 times)

0 Members and 1 Guest are viewing this topic.

Offline RedKetchup

  • Champion
  • Banished Expert
  • *****
  • Posts: 11152
Re: Creating a 3d model house in blender and making it available in game
« Reply #45 on: June 24, 2018, 05:32:27 PM »
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 .

Offline hadrian900

  • Laborer
  • **
  • Posts: 28
Re: Creating a 3d model house in blender and making it available in game
« Reply #46 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.

Offline RedKetchup

  • Champion
  • Banished Expert
  • *****
  • Posts: 11152
Re: Creating a 3d model house in blender and making it available in game
« Reply #47 on: June 24, 2018, 06:47:33 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.
« Last Edit: June 24, 2018, 06:52:22 PM by RedKetchup »
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

Offline hadrian900

  • Laborer
  • **
  • Posts: 28
Re: Creating a 3d model house in blender and making it available in game
« Reply #48 on: June 25, 2018, 08:15:41 AM »
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?

Code: [Select]
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.

https://i.imgur.com/OiQuFSa.jpg
Creating a 3d model house in blender and making it available in game


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
https://i.imgur.com/FfgNaVR.jpg
Creating a 3d model house in blender and making it available in game


And this is how it looks in 3ds max
https://i.imgur.com/5x9c7B8.jpg
Creating a 3d model house in blender and making it available in game


.FBX file attached so that you can see the model in editor.
« Last Edit: June 25, 2018, 11:03:58 AM by hadrian900 »

Offline RedKetchup

  • Champion
  • Banished Expert
  • *****
  • Posts: 11152
Re: Creating a 3d model house in blender and making it available in game
« Reply #49 on: June 25, 2018, 01:42:59 PM »

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?

Code: [Select]
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

https://i.imgur.com/7kPuXiJ.png
Creating a 3d model house in blender and making it available in game
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

Offline RedKetchup

  • Champion
  • Banished Expert
  • *****
  • Posts: 11152
Re: Creating a 3d model house in blender and making it available in game
« Reply #50 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

« Last Edit: June 25, 2018, 02:19:15 PM by RedKetchup »
> > > Support Mods Creation developments with Donations by Paypal  < < <
Click here to Donate by PayPal .

Offline hadrian900

  • Laborer
  • **
  • Posts: 28
Re: Creating a 3d model house in blender and making it available in game
« Reply #51 on: June 25, 2018, 02:17:11 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?

Offline RedKetchup

  • Champion
  • Banished Expert
  • *****
  • Posts: 11152
Re: Creating a 3d model house in blender and making it available in game
« Reply #52 on: June 25, 2018, 02:19:03 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 .

Offline RedKetchup

  • Champion
  • Banished Expert
  • *****
  • Posts: 11152
Re: Creating a 3d model house in blender and making it available in game
« Reply #53 on: June 25, 2018, 02:30:51 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 .

Offline RedKetchup

  • Champion
  • Banished Expert
  • *****
  • Posts: 11152
Re: Creating a 3d model house in blender and making it available in game
« Reply #54 on: June 25, 2018, 02:35:12 PM »
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 .

Offline hadrian900

  • Laborer
  • **
  • Posts: 28
Re: Creating a 3d model house in blender and making it available in game
« Reply #55 on: June 25, 2018, 02:37:25 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.

Offline RedKetchup

  • Champion
  • Banished Expert
  • *****
  • Posts: 11152
Re: Creating a 3d model house in blender and making it available in game
« Reply #56 on: June 25, 2018, 02:48:30 PM »
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 .

Offline hadrian900

  • Laborer
  • **
  • Posts: 28
Re: Creating a 3d model house in blender and making it available in game
« Reply #57 on: June 25, 2018, 03:05:58 PM »
https://i.imgur.com/fMNBa7x.jpg
Creating a 3d model house in blender and making it available in game

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.

Offline RedKetchup

  • Champion
  • Banished Expert
  • *****
  • Posts: 11152
Re: Creating a 3d model house in blender and making it available in game
« Reply #58 on: June 25, 2018, 04:36:52 PM »
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 .

Offline hadrian900

  • Laborer
  • **
  • Posts: 28
Re: Creating a 3d model house in blender and making it available in game
« Reply #59 on: June 27, 2018, 05:41:25 AM »
Still, why does my model shows wrong UV\texture despite being set correctly?