FEATURE INFO Modding models for blocks

Discussion in 'FAQ & Feedback' started by Pantera, Dec 17, 2020.

  1. Pantera

    Pantera Administrator Staff Member

    • Developer
    • Moderator
    Joined:
    Aug 15, 2016
    Messages:
    3,226
    Likes Received:
    5,654
    How to load the Example Project:
    1. Start Unity ( install Unity 2022.3.22f1 from https://unity3d.com/get-unity/download/archive )
    2. Select the Example Project Folder and start it with Unity 2022.1.24f1
    3.1 If you want to check out how Rotation for your Blocks work, go in your Project View (bottom left default), click on SuitPropsExt and drag and drop the SnowmanHead2 into your Hierarchy window.
    3.2 Expand the SnowmanHead2 package and click on the Spotlight object.
    3.3 In your Inspector (CTRL + 3) you see at the bottom the Script, which lets a spotlight rotate around the Y-axis

    image_2020_12_12T15_53_44_723Z.png

    4.1 If you want to check out how Particles for your Blocks work, go in your Project View, click on BlockModels and drag and drop the BigFlowerPrefab2 into your Hierarchy
    4.2 Click on the BigFlowerPrefab2 package in your Hierarchy.
    4.3 In your Inspector (CTRL + 3) you see at the bottom the Script, which lets Particles spread, once you activate the Block / Structure

    image_2020_12_12T15_53_34_574Z.png

    How to export your custom model (for the head):
    1. Put your 3D model (.fbx or .glb file for example) in your SuitPropsExt folder
    2. Go to your Unity project, it will show up in your Project Folder/SuitPropsExt automatically
    3. Drag and Drop your Model to your Hierarchy
    4. Normalize your Position and Rotation of your main object
    5. Move the child object inside that object to the desired location (test in game how it must be)
    6. Once ready, drag and drop the Object from the Hierarchy back to your Project Folder/SuitPropsExt
    7. Now click at the top menu at "EmpTools" and "Build Bundles"
    8. Copy the two exported files in your Bundles folder. For example suitpropsext and suitpropsext.manifest and paste it in Content/Scenarios/YourScenario/SharedData/Content/Bundles/suitprops
    9. Reference your head model in the ItemsConfig.ecf with the Property "PropHead: YourPrefabNameFromTheUnityHierarchy"
    11. the property Shape in BlocksConfig.ecf needs to be set to ModelEntity for them to work (Shape: ModelEntity)

    How to export your custom model (for a block):
    1. Put your 3D model (.fbx or .glb file for example) in the folder Assets/BlockModels in the extracted project
    2. Go back to Unity, the model will show up in your Project Folder under BlockModels automatically
    3. Drag and Drop your Model to your Hierarchy
    4. If you want to offset your model, you need to create an empty GameObject and parent the model as child to it
    5. Move, rotate and scale this child object object to the desired location (test in scene view how it looks)
    6. The model will be positioned in the game at the position of the block. For BA/CV it will be scaled by 2, for SV/HV it will be scaled by 0.5. So f.e. 1 meter in Unity is 2 meters in a BA.
    6. Once ready, drag and drop the main GameObject from the Hierarchy back to your Project Folder/BlockModels. The name of this GameObject will be the name you need to specify in the BlocksConfig.ecf. Please make sure to not have a second object (like a material) with the same name.
    7. Now click at the top menu at "EmpTools" and "Build Bundles", this will create a bundle named blockmodels in the folder Bundles under the main project.
    8. Copy the two exported files in your Bundles folder. For example blockmodels and blockmodels.manifest and paste it in Content/Scenarios/YourScenario/SharedData/Content/Bundles/
    9. Reference your block model in the BlocksConfig.ecf with the Property "Model: @blockmodels/YourPrefabNameFromTheUnityHierarchy"
    10. Note that colliders need to be on top level of the prefab. Also the Collide property in BlocksConfig.ecf must either be not set or contain 'movement' for blocking the player movement
    11. The property Shape in BlocksConfig.ecf needs to be set to ModelEntity for them to work (Shape: ModelEntity)

    download here

    How to make your Blocks colorable ? :

    1. Put the shader file from this location:
    BlockModelsAndSuitPropsModding\Assets\BlockModels\AlienFlora\Models beside your model file (e.g. .fbx)
    2. Choose the Shader in the Inspector: EmpShader/Example Block Colored
    3. Set as Color Mask a white image. White = colorable
    4. Build
    5. Set in your BlocksConfig.ecf: theIsColorable: true for your custom block


    How to make your Blocks Light Up ? :


    3.png

    1. Put the shader file from this location:
    BlockModelsAndSuitPropsModding\Assets\BlockModels\AlienFlora\Models beside your model file (e.g. .fbx)
    2. Choose the Shader in the Inspector: EmpShader/Example Block Colored
    3. Set an Emisive Texture with the parts that you want to light up
    4. Use the following tags in the BlocksConfig "IsAccessible: true, IsActivateable: true , EnergyIn: 1"
     

    Attached Files:

    #1
    Last edited by a moderator: Jun 18, 2024
  2. Kassonnade

    Kassonnade Rear Admiral

    Joined:
    May 13, 2017
    Messages:
    2,819
    Likes Received:
    4,113
    Mega-cool. :cool:
     
    #2
    ravien_ff likes this.
  3. ravien_ff

    ravien_ff Rear Admiral

    Joined:
    Oct 22, 2017
    Messages:
    6,274
    Likes Received:
    11,936
    This is a huge step forward.
     
    #3
    Lyceq, byo13 and Myrmidon like this.
  4. Vermillion

    Vermillion Rear Admiral

    Joined:
    Jul 15, 2018
    Messages:
    3,258
    Likes Received:
    8,932
    I've spent the last few hours trying to get a single unity store asset into the game to no avail. I couldn't even get it out of Unity.
    The instructions make no sense and half the things designated don't exist or don't work. (e.g. click "EmpTools" and "Build Bundles" does nothing. You click it and nothing happens.), followed by doing something with exported files that don't exist because exporting wasn't covered and build bundles didn't work. The only exporting possible turns the files into a Unity package which is NOT what i'm supposed to be getting. So once again, wrong.
    Even just "moving object around and positioning them" is a pointless task without a point of reference or scale. An imported ship asset could be 10km wide or 200 meters away for all anyone knows. Then there's the colliders mentioned, which needs them to be on the top level of the prefab, whatever/wherever those are, however you do that.
    Steps are missing and the example file is simply unusable as an example. An example shows you a functioning end result that you can replicate, but this doesn't even have functioning component parts, letalone a finished whole.

    The only people that could manage these things will have gone through Unity from start to finish, ostensibly to make their own game. In which case they wouldn't be here, they'd be making their own game.
    You don't go through a month-long training course in Unity just to add assets to someone else's game. You do that to make your own.
     
    #4
    zaphodikus, Khazul and ravien_ff like this.
  5. SteveEmpyrion

    SteveEmpyrion Lieutenant

    • Developer
    Joined:
    Oct 25, 2016
    Messages:
    23
    Likes Received:
    62
    Hey Vermillion, sorry to hear that you have problems importing your own block models. I saw the description above had some errors so I corrected them.

    You should have at least small knowledge of how to position, rotate or scale an object in Unity. Also knowing what a prefab is, what the hierarchy or the project window in Unity are for, helps. But you do not need to have more Unity experience, let a alone being a professional.

    Regarding scale: the scale of your imported object in Unity will be used in the game. 1 meter will be 1 block in the game. You don't need to position the imported object at the Unity origin as the game sets the position of the parent transform to the position of the block. However if you want to offset your object, you need to add this offset to a child GameObject. I corrected the description from above.

    Would you mind trying the example project - it should really work - and give feedback at what step you failed? After that we can try importing your (big) model.
     
    #5
    Germanicus, Lyceq, Sofianinho and 3 others like this.
  6. Vermillion

    Vermillion Rear Admiral

    Joined:
    Jul 15, 2018
    Messages:
    3,258
    Likes Received:
    8,932
    No problems involved now. However, when it comes to moving, rotating and scaling the object. Without a point of reference, any actions are pointless. Which is solved with Game Object > 3D Object > Cube to spawn in a cube. Set the transformation values to 0 to put it at the center point of the endless void and now you have a frame of reference for a block with which to align the prefab to.
     
    #6
    Lyceq, SteveEmpyrion and ravien_ff like this.
  7. RexXxuS

    RexXxuS Rear Admiral

    Joined:
    Jan 31, 2016
    Messages:
    859
    Likes Received:
    1,434
    Dear Modders,
    I wish you a Happy New Year 2021 and as motivation for the next year I want to share a little "what is possible" video with you regarding modding models/blocks.



    With the new addition of the SharedData folder, with the ability to create your own blocks, models the game became even more awesome.

    In this case, I bought a firework package from the Unity Asset Store, imported it in my Unity Project, modelled my little Firework Box in Blender (you can also just take a Cube) and map it with the bought Firework package.

    upload_2020-12-31_19-36-58.png

    upload_2020-12-31_19-36-1.png


    If you are interested, I can also do a Tutorial video how to do all of that - I would like to do it and it is really not that difficult as some might think :)

    Either way, there is much more possible and only your creativity is the boundary.

    Take care
     
    #7
  8. Kassonnade

    Kassonnade Rear Admiral

    Joined:
    May 13, 2017
    Messages:
    2,819
    Likes Received:
    4,113
    I think it's actually more difficult to simply make a new block in the configs than making prefabs in Unity...

    Who is "Eric" and what is he doing with the "rocks" ? ... :p

    Long story short : some of the comments in the BlocksConfig.ecf are obscure, I can't see if they are directed at us (players/ modders) or at someone at Eleon, so trying to figure out precisely what they mean is guesswork. There is a new "experimental" section at the bottom of the file, where it is written to "put all new blocks here". Is that the "new rule" for custom blocks ? Can we simply replace any "available, free" ID numbers with our own stuff ? If any changes come in the future to these IDs, we will need to assign another ID to our block ?

    Just from the top of my head. Maybe some of these informations were "given" on other channels than the forum, but I have no clue, just speculating here. A simple example : we were told to put our "modded configs" in the "Mods" folder. So I make a "clone" of an object (toilet block) at ID number #782 ( I removed the "+" before the ID number) change the model and give it a custom icon, and it's not showing in game. But if I do the same modification in the BlocksConfig of the "main game" it works. Should we then ignore the directive to put our mods in the Mods folder ?

    So yes, @RexXxuS , I would appreciate if you could give us a quick and dirty run on this, and some pointers about the BlocksConfig.ecf "rules" if you know about these.

    .
     
    #8
    Last edited: Dec 31, 2020
    zaphodikus likes this.
  9. Taelyn

    Taelyn Guest

    Just internal Comments. You can ignore those

    You can either Copy the Original Files to Content/Mods
    or to ScenarioName/Content/Configuration

    This way a Game Update wont undo your changes

    Where in the file you put your blocks doesnt matters. The comments are Internal Stuff since there the same files we use to build the game. We have a certain workflow
     
    #9
    Kassonnade likes this.
  10. Kassonnade

    Kassonnade Rear Admiral

    Joined:
    May 13, 2017
    Messages:
    2,819
    Likes Received:
    4,113
    Like I wrote, the changes are not taken into account if I only mod the file in "Mods" folder. So this is essentially just a "backup" location ?

    Anyways, nothing urgent here. Unity keeps hiding the inspector when I boot it, one time out of two... Did I say I hate Unity ?

    .
     
    #10
  11. LiftPizzas

    LiftPizzas Rear Admiral

    Joined:
    Sep 28, 2015
    Messages:
    1,434
    Likes Received:
    2,573
    I'd really love a tutorial video.

    Also I'd love to get a 3-d model for binoculars if someone wants to make one. ;) I added binocs (and a custom 2-d icon) and they work great, but the 3-d model for them has to be one of the existing scoped guns, in order to have the scope overlay and the range-indicator functionality. (Otherwise it just does an FOV change to produce zoom.)

    Binoculars demonstration:
     
    #11
    SacredGlade and Kassonnade like this.
  12. Kassonnade

    Kassonnade Rear Admiral

    Joined:
    May 13, 2017
    Messages:
    2,819
    Likes Received:
    4,113
    I'm not sure we can make models for "items" as it seems to be only for "blocks" that have the "Shape: ModelEntity" tag in the config. Do you want the binoculars as "props" for the player model ?

    Nevertheless, I followed the "wrong" instructions for a few days before noticing that some had changed. I saved the (bad) web page/ 1st post for offline use and I kept banging my head on the wall because I could not get any texture on my block in game. I could get a nice prop with proper skinning, but no simple "texture" on a basic cube in the "export your blocks" procedure. Arg...

    Now it seems ok, following all steps works fine. Thanks to whoever made the changes. I can even skip the janky FBX export and simply copy a .blend file in there, then import textures after from Unity's import menu, and it fixes texture/ normal maps assignations for me.
     
    #12
    Taelyn likes this.
  13. Taelyn

    Taelyn Guest

    No you cant mod Items yet. Only Blocks & SuitProps
     
    #13
    Last edited by a moderator: Jan 1, 2021
  14. Taelyn

    Taelyn Guest

    Ill check it out tomorrow since it should work from the Mods Directory.

    Your not alone in that. I curse atleast 10 times per day at Unity :D:D:D
     
    #14
  15. Kassonnade

    Kassonnade Rear Admiral

    Joined:
    May 13, 2017
    Messages:
    2,819
    Likes Received:
    4,113
    I saw the dependencies in the blockmodels.manifest, after using the 1st procedure, and it pointed to the "props" folder in Unity. That was why I could not get any texture to follow, by dropping the model in one folder and making the "prefab" in another. So I just tried dropping all in the blockmodels folder and it worked. Only after trying this did I come here and see that the instructions were changed to reflect this... :cool:

    But Unity boasts of "finding all your assets by extensively searching everywhere"... which it failed miserably here.
     
    #15
  16. Taelyn

    Taelyn Guest

    Ive just tested my custom BlocksConfig to the Mods Folder and its read fine in the Default Game

    1.png
     
    #16
    Kassonnade likes this.
  17. LiftPizzas

    LiftPizzas Rear Admiral

    Joined:
    Sep 28, 2015
    Messages:
    1,434
    Likes Received:
    2,573
    So does this mean we can make additional armor suits (e.g a dedicated EVA suit) and alternate-material blocks (e.g. aluminum or titanium or glass blocks)
     
    #17
    zaphodikus likes this.
  18. Taelyn

    Taelyn Guest

    No

    SuitProps are assets on your head. Like the ChristmasHat or the SnowManHead we added.
    They get added ontop of your suit. You cant modify the actual suit or any Asset from the ItemsConfig

    BlockModels are mostly Decoration Items you can do. Or a new Constructor. (No Turrets)
     
    #18
    Kassonnade, Vermillion and LiftPizzas like this.
  19. Kassonnade

    Kassonnade Rear Admiral

    Joined:
    May 13, 2017
    Messages:
    2,819
    Likes Received:
    4,113
    Well... technically, if it can be "on the player" even if "just on the head"... hem...

    NewGame_16_2021-01-01_20-33-47.png

    :D

    .
     
    #19
  20. Taelyn

    Taelyn Guest

    Yes true, but its not a replacement of the actual suits. Thats more what i ment :)

    Look cool tho!
     
    #20
    SacredGlade likes this.

Share This Page