AmbientRun / Ambient

The multiplayer game engine
https://ambient.run
Apache License 2.0
3.8k stars 124 forks source link

Rough block out for Physics settings in Ambient.toml #281

Open SK83RJOSH opened 1 year ago

SK83RJOSH commented 1 year ago

Since Ambient.toml and project macros are being refactored, now would be the perfect time to introduce a skeleton for physics layers/physics configuration.

We'd like something like this:

[physics]
collision_response = [
  { layer_a = "player", layer_b = "projectile", filter = "Block" },
  { layer_a = "player", layer_b = "pickup", filter = "Overlap" },
  { layer_a = "pickup", layer_b = "projectile", filter = "Ignore" }
]

[physics.layers.player]
name = "Player"
description = "Layer for player collisions"

[physics.layers.projectile]
name = "Projectile"
description = "Layer for projectiles"

[physics.layers.pickup]
name = "Pick-Up"
description = "Layer for pick-ups"

It may make sense for layers to be namespaced like concepts and components. Otherwise this should be pretty straight forward.

philpax commented 1 year ago

I'm doing more rework on the project stuff (#417). Is this still the API you want?

SK83RJOSH commented 1 year ago

I've got a branch with this API implemented already – just didn't figure out the code gen side of things. If the changes aren't too disruptive I can merge on my own after, otherwise I'll show you my fork and you can direct me. :)