one way i've found to deter memory editor hacking is to shuffle variables around every game loop.
So, for every critical variable, replace "int" with a custom "Integer" class, float with Float, or whatever. The "MyInteger" class would store a pointer to an integer, instead of an integer, then you could write all the necessary operator functions (operator+, operator-, operator+=, MyInteger()), and all the necessary constructors/copy constructors/destructor, so that it behaves like an integer without memory leaks. Then you can add a function called "shuffle", which deallocates the internal pointer, and allocated a new variable. the class would look something like this:
class MyInteger
{
int* internalptr;
public:
MyInteger()
{
internalptr=new int;
}
MyInteger(const MyInteger& arg)
{
internalptr=new int;
*internalptr=arg.value();
}
MyInteger& operator=(MyInteger& arg)
{
*internalptr=arg.value();
}
~MyInteger()
{
delete internalptr;
}
void shuffle()
{
int val=*internalptr;
delete internalptr;
internalptr=new int;
*internalptr=val;
}
MyInteger operator+(const MyInteger& arg);
MyInteger operator+(int arg);
MyInteger operator-(const MyInteger& arg);
MyInteger operator-(int arg);
MyInteger operator*(const MyInteger& arg);
MyInteger operator*(int arg);
MyInteger operator/(const MyInteger& arg);
MyInteger operator/(int arg);
MyInteger operator+=(const MyInteger& arg);
MyInteger operator+=(int arg);
//etc
}
Hopefully that would cause the variable to change position in memory a bunch. You could get fancier to make sure that the variables change position in memory, but this would probably suffice.
Why does blue text appear every time you are near?