openclonk/docs/sdk/renderclonkExamples.xml

57 lines
10 KiB
XML

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!DOCTYPE doc
SYSTEM '../clonk.dtd'>
<?xml-stylesheet type="text/xsl" href="../clonk.xsl"?>
<doc>
<title>Renderclonk Examples</title>
<h id="Blenderclonk">Renderclonk Examples</h>
<part>
<text>Those who do not know about modeling with Blender should first do a generic blender tutorial.</text>
<text>To do so please follow one of the beginner's tutorials on <a href="http://www.blender.org/education-help/tutorials/">http://www.blender.org/education-help/tutorials/</a>.</text>
<text>There are also Blender tutorials on the Clonk Center, e.g. <a href="http://www.cc.striver.net/texts.php?action=sh&amp;id=53">a flint</a>, <a href="http://www.cc.striver.net/texts.php?action=sh&amp;id=60">a construction kit</a> oder <a href="http://www.cc.striver.net/texts.php?action=sh&amp;id=134">a sword</a>. They are in German language however.</text>
</part>
<h id="ClonkWerden">Farmer Humpe wants to become a clonk.</h>
<text>The goal of this tutorial is to create a Farmer clonk. So let's start up Blender and open the script. Since the farmer is supposed to be based on the normal Clonk the first thing we do is to load the Clonk model. In the scripting window click on <strong>LoadClonk</strong> or <img src="../images/DropDown.png" width="10" height="12"/> and select Clonk.mesh (or Clonk, respectively). Now the Clonk is loaded and we find ourselves in the main menu. Next, we rename the Clonk to Farmer so that we don't overwrite the original Clonk. To do so we click on <strong>Save/Load</strong> and change Clonk to Farmer in the <strong>Clonk Name</strong> field. Now the Farmer can be saved by another click to <strong>Save Clonk</strong>.</text>
<text>Great, so we have already created a new Clonk. The Farmer!</text>
<h id="Hut">Farmer Seeks Hat</h>
<text>To be able to see a difference between Farmer and Clonk the Farmer should look different of course. So let's give him a hat.</text>
<text><img src="../images/Hut.png" height="238" width="257" /></text>
<text>First an appropriate hat needs to be modeled. This should not be a problem when making use of one of the Blender tutorials mentioned above.</text>
<text>Initially the hat is an individual mesh. To be able to be stored together with the Clonk it needs to be connected to the Clonk mesh. To do so first switch to ObjectMode (maybe switching from the EditMode using Tab) and right-click the hat mesh, then right-click the Clonk mesh while pressing the Shift key. Now the hat has a dark border and the Clonk has a bright one. Pressing Ctrl+J connects the two meshes.</text>
<text>To move the hat together with the Clonk's head it needs to obtain an appropriate VertexGroup. Click on <img src="../images/Button.png" width="21" height="21"/>, then on the left click on the symbol next to the text entry. From the drop-down menu choose 'Head' (referring to the head bone, i.e. the bone which controls the head). Afterwards switch to Edit mode using Tab, select all vertices of the hat (it doesn't matter if a few head vertices are selected as well) and assign them to the Vertex group by clicking on Assign.</text>
<text><img src="../images/Vertexgroup.png" height="130" width="499" /></text>
<text>In the scripting window the Farmer can be saved including its head by choosing <strong>Clonk</strong>, then <strong>Save Farmer</strong>.</text>
<h id="Hose">Humpe wants to have pants</h>
<text>As a next step Farmer Humpe wants to have his own pants since the unit jumpsuit of the Clonks can not be used for agricultural purposes. So we need brown leather pants.</text>
<text>The first thing we need is a new material group. So, at <img src="../images/Button.png" width="21" height="21"/> in the area to the right hand side of the vertex groups, click 'New'. Then click on <img src="../images/Button2.png" width="21" height="21"/> and assign a name for the new material, such as 'Leather'. Choose a brownish shade using the color selector. Now the material needs to be assigned to the corresponding parts of the Clonk. In EditMode select the vertices which shall make up the pants, then in <img src="../images/Button.png" width="21" height="21"/> click on Assign.</text>
<text><img src="../images/Trousers.png" height="250" width="443" /></text>
<text>Now that Humpe wears his pants it's time to save the mesh again.</text>
<h id="Mistgabel">A pitchfork for Mr. Humpp</h>
<text>A farmer without a pitchfork is not a real farmer!</text>
<text><img src="../images/Pitchfork.png" height="292" width="258" /></text>
<text>First the pitchfork needs to be modeled. The mesh as well as the object should be assigned the name 'Pitchfork'. Afterwards the mesh should be aligned so that the point at which the Clonk touches the pitchfork is exactly on the Tool1 bone of the armature object (see picture). Then save the pitchfork using the 'Save Tool' button in the 'Save/Load' menu. In the popup menu choose the 'Pitchfork' entry.</text>
<text>Now of course Humpe should carry the pitchfork when walking. We are going to use the 'WalkStaff' action as a basis for this. To load it go to 'Save/Load' and choose the 'Load Action' entry, then choose 'WalkStaff'. In the 'Actions' submenu choose the 'WalkStaff' action, then click on 'New' to create a new action. Call it 'WalkPitchfork' and answer yes when asked whether to copy the keyframes. This results in a new action called Pitchfork using the keyframes from the WalkStaff action. The last thing to do is to choose the pitchfork as Tool1 so that it uses the pitchfork instead of the staff. Click on 'Save WalkPitchfork' to save the new action.</text>
<text>To make the rendering use the new action instead of the old Walk animation we need to switch it in the action list of the clonk. Go to 'Clonk' and enlarge the window by clicking on <img src="../images/ButtonFullScreen.png" width="52" height="17"/>. Then change 'Walk' to 'WalkPitchfork'.</text>
<text>Now we can do the same for the Jump action. We load 'JumpStaff' and use it to create the new JumpPitchfork action, then assign Pitchfork as Tool1. Don't forget to set the length of the jump animation to 8 instead of 16 frames. Eventually replace Jump by JumpPitchfork in the action list.</text>
<text>Now Humpe happily walks and jumps around carrying his pitchfork! Time to save.</text>
<text>Finally farmer Humpe can be rendered and enjoy being a Clonk:</text>
<text><img src="../images/Humpe.png" height="320" width="256" /></text>
<part>
<h id="Aufstand">Farmer uprising! Humpe fights</h>
<text>But this is not enough! Humpe also wants to use his pitchfork for fighting.</text>
<text>So fighting animations need to be created. However since one cannot use the pitchfork to strike the same way as with a sword we cannot simple replace the sword by a pitchfork in the sword fighting animation. This means we need to create a new animation from scratch.</text>
<text>To do so we switch to the Action submenu, click New and choose 'PitchforkStrike' as the new name. When asked whether to copy the keyframes we say 'No' this time. The animation length is set to 8 and the width to 24. The height we leave at 20. Now select the armature object and switch to 'Pose Mode'.</text>
<text>First switch to Frame 1. The frame number is shown in the bottom-left corner of the 3D window, or as a green line in the animation window respectively (see picture). So either click at the position of Frame 1 in the animation window or navigate to Frame 1 using the arrow keys. Having arrived at the first frame we can bend the Clonk's bones to how he is supposed to look like at the beginning of the strike animation. The camera should look at the clonk somewhat displaced from the front since this is the case for most animations.</text>
<text>Bones at their final positions need to be taken over to the keyframe list by pressing the 'i' key and choosing 'LocRot'. When the pose is finished and all bone positions are saved as keyframes we can continue. In frame 5 the Clonk should be at the backmost position when striking out (intermediate frames are computed automatically by Blender). Then in frame 7 the Clonk should be stabbing directly towards his enemy. The 9. frame should be the same as the first so that the Clonk returns into his initial position. So we press 'b' to select all keyframes of the first frame by drawing a selection rectangle in the action window. Using Shift+D they are duplicated and moved to frame 9. Why frame 9 when we only have 8 frames, you might ask. We don't need the first frame twice in the animation, the additional frame is just so that the eighth frame is computed as a transition from the seventh to the first frame by Blender.</text>
<text>A click on 'Save StrikePitchfork' makes sure the new action is saved.</text>
<text><img src="../images/StrikeAction.png" height="372" width="637" /></text>
<text>Now we need another animation in which Humpe is in fighting position with his pitchfork (when two clonks stand opposed to each other when fighting). In this case a copy of SwordFight is good. So let's load SwordFight via 'Save/Load' and 'Load Action'. In the 'Action' submenu create a copy of the action with 'New'. The length needs to be set to 4 and the width to 24. Tool1 is again chosen to be our pitchfork.</text>
<text>However now we can see that the Clonk is holding the pitchfork too high up. So in 'Pose Mode' lower the Tool1 bone a bit and insert a keyframe with 'i' and 'LocRot'. Do the same for frames 1, 3 and 5, then save with 'Save PitchforkFight'.</text>
<text>Eventually the two actions need to be added to the action list of the Clonk. To do so click on the empty field below Drink and choose 'PitchforkFight'. Then click again in the next empty field which gets created below 'PitchforkFight' and choose 'PitchforkStrike'.</text>
<text>Clicking on 'Save Farmer' saves what we have done.</text>
<text>Finally our little Farmer is finished. Both Graphics.png and Overlay.png are created in the Graphics/Farmer subfolder when clicking on 'Render', then 'All', then 'Both'. They can be used to add the graphics into the game.</text>
<text><img src="../images/Full.png" height="320" width="256" /></text>
</part>
<author>Randrian</author><date>2008-05</date>
</doc>