Zixuan Wang and I spent about a week debugging existing content; editing art effects; synchronizing with David’s modification suggestions.
The development of this project is generally smooth, and I have accumulated a lot of experience. Thanks UAL.
Zixuan Wang and I spent about a week debugging existing content; editing art effects; synchronizing with David’s modification suggestions.
The development of this project is generally smooth, and I have accumulated a lot of experience. Thanks UAL.
I drew a blueprint of the functionality.
When the purple circle representing the player enters the green trigger, the shuttle event will start. At this point, the player is no longer able to exit the shuttle event. Players can press W to walk towards the portal. When it is detected that the player enters the portal, a 3D character will be generated at the appropriate 3D position and the 2D character will be deleted at the same time.
all righ, let’s try it.
It’s very simple, isn’t it? Then let’s get 3D players back to the books.
Let’s look at the breakdown of the character returning from 3D to 2D. When the player jumps from the portal entrance on the book, he will first touch the red trigger, and at this time, the event of switching the camera will be executed. In the next step, the player will trigger a relatively small yellow trigger to execute 3D to 2D events: generate 2D characters and delete 3D characters.
Let’s take a look at the demo.
Looks good.
What I introduced in the blog is relatively simple, but in fact, the number of problems encountered in the actual development process is unimaginable. As a developer, I need to take into account every possible situation that a player can have.
There is less than half a month before the submission date. In the last 15 days, I will finish the thesis and cooperate with the level editor Zixuan Wang to complete the game construction.
Today is an important holiday for the Chinese Internet, similar to Black Friday in Western countries.
I was going to finish this part of the blog today since I’ve already finished modeling and shading the magic book.
I use a camera to capture the Canvas and render to a render texture. And use this render texture as the texture of the magic book. The image material of the 2d part is provided by Anqing Sun.
Anyway, players can now walk around on books.
Tomorrow let the character jump out of the book first.
Considering that this game is not meant to be a hardcore shooter, I will build distance attack into curve.
Kasha’s ICATHIAN RAIN skill in League of Legends is a very good reference.
Such an attack method can greatly reduce the efficiency of the attack, thereby weakening the weight of the game.
SSo now only the curve of the attack is needed. Curve We mentioned the bezier curve in the <spider attack event> blog.
fmp 05/11/2022 – Yuanhang Wu | MA 3D Computer Animation Notes (arts.ac.uk)
But what I need to use here is a high-order bezier curve.
It can be seen that the seven points A1 to A7 in the above figure control this curve. And these seven points can be calculated by the vector of the ghost pointing to the target and the ghost forward vector.
As can be seen from the above code, I used a lot of Random functions to randomize the positions of A1 to A7 so that each curve is different.
I recorded a demo and set the missile to lightning.
I think the effect is not good enough. Fortunately, I have built a tail effect in a previous project, which happens to be useful here.
So let me add the tail FX to the missile and see the effect.
nice! It looks great.
Tomorrow I will start building the last function of the game: player shuttles from 2d to 3d.
According to the character design drawn by Anqing Sun, the character is followed by a ghost.
I want the ghost to wiggle as it moves.
And ghosts can cast spells.
But before everything started, I needed to model and rig the ghost.
I finished modeling the ghost using the MD who modeled the character’s clothes before. At the same time, the editing of the ghost polygon uv was completed in Maya.
I used a very simple joint to complete the rigging of the character.
Similarly, the simulation method mentioned in the previous blog can also be used here.
It can be seen that the magica cloth plug-in is really easy to use.
After working last night and this afternoon, I have figured out the spider boss.
I will record a demo at the end. It is worth mentioning that the effect of facing large spiders from the player’s perspective is still very good.
The following demo was recorded after I completed the development of the health bar system. (15/11/2022)
My next step is to start working on the ghost that follows the player. This ghost can give the player the ability to attack from a distance.
In fact, when I made the spider standby animation yesterday, I had already thought about the spider’s attack logic.
But before I start to introduce all this, I need to introduce a very useful function: Bezier curve.
Bezier curves are widely used in modern computer graphics. Bezier curves are often used to describe surfaces and curves, such as the pen tool in photosh. But we only use it here to describe a curve, and the curve can have multiple control points.
The complete concept of Bezier curves can be found in the above Wikipedia link.
Because I couldn’t find a similar tutorial in the Simplified Chinese online community, I even recorded a tutorial for this purpose, and got 4000 views. The tutorial I made myself can click the link below.
https://www.bilibili.com/video/BV1xP4y1U7J8?t=3.6
After a simple tutorial of the mathematics part, then let’s begin to see the spider’s attack logic.
The upper left corner of the picture shows the attack range of the spider legs. The attack event is triggered when the player walks into the attack range.
The lower right corner of the image shows the spider leg attack. A1 in the figure is the starting point of the spider’s leg, A3 is the player’s current position, and A2 is a control point calculated by interpolation between A1 and A2.
In this way, I only need to go through the positions of the ends of the six spider legs and the character to get the spider leg closest to the player.
I’ve done the initial spider construction. Check out the video demo below.
The effect is very good, isn’t it? I’m going to add an idle animation to the spider next.
I want the spider’s body to float up and down vertically, and also have a rotation on the x-axis. Preferably the x and z axes are also slightly shifted.
It should be noted that this is not a keyframe-driven animation, but an idle animation completely implemented by code.
The principle is very simple, I make the rotation angle of the spider equal to a sine function (the parameter of the sine function is an increasing time).
And I can use a float to multiply the sine function to control the range of the wave.
The same method can be used not only for rotation, but also for displacement using a sine function to achieve a wave effect.
However, the spider’s legs should not remain in contact with the ground. I need to add an idle animation to the spider legs as well.
Well, now it is the full version of the spider idle state.
Tomorrow I will start working on the attacking event of the spider (to player).
You must know that implementing the IK system in Maya requires a lot of operations. However, there is no ik system support in unity, which requires developers to develop ik systems themselves.
Here is a really fancy lecture about ik system. Not only on unity but based on 3D mathematics.
The IK system is actually not complicated. It only contains some relatively elementary vector operations. The main core is to interpolate the original position of the joint with the target position, and use the distance from the target as the weight.
I won’t say too much about linear algebra here. I am going to show the demo directly.
I added another control point to this ik system to affect the mid joints.
Now that the legs and body are developed, we can start assembling the big spider!
I was only told that the boss form will be a spider. The rest I will be allowed to create what ever I want.
start modeling.
Considering that the spider’s legs are going to attack the player, So I am going to prepared the legs separately from the body.
Considering that spiders are arthropods, I will make polygons a child of joints. Instead of controlling by weight.
I will set up the spider’s body in the unity engine first.
I used the simulation scheme mentioned in the previous blog here. For the method, please refer to:
fmp 21/10/2022 – Yuanhang Wu | MA 3D Computer Animation Notes (arts.ac.uk)
Now the spider’s tail can wag with movement.
Next I’ll build the spider’s legs.
The method for the legs is the same as for the body: set the polygon as a child of the joint.
I will talk about ik system in unity engine in tomorrow’s blog.