Skip to content
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

Spectator #2083

Merged
merged 46 commits into from
Aug 29, 2015
Merged

Spectator #2083

merged 46 commits into from
Aug 29, 2015

Conversation

kymckay
Copy link
Member

@kymckay kymckay commented Aug 9, 2015

Introducing the all new spectator:

  • Split spectator state into two separate states:
    • setSpectator (virtually set local machine as spectator and open the UI)
    • stageSpectator (physically hide and move a unit)
  • Compatible with BI's respawn framework (via introduction of a template)
  • Compatible with custom scripted respawn frameworks (via public function API)
  • Supports zeus usage (note that zeus doesn't open when dead, that's a zeus thing we might be able to change in ace_zeus)
  • Admins can use chat
  • Improved unit icon system, renders group icons above 200m, unit icons within 200m, optimized
  • Improved unit list system, added coloured unit icons to the list, list culls and adds data rather than refreshing it all, optimized
  • Using map control type 100 to remove all engine unit icons
  • Fixed public API altering of the camera position (fixes map camera teleporting)
  • Introduced keybindings for speed/zoom to provide finer control
  • Introduced "focus on unit" keybinding to teleport the camera to look at the selected unit in the list
  • Tweaked UI to avoid clashes with the MPTable element (respawnDialog that shows on death)
  • Added support for BI's respawn counter - blends it into the UI if present
  • Camera rotation and movement scales with zoom level

kymckay added 30 commits July 31, 2015 23:32
Vertical camera movement (boom) was previously at a constant speed. However this felt too slow at times, half the horizontal (dolly) speed should improve this.
Restores spectator that was removed from release branch
With the changes planned to allow spectator in the true death state, physical changes aren't applicable in all of the possible usage cases. This separates the physical process into new function ace_spectator_fnc_stageSpectator
uiNamespace persists between missions and should be reset on mission start
Existing variable "ace_spectator_isSpectator" split into counterparts "ace_spectator_isSet" and "ace_spectator_isStaged" in order to better manage spectator events
New spectator on death system should enter spectator mode upon dying and exit upon respawning. Only virtual spectator state is suitable for this system since the body should remain as is.
Since spectator was pushed back to a feature branch from the release branch these translations from a PR were also lost (as the commits were prior to the removal commit) when it was merged after the fact.
Using boolean instead of simply checking for the display. Checking for diplay was unreliable since it can be technically closed while theoretically open during the escape menu and such.
When staging a spectator (physically applying the spectator state) the unit position is saved for potential later restoration. This shouldn't be done multiple times since the function can be called again to reset staged units.
When using ACE_Player the camera would return to the dead body. It makes sense to simply pass the reset unit by reference to the camera exit code.
The spectator camera should start in night vision mode if the sun to moon transition state is appropriate
Seamlessly integrates the spectator system with the vanilla respawn framework when the onDeath setting is enabled. This commit makes a lot of changes:
- Edit BI functions used by the vanilla respawn framework to enable support for ace_spectator.
- Set spectator state is now tracked using a GVAR for the local player since using a unit won't be reliable all of the time. However unit is still marked for any filtering purposes.
- Instead of NV being used based on the sun to moon transition state by default, that functionality only takes place in the integrated system so that custom frameworks can do what they want.
- Seagull units are hidden when using framework integration since they're spawned by the engine with respawn type 1 and they just hang around undesirably
Hacking the BI respawn framework to support a spectator setting was intrusive and limiting. Instead of using a setting, I've opted to introduce a new respawn template that can be used within BI's respawn framework. The benefits of this approach are:
- Compatibility isn't a concern, that responsibility is shifted onto mission designers.
- Mission designers can use the functionality of the BI framework alongside the spectator system (combining templates, using different templates for different sides, etc.).
- If a custom respawn framework is used, then this doesn't change anything. Custom frameworks are still fully supported via the public functions provided.
- Remains simple to set up, just requires a description.ext edit
Previously the camera would be automatically moved away from corpses (when the unit currently being watched dies). This changes it to stay on them until the view is manually switched as users might want to stick around and watch whatever was going on at the time of death.
Adds an option to use playableUnits for scenarios where AI playable units are enabled.
Rather than hiding the BI respawn counter, it should be "integrated" into the UI via code if present.
- Swap the FOV and vision mode tools into a more logical order.
- Shorten the unit list to prevent overlay with main UI
- Fix name tool on dead units
Makes the fake pause menu closer to the real thing for UX purposes
Can only use zeus while alive, so it won't work using the respawn template. However it's useful for communities usign custom frameworks
Now that booming the free camera is influenced by the camera speed, the keys should be whitelisted from the held-key prevention system to allow the speed to be adjusted on the move. Also includes a failed attempt to fix the free camera map teleporting functionality.
- Optimize and improve 3D icon drawing
- Combine 2D and 3D PFHs into 1
- Render group icons outside of 200m, unit icons within
- Store list of groups on units update to cut down on what needs to be done each frame
- Change map control type to 100 to remove all default unit icons
- Improve colour caching, group colours don't change, unit colours do
- Remove icon setting, toggling should be at users discretion
The old method of refreshing the tree on each update would reset all expanded/collapsed nodes. Now the code will cull any units/groups/sides no longer spectatable from the list and cache the ones that are still valid. The cached data is then used to populate the list with new units.

Add coloured unit icons beside units in the list for quick user reference of side and type.

Store group netIDs in respective nodes for possible use in code.
Having the help window in the centre of the screen blocked too much of the users view and also clashed with the MPTable element (the table that appears on death, aka "respawnDialog"). It was moved to the right of the screen and now mirrors the unit list. To save screen space, the action keys are given as tooltips for the listbox entries so users must mouse over for more info.
With new layout of help window the toggle UX also changes. User expects help window to toggle as part of overall UI.
When the BI respawn counter is blended with the spectator UI its colours are also updated to match
Adds a title to the unit tree to match the help list and enters the title text.
Sometimes you just want a burst of speed rather than to adjust it and then adjust it back. Also swapped the speed/zoom scrolling modifier around.
kymckay added 7 commits August 7, 2015 19:00
Type 0 worked, but the mission didn't end when all players were killed.
Type 1 didn't work because isPlayer isn't true for seagulls. So spectator virtual state is now entirely unassociated from objects in the game.
Pressing F will move the free camera to a position viewing the unit currently selected in the list. Fixes map teleporting functionality also.
Allows for finer control of the speed and zoom, as well as a quick way to reset either.
@kymckay kymckay added the kind/feature Release Notes: **ADDED:** label Aug 9, 2015
@kymckay kymckay added this to the 3.3.0 milestone Aug 9, 2015
@BryanBoru
Copy link

that is one hell of a feature list, outstanding job.

@kymckay
Copy link
Member Author

kymckay commented Aug 9, 2015

Doesn't even include the initial implementation 😉

@kymckay
Copy link
Member Author

kymckay commented Aug 9, 2015

I'll need to update the documentation on this at some point since the simple way mission makers can set it up has changed.

@jonpas
Copy link
Member

jonpas commented Aug 9, 2015

Very nice job!

@kymckay
Copy link
Member Author

kymckay commented Aug 9, 2015

Feel free to test the hell out of it 😄

Want it to be in as good a condition as possible for 3.3.0

@voiperr
Copy link
Contributor

voiperr commented Aug 9, 2015

👍 👍 👍

I'm seeing lots of cleverness at play here. Well done. I'll test it when I can.

kymckay added 4 commits August 9, 2015 20:59
If the spectator camera unit was set before the camera had ever opened then the unit list wouldn't be populated and as such the camera would automatically abort to free mode since the unit wasn't available to spectate.

So now I'm running the updateUnits function before opening the camera to pre-populate the list.
A public API system to allow external systems to interrupt and resume the spectator interface. Also made use of it for the escape menu and zeus support.
- Use a display rather than a dialog (contextually makes more sense).
- Move the entry/exit functionality to the setSpectator function. Preserves the handleInterface function for purely display related events and makes more sense.
- Fix missing semi-colon
@thojkooi
Copy link
Contributor

@SilentSpike What is the status on this?

@kymckay
Copy link
Member Author

kymckay commented Aug 24, 2015

Couple minor changes to be made as per user feedback: #1781 (comment)

However it's functional. There are two other tasks in the original issue that'd be nice to have done too, but they're not critical for release

gienkov and others added 5 commits August 24, 2015 14:35
Translate spectator strings to polish
Slows the camera movement close to the ground as it feels more natural when spectating units up close and such
kymckay added a commit that referenced this pull request Aug 29, 2015
@kymckay kymckay merged commit e3cda8e into master Aug 29, 2015
@kymckay kymckay deleted the spectator branch August 29, 2015 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Release Notes: **ADDED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants