BECOME A "CHILD ADVOCATE."
1) Get involved with a network of parent educators.
2) Make time for play dates and/or parties. Invite parent-chaperones who will observe you as a Superdad in fine form. Make sure mothers are invited. Ideally, they should be solidly married, above reproach, and will not be disparaged for having an affair with you.
These are great sources for collateral witnesses.
2) Enroll yourself and/or your kids in classes/counseling/treatment as necessary: Parenting classes; Co-parenting classes; Anger managment; Couseling for kids caught-in-the-middle; enroll in a Children's First program; Alcohol/drug treatment. Read contemporary books and literature on the above subject matter. Take the initiative. Become informed. Do whatever it takes. Don't wait 'til it's too late.
3) The most important witnesses are court-appointed professionals, so-called "neutral third parties." They include; the home study evaluator, the forensic evaluator, the custody evaluator, the psychologist, the play therapist, and the GAL. Tread lightly with these people. They are anything but neutral. These thugs are "GOD" in determining custody decisions. Keep in mind, the judge is gonna rule whatever they recommend. They live by one fundamental principle, "Dads be damned."
Whatever you do, NEVER agree to any form of binding mediation. You'll be giving up all your rights to further litigation. You'd just as well sell your soul to the Devil.
From the beginning, you must "attempt" get these witnesses on your side. They are the "tie-breaker." Truth be known, it's their job to insure the race isn't even close, much less a "tie." Nevertheless, do your best. Be sure to document everything.
a) It's their job to not like you.
b) It's their job to fabricate lies about you.
c) It's their job to soften you up and trick you into giving up custody before trial.
Remember "rebuttable presumption?" Some state's statutes declare both fathers and mothers have an equal right to parent their children. In this phase, that right is summarily taken from you. In other words, the game is rigged. It should come as no surprise, gender discrimination is rife within the Judicial Branch of Government.
With that in mind, you might consider hiring a private custody evaluator. The idea is to bring conflicting opinion/testimony with you to court. This is one sure way to minimize a GAL's highly biased testimony/report.
Additionally, make sure to get documentation/history of any violence, both physical and/or verbal/psychological. Is your STBX any threat to herself, to you, to your kids, or to anyone else? Evidence of this nature is critical to rebut an already biased GAL report/testimony.