Let's summarize:
- vents can only go up - if they end up horizontal on any part, it must still have slope towards the drain line so it can't fill up with condensation or rain water
- traps need to be vented BEFORE the drain line turns down, or there may not be any air movement to the vent (IOW, it won't work!)
- the length of the trap arm depends on the size of the pipe...smaller pipes must be vented with a shorter trap arm than larger pipes (the slope could block the air flow, thus blocking the vent if it is too small or too long of an arm)
- the size of the vent is determined by the number of fixture units - each type of device has a prescribed number - you add them up, then look at it on the chart.
- if it regularly gets below freezing in your area, the part of the vent going through the roof may need to get bigger for a prescribed length before then to help prevent it from freezing over from the hot, moist air flowing out of it condensing, freezing, and blocking it off.
Plumbers go to school and OJT for often a number of years to figure this all out. There's more to it than many people think.