<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Junying Wang on Medium]]></title>
        <description><![CDATA[Stories by Junying Wang on Medium]]></description>
        <link>https://medium.com/@junyingw?source=rss-324c95abd4ab------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*x9u7XArHMt90IHo3CQmoPQ@2x.jpeg</url>
            <title>Stories by Junying Wang on Medium</title>
            <link>https://medium.com/@junyingw?source=rss-324c95abd4ab------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 20:14:54 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@junyingw/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to use MoCap data to animate your own avatars in Maya]]></title>
            <link>https://medium.com/@junyingw/how-to-use-mocap-data-to-animate-your-own-avatars-in-maya-889550138365?source=rss-324c95abd4ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/889550138365</guid>
            <category><![CDATA[maya]]></category>
            <category><![CDATA[animation]]></category>
            <category><![CDATA[game-design]]></category>
            <category><![CDATA[graphics]]></category>
            <category><![CDATA[motion-capture]]></category>
            <dc:creator><![CDATA[Junying Wang]]></dc:creator>
            <pubDate>Mon, 28 Sep 2020 21:25:10 GMT</pubDate>
            <atom:updated>2020-09-28T21:25:10.488Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article, I would like to share a simple and a more effective way to animate the 3D avatars. However, this method might not get all accurate and smooth motions. If you want to get varied and large 3D avatar motions in a short period time or doing data augmentation without caring about the accuracy of motions, that would be a good strategy to apply this method.</p><p>Firstly, let’s get to know the background of cartoon animation briefly.</p><p>You might have watched the movies, <em>Chicken Run</em>, <em>Shaun the Sheep</em> and <em>Corpse Bride</em>. They are all stop-motion films. All these cartoon movies mentioned above, their filming processes are based on stop-motion techniques.</p><blockquote><strong>What is stop motion?</strong></blockquote><p><a href="https://en.wikipedia.org/wiki/Stop_motion">Stop motion</a>[1] is an animated film-making technique in which objects are physically manipulated in small increments between individually photographed frames so that they will appear to exhibit independent motion or change when the series of frames is played back. When we apply this logic in 3D virtual world, we can animate the 3D characters by setting the key joints and doing interpolation between the key frames. These animated characters can be exported and used in game environment or VR scene.</p><p>However, the whole process of key-frame animation might need sophistic artists to animate decent characters, the final animated characters would be charming and delicate, while the whole process would be complex and clumsy.</p><blockquote><strong>How to do quick 3D avatar animations?</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-TnShIdhNFJISZefItiacQ.png" /><figcaption>figure 1: 2D pose frame by frame (avatar is download from <a href="https://www.mixamo.com/#/">Mixamo</a>)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*fVMJfvg81VTiCwSW3jk56g.gif" /><figcaption>figure2: animated avatar rendered in Maya</figcaption></figure><p>Key-frame animation sounds clumsy while using MoCap data (.bvh or .fbx files) to animate the 3D avatar might be a quick way to get multiple 3D poses of avatars. Once we finish animating the 3D avatars and get the motion sequences(<em>figure </em>2), which includes different avatars doing the same pose, we can render the 3D pose frame by frame , and build up a 2D motion (<em>figure </em>1) dataset for data augmentation.</p><blockquote><strong>What is MoCap?</strong></blockquote><p>MoCap is short for motion capture, which is the process of recording the movement of objects or people. In film making and video game development, it refers to recording actions of human actors, and using these information to animate digital character models in 2D or 3D computer animation. We can get the MoCap data from <a href="http://mocap.cs.cmu.edu/">CMU MoCap</a> for research purpose. If we want to use these data to do quick animation, we might prefer to use MoCap data in BVH or FBX format. After loading the motion into softwares, like Blender, Maya, 3dx Max or Motion Builder, we can do quick animation by applying different methods. You can find the MoCap data in BVH format following this<a href="https://sites.google.com/a/cgspeed.com/cgspeed/motion-capture/daz-friendly-release"> link</a>.</p><blockquote><strong>what is BVH format?</strong></blockquote><p><a href="https://en.wikipedia.org/wiki/Biovision_Hierarchy">BVH</a> stands for <strong>Biovision Hierarchical Data</strong>, which was developed by a motion capture company called Biovision. The BVA format (also developed by Biovision) is an older format which was the precursor to BVH. The BVH format is mainly used as a standard representation of movements in the animation of humanoid structures. It is currently one of the most popular motion data formats and has been widely adopted by the animation community (probably because of its simple specifications).</p><blockquote><strong>How to use MoCap files to animate characters in Maya?</strong></blockquote><p>I prefer to use Maya to do characters animation. The key point to use Mocap data to do animation in Maya is the <strong>HumanIK</strong> solver in Maya software. Apply different motions to different avatars of different shapes, for this process, we call it motion retargeting.</p><ul><li><strong><em>What is retargeting?</em></strong></li></ul><p>Retargeting is the process of using a forward-kinematics animation recorded for a given source character to control the movements of one or more different target characters, which may have very different properties, scale, skeletal structure, limits of motion…</p><p>This process essentially creates a mapping between the skeletal structure of the source character and the skeletal structure of the target character. It analyzes the movements carried out by the source character, determines how those movements should be reflected by the target character, and uses the inverse kinematics solver to find a final position for the target character that best reflects the original animation.</p><p>You can retarget animation data from the joints of one skeleton (source) to the joints of another skeleton (target). The source skeleton is the skeleton from which you want to retarget its animation data, and the target skeleton is the skeleton to which you want to retarget the source’s animation.[3]</p><p>Retargeting in Maya is based on the Autodesk HumanIK character solver. Once you have defined your character’s skeletal structure using the <a href="https://knowledge.autodesk.com/support/maya/learn-explore/caas/CloudHelp/cloudhelp/2018/ENU/Maya-CharacterAnimation/files/GUID-5DEFC6E5-033C-45D5-9A0E-224E7A35131B-htm.html">HumanIK character structure</a>, you can transfer animation between skeletons that have the same or different skeletal structures and proportions.</p><p>After doing retargeting, we can get various character doing the same motion. <em>Figure 3</em> shows an animated avatar from <a href="https://www.mixamo.com/#/">Mixamo</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*5_YzSI-852sDhb3dV0GtyA.gif" /><figcaption>figure 3 animated avatar</figcaption></figure><p>For Maya the keypoint to achieve motion retargeting is HumanIK. (<em>figure 4</em>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/1*zIkAm4-r3hjK6paj5ZlJQQ.png" /><figcaption>figure 4</figcaption></figure><ul><li><strong><em>What does HumanIK do?</em></strong></li></ul><p>HumanIK [2] provides two main features: full-body inverse kinematics (FK) and retargeting.</p><p>Inverse kinematic, different from forward kinematic, allows you to specify a set of target points in 3D space for your character’s joints, and update the joint position automatically to reach these target points. For example, if you want to make a motion: open a door. You can place a target point at the actual location of the doorknob, and have your character reach out toward that doorknob from any starting position. The joint moving to the targeted location can also move other joints within its chain in the skeleton hierarchy: as the hand moves toward the doorknob, it can drag the elbow and arm joints along with it.</p><ul><li><strong><em>Details of implementation</em></strong></li></ul><p>(1) Get the MoCap data. Most of MoCap data are in .bvh format. You can download them by following this<a href="https://sites.google.com/a/cgspeed.com/cgspeed/motion-capture/daz-friendly-release"> link</a>. However, Maya can only accept .fbx file. Therefore, you need to convert .bvh to .fbx firstly. You can convert .bvh to .fbx in Blender. Here I download the Mocap file from the website: <a href="https://www.turbosquid.com/">https://www.turbosquid.com/</a></p><p>(2) Import the MoCap file into Maya, get the MoCap animation, like <em>figure 5. </em>We need to make sure that the first frame of imported motion need to be in T-pose, otherwise, it would cause wrong rotation and translation when we doing retargeting in HumanIK solver.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*egyLHhTYgMUhLLJBiylyKg.gif" /><figcaption>figure 5</figcaption></figure><p>(3) Import the avatar data (.fbx) into environment, we can download free avatars from <a href="https://www.mixamo.com/#/">Mixamo</a> , just remember to make sure that the avatars need to be in T-pose. (<em>figure 6</em> )</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I03mBom-1ngz52wQzoXocA.png" /><figcaption>figure 6</figcaption></figure><p>(4) Then select HumanIK solver and create new character definition, and do a skeleton mapping between the IK solver and your imported skeleton, you can do it manually (<em>figure 7</em> )or write .mel scripts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*yZpbrB1joJ-BcVw6XKOY2A.gif" /><figcaption>figure 7</figcaption></figure><p>After we assigning the MoCap skeleton and the avatar skeleton to the same IK skeletonal structure, we need to set the <strong><em>Source</em></strong> to be motion capture sequence while the<strong><em> Character</em></strong> need to be the imported avatar.</p><p>Then we finish animating our avatar! (<em>figure 8</em>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*c64KsRVxFtUMOREvEOSi7w.gif" /><figcaption>figure 8</figcaption></figure><p>(5) After we getting the animated avatar, we can also render the pose sequence in Maya, and get the 2D pose of avatar frame by frame, like <em>figure 9</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*NqZfS_6My9UN7MG-Cg63gw.gif" /><figcaption>figure 9</figcaption></figure><p>Now we have finished using MoCap data to animate our own avatars :-)</p><p><strong><em>Reference:</em></strong></p><p>[1] <a href="https://en.wikipedia.org/wiki/Stop_motion">https://en.wikipedia.org/wiki/Stop_motion</a></p><p>[2] <a href="https://knowledge.autodesk.com/support/maya/learn-explore/caas/CloudHelp/cloudhelp/2019/ENU/Maya-CharacterAnimation/files/GUID-EDBDA3DB-4715-40EF-9ADF-412F78BFF98E-htm.html">https://knowledge.autodesk.com/support/maya/learn-explore/caas/CloudHelp/cloudhelp/2019/ENU/Maya-CharacterAnimation/files/GUID-EDBDA3DB-4715-40EF-9ADF-412F78BFF98E-htm.html</a></p><p>[3] <a href="https://knowledge.autodesk.com/support/maya/learn-explore/caas/CloudHelp/cloudhelp/2020/ENU/Maya-CharacterAnimation/files/GUID-B2E9F8B9-F188-4E27-8820-BB0C8541701F-htm.html">https://knowledge.autodesk.com/support/maya/learn-explore/caas/CloudHelp/cloudhelp/2020/ENU/Maya-CharacterAnimation/files/GUID-B2E9F8B9-F188-4E27-8820-BB0C8541701F-htm.html</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=889550138365" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Future of Gaming : Rasterization vs Ray Tracing vs Path Tracing]]></title>
            <link>https://medium.com/@junyingw/future-of-gaming-rasterization-vs-ray-tracing-vs-path-tracing-32b334510f1f?source=rss-324c95abd4ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/32b334510f1f</guid>
            <category><![CDATA[graphics]]></category>
            <category><![CDATA[ray-tracing]]></category>
            <category><![CDATA[path-tracing]]></category>
            <category><![CDATA[rasterization]]></category>
            <category><![CDATA[games]]></category>
            <dc:creator><![CDATA[Junying Wang]]></dc:creator>
            <pubDate>Mon, 18 Nov 2019 20:46:03 GMT</pubDate>
            <atom:updated>2020-08-16T06:59:02.283Z</atom:updated>
            <content:encoded><![CDATA[<h3>Future of Gaming : Rasterization vs Ray Tracing vs Path Tracing</h3><p>For now, we could say that we still live in a three-dimensional world, which is surround by all the 3D objects. Generally, we use three-dimensional commands as the natural user interface, such as assistive touch, lip-reading, and facial expression sensors, to communicate with others. Meanwhile, when we come into the computer game world, we are emerging from three-dimensional world into two-dimensional commands, since for most of the computer games, we still need the computer screen to get the direct interactive information from these 2D animations.</p><p>Here comes the question: Have you ever think about that why the 3D characters we set in the game environment would finally run as 2D images frame by frame on our computer screen (<em>figure 1</em>)? The answer is : the render techniques behind the screen .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GOYTns1mURw3w6MYWxydKg.png" /><figcaption>figure 1</figcaption></figure><p>When you try to explore a new page of game design, you may heard some of the buzzwords like ray tracing, path tracing and real-time rendering and so on. So what will be the the mainstream graphics techniques for game design in the future? And what kind of render techniques can make great contributions to the future of gaming? How could we make a trade off between rendering qualities and rendering efficiencies?</p><p>In this story, I would like to discuss these questions as follows:</p><blockquote><strong>What is rasterization?</strong></blockquote><blockquote><strong>What is ray tracing?</strong></blockquote><blockquote><strong>What is path tracing?</strong></blockquote><blockquote><strong>What are the differences between ray tracing and path tracing ?</strong></blockquote><blockquote><strong>How to make some improvements based on the these render techniques?</strong></blockquote><ol><li><strong>What is rasterization?</strong></li></ol><p>Rasterization is a process of rasterizing 3D models onto a 2D plane for display on a computer screen. However, this process is often carried out by fixed function <strong>hardware</strong> within the graphics pipeline.</p><p>Let’s get a quick review of general OpenGL graphics rendering pipeline (<em>figure 2</em>):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z9cmRw9QtkPEdQfdKpsh3Q.png" /><figcaption>figure 2</figcaption></figure><p>This pipeline is implemented by <strong>OpenGL, graphics driver, graphics hardware</strong>. The basic logic for this pipeline is object-oriented, which needs walking through objects, transforming and then drawing each one unless the z-buffer says that it’s not in front.</p><p>From this pipeline, we can see that any image that you see displayed on a computer screen does not start out as that image. It begins as either a raster or a vector image. A raster image is composed of a collection of shaded pixels.</p><p>The main advantage of rasterization is its speed, especially compared with ray tracing. The GPU will tell the game to create a 3D image out of small shapes, most often triangles. These triangles are turned into individual pixels and then put through a shader to create the image you see on screen(<em>figure 3</em>). It can be used as real-time rendering.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/440/1*tFbKq_RYLT2SiCDhZQKRRQ.gif" /><figcaption>figure 3</figcaption></figure><p>However, rasterization is simply the process of computing the mapping from scene geometry to pixels and does not prescribe a particular way to compute the color of those pixels. So it cannot take shading, especially the physical light, into account and it cannot promise to get a photorealistic output. That’s a big limitation of rasterization.</p><p><strong>2. What is ray tracing?</strong></p><p>Since rasterization is extremely fast, so it has been a good option for video game graphics for a long time. However, as current technology begins to bump against its limits like color limitation, more advanced techniques should be taken into consideration. So here comes one break through of the next rendering level: the ray tracing technique. Ray tracing looks far more realistic than rasterization.</p><p>Ray tracing is eye-oriented process that needs walking through each pixel looking for what object should be shown there, which is also can be described as a technique that follows a beam of light (in pixels) from a set point and simulates how it reacts when it encounters objects.</p><p>Consider the picture : <em>figure 4. </em>Ray traced graphics would start at your “eye”, actually it’s camera here. And then the shooting ray from each pixel of the image plane will follow your line of sight to the scene object, and then follow the path of light from the intersected object back to the light source.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sJWf5cb6OL0mQsPhx9u0gg.png" /><figcaption>figure 4</figcaption></figure><p>Ray tracing is an offline rendering technique, which is useful for film industry. Because the film illustrates the reflection of light from every surface to create the graphical style everyone has come to know and love, so ray tracing can make a better quality for each frame.</p><p>However, compared with rasterization, ray tracing is hard to be implemented in real time, since even one ray can be traced and processed without much trouble, but after one ray bounces off an object, it can turn into 10 rays, and those 10 can turn into 100, 1000…The increase is exponential, and the the calculation for all these rays will be time consuming. For example, for film making, <em>Toy Story 3 </em>took an average of 7 hours per frame, and some frames in <em>Monsters University</em> took a reported 29 hours each. So there is still a digital gap that using ray tracing to do game design.</p><p>Maybe with attainability of graphics cards capable of ray tracing, this technique will become as readily available as 3D graphics eventually. For now, though, ray tracing is still considered the cutting-edge of computer graphics.</p><p><strong>3. What is path tracing?</strong></p><p>Path tracing is a type of ray tracing. When using path tracing for rendering, the rays only produce a single ray per bounce. The rays do not follow a set line per bounce, but rather shoot off in a random direction. The path tracing algorithm then takes a random sampling of all of the rays to create the final image. This results in sampling a variety of different types of lighting.</p><p>For simple ray tracing, it shoots one ray from each pixel, but in path tracing , instead of sending out one ray it sends out tens, hundreds or even thousands of rays for each pixel to be rendered. When it hits a surface it doesn’t trace a path to every light source, instead it bounces the ray off the surface and keeps bouncing it until it hits a light source or exhausts some bounce limit. It then calculates the amount of light transferred all the way to the pixel, including any color information gathered from surfaces along the way. It then averages out the values calculated from all the paths that were traced into the scene to get the final pixel color value. It requires a ton of computing power and if you don’t send out enough rays per pixel or don’t trace the paths far enough into the scene then you end up with a very spotty image as many pixels fail to find any light sources from their rays. So when you increase the the samples per pixel, you can see the image quality becomes better and better. Besides, now most of softwares use path tracing as the prior rendering technique. <em>Figure 5 </em>shows a water animation that I used <em>Blender</em> to create it. For rendering part, the engine uses path raytracing technique to get each frame. Even the calculation is time consuming, but the final quality still worthies that.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*K9Fpn6oUL8g8FCJXSdNO0A.gif" /><figcaption>figure 5</figcaption></figure><p><strong>4. What are the differences between ray tracing and path tracing?</strong></p><p>Actually, it is improper to compare ray tracing and path tracing, since there is no<strong> differences</strong> between them. Path tracing is type of ray tracing, it is pointless to compare these two terminologies, since they belong to different levels, like two different layers of a matryoshka doll.</p><p>The basic concept of racy tracing is that you shoot a ray that will calculate the primary lightning, however, the ray will bounce and generate more and more rays, which might contribute less of the final lighting. According to this issue, path tracing shows a reasonable rendering equation to solve the exponential ray-increasing problem. So path tracing is only a fast form of ray tracing.</p><p>Path tracing has some advantages:</p><p>Firstly, path tracing is an evolution of classic Turner Whitted raytracing. As we mentioned before that for classic ray tracing the rays will increase exponential. Path tracing provides a solution to that. For each pixel, instead of shooting only one ray, it shoots off multiple rays in a random direction.</p><p>Secondly, path tracing can be used to solve more complex lighting situations (with diffuse inter-reflection or caustics) through the use of Monte Carlo integration to solve an integral equation which represents light transport within a scene. It represents a more disciplined approach to image generation, capable of reproducing a more rich set of light or surface interactions.</p><p><strong>5. How to make some improvements based on these render techniques?</strong></p><p>With the development of hardware that in consumer-grade machines, ray tracing is possible in real-time in video games. BUT these hardware now are not considered as affordable. So these is still a long way to make an impressive breakthrough in graphics area.</p><p>For now, for programming part, the most common way to do fast ray tracing or path tracing is to use some data structures to improve the calculation time. These commonly used data structure are k-d tree, BSP tree and so on. In the next story I will discuss how to use k-d tree to do fast path tracing.</p><p>References:</p><p>[1] <a href="https://en.wikipedia.org/wiki/Rasterisation">https://en.wikipedia.org/wiki/Rasterisation</a></p><p>[2] <a href="https://www.dusterwald.com/2016/07/path-tracing-vs-ray-tracing/">https://www.dusterwald.com/2016/07/path-tracing-vs-ray-tracing/</a></p><p>[3] <a href="https://www.quora.com/Whats-the-difference-between-ray-tracing-and-path-tracing">https://www.quora.com/Whats-the-difference-between-ray-tracing-and-path-tracing</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=32b334510f1f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Is there a digital gap that people with visual disability trying to use the visual electronics?]]></title>
            <link>https://medium.com/@junyingw/is-there-a-digital-gap-that-people-with-visual-disability-trying-to-use-the-visual-electronics-b0fd8367b822?source=rss-324c95abd4ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/b0fd8367b822</guid>
            <category><![CDATA[creativity]]></category>
            <category><![CDATA[disability]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[visualization]]></category>
            <category><![CDATA[equality]]></category>
            <dc:creator><![CDATA[Junying Wang]]></dc:creator>
            <pubDate>Sun, 27 Oct 2019 22:29:53 GMT</pubDate>
            <atom:updated>2019-10-27T22:29:53.496Z</atom:updated>
            <content:encoded><![CDATA[<p>Technology may not yet be capable of human consciousness, the close human connection without the assistance of technology may help us finding the true personal warmth that social networks can never achieve.</p><p>I am a fanatic game lover, I am trying to acquire different game experiences based on various types of game equipments. For example, <a href="https://www.pokemongo.com/en-us/">Pokémon Go</a> is an augmented reality mobile game, we can simply use our mobile phone to catch these <em>Pokemon</em>, like a cute Pikachu! With the virtual reality equipments, people can easily obtain the immersive experience by wearing the VR glasses. If you are Nintendo Switch enthusiasts, you must have heard <em>The Legend of Zelda</em>, <em>Super Mario</em>. No matter what kind of game it is, all these games are followed on the same interactive principle: they use their own interfaces to get users’ inputs and generate the visual outputs in order to give the players general feedbacks. What you expect from the game experience most depends on the visual parts. Since we are emerging from two-dimensional commands into assistive touch, voice recognition, lip-reading, and facial expression sensors, when we play video games, what we need is following the instructions and use our own strategies to embrace a good result, getting relaxed, we just need to follow the rules rather than create something. This is how young people getting relaxed, building social network and making new friends, especially for my generation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*SKnkZq0neFakZ3YFCOhq0g.jpeg" /></figure><p>However, are we beginning to ignore something that potentially affect us in the daily life? Here comes my question, just as the title of the article mentioned:</p><p><strong>Is there a digital gap that people with visual disability trying to use the visual electronics?</strong></p><p><strong>The answer is : Yes, there is.</strong></p><p>There are amount of technologies coming to their unique viable birth day by day. These new techs will bring significant improvements for these certain people, especially in voice recognition area. Take it for instance, Siri of iPhone can free people’s hands and bring a new light to these people who cannot rely on the visual information. However, for the entertainment parts, since most of the games are focus on the vision outputs, they may show us many fancy animations with cheering motions, therefore, for these people with visual disabilities, they cannot get the feelings as same as us.</p><p>I used to be a volunteer at the Blind school of my hometown. On the weekends, I taught mathematics and physics to blind students and forged strong friendships despite the disability. In contrast to this close interaction I had the pleasure of experiencing, I began to realize that some students merely used electronics, especially using the game equipments. They barely played video games, even in deep of their heats, they still wanted to have a try. They were so sensitive and felt alienated from the rest of the world. Indeed, there is a tremendous digital gap that we face with students with disabilities. Though they are alienated from the visual world, they still have the same equalities and abilities to touch, to feel and to create some intuitive things. Therefore, this deficit has inspired my desire to work on the motion area, especially motion with entertainment parts. Motion comes from vision, but also beyond vision, which means it can break the limitation of the visual area and get a positive compensation to the whole human computer interactive system. And it has become my life mission to optimize the students’ everyday technologies and bridge the digital-social gap. Just as President Franklin D. Roosevelt said:</p><blockquote><strong>“If civilization is to survive, we must cultivate the science of human relationships; that is the ability of all peoples, of all kinds, to live together, in the same world at peace.”</strong></blockquote><p>In this spirit of this quote, I believe that it is time to bring revolutionary change for these students in need and to make a difference in their lives.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JJgCSb8yPb3psNXSrovlYw.jpeg" /></figure><p>The truth is that for everyone in the world, if they can feel that they are valued, they will value the world. So do not try to isolate them, at least, try to do some small contributions to their lives and let them feel that they a valued by us!</p><p>If we can do like that, Let me ask the same question again:</p><blockquote><strong>Will there still be a digital gap that people with visual disability trying to use the visual electronics in the future?</strong></blockquote><p>My answer will definitely be:</p><p><strong>No, it won’t any more. :-)</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b0fd8367b822" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Multiplayer First Person Shooter Game Design]]></title>
            <link>https://medium.com/@junyingw/multiplayer-first-person-shooter-game-design-f39069c72832?source=rss-324c95abd4ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/f39069c72832</guid>
            <category><![CDATA[unity-game-development]]></category>
            <category><![CDATA[game-design]]></category>
            <category><![CDATA[multiplayer-game]]></category>
            <category><![CDATA[games]]></category>
            <category><![CDATA[game-development]]></category>
            <dc:creator><![CDATA[Junying Wang]]></dc:creator>
            <pubDate>Tue, 15 Oct 2019 03:29:21 GMT</pubDate>
            <atom:updated>2019-10-15T03:29:21.678Z</atom:updated>
            <content:encoded><![CDATA[<p>That’s to be continued…</p><p>Last time, I shared my experience of how to design a first-person shooter zombie game. In this part, I would like to introduce the next level of game design — How to start a multiplayer game design!</p><h3><strong><em>Game Story:</em></strong></h3><p><em>Figure 1</em> shows two posters of the animation <strong><em>Love, Death and Robots</em></strong>. I could say I got the inspiration from this animation and would like to use some elements, setting this multiplayer game design into a different background.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jX6GT87IqSIA19H8vmtSWg.png" /><figcaption>figure 1</figcaption></figure><p>Welcome to FPS multiplayer game design — <strong><em>Nirvana</em></strong>! The reason I use Nirvana as the game name is that you cannot kill other player totally in this game, since the killed player will bring back to life again and again. Sounds crazy, right? In the first game part, our main character Seven is not a real human, so we cannot use the normal life logic to play the game. As a player when you play the game, just enjoy shooting, no worries about the death or damage.</p><h3>Implementation:</h3><p>Welcome to multiplayer first person shooter game design! Our main character is same as the the first level — zombie shooter game. Since we have already set the player movement in the first level, so let’s come to environment setup directly.</p><ul><li><strong>Environment set up</strong></li></ul><p>Welcome to our fantasy world, filled with incredible animals and kinds of plants! Environment setup is usually tedious, however, for this game, I just downloaded the game kit for from <a href="https://assetstore.unity.com/packages/essentials/tutorial-projects/3d-game-kit-115747"><strong><em>Unity Asset Store</em></strong></a>. This game environment contains particle system, which makes the whole game in a dreamlike world, like <em>figure 2</em> and <em>figure 3</em> show:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9B_bbsjLkICaP4Dk" /><figcaption>figure 2</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PPswINpHrMY99iJC" /><figcaption>figure 3</figcaption></figure><ul><li><strong>Multiplayer and Networking</strong></li></ul><p>The main principle in Unity of Networking shows as <em>figure 4</em>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oGUqum_EI7aNE9vZJFWDkA.png" /><figcaption>Figure 4</figcaption></figure><p>Basically, the local client, which is our player, is the part of the host, and it is connected to the server. The server or the machine has a single IP address. If we want to set up a multiplayer environment, we need to have other clients connect to the local server, which means other clients need to connect to the IP address to the server. The server can tell the local client what to do next. So we can say every information that transferred between local client and other clients will go though the local server. However, the main problem for this multiplayer strategy is that when one client wants to connect to the local server, he or she needs to type the IP address every time, it is time consuming. Therefore, we need a kind of matchmaking system.</p><p>In order to avoid this problem, Unity has a matchmaking system, named Unity Relay Server. (<em>figure 5</em>) Therefore, when other clients want to connect to the local host, they just need to connect to the matchmaking system directly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mt9kHOEoiTUgUgCUc2lEQA.png" /><figcaption>Figure 5</figcaption></figure><p>Let’s go back go the game design. In Unity for multiplayer game, we use Networking: NetworkManager — playerPrefab must have a NetworkIdentity.</p><p>After we set the NetworkIdentity to our local player, we go to the NetworkManager, and put the Player prefab to the Spawn Info. Now when we run the program we can generate our player automatically. However, if we want to multiplayer, we need to set up the spawn points in our game scene, at least two Spawn points. Next step, we add our main scene to the Build setting and click Build and Run (<em>figure 7</em>). Then we can get the host client and other client. Like <em>figure 6</em>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6RKkfstHpowasIEw" /><figcaption>Figure 6</figcaption></figure><p>However, there is a problem: when we move our local player, the guest player move too. If we want to solve this problem, we need to write a script <strong><em>PlayerSetup.cs</em></strong> to disable components that should only be active on the player that we control. Like <em>figure 7</em>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VortvAflmKQ4Z00ihZFj_w.png" /><figcaption>Figure 7</figcaption></figure><p>Then we can see, when we move one character, the other character won’t be affected.</p><ul><li><strong>Shooting and fire</strong></li></ul><p>Obviously, the most important part for a shooting game is shooting. In this game, we use gun to shoot and when the mouse left button click down, we begin to shoot. The main logic for shooting is using <a href="https://docs.unity3d.com/ScriptReference/Physics.Raycast.html"><strong><em>Raycast</em></strong></a><strong> </strong>method. When our mouse button click down, we will cast a ray from point origin against all colliders in the scene. At the same time, we also need to provide a layer mask, which will filter out any colliders that we are not interested in generating collisions with.</p><p>After getting this method, we write two scripts: <strong><em>PlayerShoot.cs</em></strong> and <strong><em>PlayerWeapon.cs</em></strong>. Attach these two scripts to our player, then we finish the shooting part! Just pay attention, we need to disable <strong><em>PlayerShoot.cs</em></strong> when we do shooting. Otherwise, when we shoot the other player, we actually shoot our host player at the same time.</p><p>What’s more, we can add crosshair when we shoot. The implementation is easy, we can just create a UI and the crosshair image to it, then set it in <strong><em>PlayerSetup.cs</em></strong>, making it appear when we start the game. Then as the <em>figure 8</em> shows, the crosshair will move along with the gun.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ZzwXG5mS8YaHA2lo" /><figcaption>Figure 8</figcaption></figure><ul><li><strong>Damage and Respawn</strong></li></ul><p>In this part, we need to make our players have current healths, so when they shoot each other, we can see their current healths are decreasing. Let’s add another script to our player — <strong><em>Player.cs</em></strong>. At current level, we can set our players respawn after the current health is zero. After we finish this part, we can see when we shoot the other player in the scene, his current health is decreasing, and when his dies, he will respawn at the spawn point. (<em>figure 9</em>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9XAHiSn4GrGSEC7B" /><figcaption>Figure 9</figcaption></figure><ul><li><strong>Shooting animation and death effect</strong></li></ul><p>In real life, if we try to shoot something, we can see the spark and smoke, so is it in a game. In order to make a game much fancier, we should add the shooting animation and some effects. The most convenient way is to use the particle system.</p><ul><li><strong>What is particle system?</strong></li></ul><p>Particles are small, simple meshes, when they are displayed and moved in great numbers, they will form a particle system. For example, as we can see the smoke cloud. In smoke cloud, each particle represents a small portion of the smoke. But when we combine the effect of all the particles together, that would create the impression of the complete entity. The whole particle system contributes the total volume of effects.</p><p>In this game, we have four effects: HitSparks, HitEffect, DeathEffect and RespawnEffect. Firstly, adding hit sparks. In this game, when we get the left mouse button down, we begin to fire, so when we press mouse left button, we should play the particle system at the same time. When left mouse up, stop playing the hit sparks effect. Secondly, set the hit effects. Take in the hit point and the normal of the surface (from RaycastHit we can get the hit positions), so when it is called on all clients, we can spawn in cool hit effects at the certain positions. Thirdly, set the death effects and respawn effects. Both of them use the same logic, when the current health is equation to zero, we can call the target function, at the same time, play the fancy effects. After we set up all the shooting effects, we can get a output like <em>figure 10</em>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*GVWUjb1xQ-h1d3AF" /><figcaption>Figure 10</figcaption></figure><ul><li><strong>Networking setup-Matchmaking</strong></li></ul><p>The interesting part is that if you want to release your multiplayer game, you need to pay for the traffic that use Unity Matchmaker and Relay servers. If you want to design a personal project, you will find the CCU is 20, like <em>figure 11</em> shows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*mbzZgkClo3xTXp0J" /><figcaption>Figure 11</figcaption></figure><p>For now, we just need to use the personal development for free. After we build this, refresh the server menu, and we can see the information about the CCU and the max number of player.</p><p>Then run the game, we can click the <strong><em>Enable Matchmaker </em></strong>(<em>figure 12</em>), if we click <strong><em>Create Internet Match </em></strong>(<em>figure 12</em>), Unity will create it like a room, which is used for people to join. Follow the steps, name the room, then players can find the room and join in it, everything works!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZSByzo2JcQE6msBJihZTbA.png" /><figcaption>Figure 12</figcaption></figure><ul><li><strong>Networking setup-Joining and disconnecting</strong></li></ul><p>One of the networking setup part is the joining part. In this section, we will try to design the joining user interface, including create rooms and click to join the rooms. The main logic is that if you are a player, you want to invite your friends to play with you. Firstly, you need to create a host room, then other players will find the room on the JOIN GAME list, so they can click to join the game. After we follow this method, we can create a GUI like <em>figure 13</em>. The related scripts are <strong><em>RoomListItem.cs</em></strong>, <strong><em>HostGame.cs </em></strong>and <strong><em>JoinGame.cs</em></strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oEklp5CIAw1kwWQj" /><figcaption>Figure 13</figcaption></figure><p>After we joining the game, if we want to quit, we need to disconnect the server. In this game, when we load the game, we use keyboard <strong><em>Q</em></strong> to leave the room, then the <strong><em>LEAVE ROOM </em></strong>button will appear. Click the button, we will leave the room and disconnect the server.</p><ul><li><strong>Create user accounts</strong></li></ul><p>Basically, when one user joins the game, the user’s info and data should be saved into a database. We can create our own database use MySQL or other softwares. However, in this game design, if we try to create our own database, it could be complex and time consuming. Instead of creating the database, we can just simply import the <strong><em>Database Control</em></strong> from <a href="https://assetstore.unity.com/packages/tools/network/database-control-free-41337"><strong><em>Unity Asset Store</em></strong></a>. We can simply create a new database and empty a database using the imported asset.</p><p>In this section, we will try to use this user interface and make them fit into our game design. The main pipeline for a new user to join a game and quit a game is : <strong><em>Register as a new user</em></strong> -&gt; <strong><em>Log in </em></strong>-&gt; <strong><em>Create a new room</em></strong> -&gt; <strong><em>Join in</em></strong> -&gt; <strong><em>Escape</em></strong> -&gt; <strong><em>Log out</em></strong></p><p>Follow the whole pipeline, we create the user account interfaces like <em>figure 14</em>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UI5kjLnLNbnqZdB5GfN7WQ.png" /><figcaption>Figure 14</figcaption></figure><ul><li><strong>Getting data and sending data</strong></li></ul><p>For each client or player, they will get the data from the connected server and also send their data to the connected server when they are playing the game. We have two player statuses: <strong><em>KILLS</em></strong> and <strong><em>DEATHS</em></strong>. The data we get are used to record the number of kills and deaths. For the getting data part, we can get the data from the server directly, at the same time, when our main player kill others, we also need to send data to the database of the server. After the whole circulation, we get the updated data. We can apply user interface to show these information. The related scripts are <strong><em>PlayerStatus.cs</em></strong>, <strong><em>DataTranslator.cs</em></strong> and <strong><em>UserAccountManager.cs</em></strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*274EYxO-ptSkdKCX" /><figcaption>Figure 15</figcaption></figure><ul><li><strong>Solve join game timeout problem</strong></li></ul><p>Currently, we are using the matchmaking system that Unity gives to us (Unity Matchmaker). That works fine, however, there is an annoying problem: Once the host create the room and leave the room, that room will be not joinable though it is still on the join list. Therefore, when other clients want to join the room, it does not work, unless you click the refresh button. In order to solve this problem, we should add some join game timeout hints. Basically, using timer is a good way to solve the problem.</p><ul><li><strong>Kill feed and health bar user interface design</strong></li></ul><p>In this part, we will add the kill feed user interface. The kill feed is the live on-screen update of the kills in a multiplayer game, providing updates as to whom is killing whom. This function can be added in the GameManager. The main part to add the kill feed is to get the players data from the server, once we get the right user name, we can add an UI to record information. Therefore, once one player kill another player, the updated information will be shown on the right corner of the screen.</p><p>In order to record the player’s status vividly, we also need to add a health bar. The health bar can be used to show the current health. The design of a health bar is same as it in the first part — zombie game. After we set up it, we can the health bar at the left bottom of our screen. (<em>figure 16</em>)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nhxgjMhvy1nUsuTm" /><figcaption>Figure 16</figcaption></figure><p>After we finish the UI design and audio, we will get a simple multiplayer FPS game!</p><h3><strong>Summary</strong></h3><p>After I think over, I find that this game has a big weakness: This game is mainly focus on multiplayer part (since this is my first time try to make a multiplayer game), so it would not be as fancy as I imaged before. The fact is that after each player shoot to other players, there will be nothing else to do. In other words, you only need to do aiming, running and…shooting. Really sad.</p><p>Maybe the next step is to add some different game story backgrounds, like user can decide which game background they want to enter. Or I can combine escape game with FPS game together, then our player can cooperate with each other and enjoy the game!</p><p><em>Special thanks to </em><a href="https://www.youtube.com/channel/UCYbK_tjZ2OrIZFBvU6CCMiA"><strong><em>Brackeys</em></strong></a><em>, which gave me good tutorials of game design!</em></p><p><strong><em>If you want to get the scripts, you can check with my </em></strong><a href="https://github.com/Junyingw/Multiplayer-FPS-Game"><strong><em>GitHub Repo</em></strong></a><strong><em>.</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f39069c72832" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Comparison between linear blend skinning and dual quaternion skinning]]></title>
            <link>https://medium.com/@junyingw/comparison-between-linear-blend-skinning-and-dual-quaternion-skinning-369e727fdcf6?source=rss-324c95abd4ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/369e727fdcf6</guid>
            <category><![CDATA[computer-graphics]]></category>
            <category><![CDATA[skinning]]></category>
            <category><![CDATA[animation]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Junying Wang]]></dc:creator>
            <pubDate>Thu, 26 Sep 2019 09:17:38 GMT</pubDate>
            <atom:updated>2019-09-26T09:17:38.867Z</atom:updated>
            <content:encoded><![CDATA[<p>There is a certain relationship between skeleton transformation and skin transformation when we aim to do skeleton animations, especially when using the skeleton to drive more complex objects that with skin. This process called skinning.</p><p>Basically, there are several ways to achieve that. Firstly, <strong>simple skinning</strong>: iterate each vertex on the mesh and bound each vertex to a certain bone. Secondly, <strong>linear blend skinning(LBS)</strong>: each vertex is influenced by multiple bones, and each vertex has a certain influenced weight with each influencing bone. Compared to simple skinning, LBS is a classic way to do skinning, it can create natural animation. Thirdly, <strong>dual quaternion skinning(DQS)</strong>: based on the same strategy as LBS, DQS converts rotation matrices to quaternions and compute normalized quaternions, using the related joints’ weight internally, rather than using the rotation matrixes directly.</p><p>Here comes a comparison between linear blend skinning and dual quaternion skinning.</p><ol><li><strong><em>Dural quaternion skinning can avoid the loss of volume problem.</em></strong></li></ol><p>As picture1–1 shows: the left side is an implementation of LBQ, the blend shape is unnatural, the elbow has a loss of volume. The right sides shows the output of using DQS method, which can reduce the artifacts within minimal cost. Suppose we know two vertices positions: P1 and P2. If we use linear interpolation to get the new position, the new position will be lying on the segment between P1 and P2. If we use DQS, the new position will be lying on the arc circle contains P1 and P2, which will avoid mesh shrinkage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AMii86rmmn_PxxJllrNFjg.png" /><figcaption>picture 1–1</figcaption></figure><ol><li><strong><em>Dural quaternion skinning may cause unnatural protrusions on the knees and elbows when they bend.</em></strong></li></ol><p>picture1–2 shows a joint bulging problem with dural quaternion method.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*vEaRr9-EJ9qPOODYISHGPw.png" /><figcaption>picture 1–2</figcaption></figure><p>Reference: <a href="http://rodolphe-vaillant.fr/?e=29">http://rodolphe-vaillant.fr/?e=29</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=369e727fdcf6" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to make a First Person Shooter zombie game?]]></title>
            <link>https://medium.com/@junyingw/how-to-make-a-first-person-shooter-zombie-game-fc92ce6a5292?source=rss-324c95abd4ab------2</link>
            <guid isPermaLink="false">https://medium.com/p/fc92ce6a5292</guid>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[shooter-game]]></category>
            <category><![CDATA[unity-game-development]]></category>
            <dc:creator><![CDATA[Junying Wang]]></dc:creator>
            <pubDate>Wed, 25 Sep 2019 00:09:19 GMT</pubDate>
            <atom:updated>2019-09-25T00:09:19.720Z</atom:updated>
            <content:encoded><![CDATA[<p>Hey, this is my first time trying to write a game independently, and also my first time trying to learn how to use Unity. I would like to share my game design experience to you!</p><p><strong>Game story:</strong></p><p>It’s hard to tell what is real and what is unreal, maybe one day it’s hard to tell what the differences between machine and human, with the development of artificial intelligence. Or maybe the next time when you try to open the door of future, you will open a Pandora’s box.</p><p>Inspired by the TV play ​<a href="https://www.imdb.com/title/tt0475784/"><strong><em>Westworld</em></strong></a>(<strong><em>​ </em></strong>picture 1–1), I would like to set our game background to the era of AI, even our main character is still dressed in Middle Ages suit…Given our player a name, let’s call him Seven, which is the serial number when he was designed by human. Of course Seven is an AI. Seven is different from his brothers and sisters, even they were produced under the same assembly line, he has his own mind and emotions. That sounds creepy, but he is still under control of human. In this game, the first challenge for him is a zombie fight. Seven decides to make a revolution, fight for himself, strive through all the difficulties.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eA7n53oWP0Zp7GJuZOGzEQ.png" /><figcaption>1–1</figcaption></figure><p>After he win the war, will he start a new life as normal human or he is still in sandbox created by human?</p><p>Let’s open the first page of our ​<strong><em>APOCALYPSE </em></strong>!<strong><em>​</em></strong></p><p><strong>Implementation:</strong></p><p><strong>- Main character :</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S2Hv6ZD0bLC57D7J1gI_DQ.png" /><figcaption>1–2</figcaption></figure><p>These two above pictures (1–2) shows the main character. As a beginner, instead of modeling the main character, I downloaded the main character from website — <a href="https://www.mixamo.com/#/"><strong><em>M</em></strong>​<strong><em>ixamo</em></strong></a><strong><em>​</em></strong>. It is a convenient way to make a simple game for a novice.</p><ul><li><strong>How to import the downloaded character into Unity?</strong></li></ul><p>After downloaded the .fbx character, some people would meet the the missing texture problem, when they tried to import the .fbx into Unity. I met the problem too, then I fixed the problem by clicking ​<strong>* <em>.</em>​ <em>fbx​ </em></strong>(my character) -&gt; go to​ <em>​</em><strong><em>Inspector​ </em>​</strong>menu bar -&gt; click ​<strong><em>Extract Texture​ </em></strong>-&gt; name a new <strong><em>f</em></strong>​ <strong><em>older​ </em></strong>-&gt; click <strong><em>c</em></strong>​ <strong><em>hoose​</em></strong>. After these operation, the missing texture will come back. As 1–3 shows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y-pwLHcbnl6AT9po-W5HUg.png" /><figcaption>1–3</figcaption></figure><p><strong>- Game environment set up:</strong></p><p>For game environment set up, I used the elements of <a href="https://assetstore.unity.com/account/assets"><strong><em>Unity Asset Store</em></strong></a>. After imported the all the elements, we can see our game environment is almost like that. As what picture 1–4 shows:</p><p>The next step of environment set up is adding the sky box, as the picture 1–5 shows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-66CkG1xEHVS9xeb" /><figcaption>1–4</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-sin-MTkxSpZfEFA" /><figcaption>1–5</figcaption></figure><p><strong>- Create a 3D character movement:</strong></p><ul><li><strong>Player motor part:</strong></li></ul><p>After we setup the environment, the next step is creating 3D character movement. The main movement part depends on the script <strong><em>PlayerMotor.cs</em></strong>. In this script, we need to set mouse for rotations, and the default keyboards ”<strong><em>W</em></strong>”, ”<strong><em>A</em></strong>”, “<strong><em>S</em></strong>”, “<strong><em>D</em></strong>” are used for going forwards, left side, backwards and right side. Once we finish it, we need to assign it to the Player. Then when you run the program, you can see our player can move now!</p><p>Since it is a first person person game, we need to set the main camera as a part of our player (dragging the main camera under the player object, as a child). Then transforming the camera position, we can play the game in the first person perspective!</p><ul><li><strong>How to add animations to our main player?</strong></li></ul><p>In this game design, I just downloaded the animation from<strong><em> </em></strong><a href="https://www.mixamo.com/#/"><strong><em>Mixamo</em></strong></a>, as we can see from 1–6. However, we can design some fancy animations by ourselves. But for this simple FPS game, I just chose the fastest way. Thanks for this website, it survived me from my directed research…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lzTljGQ4aBDoJFZnBxckBw.png" /><figcaption>1–6</figcaption></figure><p>For animations, I used <strong><em>run forwards</em></strong>, <strong><em>run backwards</em></strong>, <strong><em>run left, run right</em></strong>, <strong><em>walk forwards</em></strong>, <strong><em>walk backwards</em></strong>, <strong><em>walk left</em></strong> and<strong><em> walk right</em></strong>. If we want to add these animations to our player, the first step is creating an <strong><em>Animator Controller</em></strong>, with a script named <strong><em>PlayerAnimController.cs</em></strong>. In the second step, we need to create two parameters: Direction and Speed. At the same time, we create a blend tree named Movement, which means once we go to Entry, we will go to the default state — Movement. Next step, we will set our blend tree.</p><ul><li><strong>What is blend tree in Unity?</strong></li></ul><p>A <a href="https://docs.unity3d.com/Manual/class-BlendTree.html"><strong><em>blend tree</em></strong></a> is a way for animation transition that allows blending animations together using variables, which means we can define variables to control the transition between different animations. For normal animation transition, we can see directly that we can go from one animation to another animation, for blend tree, that allows us massive control over all the animations. All in all, blend tree is good choice when you want to do something like character movement.</p><p>We import our animations into the blender tree (picture 1–7), according to these two parameters Direction and Speed, we set PosX and PosY. Pay attention, once we import the animation, we need to make sure that we click the <strong><em>Loop time</em></strong> and <strong><em>Loop Pose</em></strong>, as picture 1–7 shows. Otherwise, when we run the program, our player will stuck in one certain position.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wm_XnyISfr7610nUjeHaqw.png" /><figcaption>1–7</figcaption></figure><p>After we finish all the parts, attach script <strong><em>PlayerAnimController.cs </em></strong>to our player, then we can use keyboard and mouse to control the player’s movement, now you can see the animations, like walking forwards and running left side.</p><ul><li><strong>Set IK target and Weapon-AK47</strong></li></ul><p>Our goal is letting the gun,as well as the bone, always aim to the target IK , when we aim something. For aiming, we need to set IK target, in this game, we can create a sphere under camera and and set it as the IK target (target IK is a child of the main camera). Next step, we add aiming function in the script <strong><em>PlayerAnimController.cs</em></strong>, using <strong><em>Space</em></strong> to control if aiming or not. Then we need to add a new Aiming layer, a new parameter <strong><em>isAiming</em></strong> and set the Aim mask in our Animator Controller. Then we can add the <strong><em>Rifle-Aiming</em></strong> animation to Aiming state.</p><p>For weapon setup, I choose the AK-47, which I downloaded from<strong><em> </em></strong><a href="https://assetstore.unity.com/packages/3d/props/guns/low-poly-gun-pack-4725"><strong><em>Unity Asset Store</em></strong></a>. Then we need to set the AK-47 manually, like transformation, rotation and scaling. Then we run the program, we see that our player can use the gun aiming now! (picture 1–8)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EFcsIfwXq5kKkabx1kczTQ.png" /><figcaption>1–8</figcaption></figure><p><strong>- Player Information and Character Setup</strong></p><p>Here! we come to one of the most important parts — -player information set up. In our game, we have two main characters: player and enemy (zombie). The attributes of characters are maximum health and current health. As the normal logic, when the player is attacked by enemies, the current health of player will decrease, according the volume of damage. If the current health is equal to zero, the game is over and our game objects will be destroyed.</p><p>For our character, we need to add three scripts: <strong><em>Character.cs, CharacterInfo.cs, GameManager.cs</em></strong>. What I have achieved in this part are as follows :</p><p>Firstly, this game has multiple levels, when our player shoot all the zombies in scene, the level will increase, at the same time, the number of spawner zombie will double.</p><p>Secondly, our player has two attributes — -current health and max health, max health is based on the current level, when the level increase, the max health will go up. The current health depends on the amount damage that the player taken.</p><p><strong>- AI Zombie setup</strong></p><p>Let’s go to the enemy part! In this game, the enemy character is zombie, as picture 1–9 show:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mtt_tkORoxjDfoj1_bP_HQ.png" /><figcaption>1–9</figcaption></figure><ul><li><strong>Zombie animations set up</strong></li></ul><p>For zombie animations, we need to set zombie animation controller, as picture 1–10 shows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b8xmecmpbjAcfmmIqSJS7w.png" /><figcaption>1–10</figcaption></figure><p>In this game, zombie has three states: <strong><em>Moving, Attacking, Death</em></strong>. For each state transaction, we need to assign the correct animation according to the parameters.</p><ul><li><strong>How to make enemies always attack towards our player?</strong></li></ul><p>When we play game, we need to make sure that the zombies can find the player and attack the player. Image if the zombies stroll around and don’t care about the player…this game will have no more challenges, it will be boring.</p><p>If we want to make sure that zombies will always attack towards our player, using <a href="https://docs.unity3d.com/ScriptReference/AI.NavMesh.html"><strong><em>NavMesh</em></strong></a> and <a href="https://docs.unity3d.com/ScriptReference/AI.NavMeshAgent.html"><strong><em>NavMeshAgent</em></strong></a> is the best way to solve this problem. NavMeshAgent can be attached to the game character and allow it to navigate the scene using NavMesh, it can be called in Unity internally. Next step we need to add the transform (LookAt) functions in the script and make the zombies always facing towards the player.</p><p>Then adding two scripts <strong><em>CharacterInfo.cs</em></strong> and <strong><em>ZombieMotor.cs</em></strong> to our zombie, just remember to bake the floor as the picture 1–11 shows. Finally, we run the program, we can see one zombie walking towards our player and trying to attack him.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yeFNc2e9Db7eKEsh" /><figcaption>1–11</figcaption></figure><p><strong>- Zombie spawners setup</strong></p><p>In the last part, we finished zombie animations set up. However, one zombie is not enough for shooting. So this section, we need to set zombie spawners, which decides the locations that zombies spawn. Add spawning requirements in <strong><em>GameManager.cs</em></strong>, define the size of zombie spawn points and drag the element into the menu list. Now we can see that bunches of zombies are walking towards to our player. (picture 1–12)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-xC1mvaQbq1G93ZM" /><figcaption>1–12</figcaption></figure><p><strong>- Damage and bullet</strong></p><p>Our player has a weapon AK-47, he can aim but cannot shoot for now, since we didn’t load the bullet to the gun. Therefore, in this part we need to set the damage and bullet.</p><p>The damage is bidirectional, zombies attack the player and player shoot the zombies, so we need to add script <strong><em>DealDamage.cs</em></strong> to both of the characters. For zombies, they use hands to attack, which means we need to attack the script to their hands, once their hands touch the collider of our player, the current health of our player will decrease. For our player, he uses gun to shoot, which means we need to attach the damage script to the bullet. Once the bullet hit zombie’s collider, the current health of zombie will decrease. After we finish this part, we almost come to the end of our game design pipeline!</p><p><strong>- Menu and user interface design</strong></p><p>User interface is a necessary part for a fancy game, in this section I would like to share how I design the simple menus and GUI (picture 1–13, 1–14).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lH1EL6vqO_GG17M-" /><figcaption>1–13</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wODynEk3QI8K2S32" /><figcaption>1–14</figcaption></figure><p>These all three scenes we need to create, one is our main game, one is the main menu and another one is used to show the game instruction. After we create these scene, the first thing we need to do is adding scenes in build, please pay attention to the building index. Our main menu has two buttons, when click “<strong>!</strong>” button, we will jump to the instruction menu, this function can be realized by attaching <strong><em>JumptoInstruction.cs</em></strong> to the button. If we click “<strong><em>NEW START</em></strong>” button, we will jump to our main game. This jump function is achieved in <strong><em>GameManager.cs</em></strong>. The another important GUI part is the scoreboard (picture 1–15). The scoreboard is used to record the number of zombie that our player killed and the kill ratio. After our player die, the scoreboard will show up.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6Oy0AigBeeLtLkqt" /><figcaption>1–15</figcaption></figure><p>The last part of GUI is the health bar of our player. The health bar can show the current health of our player directly. Therefore, when we play game, we can change our strategies according to the current health. Creating a health bar is not complicated. First, add image named <strong><em>HealthBar </em></strong>under UI canvas, setting it to <strong><em>Mask </em></strong>(picture 1–16). If we add another image above the mask, when the image move, it can be hidden by the mask. Secondly, we create an image under the health bar, named <strong><em>CurrentHealth</em></strong>, setting the image type to <strong><em>Filled</em></strong> and fill method to <strong><em>Horizontal</em></strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*So_NTxaNNBEUnk6tb-hIqQ.png" /><figcaption>1–16</figcaption></figure><p>Lastly, we need to write a script attaching to our health bar, which set the filled amount of the current health. After we finish that, now we can see the health bar is at the left corner when we play the game, and when our player is attacked by zombies, the amount of blood of the health bar will decrease. (picture 1–17)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*h0dWMGKz7q3kIEbh" /><figcaption>1–17</figcaption></figure><p><strong>- Audio and BGM set up</strong></p><p>Finally finally, we come to the final part! Audio and BGM! It’s my favorite part, most of time, a good background sound can build a favorable atmosphere for our game. For this game, it’s not a horror game, we don’t need to add some horror elements, especially some horror sound…Therefore, I used some lively melodies, maybe it can make this game not creepy. Adding audio is easy to implement, for our player, we need to add footstep sound. I added the step events to the animations of our player, and under the player object, adding <strong><em>Audio Source </em></strong>part is necessary. Then choose the BGM you like and add them to different scenes.</p><p>Now we get a completed FPS game! I am sure you will have a cheering experience when you play the game.</p><p>Special thanks to <a href="https://www.youtube.com/channel/UCl79oyrtcsMTeCK_AG39mlA"><strong><em>CB Showtunes</em></strong></a>, which gave me good tutorials of game design!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc92ce6a5292" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>