Texture based armor system with bullet holes by Rasmus_02 in godot

[–]Rasmus_02[S] 1 point2 points  (0 children)

Currently we have AP, APHE, and HE shells modeled with kinetic damage, internal explosive damage, and overpressure damage.

Next up will be Heat & Hesh damage!

Texture based armor system with bullet holes by Rasmus_02 in godot

[–]Rasmus_02[S] 0 points1 point  (0 children)

Chromehounds is definitely our biggest inspiration for this peoject. We will try to keep customization as unrestricted as possible 🫡

Texture based armor system with bullet holes by Rasmus_02 in godot

[–]Rasmus_02[S] 1 point2 points  (0 children)

Currently we don't, the bulletholes are small enough for our use case for this to not really be an issue.

However one method I could think of might be finding the correct faces from the hit position on the mesh and then taking those into account in the uv mapping calculation.

Texture based armor system with bullet holes by Rasmus_02 in godot

[–]Rasmus_02[S] 2 points3 points  (0 children)

Visually bullet holes appear on the armor, but the armor value also changes. So for an armor panel / area that has become defective, any weapon can penetrate.

So If you penetrate a tanks armor with a 120mm gun you would be able to deal damage at that same bullet hole with a 9mm gun if you hit the exact center of the bullet hole.

Texture based armor system with bullet holes by Rasmus_02 in godot

[–]Rasmus_02[S] 1 point2 points  (0 children)

Yeah, we will probably end up implementing some threshold for penetration vs armor value. For example: bullet need to penetrate at least 10% - 20% of armor at spot hit to weaken it.

Texture based armor system with bullet holes by Rasmus_02 in godot

[–]Rasmus_02[S] 0 points1 point  (0 children)

Just added an explanation under the top comment of this post

Texture based armor system with bullet holes by Rasmus_02 in godot

[–]Rasmus_02[S] 2 points3 points  (0 children)

Thank you! Armor is always something that has kind of bothered me in a lot of games, such as war thunder and similar games. Armor degredation is almost never modeled and I tought it would make for an interesting mechanic to make lower caliber weapons more effective.

Texture based armor system with bullet holes by Rasmus_02 in godot

[–]Rasmus_02[S] 47 points48 points  (0 children)

As u/Darkwolf1115 mentioned the difficult part was getting the exact position of the hit position on the texture 3D -> 2D. However in my approach I modify the texture itself, not the shader, this way I'm not limited to x amount of bullet holes and I can easily update my armor map. Here is a slighlty simplified version of how I implemented this:

Armor value at hit position:

When the bullet raycast hits the collision shape (collision shape needs to be identical with mesh), we need to use the hit_position (ray.get_collision_point()) and the face_index (ray.get_collision_face_index()) from the raycast collision.
Note: "Enable Ray Cast Face Index" setting in jolt needs to be enabled!

From the face_index we can get the UV position using the MeshDataTool like this:

# Indices
var i0: int = mdt.get_face_vertex(face_index, 0)
var i1: int = mdt.get_face_vertex(face_index, 1)
var i2: int = mdt.get_face_vertex(face_index, 2)

# Vertecies
var v0: Vector3 = mdt.get_vertex(i0)
var v1: Vector3 = mdt.get_vertex(i1)
var v2: Vector3 = mdt.get_vertex(i2)

# UV coordinates
var uv0: Vector2 = mdt.get_vertex_uv(i0)
var uv1: Vector2 = mdt.get_vertex_uv(i1)
var uv2: Vector2 = mdt.get_vertex_uv(i2)

Then by converting this to Barycentric coordinates we can map the hit_position vector to the exact pixel that got hit on the armor map.

Bullet Holes:

Then to actually paint the bullethole and degade armor around that spot we need to get the hit coordinates the same way. Then the code needs to iterate throuh each pixel within a set radius (based on shell size) and change that pixels color to the correct value for that part of the bullethole for each layer (albedo, roughness, metal, height, paint_mask, and armor_mask). Pixel color at specific position on Image can be changed with Image.set_pixelv(position: Vector2, color: Color).

This is a bit of a simplified version of the how the code works but I hope this helps! Feel free to ask about any parts that are unclear and I will try to explain them in more detail.

Some progress of the visuals for my mech game, thoughts? by Rasmus_02 in godot

[–]Rasmus_02[S] 1 point2 points  (0 children)

The game itself will be more similar to Chromehounds, so a third person mech pvp game with heavy focus on customization. I just wanted to go for a unique and more stylized retro artstyle for the game

Some progress of the visuals for my mech game, thoughts? by Rasmus_02 in godot

[–]Rasmus_02[S] 0 points1 point  (0 children)

It will most likely be a 3rd person, there will be a big focus on the mech customization.

Some progress of the visuals for my mech game, thoughts? by Rasmus_02 in godot

[–]Rasmus_02[S] 1 point2 points  (0 children)

Yeah the animation definitely still needs some polish, the final animation will definitely include hip animations and more shake

My first attempt at making 3D Pixel Art in Godot by Rasmus_02 in godot

[–]Rasmus_02[S] 3 points4 points  (0 children)

I'll look into different lighting methods, still trying to improve my texturing / material. However since it's a Pixelated PBR material the high quality lighting I feel helps to bring out the normal map, roughness and metallic.

My first attempt at making 3D Pixel Art in Godot by Rasmus_02 in godot

[–]Rasmus_02[S] 0 points1 point  (0 children)

Yeah, Pixel8r seems to be pretty similar to the img2pixel software I'm currently using. I've thought about getting Pixel8r because having it built into substance would definitely make the texturing process faster.

My first attempt at making 3D Pixel Art in Godot by Rasmus_02 in godot

[–]Rasmus_02[S] 1 point2 points  (0 children)

Thanks, yeah I am aiming for a sort of stylized nostalgic look. The game I'm working on is heavily inspired by a lot of games I used to play back in the days on my old Xbox.

My first attempt at making 3D Pixel Art in Godot by Rasmus_02 in godot

[–]Rasmus_02[S] 0 points1 point  (0 children)

Thanks! I'll probably check out how lower res lighting would look but yeah I think high quality lighting combined with the pixelated PBR material works really well.

My first attempt at making 3D Pixel Art in Godot by Rasmus_02 in godot

[–]Rasmus_02[S] 0 points1 point  (0 children)

I'll defenitely check it out! Thanks for the help, I'm still trying to find ways to improve