Scaling Laws for Pre-training Agents and World Models