Approach: Higher simulation rate
Your timing for your user interface should be decoupled from your actual game loop, as should your rendering. Say for example your world runs at 4x speed. Lets say that at your basic (1x) speed, your game runs 30 updates per second.
You would then have something like the following, when in fast-forward mode:
- World logic runs 4 updates for every update of UI and renderer. This means it needs to run 120 updates per second. Thus, your world model (data) is updated at this rate.
- Renderer and UI logic both continue to poll or do whatever at 30 updates per second.
In other words, the game as a whole is not running faster. The simulation part is.
You can deduce two things from this:
You need to keep your game logic simple enough that you can easily run it four times faster on your target platform, OR you need to introduce methods to extrapolate various aspects of gameplay more quickly -- this can result, though, in a model that is different from what it would have been if you had simply used a more rapidly paced simulation. So the tradeoff would be processing cost for accuracy. See approach 2, below.
It is the separation of concerns that allows you to easily speed up your world simulation, that separation being model, view and controller (MVC). If your world data(M), render logic(V), and game logic(C) are all mixed up, you really won't be able to
do this, at least not without a massive migraine.
Approach: Extrapolation based on time deltas
As mentioned above, you'll need to calculate motion based on how far something would have travelled in a given time. This assumes your game physics are inherently more realistic in their simulation, however, which may not be the case. This is a rather larger topic and considerably more complex. You'll need to ask more questions about if you want to know. Essentially, you'll be doing some calculus to get things right. You'll need to deal with interpenetration in collisions and a host of other issues I won't go into here.
To conclude
This gives you the general outline. Your language choice is your own, presumably you either know how to do that in Unity or you don't. Timing in any language requires you to understand the ins and outs in detail, I'd suggest starting with Gaffer's articles and checking out the Unity API docs.