Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
Footprint routine...

Registered User
2023-04-30 04:56:06

My dev is having a little difficulty with making footprints, using the CopperCube footprint code. Seems part of the footprint is being obscurred by surrounding polygons/vertices. I've deduced this is because the terrain is not perfectly flat and the routine is picking a single polygon to place the footprint, but surrounding polygons are cutting it off or obscuring it, because they're angled to some degree.

If my theory is correct, if someone could alter the code to eleviate this issue on non-level terrain/textures, I'd be greatly appreciative.

2023-04-30 05:33:25

What you are asking seems to be decals, as most of the decals example out there are fake decals or simulations, meaning that they will only work for flat surfaces, and will not auto-align according to the surface. For example for uneven terrains and other kinds of objects. You will see them culling out of the geometry and whatnot.

Unfortunately there is no real decal system for now in CopperCube, the best you can do is use the fake simulators out there, like the one that shoots bullets and on impact clones the footprints at the impact position and all. But they don't fiddle with the Z-order of the footprint node, you can change the Z-order of the footprint node so that it will always show on top of every node, or you can ask your dev to check it with the camera, and the player and the floor(terrain) and align it accordingly. So that it will have the correct rotation and it will appear on top of the terrain or object without being culled.

I am not sure though if the above will work as expected or not but can be an Idea to simulate decals in much more better way.

Registered User
2023-05-10 10:43:33

You can place footprints on uneven terrain by using a dummy node for the footprints (instead of using the character to make the footprints directly) - enable "inclination" on the dummy character's "collide when moved" properties (so the dummy node is always parallel with the floor while is places the footprint.png's). Simply have the dummy node follow the player node with zero-delay, so the footprints are always in the same position and same rotation as the player.

I showcased this method, with a taxi-car that left skidmarks on flat and uneven terrain, in my CarnageV4 demo - I also added straight and curved skidmarks, depending if the car was turning left/right or not - and you can change the colour/sounds of the footprints to match the terrain: by using "on proximity" to detect the terrain type.

Here's a quick video demo of a car placing skidmarks on inclines with no clipping....

If you want perfect timing for each foot-fall, add a node to the "animated joints" of the feet of your Luposian model (to detect when each foot collides with the floor, using on proximity) - this way you can place the footprint and play the sound at the exact time each foot hits the floor.

You can also fade the footprints out over time, to save it filling your memory - I used tiny png files of a few KB each so they use less memory and can draw thousands of them without slowdown - the tiny image resolution also adds a nice blur effect so they are not too sharp against the terrain.

Here's the old post with some of my code for it (download is missing)....

2023-05-11 03:12:00

@VP, while the inclination method works partially, it will still clip the object on an uneven surface, inclination depends on the triangles of the surface. So if you have smaller triangles and uneven shapes of triangles in your surface geometry it will be going to clip the trails.
However, it can be used, to get somewhat of nice-looking decals.

Registered User
2023-05-13 08:40:32

Ok, I've got the footprint routine incorporated into my game. Now I'm trying to add sound for each step. There is an option to play sound for the routine, but when I do so, it only plays the sound file after every two steps (i.e. Left footprint, Right footprint (sound), Left footprint, Right footprint (sound), etc.).

How do I get it so that every footprint produces the sound? The javascript routine does mention sound, but I can't figure out if I change it there or within CopperCube. .

2023-05-13 15:30:32

Glad you got it working. Like I said, add an animated joint to the feet nodes and a plane to the floor of your character, use on proximity to play the sounds when the feet touch the plane.

Check out my terminator game ccb on itchio and look at the terminator models, they all have real-time footstep sounds. or I can make a separate ccb file for you.

Create reply:

Posted by: (you are not logged in)

Enter the missing letter in: "Int?rnational" (you are not logged in)




Possible Codes

Feature Code
Link [url] [/url]
Bold [b]bold text[/b]
Image [img][/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]



Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact