What structural features make a molecule a potent opioid receptor agonist?
Specific parts — moieties — of an agonist molecule bind to the receptor protein, causing the receptor to change shape, which in turn initiates a signaling pathway inside the cell. 

Some agonists are better at causing the receptor to change to its "optimal shape" for relaying signal. These are called "full agonists".

Other agonists cause a partial change in receptor shape and reduced signal. These are called "partial agonists". The strength of the resulting signal is called "efficacy".

In addition to differences in efficacy between agonists, the parts of the agonist that bind to receptors can have a different chemical makeup and so create a different environment of electrostatic attractions and van der Waals forces between atoms in the agonist and in the atoms in the binding site in the receptor. Agonists that bind more strongly will stay bound to the receptor longer. These are said to have higher "affinity". Agonists that bind more weakly have lower affinity.

It is affinity and efficacy together that determine potency, or how well an agonist works. 

In a biological environment, as well, these agonists swim in a pool with other agonist and antagonist molecules. For example, your agonist of interest might do a good job of changing a receptor's shape, but if it binds weakly, it will "pop off" the receptor quickly — perhaps too quickly to trigger the necessary signal. Another, different agonist molecule comes in and binds more tightly, but it doesn't create as strong a signal. Or perhaps a passing antagonist molecule floats around and pops onto the receptor, stopping any signal from that receptor and also keeping any agonist molecules from binding again for a while.

The population of agonists, antagonists, and receptors all change the number and kinds of binding events that take place, which determines whether you get the signal you want, as strong as you want it.

While the opioid molecules you are looking at have different numbers and varieties of atoms, it is the molecule's shape and electrochemistry that matter. Most specifically, it will be the part of the agonist molecule that actually binds to the receptor that matters most: how well it causes a conformal change in the receptor, and how strongly it binds. 

These molecules could look very different from one another, but ultimately it is the part of the molecule that binds to the receptor, and how well it binds, that matters.

I don't know about the receptor-ligand kinetics of how different opioids bind to pain receptors, specifically, but hopefully there is some terminology in this answer that helps with further research.