Logo Khaganat

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:peluche [2014/08/13 22:56] – Suite de la trad Lyneen:peluche [2021/12/03 19:19] (current) – external edit 127.0.0.1
Line 3: Line 3:
 The aim of this tutorial is to show how to create cuddly toys based on the models of atysian animals.  The aim of this tutorial is to show how to create cuddly toys based on the models of atysian animals. 
  
-{{ 00-tuto-peluche.png?200 |}}+{{ fr:00-tuto-peluche.png?200 |}}
  
 Prerequisite for modelising only the cuddly toy: Prerequisite for modelising only the cuddly toy:
Line 31: Line 31:
  
  
-{{ 01-tuto-peluche-dossiers-mobs.png?600 |}}+{{ fr:01-tuto-peluche-dossiers-mobs.png?600 |}}
  
 =====   Step 2: Getting the model and creating a dedicated work folder   ===== =====   Step 2: Getting the model and creating a dedicated work folder   =====
Line 43: Line 43:
  
  
-{{ 02-tuto-peluche-asset-tracking.png?800 |}}+{{ fr:02-tuto-peluche-asset-tracking.png?800 |}}
  
 The aim here is to deploy cuddly mobs for the month object. Hence, we'll create a dedicated folder for our to-be toys and respect the naming convention used by Ryzom. The aim here is to deploy cuddly mobs for the month object. Hence, we'll create a dedicated folder for our to-be toys and respect the naming convention used by Ryzom.
Line 64: Line 64:
 In the "soft-toy" folder, you should now have as a result: In the "soft-toy" folder, you should now have as a result:
  
-{{ 03-tuto-peluche-dossier-soft-toy.png?600 |}}+{{ fr:03-tuto-peluche-dossier-soft-toy.png?600 |}}
  
 =====   Step 3: Cleaing the 3D model using 3DSMax  ===== =====   Step 3: Cleaing the 3D model using 3DSMax  =====
 The monster 3D model contains a skeleton and animation track. This is not necessary for a toy accessory and unnecessarily overburden the final ryzom model. We will delete it.  The monster 3D model contains a skeleton and animation track. This is not necessary for a toy accessory and unnecessarily overburden the final ryzom model. We will delete it. 
  
-{{ 04-tuto-peluche-animation.png?800 |}}+{{ fr:04-tuto-peluche-animation.png?800 |}}
  
 Select with the mouse the "Gubani" model. In the right panel, select the "//modify//" tab. You should see the mesh called "TR_MO_H12" and in the stack one modifier called "physical". We will delete it also. Select with the mouse the "Gubani" model. In the right panel, select the "//modify//" tab. You should see the mesh called "TR_MO_H12" and in the stack one modifier called "physical". We will delete it also.
-{{ 05-tuto-peluche-physique.png?600 |}}+{{ fr:05-tuto-peluche-physique.png?600 |}}
  
 Then we will open the scene explorer screen  via the "Tools" menu => "New Scene Explorer" and delete all the elements constituting the skeleton of the model and keep only the animal mesh. Then we will open the scene explorer screen  via the "Tools" menu => "New Scene Explorer" and delete all the elements constituting the skeleton of the model and keep only the animal mesh.
  
-{{ 06-tuto-peluche-bones-01.png?800 |}}+{{ fr:06-tuto-peluche-bones-01.png?800 |}}
  
 Now we have only one element in our "scene": the Gubani mesh "TR_MO_H12" Now we have only one element in our "scene": the Gubani mesh "TR_MO_H12"
  
-{{ 07-tuto-peluche-nettoyer-modele.png?800 |}}+{{ fr:07-tuto-peluche-nettoyer-modele.png?800 |}}
  
 In the right panel, we will rename the mesh "ge_acc_tedy-gubani_01". This name will be used by the export "NEL" to name the generated file when exporting to "shape" NEL format. In the right panel, we will rename the mesh "ge_acc_tedy-gubani_01". This name will be used by the export "NEL" to name the generated file when exporting to "shape" NEL format.
  
-{{ 07-tuto-peluche-nettoyer-modele-fin.png?800 |}}+{{ fr:07-tuto-peluche-nettoyer-modele-fin.png?800 |}}
  
 =====   Step 4: Map the right texture to the model   ===== =====   Step 4: Map the right texture to the model   =====
Line 96: Line 96:
  
  
-{{ 08-tuto-peluche-texture.png?800 |}}+{{ fr:08-tuto-peluche-texture.png?800 |}}
  
 The ID 1 slot is used for textures of Tryker ecosystem, the second slot (ID 2) for the Fyros ecosystem. The third slot (ID 3) for Zoraï ecosystem and the fourth one (ID 4) for the Primes Root ecosystem. Do not look for Matis slot. As good aesthetes, they understood that beauty lay in the Zorai nature and therefore use Zoraï textures for all their animals. Note that here the Gubani is being only present in jungle and primes root. Only slots 3 and 4 are used The ID 1 slot is used for textures of Tryker ecosystem, the second slot (ID 2) for the Fyros ecosystem. The third slot (ID 3) for Zoraï ecosystem and the fourth one (ID 4) for the Primes Root ecosystem. Do not look for Matis slot. As good aesthetes, they understood that beauty lay in the Zorai nature and therefore use Zoraï textures for all their animals. Note that here the Gubani is being only present in jungle and primes root. Only slots 3 and 4 are used
Line 102: Line 102:
 The same system is also used for other IG objects, such as buildings. In this case, the 4 slots correspond to the four seasons. Thus we can note the presence of snow on some Zoraï buildings in winter.  The same system is also used for other IG objects, such as buildings. In this case, the 4 slots correspond to the four seasons. Thus we can note the presence of snow on some Zoraï buildings in winter. 
  
-{{ 09-tuto-peluche-multi-texture.png |}}+{{ fr:09-tuto-peluche-multi-texture.png |}}
  
 We will not use this mechanism. We will therefore delete the "NEL Multi Bitmap" and replace it with a simple "Bitmap" by dragging the mouse from the output of "tTexture 1" as shown in the above image. When releasing the mouse, a menu appears (2), select "Bitmap" entry:  We will not use this mechanism. We will therefore delete the "NEL Multi Bitmap" and replace it with a simple "Bitmap" by dragging the mouse from the output of "tTexture 1" as shown in the above image. When releasing the mouse, a menu appears (2), select "Bitmap" entry: 
  
-{{ 10-tuto-peluche-bitmap.png?800 |}}+{{ fr:10-tuto-peluche-bitmap.png?800 |}}
  
 Then select our texture "W:databasestuffgenericagents _texturesaccessories oft-toyge_acc_teddy gubani_01.dds" (or ".tga").  Then select our texture "W:databasestuffgenericagents _texturesaccessories oft-toyge_acc_teddy gubani_01.dds" (or ".tga"). 
  
-{{ 11-tuto-peluche-bitmap.png?800 |}}+{{ fr:11-tuto-peluche-bitmap.png?800 |}}
  
 Repeat the operation on the other "Nel Multi Bitmap" that reference the same image. Repeat the operation on the other "Nel Multi Bitmap" that reference the same image.
  
 +=====  Step 5: Scaling the model  =====
 +
 +Our 3d model is almost ready. However, its size does not match what is expected. If you use the 3dsmax measuring tool you will see that the Gubani is 2m high. The simplest way to put it in the right size is to load a Homin model to have visual comparison and ensure that the teddybear can be taken in hand.
 +
 +So we will temporarily put in our scene a reference to another 3d model via the File menu (1) => References (2) => Xref Scene (3) and then clicking on the Add button (4) :
 +
 +
 +{{ fr:15-tuto-peluche-xref.png?800 |}}
 +
 +
 +Select the Homin model "W:\database\stuff\generic\agents\actors\male\ge_hom_armor02.max" which should appear in your 3d scene.
 +
 +
 +{{ fr:15-tuto-peluche-xref-02.png |}}
 +
 +Scale the Gubani model and move it via tools "Scale" and "Move" from the popup menu that appears when you click the model with the right mouse button.
 +
 +{{ fr:16-tuto-peluche-echelle.png |}}
 +
 +Once at the right scale, remove the reference to the homin model through the File menu => References => Xref Scene.
 +
 +
 +Reposition the Gubani model at the scene origin  (x = 0, y = 0, z = 0), because when the object is carried the position (0,0,0) is located in the hand.
 +
 +
 +=====  Step 6: Adapt the texture for a fluffy look  =====
 +
 +In terms of texture, to give a "plushy effect", give free rein to your imagination
 +
 +{{ fr:17-tuto-peluche-texture-source.png |}}
 +
 +
 +I edited the "ge_acc_teddy-gubani_01.tga" image with the Gimp application. I used the filter "Artistic> GIMPressionist" using the "canvas" model for a weft fabric effect.
 +
 +{{ fr:17-tuto-peluche-texture-peluche.png |}}
 +
 +
 +Once the image saved, I re-generated the dds texture with the command:
 +
 +
 +  tga2dds ge_acc_teddy-gubani_01.tga
 +
 +Here is the result on the 3d model in 3dsmax:
 +
 +{{ fr:18-tuto-peluche-modele3d.png |}}
 +
 +=====  Step 7: Shape export   =====
 +
 +
 +It's time to test the teddybear IG. For this you have to export the model to the "shape" file used by the Ryzom engine
 +
 +If this is not already done, add the ''NEL export'' button on your right side panel by clicking on the "utilities" tab then "More" button and selecting the "NEL Export" option: 
 +
 +{{ fr:20-tuto-peluche-export-nel-01.png |}}
 +
 +Then select the Gubani mesh with the mouse and click on the "Export Model" button. You must specify the folder in which the file "ge_acc_teddy-Gubani-01.shape" will be created.
 +
 +
 +{{ fr:20-tuto-peluche-export-nel-02.png |}}
 +
 +
 +=====   Step 8: Testing the plushy IG  =====
 +
 +
 +If we wanted to do it by the book, we should add the "datasheet" for the teddy-gubani on the game server and patch the client. This method will be detailed later. However there is a workaround if you don't have your own game server to do these steps.
 +
 +You have to know that a plushy is nothing more that a weapon hold in hand. So we could replace the model of the dagger with the one of our gubani to test it on the official server. There is a simple trick for this. The game client looks for the models and textures in the "user" folder before trying in the "data" folder. Just copy the shape file and the associated texture in the "user" folder, then rename the gubani shape into the one of the dagger: "GE_Wea_Dague.shape"
 +
 +Now, when you'll take a dagger IG, you'll hold the "teddy-gubani".
 +To retrieve the original dagger, you just have to remove the shape file from the "user" folder:
 +
 +
 +{{ fr:21-gubani-peluche-axe.png?400 |}}
 +
 +
 +By doing this test, you can notice an anomaly: the toy is hold by its foot, which isn't necessarily what we want.
 +
 +
 +=====   Step 9: Orientating and positionning an object hold in hand  =====
 +
 +The fastening point for an object hold in hand is at the point with (0,0,0) coordinates of the object. Its orientation obeys the following rule:
 +
 +  X axe goes up along the forearm;
 +  Y axe starts from the back of the hand towards outside;
 +  Z axe points towards the top of the object firmly hold in hand.
 +
 +
 +We realign the teddy-gubani in 3DSMax as shown in the following image: X axe exits the gubani's deck to go up the arm that will hold it. Z axe exist the hand and is hence probably in the extension of the soft-toy's head:
 +
 +{{ fr:22-gubani-peluche-axe-3dsmax.png |}}
 +  
 +After realigning the gubani model and re-exporting the shape, we get a plushy which is hold by its trunk:
 +
 +{{ fr:22-gubani-peluche-axe.png?400 |}}
 +
 +If you want to know more about objects held, you can read [[creation_d_un_objet_prehensible_en_jeu|this tutorial]].
 +
 +
 +=====   Step 10: Creating the icone for inventory and actions bar  =====
 +
 +
 +
 +You have to create an icon to show the teddy-gubani item in the inventory and in the action bar.
 +This icon in tga format has do be of size 40x40 pixels, with a transparent background. We'll name it "icon_teddygubani.tga"
 +
 +The 40x40 pixels icon:
 +
 +{{ fr:23-icone-gubani.png?80 |}}
 +
 +For performance reasons, these icones aren't stored individually but gathered under one single image names: "texture_interfaces_v3.tga". The text file associated to it is called "texture_interfaces_v3.txt" and provides the list of all present icons and their position in the image:
 +
 +
 +{{ fr:23-icone-gubani-contexte-txt.png |}}
 +
 +The text file uses the following format for each line:
 +
 +  NomFichierIcone u1 v1 u2 v2
 +
 +Where:
 +  * u1,v1 is the position of the upper left corner of the icon
 +  * u2,v2 is the position of the lower righ corner of the icon
 +
 +
 +Unlike coordinates in pixels, these coordinates are using the 3D UV Mapping technique, and have their values in [0|.. 1] interval. The (0,0) coordinate is the upper left corner of the image and (1,1) is the bottom right corner of the image.
 +
 +Passing from one system to the other one is simple. Let (x1,y1) be the place of the upper left corner of our icon in the global image and (x2,y2) the place for its bottom right corner, then:
 +  * u1 = x1 / image width
 +  * v1 = y1 / image height
 +  * u2 = x2 / image width
 +  * v2 = y2 / image height
 +
 +Knowhing that the "texture_interfaces_v3.tga" texture has a size of 1024x1024 pixels, and that in the example the "icon_teddygubani.tga" icon is located in position (x1=118,y1=798), that the bottom left corner is in (x2=157,y2=837), the text file contains the line:
 +
 +  icon_teddygubani.tga 0.115234375 0.779296875 0.1533203125 0.8173828125
 +  
 +Even if it can be added by hand, the proper way to do it is to use the dedicated NEL tool //build_interface//, as explained in [[creer_icone_objet|this tutorial]], which recreates the global texture and the txt file from a folder with all the icons.
 +
 +
 +
 +Nota: Adding the icon isn't enough, you'll also have to create the datasheet for the soft-toy object and specify in it the name of the icon to be used, as will be seen later in this tutorial. By the end, we're getting the following result IG:
 +
 +{{ fr:23-icone-gubani-contexte.png |}}
 +
 +
 +
 +
 +=====   Step 11: Creating the names file  =====
 +
 +
 +To be completed.
 +
 +{{ fr:30-tuto-peluche-txtfile.png |}}
 +
 +
 +=====   Step 12: Creating the datasheet  =====
 +
 +Basically, a soft-toy remains an object held like a weapon. Actually, the datasheet for the soft-toy is very similar to the one of a one-handed weapon, such as the dagger's example below.
 +
 +__icrm1pd.sitem  ( datasheet for the refugee dagger):__
 +
 +<code xml>
 +<?xml version="1.0"?>
 +<FORM Revision="$Revision: 1.2 $" State="modified">
 +  <PARENT Filename="_c_m1pd.sitem"/>
 +  <STRUCT>
 +    <STRUCT Name="basics">
 +      <ATOM Name="name" Value="refugee dagger"/>
 +      <ATOM Name="origin" Value="refugee"/>
 +      <ATOM Name="Drop or Sell" Value="false"/>
 +      <ATOM Name="CraftPlan" Value="bcrmea06.sbrick"/>
 +      <ATOM Name="Saleable" Value="false"/>
 +    </STRUCT>
 +    <STRUCT Name="3d">
 +      <ATOM Name="shape" Value="GE_Wea_Dague.shape"/>
 +      <ATOM Name="shape_female" Value="GE_Wea_Dague.shape"/>
 +      <ATOM Name="map_variant" Value="Low Quality"/>
 +      <ATOM Name="icon background" Value="BK_generic.tga"/>
 +      <STRUCT Name="fx">
 +        <ATOM Name="Trail" Value="GE_Wea_Dague_trail_00.shape"/>
 +      </STRUCT>
 +    </STRUCT>
 +  </STRUCT>
 +  <STRUCT/>
 +  <STRUCT/>
 +  <STRUCT/>
 +  <STRUCT/>
 +  <LOG>
 +</FORM>
 +</code>
 +
 +What will be changed is:
 +
 +  * the reference for the shape in the "3d" section
 +
 +      <ATOM Name="shape" Value="ge_acc_teddy-gubani_01.shape"/>
 +      <ATOM Name="shape_female" Value="ge_acc_teddy-gubani_01.shape"/> 
 +
 +  * the reference for the icon used in the action bar and in the inventory in the "3d" section
 +
 +      <ATOM Name="icon" Value="icon_teddygubani.tga"/>
 +      <ATOM Name="icon overlay" Value="icon_teddygubani.tga"/>
 +
 +  * the base features which differ from the ones of a weapon: no level required, no craft stanza, etc...
 +
 +    <STRUCT Name="basics">
 +      <ATOM Name="name" Value="staff"/>
 +      <ATOM Name="origin" Value="common"/>
 +      <ATOM Name="family" Value="handled item"/>
 +      <ATOM Name="ItemType" Value="Staff"/>
 +      <ATOM Name="Bulk" Value="5"/>
 +      <ATOM Name="RequiredCharacQualityFactor" Value="0"/>
 +      <ATOM Name="RequiredCharacQualityOffset" Value="0"/>
 +    </STRUCT>
 +
 +Here is then the datasheet for the teddy-gubani which will be called  "teddygubani.sitem":
 +
 +<code xml>
 +<?xml version="1.0"?>
 +<FORM Revision="$Revision: 1.7 $" State="modified">
 +  <PARENT Filename="_c_m1pd.sitem"/>
 +  <STRUCT>
 +    <STRUCT Name="basics">
 +      <ATOM Name="name" Value="staff"/>
 +      <ATOM Name="origin" Value="common"/>
 +      <ATOM Name="family" Value="handled item"/>
 +      <ATOM Name="ItemType" Value="Staff"/>
 +      <ATOM Name="Bulk" Value="5"/>
 +      <ATOM Name="RequiredCharacQualityFactor" Value="0"/>
 +      <ATOM Name="RequiredCharacQualityOffset" Value="0"/>
 +    </STRUCT>
 +    <STRUCT Name="3d">
 +      <ATOM Name="shape" Value="ge_acc_teddy-gubani_01.shape"/>
 +      <ATOM Name="shape_female" Value="ge_acc_teddy-gubani_01.shape"/>
 +      <ATOM Name="map_variant" Value="Low Quality"/>
 +      <ATOM Name="icon" Value="icon_teddygubani.tga"/>
 +      <ATOM Name="icon background" Value="BK_generic.tga"/>
 +      <ATOM Name="icon overlay" Value="icon_teddygubani.tga"/>
 +      <STRUCT Name="fx">
 +        <ATOM Name="Trail" Value="GE_Wea_Dague_trail_00.shape"/>
 +      </STRUCT>
 +    </STRUCT>
 +  </STRUCT>
 +  <STRUCT/>
 +  <STRUCT/>
 +  <STRUCT/>
 +  <STRUCT/>
 +  <LOG></LOG>
 +</FORM>
 +</code>
 +
 +=====   Step 13: Deploying the soft-toy on the game server and client  =====
 +
 +
 +In order to deploy the soft toy in game, the official method consists in using the "build_gamedata" pipeline (cf. https://ryzomcore.atlassian.net/wiki/display/RC/Gamedata+Build+Pipeline). I'll propose you a different method, where the actions will be done by hand but only the ones required for the soft-toy:
 +
 +We'll need the following files:
 +
 +  * teddygubani.sitem (the datasheet for the teddy-gubani)
 +  * ge_acc_teddy-gubani_01.shape (the 3d NEL model for the soft-toy)
 +  * ge_acc_teddy-gubani_01.dds (the texture for the 3d model)
 +
 +Moreover, deploying this soft-toy will impact the following files:
 +
 +  * the "*.packed_sheets" files used by the server and the client, which are a compiled version of the datasheets
 +  * the "sheet_id.bin" file, which is an index of all the datasheets used by the game
 +  * the "visual_slot.tab" file, which lists the items that can be showed on client side
 +
 +To work properly, we'll also create a "soft-toy.bnp" file, which will include the shapes and the textures for all the future soft-toys.
 +
 +
 +For the next operations, we'll consider that our game server uses linux, and that the following environement variable are defined as follow:
 +
 +  * LEVELDESIGNPATH points out the folder for the datas of the level design
 +  * RYZOM_HOME on the install of the server sources
 +
 +====   Adding the "teddygubani.sitem" datasheet to the server  ====
 +
 +
 +On server side, we'll create a folder dedicated to the soft-toys and place the gubani's one there:
 +
 +  $ mkdir $LEVELDESIGNPATH/leveldesign/game_element/sitem/soft-toy
 +  $ cp teddygubani.sitem $LEVELDESIGNPATH/leveldesign/game_element/sitem/soft-toy
 +
 +====   Cleaning beforehand  ====
 +
 +====   Re-generating the "sheet_id.bin" file  ====
 +
 +The first step consists in regenerating the index file for the datasheets throught the "make_sheet_id" command. It takes over the existing index file and complete it with the datasheets from the $RYZOM_LEVELPATH/leveldesign/game_element/sitem/soft-toy folder, namely the datasheets for our soft-toys.
 +
 +  $ make_sheet_id -o$LEVELDESIGNPATH/leveldesign/Game_elem/sheet_id.bin $LEVELDESIGNPATH/leveldesign/game_element/sitem/soft-toy
 +
 +====   Re-generating the "*.packed_sheets" and "visual_slot.tab"   ====
 +
 +The "*.packed_sheets" have to be regenerated. These are the pre-compiled versions of the datasheets:
 +
 +  $ sheets_packer
 +
 +This command also regenerate the visual_slot.tab file.
 +
 +====   Copying the needed files on the client side  ====
 +
 +  * Copy the "visual_slot.tab" file generated in the current folder into the "user" folder of the game client
 +  * Copy the $LEVELDESIGNPATH/leveldesign/Game_elem/sheet_id.bin file into the "user" folder of the game client
 +  * Replace the packet_sheets files in the "data" folder of the client, with the ones generated in $RYZOM_HOME/code/ryzom/client/data/*.packed_sheets using the //sheets_packer// command
 +
 +
 +====   Creating a bnp for the soft-toy model  ====
 +
 +To end this, you'll have to copy the shape and the texture of the soft-toy into the "data" folder of the client.
 +However, in order to work cleanly, let's create a dedicaed ".bnp" file.
 +A ".bnp" file is some sort of zip that gathers the various shape, dds, txt, or other files on a same theme.
 +
 +Let's create a "soft-toy" folder, and copy in it all the shapes and textures for our soft-toys, meaning for now "ge_acc_teddy-gubani_01.shape" and "ge_acc_teddy-gubani_01.dds" and let's create a BNP file to contain them
 +
 +
 +  bnp_make /p soft-toy
 +
 +The command will create a "soft-toy,bnp" file, which will contain our two files. Now, let's copy it in the "data" folder of the client.
 +
 +
 +====   Testing IG   ====
 +
 +Restart the server with the //shard start// command and connect with your client.
 +
 +If everything went well, when starting your game client, you can create a soft-toy in your inventory with this command:
 +
 +  /a createItemInBag teddygubani 1 5
  
  
 {{tag>Tag_a_ajouter}} {{tag>Tag_a_ajouter}}
CC Attribution-Share Alike 4.0 International Driven by DokuWiki
en/peluche.1407963381.txt.gz · Last modified: 2021/12/03 19:18 (external edit)

Licences Mentions légales Accueil du site Contact