Skip to content

wzapi::hackTextMarker - Place colored text marker on map #4243

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

1269339743
Copy link
Contributor

@1269339743 1269339743 commented Mar 20, 2025

Place text on map is useful for AI debugging or tutorial.
It use same palette of player colour.

effect:
1

subtract playerPos.p.x % TILE_WIDTH ... for better sub-tile precision (mp4 video):
before:
https://github.com/user-attachments/assets/416ee2b4-7020-4e98-8d71-7096888f9439
after:
https://github.com/user-attachments/assets/a8c63624-4795-4bf0-b34a-1e623f17c513

@1269339743
Copy link
Contributor Author

Mod to test hackTextMarker
Phase 0: Place marker on tile under droid
Phase 1: Place marker on droid
Switch between Phase 0 and Phase 1 every 10s

hackTextMarker.zip

@past-due
Copy link
Member

past-due commented May 30, 2025

@1269339743 When testing these changes, I noticed that locateMouse() was returning less accurate values, and thus the mouse tile coordinates were noticeably "off" in many cases.

I've pulled out the sub-tile change to #4322 and incorporated a draft fix to screenCoordToWorld - please let me know your thoughts (there may be a better approach, this was a very quick attempt at a fix).

For testing: I find that these scavenger buildings near the starting position on "Fastplay" mode are a good place to find issues.

fastplay_buildings

@1269339743
Copy link
Contributor Author

1269339743 commented Jun 1, 2025

I forgot to add relative code, my incomplete fix caused bug

Current code search in a continuous array, it probably gained some speed from CPU cache
Index colour O(1) or Quadtree O(log2(n)) can be faster, but need lot of math and coding
Since there is only one mouse and the function called once per frame, current code should work well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants