The question is how many cores can your games can actually use.
Most games can only make use of 2-3 cores.
The FX-6300 has a total passmark rating of 6343, and a single core rating of 1408.
The G3258 has a total rating of 3998, and a single core rating of 2170.
If a game can actually use more than 4 cores, then that is an advantage to the FX-6300.
If a game can use 3 cores, then it is about a wash. 2 x 2170 is about the same as 3 x 1408.
One or two cores will be an advantage to the G3258.
More importantly, the G3258 runs on a lga1150 motherboard. That supports many upgrades from i3, i5, i7.
There is no cpu upgrade to the FX except two more slow cores.
Here is a comparison of the X4-860K which has a single core rating of 1596 which is better than the FX-6300
The conclusion is that faster cores trumps more cores:
http://www.techspot.com/review/1017-best-budget-gaming-cpu/
The passmark ratings are based on stock speeds. Overclocking is variable, but I think a G3258 can typically get a higher percentage overclock than the FX chips.