Not sure how that would work out, do you want to iterate 5 times per seconds or per 0.1s ? But anyway I would wait for blizzard's official support around Dec
Hey programmer would it be possible to make your DUMMIES UNITS into "missiles" Generally most people are going to be filtering out missiles anyways..... That or they're just stupid.
Feel free to set the dummy unit type to missile, it will still works but does nothing to improve performance.
Oh thanks for the explain. Events any unit enter region. I'm thinking the maximum thread is about 240. so low precision work fine, but yeah using unit will have such limitation, I will think about using actor if highlight event support actor, make sure your enter region does not have wait and filter them correctly might help
Could you specify the problem ? new version no longer spawn by zone, but instead around a player's camera, 8 player looking at a same place can cause problem, but this could be fixed with some checking of camera target and remove unnecessary unit. Other than that, it works perfectly, changing camera position like clicking the minimap will cause unit to update their position
By all means use a square unit or such, if you're advanced enough, it can be easily changed in the library. (only the radius or z scale need to be touched. I dont want it to overwhelm newbie users. Also, i'm working on another ways of mouse detection so i'll leave it at that.
New version of the system is up. Now it will firstly spawn unit at camera position and move it when camera moves. Guaranteed to reduce lag and available on 256x256 map
you may should use a square with the z scale 0 or something very low in wc3 the selection/collision box or whatever is also scaled and you'll select allways the right unit no matter what the camera settings are
If someone in modeling could make 1 simple model for that, i would glad to use, just simple place them in the model (part 2) of my guide, scaling may have to be manually changed however. For now its the simplest model that can be found for the game's assets.
Regarding your method, Rather than recreating units whenever the player moves the screen, any idea if moving the units would work better instead? As you scroll to the right, the leftmost column shifts to the right and so on. Either that or a moving matrix of invisible units, that centers about the point of the players camera.
I could try this, however as I said before, even the function return camera position is delayed by a good second, not really viable when camera is abruptly changed
It still sucks for now. 1.0 precision is still good enough for things like diablo movement. Its the best robust way to have all unit ready than creating/destroy or hide/unhide them. They always take time so it will lag (not even talking about abrupt camera position change). Better precision can be achieved with un-traditional map llike minigames using mouse where camera is locked or the trackable region is limited. This is still very useful. I honestly understand why blizzard dont want to track mouse position in the first place. Even the camera position is delayed by a good second
does this method also work when the mouse moves behind dialog windows?
(so the mouse cursor can be changed when it is over a dialog (with
buttons on it)
guess it can. You have to lock camera, put it in 90 degree position. Also differen screen resolution will yeild different field of camera view so you have to build UI for the smallest 3:4
This is using unit on the field to track, you dont even attempt to know how its done. The UI is weird with all the different resolution and anchor so: No.
Special thanks to onetwo for his idea and tutorial. Thanks to progammer for doing the footwork and testing on his crap computer.
Cons, read this before deciding to use
Performance is inversely correlated to precision. From 100 to even 10000 of invisible unit will be placed on the map for measuring mouse position. ( My computer and the video above use 1.0 precision scale)
When too much unit is on the screen at the same time, some model/particle will not appears (typically about 0.5 precision scale and default camera zoom)
Since mouse tracking is using unit is highlighted events, any big unit (command center, thor) will block and reduce the precision. Either make those unit unselectable/untargetable or scrap the idea.
In order to target correctly with other unit on the field, make sure all target unit has the flag Unhighlightable Off either by trigger or bulk data editing
There seems to be a cap on how many unit can be on the field at the same time. Need confirm. (not applicable)
Promote sc2mapster in your map if you used this system (ok not really a con but just put it here for now )
Pros
Enable sweet AOE icon for spell not using traditional UI
Enable Diablo click and point movement system
Enable more possibilities regarding problems that need real time mouse position
Notes
I will need feedbacks from anyone tried it on
better computer
on battlenet
256x256 map
with both normal and even extreme precision (as extreme as your computer can handle)
Feedbacks below this thread
Another note: This is not a tutorial to do the first video. The map to download only contain simple example trigger on how to implement the second video. Here are the instructions to use this library to get mouse position at real-time by 1 functions that return a point
How to use this library
Open any map of your choice, with whatever terrain and size, follow these 3 steps
Step 1: Open Data Edtior, Unit Tab
Create a new Unit named Coordination Unit (or any name of your choice) with Type: Generic Unit, based on Default Setting (Unit)
Basically you dont have to do anything with this unit, just note it name down.
Note: If you want this system to track mouse position in the fog of war, do the following ( will cause extreme lag with high precision system. Use it at your own risk )
set UI- Fog Visiblity: Dimmed
Step 2: Open Data Edtior, Model Tab
Create a new Model named Invisible Model (or any name of your choice) with Type: Generic<</color>> , based on CModel
set Model:Assets\Units\Test\HitTestSphere\HitTestSphere.m3
note down the Model ID, as circled red above, as a case sensitive string (not applicable since v1.2)
Open ShapeCube (Unnamed)
set Shadow Radius: 0.0
You are done with the data editor, everything else will be handled by the library
Step 3: Using the library
Open the downloadable map, you will see these trigger:
Copy them over to your map, then follow the instruction on the documentation comments, or follow instruction below
Not sure how that would work out, do you want to iterate 5 times per seconds or per 0.1s ? But anyway I would wait for blizzard's official support around Dec
Check the first posts for update
Updates v1.2 :
- Used a square unit instead of circular. (more precise)
- Step 2 modified, no need to make new model, change Shadow Radius of ShapeCube to 0.0
- Model Name parameter removed. It is now the cube.
Feel free to set the dummy unit type to missile, it will still works but does nothing to improve performance.
@Magi66: Go
Oh thanks for the explain. Events any unit enter region. I'm thinking the maximum thread is about 240. so low precision work fine, but yeah using unit will have such limitation, I will think about using actor if highlight event support actor, make sure your enter region does not have wait and filter them correctly might help
@Magi66: Go
Could you specify the problem ? new version no longer spawn by zone, but instead around a player's camera, 8 player looking at a same place can cause problem, but this could be fixed with some checking of camera target and remove unnecessary unit. Other than that, it works perfectly, changing camera position like clicking the minimap will cause unit to update their position
@GaelicGamer: Go
By all means use a square unit or such, if you're advanced enough, it can be easily changed in the library. (only the radius or z scale need to be touched. I dont want it to overwhelm newbie users. Also, i'm working on another ways of mouse detection so i'll leave it at that.
New version of the system is up. Now it will firstly spawn unit at camera position and move it when camera moves. Guaranteed to reduce lag and available on 256x256 map
Check the 1st post for any info
http://forums.sc2mapster.com/resources/trigger-libraries/11481-library-realtime-mouse-tracking-system/?post=1
Need testing on battlenet/ multiple player/ camera
If someone in modeling could make 1 simple model for that, i would glad to use, just simple place them in the model (part 2) of my guide, scaling may have to be manually changed however. For now its the simplest model that can be found for the game's assets.
I could try this, however as I said before, even the function return camera position is delayed by a good second, not really viable when camera is abruptly changed
@OneTwoSC: Go
It still sucks for now. 1.0 precision is still good enough for things like diablo movement. Its the best robust way to have all unit ready than creating/destroy or hide/unhide them. They always take time so it will lag (not even talking about abrupt camera position change). Better precision can be achieved with un-traditional map llike minigames using mouse where camera is locked or the trackable region is limited. This is still very useful. I honestly understand why blizzard dont want to track mouse position in the first place. Even the camera position is delayed by a good second
What exactly did you get ? trigger timeout or an unit cap ? Try with lower precision ?
guess it can. You have to lock camera, put it in 90 degree position. Also differen screen resolution will yeild different field of camera view so you have to build UI for the smallest 3:4
@EternalWraith: Go
This is using unit on the field to track, you dont even attempt to know how its done. The UI is weird with all the different resolution and anchor so: No.
Updates v1.2 :
- Used a square unit instead of circular. (more precise)
- Step 2 modified, no need to make new model, change Shadow Radius of ShapeCube to 0.0
- Model Name parameter removed. It is now the cube.
Updates v1.1 :
Spawning units only at camera position and move them when camera moves. Guaranteed to reduce lag and available for even 256x256 map
Changelog: v1.1
Great thanks to Onetwo for his idea and explanation video leading to this improved system
http://forums.sc2mapster.com/resources/tutorials/11010-video-diablo-camera-movement/
AOE model for spell not using traditional UI
Diablo Movement System for unit (what you will actually find in the library map)
Asset page for map download:
(v1.2)
http://www.sc2mapster.com/assets/realtime-mouse-tracking-system/
Special thanks to onetwo for his idea and tutorial. Thanks to progammer for doing the footwork and testing on his crap computer.
Cons, read this before deciding to use
There seems to be a cap on how many unit can be on the field at the same time. Need confirm.(not applicable)Pros
Notes
I will need feedbacks from anyone tried it on
256x256 mapFeedbacks below this thread
Another note: This is not a tutorial to do the first video. The map to download only contain simple example trigger on how to implement the second video. Here are the instructions to use this library to get mouse position at real-time by 1 functions that return a point
How to use this library
Open any map of your choice, with whatever terrain and size, follow these 3 steps
Step 1: Open Data Edtior, Unit Tab
Basically you dont have to do anything with this unit, just note it name down.
Note: If you want this system to track mouse position in the fog of war, do the following ( will cause extreme lag with high precision system. Use it at your own risk )
Step 2: Open Data Edtior, Model Tab
Create a new Model named Invisible Model (or any name of your choice) with Type: Generic<</color>> , based on CModelset Model:Assets\Units\Test\HitTestSphere\HitTestSphere.m3note down the Model ID, as circled red above, as a case sensitive string(not applicable since v1.2)You are done with the data editor, everything else will be handled by the library
Step 3: Using the library
Function listing:
Initiate Coordination System(Unit Type, Model Name, Player, Radius, Precision Scale, Debug Mode On)
Model Name: Enter the dummy Model ID as a case sensitive string
( not applicable since v1.2 )(How to choose a preset)
GetMouseWorldPosition(Player)
Clean Up Coordination System()
Note for localization issue: If you does not see the trigger name due to localization, use those above screenshot to rename them.