Original Post
THIS MAY BE BORING AND/OR NONSENSICAL. APOLOGIES Hi folks. I'm writing my game in a slightly unconventional way and have come up against a little bit of a maths problem. Instead of doing incremental updates on a per frame basis, each time an event happens to an object in the world I recalculate the formula for the objects position and when I render, i just look at the formula for the time being viewed. This means I can do stuff like absolute collision detection and can rollback time and do stuff like kill a unit ten seconds ago. In theory. So basically an entity has a series of Events objects, which each kick in at a certain point. From this a state consisting of position, direction, velocity, acceleration is generated. So an entity might have these events: ENTITY A Create event @ T=0 position = 0,0 direction = 0,1 (north) velocity = 0 accelleration = 0 Change direction event @T=10 change direction to 1,1 (northeast) Change velocity event @T=10 This would mean the entity starts facting north then at T=10, the unit will start moving at 1 unit per second north east. State objects would be created, and referenced whenever the screen is rendered. I have this up and running. The problem arises when I want to create a second Entity with the following events ENTITY B Create event @ T=0 position = -10,-10 direction = 0,1 (north) velocity = 2 accelleration = 0 Follow entity(a) event @T=0 for this period, the direction travelled should be the direction towards the first entity What I want to happen here is that b is a missile, and its should always point towards the first entity. THis means its position at time T is dependent on the path A takes. If you are smart enough to solve the problem I have, you are probably smart enough to see it at this point. The position of B can be found by: (the overall velocity vector B has taken to time T (call it V)) * T at a time T, B will change its velocity by the vector between A.position and B.position, so I I integrate that, I should get V. Right? Is this right and can anyone do this? It seems pretty fucking hard to me :) I will ask later about the situation where B can only rotate a certain amount per second :) thanks geniuses