Making sure I'm in good terms with peer researchers and not making enemies I'm a student that started doing CS research not too long ago, and I'd like some advice on making sure I'm in good terms with my peers. I've been helping another student's project (in my field, the first author is usually the author. I was to be the second author because it wasn't my project, but I'm also very interested in this research direction), but I feel that my contributions are not appreciated, and I'm often blamed for bad results. Just as an illustration, one such situation is, when I come up with an idea (e.g. finding algorithms, relevant papers that we can use in our research), the other student would pretend as if they knew about it already and tries to explain it to me as if I've never heard of it before, and takes credit. Then when I implement that idea as we discussed,  s/he seems happy with it, but later when it turns out to be not exactly what we wanted (either another slightly different method performed better or his/her advisor didn't like it), I'm blamed for introducing that problem.

And I also feel that, while I'm interested in solving the same problem, I want to approach in a different way (s/he wouldn't accept it in our current project for reasons like, there are other more important things we should be working on, and so on. and I can't argue much because it's not my project). I understand that I shouldn't simply victimize myself, and it could be a different story from someone else's perspective, but regardless, I think I started seeing how there are politics in academia and how researchers can act petty and selfish, and I want to avoid that as much as possible and focus on having fun doing research and growing my career.


If I wanted to leave a project and do similar research in my own ways, is there a wise way to do this without accidentally taking credit for anything I didn't do or giving the impression that I'm trying to steal the research? I would simply cite the work we did together if there was a paper, but there is no publication yet because we couldn't finish on time, and I don't really see it being completed this way. In addition, we found out recently that there are other papers that solve this problem or part of this problem in a very similar way. I could take a significantly different direction for solving a different problem under different assumptions, but I can also see that backfiring and giving the wrong impression.
What are some potential source of unwanted politics/conflicts that beginning researchers should be aware of in general?
If you've observed students that ended up not being able to collaborate well, what was your perspective, and what did they seem to be forgetting?
If you've had conflicts or ended up not being in good terms with another researcher, how did it affect your career, if it had a long term effect?
Starting a collaboration comes with commitments. If you work together with someone, you cannot just walk away, because the other members of the team have invested a serious amount of work, which might depend on your contribution. So usually the only thing you could do is to finish the project and avoiding starting a new one. The latter might be difficult, because people trying to exploit you can prove quite clingy. However, as I read your question, you are in a easier situation:


  In addition, we found out recently that there are other papers that solve this problem or part of this problem in a very similar way.


Face it, your project is dead. You might get a publication by applying your method to some variation of the problem, but this is neither good science nor good for your career in the long run. So cut your losses and do something else. Ending the project can also be used as a pretext for ending the collaboration, which apparently did not work out.

While you are certainly right that scientists are as selfish and petty as everyone else, quite often both sides in such a conflict feel exploited by the other side. If you tell your collaborator every idea that comes to your mind, while s/he thinks things through before communicating, s/he will think that you leave all the hard work to him/her, while you will feel starved of necessary information. So a collaboration can end in a disaster, even if all people involved behaved exactly as they expected the others to behave.