Skip to content

Commit

Permalink
v1.0.1 (#1)
Browse files Browse the repository at this point in the history
* Rename demo.txt to demo.au3

* Update README.md

* Add files via upload

* Add files via upload

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md
  • Loading branch information
user726687 authored May 1, 2023
1 parent d4b066a commit b67f088
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
# NaturalEdgePan

An RTS/MOBA camera controls scheme for the 21th century.
A modern, displacement-based edge-panning instead of the legacy velocity-based behavior of 90's RTS games.

[Download demo here.](https://github.com/EsportToys/NaturalEdgePan/releases)

https://user-images.githubusercontent.com/98432183/235227114-13128d48-fe16-4c28-af13-93ed578ad0f6.mp4

![image](https://user-images.githubusercontent.com/98432183/235364466-d2537e0d-2602-4b69-80bf-1559104d6ba6.png)


## What's wrong with current systems

The cumbersome way top-down games moves the camera at a fixed velocity when the cursor touches the screen/window edge is a vestige from 90s real-time-strategy games that has stayed entirely unchanged.
The way top-down camera moves at a preset rate when the cursor touches the screen/window edge is a legacy UX largely unchanged from 90's real-time-strategy games.

While some games provides a menu option for setting a preferred preset camera speed, it takes a lot of fiddling to find an acceptable compromise between being too slow for large displacements and too fast for fine adjustments.
While some games provide menu options to adjust the panning speed/curve, it takes a lot of fiddling to find an acceptable compromise between being too slow for large displacements and too fast for fine adjustments.

This has resulted in players usually being recommended to exclusively use the minimap for large movements and middle-click drag scroll for small adjustments, leaving edge-panning an infrequently used, awkward interaction unsuited to either tasks.
This has resulted in players usually being recommended to exclusively use the minimap and hotkeys for large movements and middle-click drag scroll for small adjustments, leaving edge-panning in an awkward position being unsuited to either tasks.

Basic UX common sense tells us that an action requiring the least cognitive load is best suited to frequently performed tasks, conversely an infrequently performed task requiring conscious intent should be activated by a deliberate action.
Basic UX common sense tells us that frequently performed tasks should have little cognitive friction, while strongly effectful actions should require conscious intent to activate.

Yet both minimap clicking and middle-click drag require a conscious action (the former needing to visually confirm where you're clicking, the latter requiring a button to activate), whereas simply moving your cursor against the edge is something that has the least cognitive load.
Both minimap clicking and middle-click drag require a conscious action that interrupt unit control (the former needing to visually confirm where you're clicking, the latter requiring a button to activate), whereas simply moving your cursor against the edge is practically no different than generally manipulating your mouse. Yet the effectful auto-panning is assigned to the easy-to-accidentally-trigger edge, while performing the frequently needed stateful adjustment require you to interrupt your current task to click an obscure button.

This inversion of frequency-of-action vs friction-against-activation leads to unnecessary cognitive burden in the skill acquisition process -- instead of skill-differentiation via expressivity, this is just learning-segregation via cruft.

Expand Down
2 changes: 1 addition & 1 deletion RunDemo.vbs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run ".\AutoIt3_x64.exe .\demo.txt"
WshShell.Run ".\AutoIt3_x64.exe .\demo.au3"
10 changes: 8 additions & 2 deletions demo.txt → demo.au3
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,16 @@ Func Init()
@CRLF & _
"Default = Edge-Pan" & @CRLF & _
"Hold MB3 = Auto-Pan" & @CRLF & _
"Hold MB1 = Drag-Pan" & @CRLF & _
"Hold MB1 = Grab-Pan" & @CRLF & _
"Hold Space = Lock Cam" & @CRLF & _
"Hold Shift = Map-Pan" & @CRLF & _
"CapsLk = Lock Map-Pan" , 0 , 0 ,150,$dim[3] ) , 8.5*96/GetDpiForWindow($hWnd) )

Global $hOverlay = GUICreate("Overlay",$dim[2],$dim[3],$dim[0],$dim[1],0x80000000,0x02080080,$hWnd)
Global $hCha = GUICtrlCreateButton("",Round($xImg)+Round($xCha)-$rCha,Round($yImg)+Round($yCha)-$rCha,2*$rCha+1,2*$rCha+1)
GUICtrlSetBkColor($hCha, 0xff00ff)
Global $hDrg = GUICtrlCreateButton("",-6,-6,2*3+1,2*3+1)
GUICtrlSetBkColor($hDrg, 0xffffff)
GUISetBkColor(0x0000F4,$hOverlay)
DllCall("user32.dll", "bool", "SetLayeredWindowAttributes", "hwnd", $hOverlay, "INT", 0x00F40000, "byte", 255, "dword", 0x03)

Expand Down Expand Up @@ -207,9 +209,12 @@ Func ProcessInput($struct,$pos,$hWnd)
$panX = $x
$panY = $y
AdlibRegister ( "Pan" , 16 )
Local $dim = WinGetPos($hWnd)
GUICtrlSetPos($hDrg,$x-3-$dim[0],$y-3-$dim[1])
EndIf
If BitAnd(32,$_.bflg) Then
AdlibUnRegister ( "Pan" )
GUICtrlSetPos($hDrg,-7,-7)
EndIf
If BitAnd(1,$_.flag) Then
; absolute movement
Expand Down Expand Up @@ -276,6 +281,7 @@ Func ProcessInput($struct,$pos,$hWnd)
ElseIf $focusChange Then
resetSens()
AdlibUnRegister ( "Pan" )
GUICtrlSetPos($hDrg,-7,-7)
EndIf
EndFunc

Expand Down Expand Up @@ -392,4 +398,4 @@ EndFunc

Func _Clamp($min, $val, $max)
Return $val<$min?$min:($val>$max?$max:$val)
EndFunc
EndFunc

0 comments on commit b67f088

Please sign in to comment.