kanan-new icon indicating copy to clipboard operation
kanan-new copied to clipboard

Request: Draw Distance Mod

Open Rydian opened this issue 7 years ago • 2 comments

This code signature... D9 56 40 D9 C0 Find this instruction... fst dword ptr [esi+40] Which is the instruction that writes the max draw distance for the camera.

After that instruction, inserting something like... mov [esi+40],X Where X is a float value will override the draw distance.

A value of 1,000,000f is enough to render pretty much everything that loads, but sometimes people would like to lower draw distance instead (for example reducing it AFKing while running shop to reduce load) so making it a slider would be preferable (as exact values aren't needed anyways). A range of 100 to 1mil would probably be best.

Rydian avatar Feb 09 '18 21:02 Rydian

This is a working script for cheat engine, I don't know if there's already a method to allocate memory via Patches.json in kanan but would be useful.

[ENABLE]
aobscanmodule(originaldistancecode,Client.exe,D9 56 40 D9 C0)
alloc(patchedmemory,$1000)

label(newcode)
label(return)

patchedmemory:

newcode:
  fst dword ptr [esi+40]
  mov [esi+40],(Float)25000
  fld st(0)
  jmp return

originaldistancecode:
  jmp newcode
return:
registersymbol(originaldistancecode)

[DISABLE]

originaldistancecode:
  db D9 56 40 D9 C0

unregistersymbol(originaldistancecode)
dealloc(patchedmemory)

LoneDev6 avatar Sep 16 '18 20:09 LoneDev6

I've had a script for it in my CE table for ages, but that's not automatic.

Rydian avatar Sep 24 '18 02:09 Rydian