You were on the Northern, Madinah side of the Valley of Badr, and they were on the Southern, Makkah side of the Valley. And the caravan of the Makkans was proceeding south along the low Western coast, from Syria to Makkah. Had you attacked the caravan, it would not have accomplished Allah's Will. He wanted you to have a decisive victory over the hostile army. Allah had decreed that the Truth shall survive and falsehood shall vanish. Allah is Hearer, Knower.