How to add Collision Object Channels number limit? Again last question have no one reply

I’m working on an RTS game, and in order for the vehicles to be able to crush (overlapping events) and avoid each other(blocks), I have to categorize the vehicles into multiple Collision Object Channels, Use this to determine when to crush and when to avoid

In this case they can’t be classified as vehicles, but must be classified as vehicles having a crush level/crushed level

We also need to make sure that the collision object belongs to player country or a friendly country, and crushing will only work on Collision Object Channels that are triggering the Overlap event, so I’ve put the units into hostile/non-hostile categories to differentiate between triggering the Overlap event or not.

This is rapidly depleting the number of Collision Object Channels, which is only 18, but I need at least 30 of them to differentiate between friendly/hostile unit with crush levels/crushed levels and special grind confirmations (these must also be split between friendly/hostile)

Currently there are a total of these different collision Object Channels (following the type of crush in Red Alert 3), World Static, World Dynamic, not involved in any collision determination, Ship, Submarine, Ground 0/10, Ground 0/20, Ground 10/20, Ground 20/30, Ground 20/40, Ground 30/75, Ground Special 1, Ground Special 2, Ground Special 3, in which the prefix of Ground is required to have a classification of enemy and self in order to determine whether or not overlap occurs (overlap event only for enemy)

That is, I need at least 20 custom Collision Object Channels to solve the problem, how should I increase its limit? If I can’t increase its limit, can I modify the ones that already exist? Why is there a limit here?

When I work with things that need multiple responses to collisions, I usually use branch logic to determine what should happen (ex. on overlap or event hit have branches.) I don’t know if I understand the problem fully, but I might try to change the collision channel based on what the object hits.

I need to be able to do collision and overlap events from one unit to another, but without using different collision object channels (e.g. if they are all pawn channels), it seems that can only do collision or overlap events, not both in different event
If there’s no way to do that, I’ll just have to add different collision channels to accommodate different collision states, carriers should collide some of the time and crush (overlap events) some of the time when interacting, how on earth am I going to achieve both of those things at the same time in the same collision channel?

it’s definitely not an easy problem to solve. My first thought is to use a larger collision body to detect when an actual collision is imminent, then based on what it hits, change the actual unit’s channel to the appropriate channel, such as pass-through, crush, normal, etc.

The idea of a channel for each type sounds easiest, but, as you said, there are only so many.

This was also my first approach, but its performance consumption immediately made me veto the idea, for an RTS it is absolutely unacceptable to have to consume a lot of performance just to update every unit’s collision channel each time they moves

I’m trying to change some collision channels of engine itself, which doesn’t increase the number, but at least increases the number thats available to me

I understand; optimizing an RTS isn’t a lot of fun. Good luck with the modifications, I cannot be of much help there.

is there anyone else?

Thank you for your help:-)

1 Like

A little late, you probably already have a solution but I wanted to chime in. You can not raise your custom collision limit as there is a hard lid on it. The main reasons being flexibility and performance. Having that many collision channels is pretty cost intensive. Instead you should look at other gameplay mechanics that will help you achieve the same goal and is more performant than collisions.

Example, use gameplay tags. Keep all your vehicles as vehicle objects and when they create a hit or overlap event, run a function that checks your tags for the things you need such as Vehicle.Crush and Vehicle.Avoid… You can create teams with tags as well, assign a team tag to a vehicle at start and when they collide if they have the similar Vehicle.Team.Blue tag then they avoid but if it’s Vehicle.Team.Red and it has Vehicle.Crush tag then do your crushing.

Your Crush Level should be an attribute on your vehicle and applied whenever crushing another vehicle. The vehicle being crushed should have an attribute called Crushed Amount and decremented by the Crush Level. Think of this like a Health attribute that gets deducted every time it is shot.

Tags are super cheap to use and very flexible. I would look into something like this long before I thought of adding so many collisions. Collisions will kill your performance rapidly. Good luck to you!