March 31, 2014
Design Decisions
I’m working through a number of design decisions before I release the next article. This engine started as a personal project, but I decided to use it as the topic of a thesis paper for this semester. However, this puts a severe time constraint on the engine, as the thesis is due on April 25. As a result, I’m trying to make some changes to the design to speed up implementation. The framework will remain as flexible as ever, but the specific implementations of my systems will be more limited in scope.
A collision system for platformers, for example, is significantly different from a collision system for a game like Asteroids. The implementation of the collision system as detailed in earlier articles is, perhaps, not ideal for platformers without adding a number of additional physical concepts like force and friction. Rather than try to create a complete physics simulator, I’m going to dial back the scope to match the deadlines and focus on what is necessary specifically for platformers.
I’m trying to work through how to resolve collisions between three entities, where the resolution of one collision causes another collision. My approach at this point is to have each entity’s collider component keep track of the shortest distance to another entity along both directions in each axis. When a collision is being resolved, it moves each entity no more than that shortest distance, and applies the remainder of the resolution vector to the other entity. If you have any thoughts on this approach, or a better approach, please let me know! Otherwise, I’ll be implementing and testing that, then I’ll write an article on it.