The effects of the phase variation, the evolution of the electron beam, the evolution of the radiation intensity, and the higher-order modes due to waveguides on a free-electron laser (FEL) oscillator have been analyzed by using two electron beams of different energies based on the proposed FEL facility which is to be operated in the far-infrared and infrared regions. The three-dimensional (3D) effects on a FEL oscillator due to waveguides and higher-order modes were studied using an extended 3D FEL code with two electron beams that we have developed. The effects of the variation on the amplitude of radiation on the electron beam's emittance and energy spreads were also calculated in the case of waveguide for multi-particle and multi-pass numbers by using a new 3D code. The phase variation, the variation in the beam envelope, the evolution of the amplitude, and power were calculated for the fundamental mode. The results were compared with those of the higher-order modes of the wiggler for various TE and TM modes for determining the FEL's performance which is required for high-quality electron beams.