Overlay jumpiness when moving menu

User Tag List

Results 1 to 3 of 3
  1. #1
    xhulic's Avatar Member
    Reputation
    2
    Join Date
    Oct 2020
    Posts
    11
    Thanks G/R
    3/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Overlay jumpiness when moving

    Hey there!

    So I have made great progress with my personal overlay written in python. I have been ignoring optimizing my overlay as I've been more interested in other things, but now I am finally at the point where it is too annoying.
    At first I thought it was a different issue with my world to screen, I had read the map grid and run A* on it to generate a path from the player to some arbitrary point. I drew this path on the game world and when I was moving, the path would jitter, and so I thought maybe it was the path-finding messing up but it is definitely the overlay.

    It only happens when there is movement. I think it might be something to do with FPS? I have made a small video here, demonstrating my overlay fps (the left number) and the in game fps (the right number, read from memory). I've made the circle around the numbers flicker to red when the value changes:

    I have picked a random point on the terrain and drawn some circles at this point. Notice how at random points they jitter/jump.
    Video example here (Let the video load all the way through and then watch it, as you might mistake the video buffering for my issue.)

    When my overlay is significantly lower/higher fps, it is very jittery. When my overlay is similar fps, it is smooth except for small jitters here and there. (This is why I believe it is related to fps)

    - My overlay is written in OpenGL
    - I have tried running the fps at the same fps the game is at any given moment
    - The game is buttery smooth its just the overlay
    - Its definitely not an issue with rendering being too slow, as even when I up the fps (or remove any delay) the jittering is worse

    I have no idea how to make this smooth all the time. Has anybody experienced this? Can anyone help?
    Last edited by xhulic; 10-16-2020 at 11:18 PM. Reason: Clarify what to look for in the video

    Overlay jumpiness when moving
  2. #2
    Sychotix's Avatar Moderator Authenticator enabled
    Reputation
    1415
    Join Date
    Apr 2006
    Posts
    3,942
    Thanks G/R
    285/571
    Trade Feedback
    1 (100%)
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    Perhaps it is a rounding error for pixel location?

  3. #3
    xhulic's Avatar Member
    Reputation
    2
    Join Date
    Oct 2020
    Posts
    11
    Thanks G/R
    3/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Sychotix View Post
    Perhaps it is a rounding error for pixel location?
    That was actually one of the first things I explored. Unfortunately I don't think that is the reason.

    When I'm standing still things seem to be okay, including me rendering names above moving entities. As soon as I move however, everything goes jittery.

    Some more info I hope helps:

    - When I move and then stop, values are still updating for a little bit after I have stopped. (This is for static positions) But the changes are so insignificant it cant change position on the screen.
    - I switched to different rendering engines and still seeing the issue. (which makes me believe I'm doing something wrong with memory reading/w2screen/loops)

    EDIT: Here is a code sample

    Code:
    class Vector2(ctypes.Structure):
        _fields_ = [
            ('x', ctypes.c_float),
            ('y', ctypes.c_float)
        ]
    
    
    class Vector3(ctypes.Structure):
        _fields_ = [
            ('x', ctypes.c_float),
            ('y', ctypes.c_float),
            ('z', ctypes.c_float)
        ]
    
    
    class Matrix4x4(ctypes.Structure):
        _fields_ = [
            ('matrix', (ctypes.c_float * 4) * 4)
        ]
    
    
    def world_to_screen(world: Vector3, screen_size: Vector2, matrix: Matrix4x4) -> Vector2:
        matrix = matrix.matrix # todo: avoid weird struct
        x = world.x * matrix[0][0] + world.y * matrix[1][0] + world.z * matrix[2][0] + matrix[3][0]
        y = world.x * matrix[0][1] + world.y * matrix[1][1] + world.z * matrix[2][1] + matrix[3][1]
        w = world.x * matrix[0][3] + world.y * matrix[1][3] + world.z * matrix[2][3] + matrix[3][3]
    
        return Vector2((1.0 + x / w) * screen_size.x / 2, (1.0 - y / w) * screen_size.y / 2)
    
    # ...
    
    buffer = read_bytes(render_component.address + 0x90, ctypes.sizeof(Vector3))
    position = Vector3.from_buffer(bytearray(buffer))
    
    screen_position = world_to_screen(position, screen_size, matrix)
    draw_rect(screen_position.x - 10, screen_position.y - 10, 20, 20)
    Last edited by xhulic; 10-18-2020 at 07:11 AM. Reason: Add code just in case I'm doing something stupid

Similar Threads

  1. [Question] Overlay disappearing when leveling up
    By FrankTore in forum TurboHUD Support
    Replies: 5
    Last Post: 07-05-2020, 12:49 AM
  2. Replies: 0
    Last Post: 12-14-2018, 01:41 PM
  3. I Will Not Move When Flame Wreath Is Cast...
    By Dragonshadow in forum World of Warcraft General
    Replies: 2
    Last Post: 03-24-2008, 09:04 PM
  4. How to not move ur legs when ur walking/flying with mount
    By Lankus in forum World of Warcraft Exploits
    Replies: 11
    Last Post: 07-07-2007, 06:21 PM
All times are GMT -5. The time now is 02:27 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search