How do you avoid "ghost in the machine" dangers
I am a relative newbie to Literotica. I did write a few stories several years ago, but they were quickly written and not very good. I am starting up again more seriously. I am working on a mult-part story right now. It is getting mixed reviews. The good reviews seem to come from people who like strong character development. The bad reviews are coming from some who just want to have indiscriminate sex with every woman and no conscience. I am trying to paint a realistic character study, even though I am writing in the sci-fi and fantasy category.
My question, however, revolves around how to avoid the "ghost in the machine" problem. I find it difficult to avoid adding elements that are there simply to move the story along or shift the characters' psyche in some way. My story has an underlying internal conflict that some reviewers find depressing. While that is not my intent, I do want him to be a sympathetic character with both positive and negative qualities. He made some bad choices and is working to resolve them.
However, ultimately I want to provide a happy ending for my protagonist, but I want it to feel realistic. So, I've read enough of the threads in this forum to respect the opinions of the writers who hang out here and would value your advice. If you have any interest, you can check out the start to my story in the abovementioned category (An Old Lamp, a New Life). However, I'm really just looking for some thoughts here. Thanks for providing such a good place to explore writing in general!