15.12.2019 21:30 - Tobii Eye Tracker Support in Empire Earth 2.



I'm proud to present a new, great feature for Empire Earth 2: Support for Tobii Eye Tracker devices, available since Unofficial Patch 1.5 (version 157026, December 2019). This is a non-sponsored article, and it wasn't created to advertise Tobii devices. It's because I programmed it to work with EE2 for myself, and I want to share it with the other players who use Unofficial Patch 1.5 and Tobii Eye Tracker.

What are Eye Tracker devices?
An eye tracker is a device for measuring eye positions and eye movement. Eye trackers are used in research on the visual system, in psychology, in psycholinguistics, marketing, as an input device for human-computer interaction, and in product design. Source (click).

Requirments in order to use Eye Tracking in EE2
1. You need to own a Tobii Eye Tracker device: https://gaming.tobii.com/products
2. You need to have the "Tobii Eye Tracking Core Software" installed: https://gaming.tobii.com/getstarted/
3. You need to update Unofficial Patch 1.5 to version 157026 or newer: https://ee2.eu/patch/
And that's it! The UP1.5 Launcher will detect if all required components are present/running, and will start an optimized thread which will do all the work for you, without the impact on performance!

How does the Eye Tracking work in EE2?
The base concept of this feature was to make an Eye Tracker device useful, helpful, and not annoying during game. It has been programmed especially for EE2, considering exclusion of the User Interface to not interrupt gameplay, sleep times before camera starts moving (unique for each border/corner), and much more. The only purpose of this feature is moving the camera by simulating arrow key pressess, depening on the current gaze point. The Launcher detects if the game window is active, to not cause problems when the game is minimized. Everyone has personal preferences regarding border thickness, time before camera starts moving, etc. Understanding that - I made this feature fully customizable, by the UP1.5 Configuration file. An instruction can be found later in this article. It's worth to mention, that the default Eye Tracking configuration is downloaded from EE2.eu, every time you start the Launcher. It gives a possibility to improve things "live", tweaking values without the need to download full updates.

Preview video:


Custom Configuration Instruction
Every time you start the UP1.5 Launcher - default values get an update from EE2.eu. It means, that whenever I disover issues or improvement possibilities - the configuration file on Server will be updated, and you will have the newest possible default values for Eye Tracking, without installing additional updates.

This feature can also be manually customized by the UP1.5 Configuration file - UnofficialVersionConfig.txt. To open this file, in UP1.5 Launcher, click on the "Change UP1.5 Settings" button. Then click on the blue "UnofficialVersionConfig.txt" hyperlink, right under Mona Lisa picture. This will open the Notepad with administrator rights, so you won't have problems saving the file. After every change, you need to save the file and restart game. It's currently impossible to reload settings once game is started.

Values after the "=" sign are these, which are currently default in the newest version of UP1.5 (and the configuration file from the Server). If the variable is missing in the .txt file - it means that the launcher will read the default value. It's actually recommended to leave this feature running on default settings, so after updates you won't need to re-configure it, or you won't lose potential improvements. The following configuration variables are available:

Enable (1) or Disable (0) Eye Tracking. It's the main switch for this feature:
TobiiEyeTrackerThreadAllowed=1

Enable (0) or Disable (1) Windows 10 Toast Notification with information that the Tobii Eye Tracker is available:
TobiiEyeTrackerDisableWin10ToastNotification=0

A configuration string (the same that is downloaded from the Server). On this website you can see the newest, updated version. Please copy and paste all text (including [ ] characters). You will have to remove this line from your UnofficialVersionConfig.txt if you want to return to live updates at the Launcher start: TobiiEyeTrackerCustomConfigurationString= [EYETRACKCONF2]main,1,1,1,750,0.725,0,0,1|top1,1440,1000,65,75,0,0,0.31093|top2,1440,250,65,75,0,0,0.20703|top3,1440,500,30,0,0,65|bot1,1440,750,40,0,0,0,0.16953,0.35807|bot2,1440,500,40,0,0,0|bot3,1440,500,40,0,0,0|left1,1440,250,40,80,0,0|right1,1440,250,40,80,0,0|topleft,1440,250,95,95,120,120|topright,1440,250,95,95,120,120|botleft,1440,250,90,90,120,7|botright,1440,250,90,90,120,7[/EYETRACKCONF2]

Please refer to the image below, to understand how the configuration works. Positions like "top", "bot", "left", "right", "topleft", "topright", "botleft", "botright" are separated in the configuration string by the " | " character.

Section "main":
1 = The same as TobiiEyeTrackerThreadAllowed=1 described above.
2 = The same as TobiiEyeTrackerDisableWin10ToastNotification=0 described above.
3 = Enable (1) or Disable (0) inversion of the Right / Left arrows, when the CTRL key is currently pressed. Thanks to it, rotating the camera using the CTRL key is more intuitive and less confusing.
4 = Time (in miliseconds) which allows you to switch borders/corners, ignoring the extra "Sleep time" (listed below). It's useful, because without this "timeout", for example if you moved eyes from the right border to the top-right corner - camera moving would pause for 250ms (0.25sec). Too high values are also not recommended, to not unintentionally trigger the bottom scrolling when trying to look at the User Interface.
5 = A float value from 0.0 to 1.0 which is the percentage height of the EE2 screen, excluding the bottom User Interface. This has been calculated by me based on 3 different 16:9 screen resolutions, but tested and works fine on different aspect rations as well. The default (0.725) is 72.5%. The full screen resolution height is multiplied by this value.
6,7 = A custom screen resolution width, height used by the Tobii's AddOrUpdateDisplayArea function. The default value "0" uses screen resolution which is automatically detected by the UP1.5 Launcher. It's highly recommended to not change it.
8 = Enable (1) or Disable (0) checking if game is currently in the Menu / Multiplayer Lobby, to prevent simulating key presses until skirmish starts.

Example section "bot1":
1 = A float value which is a "Magic Number" that decides about the scale of the "Size Border" and "Size Extra" listed below. Setting this value to "0" disables the "magic" scaling. The default borders thickness was configured for the 2560x1440 screen resolution. With the higher/lower screen resolutions it could be too little/too much. The formula is as follows: X = ScreenResolutionHeight / MagicBordersScale. BorderSize = BorderSize * X. So, let's assume that the top border width is "25", and an user uses a screen resolution 2560x1440. X = 1440 / 1080. X = 1.333. BorderSize = 25 * 1.333. BorderSize = 33.33. It's recommended to disable this option (setting to "0") if you test your own variations, for only 1 screen resolution.
2 = Sleep time (in miliseconds), after which the camera will start moving, if the gaze point stays in this area for longer than this time. It's helpful to prevent accidental "shakes" which can be more annoying than helpful. It can be configured separately for each direction (Top, Bottom, Left, Right, Top-Left corner, Top-Right corner, Bottom-Left corner, Bottom-Right corner). For example,
the Bottom values are higher, so when you move your eyes to the the User Interface area, it won't unintentionally move the camera down.
3 = A float value, which is a thickness (in pixels) of the border of the visible part of the screen. Lower values are closer the borders/corners, higher values might trigger camera scrolling too fast.
4 = A float value, which is an extra space (in pixels) that allows you to continue camera moving when looking beyond the monitor border. Without this option, the camera moving would stop too fast, especially when the "Border Size" value (listed above) was low. Please note that the extra space for the Bottom is 0. It's because increasing this value would trigger camera scrolling if you looked at the game widgets (top part of the mini map, time, calendar).
5, 6 = Position X, Y offset for the area drawing (might be used with different, hardcoded functions in Launcher).
7, 8 = Float (0 - 1.0) which is a percentage multiplier of the calculated UI distances (for the multi screen resolution support). It's used by an advanced calculation forumla in the Launcher.

Example section "topleft":
1 = "Magic Number" (as described above)
2 = Sleep time (as described above)
3, 4 = A thickness (as described above), but for corners it's additionally separated on Width/Height.
5, 6 = An "extra space" (as described above), but for corners it's additionally separated on Width/Height.


Best regards,
Dr.MonaLisa,
Unofficial Patch 1.5 Developer.
We use cookies and we monitor your activity to ensure that we give you the best experience on our website. If you continue without changing your settings, we'll assume that you are happy to receive all cookies from this website. If you would like to change your preferences you may do so by following the instructions here