Bacon Bits
Legend
You must have played your casters very poorly.
In my experience, if the DM wants you in melee, you're in melee. No amount of player skill or magical spells will compensate for consistently ham-handed encounter design. I played a campaign where I was a fighter/wizard that preferred archery to melee. Except we never had an encounter begin at longer than a charge away. The last straw (that is, when I asked to be able to switch to melee instead of archery) was when the party was travelling over open, treeless tundra and we encountered frost giants. We noticed them 30' away. They had not been hiding.
Walking around invisible in my experience is generally suicide, too, because it's so tempting to the DM to capture you or separate you somehow. The rest of the party has to play it like they don't know you're gone. We had a guy bell himself like a cat, but that didn't work too well, either. I recall another campaign where, if you were invisible, the DM made you write your actions on note cards to pass to him. The party entered a large open cavern, which suddenly filled with dozens of very large spiders that started blanketing the entire area with webs. The visible party made their saves and fled from the chamber. The cleric waited a round and I asked, "Has everyone made it through?" Two of the party said, "Yes," and nobody said, "No." I sealed the passage with stone shape or wall of stone or something similar. Of course, we had forgotten about the invisible wizard, who had failed his saved and been stuck in webbing. The unusual part was actually that the wizard had entered the room at all. Normally, he stayed outside the room until the rest of the party had fully explored the place, but for whatever reason, he didn't do that this time.