Showing posts with label gameplay. Show all posts
Showing posts with label gameplay. Show all posts

Tuesday, November 5, 2019

Unity : FPS Microgame new feature and gameplay.

Finally I added a Tracer's blink skill to the player.



Implement blink was really easy.

// tracer blink.
if (isGrounded && m_InputHandler.GetTracerBlink())
{
characterVelocity *= 10;

// make blink effect
GameObject obj = GameObject.Instantiate(trailPrefab,
transform.position, Quaternion.identity);
obj.GetComponent<VFX_Trail>().SetFollowObject(gameObject, 0.7f);
}


For trail effect I added trail effect object and 0.7 later it will be destroyed. As you can see there is a variable characterVelocity. That's a character's velocity and blink skill just boost the current velocity 10 times faster.

I added portal, weapon tuning, new blink skills and tried to play this game to make it look fun.








That is it! I hope you enjoyed this series of article. :)


Wednesday, October 30, 2019

Regression Analysis in Games.

I like Gameplay Programming. Why? Because change one value a little bit then feels very different. When I talk about the feel, I usually talk example of comparing Unreal Tournament and Quake series.

For instance jump. Feel of jump in UT and Quake are definitely different. Yes, they use similar vector calculation but different tune values.

There are another example which is Super mario. There are tons of different platformer games. but feel of jump in Super mario much better than other games. I don't know what values they use but I could use different method to make similar jump feel.

Using regression analysis, I could get a formula. First of all, you can visit http://physmo.sourceforge.net

Using PhysMo, you can get Mario's jump curve data such as


Time
Height
0
0
0.015683
0
0.033367
0.25974
0.05005
0.519481
0.066733
0.727273
0.083417
0.987013
0.1001
1.194805
0.116783
1.350649
0.133467
1.558442
0.15015
1.714286
0.166834
1.818182
0.183517
1.922078
...
...
0.500501
0.415584
0.517174
0.199842
0.523867
0
0.540551
0

With this data and use regression analysis in Excel then you can get the formula like below.





f(x) = -32.038x2 + 17.486x - 0.2101


with this f(x), we can get y value of Mario. it feels same as Super Mario. Of course we can't use it for Ground -> Air -> Falling situation and others but you get the idea how to use Regression Analysis in Games.


Reference
Original idea of Super Mario analysis by Kenton.

Task in UnrealEngine

 https://www.youtube.com/watch?v=1lBadANnJaw