In the time domain simulation of the response of an offshore structure under random waves, the time histories of the wave field should be generated as the input to the dynamic equations. Herein the wave field is the wave surface elevation, the water particle velocities and accelerations at structural members. The generated time histories should be able to match the given wave-field spectral descriptions, to trace the structural member motions if it is a compliant offshore structure, and be numerically efficient. Most frequently used generation methods are the direct summation of a limited number of cosine functions, the Fast Fourier Transformation, and the digital filtering model. However, none of them can really satisfy all the above requirements. A novel technique, called the Modulated Discrete Fourier Transformation, has been developed. Under this method, the wave time histories at each time instant is a summation of a few time-varying complex functions. The simulated time histories have continuous spectral density functions, and the motions of the structural members are well included. This method seems to be superior to all the conventional methods in terms of the above mentioned three requirements.