A Boxer or flat engine is a special variation of the Vee engine - its just got a Vee angle of 180 degrees
All boxer engines, regardless of no. of cylinders, provide perfect balance because the movement of a piston is exactly counter by the corresponding piston in another bank.

The only oddity too the smoothness equation is the Boxer twin which has a tendency to rock side to side
However, they are too wide for good packaging, and is more expensive due to more parts used, thus the usage is limited to Porsche and Subaru today.
Ferrari used a flat 12 engine in their 512 BB car, this car was mid engined with the gearbox below the engine, the only reason for the flat engine as opposed to a Vee 12 was to lower the COG of the high set motor.