Home Some FPS Game - Day 1
Post
Cancel

Some FPS Game - Day 1

Introduction

So we (Looseman, brplc, and 3enab) are working on a little project that is going to be an FPS game made with Unity using the C# programming language. The game is supposed to have the movement style of Quake Arena III, and overall, it should be very simple. The main reason why we started this project is because Looseman wanted to get familiar with Unity.

The name of the game is yet to be decided.


Looseman is going to demonstrate how the first day of development went in the next section.


The materials

First off, I wanted to use materials, so I looked it up. A material consists of multiple images, one for coloring the material, and one for normal mapping to give it a good looking texture. P.S I still do not understand everything about materials so take that with a grain of salt

screenshot


The Movement

I researched on how to implement movement on the characters, I found out that there are multiple ways in which you could implement movement. Two types stood out to me, Character Controller and Ridgidbody.

I went with Ridgidbody, because I felt that it gives a smoother feel since it uses vector physics.


Character movement:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
void Move() {
  //fuck this shit
  Vector3 currentVelocity = rb.velocity;
  Vector3 targetVelocity = new Vector3(move.x, 0, move.y);
  targetVelocity *= speed;

  targetVelocity = transform.TransformDirection(targetVelocity);

  Vector3 velocityChange = (targetVelocity - currentVelocity);
  velocityChange = new Vector3(velocityChange.x, 0, velocityChange.z);

  Vector3.ClampMagnitude(velocityChange, maxForce);

  rb.AddForce(velocityChange, ForceMode.VelocityChange);
}

Ignore the angry comment on the top, I was frustrated with all the vector math stuff. 😅

I am not going deep into abstract or simple vector math here, but just know that each object in the game needs its own physics.


Conclusion

Got the basics of Unity down, and got some basic functionality to the game. That’s about it for today.


TODO:

  • Add animations.
  • Add Weapons.
  • Add HUD.
  • Change the movement to suit me.

Thank you for reading through, and feel free to give us any suggestions!

This post is licensed under CC BY 4.0 by the author.
Recently Updated
Trending Tags
Contents

-

-

Trending Tags