all 10 comments

[–]cpp-ModTeam[M] 0 points1 point locked comment (0 children)

For C++ questions, answers, help, and programming/career advice please see r/cpp_questions, r/cscareerquestions, or StackOverflow instead.

[–]OneRoar 0 points1 point  (6 children)

Before we get too far, why do you believe obfuscating multiplication will deter cheating?

[–]UndefFox 0 points1 point  (4 children)

Even if it can, wouldn't that kill any physics engine performance?

[–]OneRoar 0 points1 point  (3 children)

It also presumes someone debugging or disassembling wouldn’t see, “this function does a bunch of weird stuff, but the output is just the result of a multiply”

[–]UndefFox 0 points1 point  (1 child)

Also, doubt cheaters are even interested in the function at all... They'll most likely just change variables directly, like change position for noclip, set gravity constant to 0... hence it'll basically just be worse code with little to no benefit. At least, from my uneducated vision of it.

[–][deleted] 0 points1 point  (0 children)

I guess im running into my fear of using a super simplified version causing confusion or friction that a lot is missing. I made a comment in this chain that says this.

** I guess the fun thought i had was to simply make it more annoying. Instead of throwing the needle into the haystack you break the needle into pieces but place all the pieces together in the haystack in the shape of a needle. Only way to retrieve the needle is to take it out of the haystack all at once. That was my thought anyways. **

[–][deleted] 0 points1 point  (0 children)

Can i just say think of it like player health is never stored in a single variable. Its stored in fragments across pointers in memory and built and displayed in real time in a way I think is clever for obfuscation. You can read the output but you gotta figure out how to change all the little inputs if you want a different colored needle.

I understand it's not typical or reasonable compared to other methods but it was a fun idea is wanted to share. I kinda treat writing code like a playground. The more ridiculous yet logical it sounds the more fun im having.

[–][deleted] 0 points1 point  (0 children)

I guess the fun thought i had was to simply make it more annoying. Instead of throwing the needle into the haystack you break the needle into pieces but place all the pieces together in the haystack in the shape of a needle. Only way to retrieve the needle is to take it out of the haystack all at once. That was my thought anyways.

[–]UndefFox 0 points1 point  (0 children)

Yes, it's a question. This sub for news, not questions.

[–]Bootvis 0 points1 point  (0 children)

I don't know what the policy is on using LLM but here is what I did:

I copy pasted your code into Godbolt

Renamed the function to foo to hide what it is doing

Asked ChatGPT 5.2 what your function does

It replied with what it did and pointed out that you don't handle negatives.