In general physics systems don’t know what characters are.
They know what primitives such as spheres, boxes, and convex hulls are.
But explaining a full physics system on a forum is neither practical nor likely necessary, since for a basic system it can be dumbed down significantly.
Why don’t you explain what kind of physics you are planning to do? 2D or 3D? How advanced does it need to be?
I am going to guess you just want physics that are so basic, the only functionality you need is to separate players from each other (and walls) on contact (but I will only talk about characters).
The overall plan would be to advance all the characters in time as you normally do, moving them either by AI logic for NPC’s or from keyboard/mouse input for actual players.
Then your primitive “physics” system runs. Optimizations aside, it looks at each character compared to each other character and checks for intersection via sphere (3D) or circle (2D).
Then both characters are moved away from each other by the exact amount that causes them to no longer be touching.
Move on to the next character pair.
You don’t have to keep track of what character pairs were already made because the loop prevents duplicates.
for ( int I = 0; I < Characters; ++I ) {
for ( int J = I + 1; J < Characters; ++J ) {
// Check characters I and J.
}
}
L. Spiro