[Tower Defense][RTS] Deterrence - Video Devlog

There's only need for one forum for now. Discuss development. No advertising or thinly veiled attempts at advertising. Create a single thread for your project and be prepared to show and tell.
User avatar
PiscesStudios
Posts: 36
Joined: Sat Apr 02, 2022 1:43 am
Contact:

[Tower Defense][RTS] Deterrence - Video Devlog 18

Post by PiscesStudios »



Making Trees for an RTS Game
Real-time strategy games have a lot happening on screen due to the view from above. In order to have a bunch of game objects on screen at the same time, the level of detail (LOD) needs to be low. I started with CG Geek's low poly tree tutorial which works fine for mid level detail, but not low enough for a RTS games because the game would be unplayable with many of them on screen.

Image

The performance is terrible mainly due to the leaves being transparent textures which take more processing power to draw. In order to fix this issue, I needed to draw less transparent textures. In order to draw less transparent textures, I would need to make the tree branch texture bigger to cover more area. Then I made a new branch by combining planes at different angles together into one object.

Image

The resulting tree had much fewer vertices and branches, but still gave the tree enough foliage. I can now have the screen filled with these new trees and still maintain a frame rate near 200 FPS.

Image

Laying Doodads Faster
Populating the game world with a bunch of environment doodads can be painfully slow with the traditional drag and drop prefabs method, I really need a tool to get this done much faster. I found a cool toolkit tutorial by PitilT that makes prefab spawning much easier. At the moment it's very basic, so I look forward to more tutorials by PitilT to expand on toolkits.

Image
M. Gianfrancesco DBA Pisces Studios
Deterrence
Image
User avatar
PiscesStudios
Posts: 36
Joined: Sat Apr 02, 2022 1:43 am
Contact:

[Tower Defense][RTS] Deterrence - Video Devlog 19

Post by PiscesStudios »



Making Trees Optimal
Continuing with CG Geek's Low Poly Tree tutorial from last week, we learned that the tree as is - is not optimal. The performance problem lies in how the tree is being rendered. When the tree is imported into Unity, the tree has hundreds of child objects for each branch and each object requires more processing power. I found that when combining meshes into one object, performance was better. So, the amount of vertices does not have as much of an impact on performance as the amount of meshes.

Image

To make CG Geek's Low Poly tree "Game Ready", I found a way to instantiate all of the particle system branches as real objects. Then I would combine all objects together as one mesh. Now, when the tree is imported into Unity, we get one object that takes two materials. Performance is now optimal since there are much fewer draw calls.

Image

Making Useful Tools for Development
I expanded on my prefab spawning tool to give it all the features I need to build maps faster. I found a really awesome four-part lecture by Freya Holmér that's jam packed with info on how to build tools in Unity. I turned my simple one click tool into a fully featured painting tool that works with the Unity Editor.

Image
M. Gianfrancesco DBA Pisces Studios
Deterrence
Image
User avatar
PiscesStudios
Posts: 36
Joined: Sat Apr 02, 2022 1:43 am
Contact:

[Tower Defense][RTS] Deterrence - Video Devlog 20

Post by PiscesStudios »



[size=18pt]Environment[/size]

Image

My aim for the environment is to be as realistic as possible to the best of my ability. Since this is a solo project and I'm not a graphics expert, this means I'll be shooting for double 'A' standards. The environment at this moment can be destroyed, but the behavior of the destroyed objects is limited, and newer behavior will be added towards the end of the project as it's not a priority to get the game to a playable demo. This log pretty much marks the completion of the nature assets and I plan on adding man-made environment assets such as utility poles, houses, fences, roads, etc.

Image

[size=18pt]Creating Nature Assets[/size]
To make the foliage textures for my plants, I used a colored construction paper as a green screen and press the leaves under a book overnight to make them flat as possible. The flatter the leaves are to the paper, the easier it will be to remove the background color because there will be no shadows. Also, the ambient lighting should be filtered for the same reason and to reduce glossy surface light.

Image

To make the textures for the terrain, I took photos of the ground around my house. It's best to do this on a cloudy day as the ambient light will be filtered. Next, I would crop the photos so that they are square and run them through a seamless texture tool that can be found here.
M. Gianfrancesco DBA Pisces Studios
Deterrence
Image
User avatar
PiscesStudios
Posts: 36
Joined: Sat Apr 02, 2022 1:43 am
Contact:

[Tower Defense][RTS] Deterrence - Video Devlog 21

Post by PiscesStudios »



Modeling Destructible Bridges
To make the bridge models, the bridge dimensions must have an aspect ratio compatible with the pathfinding grid nodes. Scale can always be fixed later. To create the destructible bridge, I copy the original model and cut it up using a knife tool. It's important that the destroyed model and original model have the same origin, scale, and UVs.

Image

Once I had my pieces for the destroyed bridge, I separated them by selection which created 2 objects (meshes). And finally, the newly created objects have holes that need to be filled and once filled, the new faces needed new UV coordinates.

Image

Programming Destructible Bridges
In order to create pathways across unwalkable rivers, each pathfinding node needs its own block collider so that the bridge can edit the nodes it resides in. To make this easy, I simply had the pathfinding grid add these blocks for each node that was below sea level.

Image

If units were present on the bridge at the time of destruction, the destroyed bridge will destroy the units referenced by a collider that records units touching it.

Image

Finally, the destroyed bridge will change its mesh to the destroyed bridge mesh and instantiate the broken piece at the same position and rotation. As long as both models have the same origin, scale, UVs, and positions, the transition will be seamless and appear to break.
M. Gianfrancesco DBA Pisces Studios
Deterrence
Image
User avatar
PiscesStudios
Posts: 36
Joined: Sat Apr 02, 2022 1:43 am
Contact:

[Tower Defense][RTS] Deterrence - Video Devlog 22

Post by PiscesStudios »



Man-Made Environment Assets
To give the game world a lived-in feel, I added more man-made assets like utility poles and houses. These assets can be destroyed like most other doodads on the game field. Houses and other civil buildings will be useful to the player as soldiers can garrison them for cover.

Image

Indie Legion Feedback Fest 1.5
I will be working on a simple level in preparation for an alpha demo to submit to the Indie Legion's Feedback Fest. You will be able to find the alpha demo for Deterrence on itch.io sometime between September 8th and September 17th.

Image

Healthbar Shaders
I started this week with shader tutorials by Freya Holmér and found a tutorial on making a healthbar entirely in shader code. I thought this would be good for unit healthbars on top of units on the field. To make the shader work for that use case, it also needed to be billboarded, so, I found another great tutorial on billboard shaders. And finally, to make these healthbars work, they needed to always draw and also have a render queue above the unit outlines.

Image
M. Gianfrancesco DBA Pisces Studios
Deterrence
Image
User avatar
PiscesStudios
Posts: 36
Joined: Sat Apr 02, 2022 1:43 am
Contact:

[Tower Defense][RTS] Deterrence - Video Devlog 23

Post by PiscesStudios »



Fog of War
Like most RTS games, this game will use a fog of war that conceals enemy movement and happenings in areas that are not within the player's vision. For Deterrence, I've decided to go with Company of Heroes approach to fog where the map is fully explored.

Image

Making of Fog
I found a decent tutorial on how to make fog of war for Unity by Mina Pêcheux. The key to making the fog is to project a black and white or gray and white texture onto the terrain, it's that simple. The fog will be a render texture that gets updated by a camera like the mini map, only this camera will see the vision layer.

Image

From the tutorial, in order to determine whether a unit is visible or not is to read the color of a pixel of the fog texture corresponding to its position. That method is extremely laggy and slow since I'm using a higher resolution fog. The work around for this is to give your vision layer objects capsule colliders, so, when an object wants to know if it's visible, the object can just do a ray cast or box check.

Image

Indie Legion's Feedback Fest

Image

For a demo level to play at the Indie Legion's Feedback Fest, I've made a rural town scene with a river that creates strategic choke points at bridges and forest trails around the outskirts for flanks. The players objective will be to defend the factory, but the win condition is still being decided between wave count or time of survival. You will be able to find the alpha demo for Deterrence on itch.io sometime between September 8th and September 17th.

Image
M. Gianfrancesco DBA Pisces Studios
Deterrence
Image
User avatar
PiscesStudios
Posts: 36
Joined: Sat Apr 02, 2022 1:43 am
Contact:

[Tower Defense][RTS] Deterrence - Video Devlog 24

Post by PiscesStudios »



Cinematic Mode
The game now has what is called a cinematic mode where all UI is hidden letting the player know the game is in an unplayable state. Cinematic mode will be used in conjunction with dialogues and setting the camera view to direct the player and tell a story.

Image

The player can also activate cinematic mode using F4. When the player chooses cinematic mode, the camera will be freed from any restrictions on rotation allowing the player to capture almost any angle of the battle. This was mainly made to capture the title screen background video.

Image

Game Menus
Title screen and in-game menus have been made using the new fully customizable menu buttons I've created. With these menu buttons, I can quickly create a new menu function and make buttons with any style, color, size, and language. The in-game menu will also act as a pause screen.

Image

Added Music
In recent weeks I've reached out to indie game music composers Nicole Marie T and Amedeo Serra for tracks. They both made amazing music for the game and I'd highly recommend both of them for your project. To get the music in the game I started off with Brackeys' sound manager script and expanded on it by making transitions between tracks.

Image

Indie Legion's Feedback Fest
The alpha demo is in a stable, playable state and is on schedule to participate in the Indie Legion's Feedback Fest! All that's left to do is make the web pages for the game guide and feedback form that will be linked through the game menus. See you there!

Image
M. Gianfrancesco DBA Pisces Studios
Deterrence
Image
User avatar
PiscesStudios
Posts: 36
Joined: Sat Apr 02, 2022 1:43 am
Contact:

[Tower Defense][RTS] Deterrence - Video Devlog 25

Post by PiscesStudios »



Milestone #1 - Alpha Demo
It was six months ago when Deterrence was just a concept on a white board, and after twenty-five weeks of development, a playable demo is available that needs your testing and feedback. The demo is currently being hosted on itch.io here.

Image

Alpha Demo Features
The game currently has a single level to play with basic UX and UI features. To aid the basic UX and UI, a game guide can be found in the pause and title screen menus; in those menus, you can also find convenient feedback and bug report forms.

Image

Moving Forward
For the upcoming weeks, I plan on adding more levels with different win conditions and additional UI/UX features. I recommend downloading and playing the demo through the itch app if you want automatic updates. Also in the upcoming weeks, the game should have a steam page and new box art. The devlogs from here on will be switching gears towards feature updates and additions; focusing more on gameplay, lore, and content rather than the technical and how to side of development.

Image
M. Gianfrancesco DBA Pisces Studios
Deterrence
Image
User avatar
PiscesStudios
Posts: 36
Joined: Sat Apr 02, 2022 1:43 am
Contact:

[Tower Defense][RTS] Deterrence - Video Devlog 26

Post by PiscesStudios »



Restructured Fog of War
The fog of war had some rework to accommodate gameplay involving high ground. The visibility objects attached to units and buildings are lowered to be just beneath the high ground and the terrain is duplicated. The duplicate terrain is given an unlit color material that is the color of the fog, its layer is set to the visibility layer, and its collider is disabled. Now the visibility can be cut off by the terrain high ground.

Image

With these new changes, the fog of war has a problem with smooth transition between the fog and vision. Luckily, Unity has a post processing feature you can add to your cameras. With the fog of war camera, I added a depth of field post processing effect to blur the image before it get rendered. And voila, we have smooth fog of war that respects the high ground.

Image

Upcoming Fixes and Additions
The following are bug fixes and additions to the game that will be in the next update v1.1:
  • Fixed GI units not being notified when a friendly gets attacked nearby.
  • Fixed camera glitch when dragging the camera using the mini map.
  • Fixed building select ring staying on if targeted and selected at the same time.
  • Added shortcut keys for unit commands.
  • Added alternative ways to move the camera view.
Image

Upcoming Festival
I hope to have even more additions and fixes done before Game Fest by DevGAMM. I believe the Game Fest will be free for attendees and require and $50 submission fee for developers submitting a game. There will be live streams, awards, and more! See you there!

Image
M. Gianfrancesco DBA Pisces Studios
Deterrence
Image
User avatar
PiscesStudios
Posts: 36
Joined: Sat Apr 02, 2022 1:43 am
Contact:

[Tower Defense][RTS] Deterrence - Video Devlog 27

Post by PiscesStudios »



Objectives
To quickly and easily make objectives for levels, I created an objective class that can be customized. The objectives can be hidden as well to act like triggers and can be used to progress a tutorial. To give the objectives a better user experience, the objectives can be clicked on to take your camera to the area related to the objective.

Image

Tutorial
For new players, the tutorial box will help explain how to accomplish each objective. The tutorial messages can be reviewed if the player needs to see earlier messages. The tutorial can also be closed to give experienced players space to play.

Image

Victory Points
In the victory point game mode, the player must have more victory points under their control to reduce the enemies score. To win, the player must be the first to reduce the enemy's score to zero.

Image

Upcoming Fixes and Additions
The following are bug fixes and additions to the game that will be in the next update v1.1:
  • Fixed lasso select not selecting when cursor is over the HUD
  • Fixed units being deselected when clicking on a UI button.
M. Gianfrancesco DBA Pisces Studios
Deterrence
Image
Post Reply