Pinned How to mod for beginners (WIP)

    • How to mod for beginners (WIP)

      (Link zum gleichen Artikel im deutschen Forum)
      Introduction

      Hello,

      I bought CnC in March 2021 and started modding for CnC shortly after I bought it. I changed also a lot of things at the other "big simulation" in the past, but only for me. End of march I got the feeling: I want to create public mods for CnC. So here I am.

      To give a possible help for any New-Modders I want to try to write my 2 month modding experience here. I'm from Germany, I want to write this help in German and English. Please excuse me, the German part will be everytime the first and then I will write the same thing with "my English" knowlegde also here. I think, you will find a lot of errors :/ , so read it, keep it and smile :saint: . But if my English really confusing .. ok, ask.
      Why I want to write this? There are a lot of movies in the internet available. But I don't like looking videos, I prefere written documentation where you only have a quick look. This how to will be only the starting point for modding and not an encyclopedia.
      All links which I used or think this is maybe helpful I will link in the text. Remember: I'm from Germany, so the most links are to German text.

      Structure of my how to. The next post will be a table of contents, where I add all new posts with a link. So this help can grow time by time and I can add any new information in this table of contents.
      If you want to add some information, feel free to write a comment. When I think it is helpful, I will add a link to this post also in the table of contents.

      Best regards
      Pebcak

      Note: You can find my first 3 7 (**) mods on Modhoster
      **) increasing :)

      The post was edited 6 times, last by Pebcak ().

    • Overview

      What you need to create a mod:
      1. Tool to draw the model
      2. Tool to create the texture
      3. Tool to bring your mod ingame
      4. The "Mod-Idea"


      In this tool overview I can give you only my experience during the last 2 month. I don't know if there are better, easier, cheaper tools available. This is only the way I did.

      A very good modding introduction movie from @TheCoCe is here available. It is German, but in the video you can see a lot of details. What he did, and how he did. A great help for beginners. Also the link list below the video.

      1. Tool: Draw the model
      You need a tool to draw your model. After a very short time I decided to take Blender too. It is very powerful, has a lot of functions, can import and export all needed formats and best: it is freeware.

      2. Tool: Create the textures
      To choose which tool I will take needed the longest time for me during my "modding intruduction phase". A lot of tools are available. Last but not least I decided also to use Substance Painter. You have to buy it, but the big advantage: everything is included and this tool is powerful. There are a lot of cheaper tools or freeware available and you can also download the needed texture sources from the internet, but in most cases you must pay for this too. Therefore I decided to buy Substance Painter.
      Tip: This tool isn't cheap, you can buy it from the publisher page for 220$/~180€, or you buy it via Steam (127€ for Germany) and if you wait until autumn you can get some € less during the pre-sale for the next upcoming version.
      In this posting in the German section I asked about texturing tools. You can find some links inside the post.

      3. Tool: Bring your mod ingame
      CnC has an Editor for this. Therefore, no discussion from my site.

      4. The "Mod-Idea"
      The starting point of each mod is the idea and you need time+mood.
      The factor time+mood you should not underestimate. You will get problems during the modding process, in this case do it like me: ask in this forum.

      Last but not least, the whole overview in one picture

      The post was edited 4 times, last by Pebcak ().

    • Create the model with Blender

      To describe the complexity of Blender I want to tell you, you can create animation movies with Blender. No Panic, we don't want to do this, we will use only the functions which we need.
      After 3 mods I can write a lot of text regarding using Blender. But this I don't want. I want only to give you a short overview.

      How you can start:
      I set the language in Blender also to English. The German translation is execellent, but it was difficult to find the same commands like the people used in the videos. A partially screenshot from my Blender, from left to right you can see the UV-Editor window, the Moddeling window and the Object window (Scene Collection)

      • From the menu we need only "Modeling" and "UV-Editor"
        With Modeling we can create our model
        With UV-Editor we can prepare our model for texturing later
      • At the beginning we need only Object Mode and Editor Mode in the Modeling window. In Object Mode you can create new Objects and move/rotate the whole object. In Editor Mode you can change everything: faces, lines and edges. If you add a new Mesh in Editor Mode, this new mesh will be a part of the current object <-> If you add a new Mesh in Object Mode, this new mesh will be a new separate object. This is important. Each separate moveable object from your mod must be a separate object in your mod. For example, you can see in the Scene Collection my mod contains 12 separate objects: main, left wing, right wing, 2*hydraulic cylinder, 2*hydraulic rod, 3 stanchion (? I mean the 3 foots which hold the subsoiler when detached), and 2 objects for the plow animation. The plow animation must not be textured, therefore my low poly group contains only 10 objects. If you asked yourself now: High-Poly? Low-Poly? Ingame-Poly? .. step back and whatch the videos.
        Or here as an example for an object, degrease the number of polygons


        The next screenshot shows you the functions which I used the main time
        Top: selection for edge, line or faces
        Left: Select, Move, Rotate, Scale, Extrude, Loop Cut

        At the modifier section I used currently only Mirror and Array (insert an object multiple times).
        Do you believe me when I tell you the main part (middle section, excluding the X-enhancement, excluding the plows and excluding the bolt+splint) is created out of 1 quader?
      • When the model is finished we can prepare our model for texturing. Therefore we create the Low-Poly model. Now we can move all faces from our Low-Poly model into the UV-Map. Blender can do this automatically, but the result is <beeep> ... so do it manually.
        Create a new 4k UV-Map (I suggest with a background), and move face by face (or group of faces) manually into the UV-Map. If you use a UV-Map with the square background you can see this squares on your model. With this help you can check easily if all faces get the same resolution and the face is not distorted. How to do this, see next picture. Click the color icon (! yes color) and choose "Image Texture" and then click the next small icon and choose your 4k UV-Map. If you don't see the squares change your view, see 1st picture, the 4 sphere icons, press the 3rd one.

        Note: the red lines in this screenshot are the cutting lines for Blender which I selected for the tool.

        Here an example for disorted faces in the UV-Map. All rectangles should by symetric and in grayscale (with my grayscale UV-Map). You can see the heave disortion in the faces in front, and the colored lines on top for the other face (maybe this should be the small + signs from the UV-Map and we see only the top-down line from the plus sign). Here we have to do something more (e.g. more cutting lines or less faces in one step).

      • After we allocated all faces a place in the UV-Map we can do another step in preparation for texturing. We coloring our model in the Vertex Layer. Each face with the same color (material) got the same color. This color is not the final model color, we use it only later as a help for texturing. Regarding this topic I had some questions, you can find my question and the answers the German post here.
      • Before we export now, you should separate each object from another. Move the object(-s) with a whole number in X-, Y- or Z-direction. Afterwards we can re-move the object(-s) to the right position back. Why we should do this? Because Substance Painter also calculate the light at each point. If you have two parts together, the faces will be textured darker. Maybe you don't want this, because one object is later a "moveable" part of your mod. Therefore separate.
        Example: The tanks and the main part are moved each 10m out of the original position. This has to be reversed after texturing and before importing to CnC.


        Now we can export our model for texturing (2 exports, High-Poly and Low-Poly). I use Substance Painter, therefore I have to choose filetype FBX.
        Note: I propose to use the "same" names for the objects in High- and Low-Poly but with different ending "_low" or "_high". Example:
        in Low-Poly: Object1_low, Object2_low, Tree123_low
        in High-Poly: Object1_high, Object2_high, Tree123_high
        With this naming convention Substance Painter can match the objects for the "baking process". If you don't follow this naming convention you have to match all objects manually.

      The post was edited 7 times, last by Pebcak ().

    • Create the textures with Substance Painter

      Substance Painter. Where should I start? Substance Painter is a powerful tool, but not for free (price see above). I don't want to write a dissertation, I will show you only a short way. To find the way and work with this tool, you have to go. Internet and Youtube will give you a lot of help.

      Our last step in Blender was to export 2 files. The high- and low-poly modell. With the low-poly file we create a new project in Substance Painter. The high-poly file we need for baking of the texture maps.
      If you took care of my tip to use the Vertex-Layer for coloring the "faces of same color/texture" you have to create the ID-Map (baking) with the low-poly file too.
      Why Vertex-Paint and ID-Map? I want to explain the advantage with following example:
      Your model has 2 objects, 1 object with 6 colors and the 2nd object with 4 colors.

      • without Vertex-Paint: You don't need to use the Vertex-Layer to color the faces to mark them for our texturing. You can do this also in the Object-Layer. But when you are finished with texturing and go on to export the textures, Substance Painter will count the colors in the Object-Layer and create for each color one separate export. Each export contains also 3 separate files.
        In worst-case you get now: 3 files per color * (6 colors + 4 colors) = 30 export files
        In best-case: 3 files per color * 6 colors = 18 export files (only in case, when you have only 6 different textures and only 1 UV-Map)
        To merge the exported textures in a file is long runner. This topic is complaint in the community since >10 years.
        You can use merge tools or do it like me.
      • with Vertex-Paint: The separation of the colors will be done by the ID-Map (which we created with the Vertex-Layer). When you now finished the texturing and start the export Substance Painter will count the number of colors in the Object-Layer again and got as result = 1.
        In worst-case we get now: 3 files per color * 2 UV-Map = 6 export files
        In best-case: 3 files * 1 UV-Map = 3 export files.
      Now you can start working and try+try+try ... and try! Brushes, Layers, Filters .. and+and+and. Do it, view some videos, search the internet. To much things to describe in this forum (and out of my time .. yes, already after 2 month working with Substance Painter only). The big advantage of Substance Painter is: the tool works without destroying. Every step can be removed. Create a new layer, paint it - create another layer, paint it. You can enable or disable layers, compare the view and later delete the layer you don't want. Or use an effect, put it on your model and decide: looks bad -> delete .. looks good -> take it.
      I added the video from @TheCoCe called Anfänger Modding Tutorial (Beginner Modding Tutorial) to my favorites. Most times only for a short look, what he did.

      The dirt map is a little bit special. With this map we can show CnC where something can be dirty. This map isn't supported by Substance Painter by default. I create this map with an additional Channel (user0, I never rename this channel in Substance Painter). Add this channel to your project and use it to create the dirt map. The dirt map is only black or white. Black means clean every time, white means can be dirty.


      Now when you finished texturing we can start the export. There are different "color-texturing-models" available in 3D games, but CnC uses this one (this is also explained in the beginner modding tutorial video from @TheCoCe, German language - but shown in the video). Lucky for us, since creating the video Substance Painter was developed and we don't need any separate tool to move all layers in the different files. Now we can configure our export settings in Substance Painter directly and get the files we needed for CnC.
      See the following pictures from my export settings in Substance Painter:
      (note: ignore the colors of the layers/maps/channels, they switch sometimes in Substance Painter)


      mesh_a = RGB:Base Color (RGB) + A:Opacity (Grayscale)
      mesh_n = RGB:Normal DirectX
      mesh_r = R:Roughness(Grayscale) + G:Metallic(Grayscale) + B:Ambient occlusion(Grayscale) + A:user0(Grayscale)

      Note: user0 is my channel for the dirt map, see above.
    • CnC Editor: Bring your mod ingame - Basics

      A basic overview


      What is done until yet:
      • The model was created with a drawing tool (e.g. like me with Blender)
      • In Blender a high- and low-poly model was created. Booth models must be exported as fbx-file (or any filetype which your texture tool support).
      • With booth fbx files we backed the maps (so called). Now the model could get the color/textures. The result of this process are the tga files.
      • Until now not mentioned above, the low poly model must be exported as a collada filetype (dae file)
      The next steps in CnC Editor:
      • Creating the world file -> import the collada file(-s)
      • Import the tga files. The CnC Editor will create the tex files. This are the texture files for the C4 Engine.
      • Creating the shop image
      Last but not least an information file is needed. This file is a text file in xml format and contains some basic information for the C4 Engine, e.g. the path to all needed source files.

      The post was edited 4 times, last by Pebcak ().

    • CnC Editor: Import the model and textures

      The editor can be started every time in CnC. To do this, press the circumflex key (in game or main menu). After this a command window display and a task bar at the bottom. To create a new mod you have to choose "New World". Now a new empty world is opened in the editor. I suggest to save the new world now, choose the location and give a name. The next steps must not be done in this sequence. Import the model or import the textures, it is your choice. I will start with the model.


      After the modell (Collada file *.dae) is imported via "Import Scene" the "Infinite Zone" has all objects from the model in a tree (left picture). Later on it can be confusing. Therefore each object can be marked as invisible: mark the entry and press CTRL+H. Invisible objects are displayed in the tree with a gray background (middle picture). Until the mod is finished more work is needed (right picture).
      In the editor it is possible to choose the prefered view. 1 or 2 or 3 or 4 windows (viewports) can be choosen in the editor, and each viewport can be configured. After a click with the right mouse button a context menu will pop up (in perspective with CTRL+right mouse click).


      Textures will be imported via the menu entry "Import Texture Map" and choose the related tga file. After this an option window will be displayed, where some options can be choosen. "Use Block Compression" should every time enabled. For the textures mesh_a and mesh_r you have maybe to select an entry at "Alpha Channel": for mesh_a "transparency" and mesh_r "emission" (-> dirt map, I did it like this and it was working)

      The post was edited 1 time, last by Pebcak ().