Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
April 8, 2022 09:29 pm GMT

3D Modeling RTS Units: Deterrence Video Devlog 4

Image description

A tower defense mixed with real-time strategy where you repel attacking sentient AI robots until they give up.

Modeling the CH-47

The most important part to modeling the chinook was reference images. Without them, the model would be have incorrect proportions and I wouldn't have gotten very far.

Figure1

To texture the chinook, I tried the high resolution model method since I didn't have an actual chinook to capture pictures of. The high resolution model method will have all the finer details of the model created with geometry, then I would render an image of that model to paint on the lower resolution game ready model.

Figure2

Making the propeller blades a separate object was important for the spinning effect I would add later in Unity.

Figure3

To finish up the chinook, I took the color texture and began to change the RGBA channels for metal, smoothness, and a gray scaled normal map to be interpreted by Unity.

Figure4

Modeling the Soldier
This was my first character model ever, I learned quite a bit and actually impressed myself with this one. I thought texturing the soldier would be incredibly difficult, but the method I used was simple and powerful. I would create the shapes I wanted to paint on the model with an image editor. I used those images to paint the color and height textures. They turned out pretty good in Unity.

Figure5

As this was my first rig in my life and in Blender, I had to a bit of trouble getting the bones to work. If your character is built with one half and mirrored, then you should know that the bones on each side should have the same name (case sensitive) and end with .L or .R for their side. Also, it's a good idea to add a few more loop cuts to your limbs to prevent them from folding completely flat.

Figure6

Unit Select Ring

The unit select ring is bascially a projector. If you've ever tried this, you'd know that Unity has a standard asset package that comes with projector shaders, and you'd know that those shaders aren't for opaque images. In order to get the projector opaque, I took the light projector shader and changed the blend to "SrcAlpha OneMinusSrcAlpha" and commented out all the fog related code. The trick to using this shader is to know that opaque black is transparency and all color data to be drawn is completely transparent.

Figure7

RTS Drag Select

You're probably thinking drag selection is as simple as just testing if the unit is between the Xs and Ys of the rectangle, which would work if the rectangle is not on an angle. In this game, the camera can rotate 360 degrees and tilt 180 degrees making the drag select programming a real drag. With the help of an online search I was able to get it working with a very awesome math technique you can find here.

Figure 8

It works like this: you find the area of the rectangle using an uncommon formula that works for any rectangle at any angle.
Rectangle Area = 0.5 * Abs|(yAyC)(xDxB)+(yByD)(xAxC)|

Figure9

Next you use the unit coordinate to make four triangles with the rectangle. If the sum of all the triangle areas are equal to the the rectangle area, then the unit is inside the rectangle.
Triangle Area = 0.5 * Abs|(x1(y2y3)+x2(y3y1)+x3(y1y2))|

Figure10

If the unit was outside the rectangle, then the sum of all the triangle areas would be greater than the area of the rectangle.

Figure11

If you would like to follow me on my game dev journey, don't forget to subscribe or follow on social media!

Facebook - https://www.facebook.com/DeterrenceGame/
Twitter - https://twitter.com/DeterrenceGame
Instagram - https://www.instagram.com/deterrencegame/
Discord Server - https://discord.gg/CjAybsdq
IndieDB - https://www.indiedb.com/games/deterrence


Original Link: https://dev.to/piscesstudios/3d-modeling-rts-units-deterrence-video-devlog-4-2df6

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To