Collision Mechanics

Started by stippishlord34, September 15, 2022, 01:05:56 AM

Previous topic - Next topic



Example 1: an infestation spawns 50 insects. You go to a nearby door and wait for them to tunnel up and begin fighting you. They range from 10 to 20 tiles away. They immediately balloon past your pawns, pushing them out of the way where you had established perfect melee blocking. They warp past the door and literally reposition your pawns into adjacent tiles.

Resource easy fix: Immediately upon spawning, enemies check if a pawn is within 15 tiles. If true, turn on collision.

Second fix: Enemies don't move your pawns, ever. If there's a collision or pathing issue, other mobile objects move first, pawns move as a very last resort. Gamers can handle enemies moving around a little bit but they're going to be enraged when enemies are moving their pawns and controlling them like that. Players need to be in control at all times. You can't take that away under any circumstances. It's just good game mechanics.

Example 2: Enemies spawn at edge of map, walk all the way to the middle where your base is located, and then still don't have collision, so they warp past your doorway, move your pawns out of the way, etc.

The resource-efficient fix: Mobile objects occasionally check their distance to location-target. Even every 4000 milliseconds would be ok. If the target is alive or within 5 cells of a pawn and distance to target is less than 15, it's time to turn on collision. Real simple, limited cycles and checks, limited lines of code.

Low hanging fruit?