How did older games do collision detection with walls, floors and ceilings?

后端 未结 4 1113
渐次进展
渐次进展 2020-12-13 04:55

I have been reading about collision detection in games on stackoverflow and other sites. A lot of them talk about BSPs, bounding elipses, integration etc. However, on the

4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-13 05:40

    In older games collision detection was often less than perfect, trading accuracy for performance.

    For example, in Super Mario Bros. collision with enemies is only checked every other frame. Collision with the end-of-level flag pole is done only once every 27 frames. There is also a limit on the maximum number of objects checked for collisions, which famously allows you to pass through some of Browser's attacks at the end of the game without dying.

    Another example is the PC Engine port of Gradius. Rather than using more expensive bounding box hit detection, it uses a tile system. Each object is reduced to a tile number, consisting of the X and Y position rounded to a multiple of 8 and concatenated into a single number. If two objects occupy the same 8x8 tile they are deemed to have collided. It's less accurate but tends to favour the player, so presents an acceptable and fun compromise.

提交回复
热议问题