What's new
  • Visit Rebornbuddy
  • Visit Panda Profiles
  • Visit LLamamMagic
  • Visit Resources
  • Visit Downloads
  • Visit Portal

PoE Camera

Dgc2002

Member
Joined
Jan 15, 2010
Messages
197
Reaction score
0
PushedX, would it be possible for you to expose camera information for us? I'm shamelessly gutting Nesox's AeroOverlay for honorbuddy and having some fun/learning a bit from it. I'm at the point that, in order to draw anything besides doodles over PoE/Text in a static position, I need some camera information.

Here's the link to HonorBuddy's WoWCamera class:
WoWCamera Class

The information I see specifically used in Nesox's plugin is:
FoV
Position
View
Forward
Projection
(maybe more if I missed anything)

I completely understand that this isn't "top of the list" priority at the moment.
 
Hm, what would you need the information for?

I ask, because in this game, it's not quite the same as D3. We have to map world/map positions into 2D screen space, to perform all actions. The game is setup in a way where, if you use any modifications to the client's camera (whether it's FoV changes, zoomhack, etc...), it affects the game itself (and certain skills). The client's hitbox testing and targeting gets affected, typically for the worst, so it's not something we can support.

We have functions exposed for doing the conversion into 2D screen space, so the camera data wouldn't be necessary, except for maybe current zoom to detect cases where the bot should zoom out the client to max before starting, since the zoom level affects what the bot can do (once again, due to the client relying on the current camera setup).

If all you need is the means to get 2D screen coords for various objects and whatnot, I can give you some examples. We don't do the calcs to manually map coordinates, because of the client design. GGG has certain things in place that break code that does it, presumably to cause issues for easy pixel/click bots (but it just might be their design). Getting it exposed isn't an issue, I can certainly put it towards the top of the todo list since it's an API issue, but the reason it's not there now is simply because I can't think of any uses for it with how the client works.
 
Ahhh I wasn't able to find any world to screen methods when I looked around. That's pretty much what I would have used the camera information to calculate. Basically my goal is to relate a location in the world to 2d screen coordinates. For example I might want to check if a certain x, y, z is within view and if it is draw something at the 2d screen position where it appears. At the moment I'm able to draw text/shapes onto a transparent/click through..able window. I just don't currently have a method of relating that to the 3d space. Any information would be appreciated but I don't want to put you through the trouble of writing another example for me =)
 
Last edited:
It's not a problem, the whole bot works this way. :)

I just checked the code, and the actual functions that expose this data are internal, so in the next build, they will be made public access. The next build will be made in less than an hour, just need to make a new thread for it.

All you'll have to do is call ClientFunctions.WorldToScreen:

Code:
public static void WorldToScreen(Vector3 position, out int cx, out int cy)
public static void WorldToScreen(float x, float y, float z, out int cx, out int cy)

If you have a Vector2 (map coords), you'll pass .WorldToWorld3()
if you have a Vector2i (map coords), you'll pass .MapToWorld3()

The function itself takes world coords (which model size is also in).

So for example, one of our input functions is MoveMouseToPosition, which moves the mouse cursor to a map position, and it's simply:
Code:
            /// <summary>
            /// Moves the mouse over the specified position.
            /// </summary>
            /// <param name="position">The map position to move to.</param>
            public static void MoveMouseToPosition(Vector2i position)
            {
                int cx;
                int cy;

                ClientFunctions.WorldToScreen(position.MapToWorld3(), out cx, out cy);

                SetMousePos(cx, cy);
            }

If you have any other questions about it after it's available, feel free to ask!
 
This works great =) I'll ask a question related to my little project here rather than start a new thread.

I am currently drawing text at the positions of monsters on the screen. For reference I retrieve their position and store it like this:

Code:
            foreach (var npc in LokiPoe.ObjectManager.GetObjectsByType<Monster>().ToList())
             {
                     Loki.Game.LokiPoe.ClientFunctions.WorldToScreen(npc.Position.MapToWorld3(), out cx, out cy);
                     positionList.Add(new Loki.Utilities.Vector2(cx, cy));
             }

It seems that when I'm a little ways away(let say half a screen, haven't gotten actual unit measurements) the position seems to update every half second..ish. But when they are closer(10is feet) the updates seem to happen more often. Is this by design or is something happening on my end?
 
The default settings for the bot is to run a tick, then wait 15 ms, which is Settings->Main->MsBetweenTicks.

If you're noticing serious delays in client data, I would think it's most likely your setup, but it possibly could be that monster information is getting incorrectly cached too long under the new design. It's hard to say though, but this weekend, I am working on rewriting the object/component system we use, to fix some issues with the new design fo the bot and how memory changes too frequently to do what we used to when it comes to trying to maintain objects over multiple frames.

So, I'm not exactly sure yet, but if I notice anything while fixing that stuff, I'll mention it later after it changes.
 
After some more testing it's still a bit confusing as to why it stutters the way that it does. Here is a video of the overlay(unfortunately I wasn't able to capture the game window and the overlay window)

Fast, Free Video Hosting & Video Sharing - VideoBam
This is just drawing lines from the center of the screen to the position of the onscreen mobs. The big stutters are due to lag while recording. The consistent smaller ones are happening under normal operation.

Each draw cycle took between 10ms and 20ms:
Code:
2014-09-06 21:55:44,953 [RenderThread] DEBUG PerformanceTimerEx (null) - [20.7673ms] OverlayManager.Render
2014-09-06 21:55:44,980 [RenderThread] DEBUG PerformanceTimerEx (null) - [24.9216ms] OverlayManager.Render
2014-09-06 21:55:44,996 [RenderThread] DEBUG PerformanceTimerEx (null) - [10.9708ms] OverlayManager.Render
2014-09-06 21:55:45,010 [RenderThread] DEBUG PerformanceTimerEx (null) - [13.4336ms] OverlayManager.Render
2014-09-06 21:55:45,031 [RenderThread] DEBUG PerformanceTimerEx (null) - [20.3962ms] OverlayManager.Render
2014-09-06 21:55:45,054 [RenderThread] DEBUG PerformanceTimerEx (null) - [22.929ms] OverlayManager.Render
2014-09-06 21:55:45,070 [RenderThread] DEBUG PerformanceTimerEx (null) - [14.1921ms] OverlayManager.Render
2014-09-06 21:55:45,089 [RenderThread] DEBUG PerformanceTimerEx (null) - [18.5682ms] OverlayManager.Render
2014-09-06 21:55:45,108 [RenderThread] DEBUG PerformanceTimerEx (null) - [18.1381ms] OverlayManager.Render
2014-09-06 21:55:45,120 [RenderThread] DEBUG PerformanceTimerEx (null) - [12.0132ms] OverlayManager.Render
2014-09-06 21:55:45,143 [RenderThread] DEBUG PerformanceTimerEx (null) - [22.2028ms] OverlayManager.Render
2014-09-06 21:55:45,155 [RenderThread] DEBUG PerformanceTimerEx (null) - [11.4985ms] OverlayManager.Render
2014-09-06 21:55:45,177 [RenderThread] DEBUG PerformanceTimerEx (null) - [21.036ms] OverlayManager.Render
2014-09-06 21:55:45,191 [RenderThread] DEBUG PerformanceTimerEx (null) - [12.8598ms] OverlayManager.Render
2014-09-06 21:55:45,209 [RenderThread] DEBUG PerformanceTimerEx (null) - [17.9651ms] OverlayManager.Render
2014-09-06 21:55:45,221 [RenderThread] DEBUG PerformanceTimerEx (null) - [11.0454ms] OverlayManager.Render
2014-09-06 21:55:45,241 [RenderThread] DEBUG PerformanceTimerEx (null) - [18.7106ms] OverlayManager.Render
2014-09-06 21:55:45,255 [RenderThread] DEBUG PerformanceTimerEx (null) - [11.9178ms] OverlayManager.Render
2014-09-06 21:55:45,274 [RenderThread] DEBUG PerformanceTimerEx (null) - [18.1807ms] OverlayManager.Render
2014-09-06 21:55:45,286 [RenderThread] DEBUG PerformanceTimerEx (null) - [11.8664ms] OverlayManager.Render
2014-09-06 21:55:45,304 [RenderThread] DEBUG PerformanceTimerEx (null) - [16.9889ms] OverlayManager.Render
2014-09-06 21:55:45,316 [RenderThread] DEBUG PerformanceTimerEx (null) - [11.5949ms] OverlayManager.Render
2014-09-06 21:55:45,336 [RenderThread] DEBUG PerformanceTimerEx (null) - [18.7616ms] OverlayManager.Render
2014-09-06 21:55:45,348 [RenderThread] DEBUG PerformanceTimerEx (null) - [10.931ms] OverlayManager.Render
2014-09-06 21:55:45,363 [RenderThread] DEBUG PerformanceTimerEx (null) - [13.4469ms] OverlayManager.Render
2014-09-06 21:55:45,376 [RenderThread] DEBUG PerformanceTimerEx (null) - [12.0108ms] OverlayManager.Render
2014-09-06 21:55:45,394 [RenderThread] DEBUG PerformanceTimerEx (null) - [17.981ms] OverlayManager.Render
2014-09-06 21:55:45,409 [RenderThread] DEBUG PerformanceTimerEx (null) - [15.0016ms] OverlayManager.Render
2014-09-06 21:55:45,428 [RenderThread] DEBUG PerformanceTimerEx (null) - [18.0031ms] OverlayManager.Render
2014-09-06 21:55:45,441 [RenderThread] DEBUG PerformanceTimerEx (null) - [10.8905ms] OverlayManager.Render
2014-09-06 21:55:45,455 [RenderThread] DEBUG PerformanceTimerEx (null) - [12.6663ms] OverlayManager.Render
2014-09-06 21:55:45,469 [RenderThread] DEBUG PerformanceTimerEx (null) - [12.9214ms] OverlayManager.Render
2014-09-06 21:55:45,481 [RenderThread] DEBUG PerformanceTimerEx (null) - [11.9821ms] OverlayManager.Render
2014-09-06 21:55:45,495 [RenderThread] DEBUG PerformanceTimerEx (null) - [13.1335ms] OverlayManager.Render
2014-09-06 21:55:45,507 [RenderThread] DEBUG PerformanceTimerEx (null) - [11.4295ms] OverlayManager.Render

So I don't THINK the draw loop is causing that delay. The stutter is more than 15ms so it doesn't seem limited by the bot's tick rate.

On the bright side I might buy another ExileBuddy key due to crashing ExileBuddy constantly and having to go to the site to kill the session =)
 
Back
Top