I took a similar sort of trip in my early 20s. Costs on a road trip can be kept pretty low, in my experience, if you have a tent, camp stove, and reasonably fuel efficient vehicle. Get the car tuned up before you leave, buy the annual parks pass at the first National Park you visit, and have fun!
When I took my trip, I was coming from east to west, so the big learning curve for me lay in figuring out how public lands work in the west. National Parks are fun, but the cheap/free camping options usually lie in National Forests or on BLM land, and learning how to (responsibly, legally, etc.) take advantage of that can be a real saver. If you're looking for a campground with showers, I've sometimes had luck at state parks -- more expensive than national forest camping, but cheaper than a motel, and often interesting in their own right.
Preparing your own food is the other big way to control costs. Restaurant food gets tempting to me on long drives, but pulling over at a rest area and making my own sandwich saves a ton in the long run. Get ready for some food boredom though, if you're heading out for a year-long trip! Maybe you could pay your friends back for hosting you by cooking tasty meals for them, and thereby enjoy more variety.