Closed nicolasbadano closed 9 years ago
!(_x in allMapMarkers)
Since we will be making this compatible with respawn missions then the code that moves those respawn markers will need to be totally changed anyway :+1:
I'd propose introducing a new marker "spectator_respawn"
(or similar) to handle the spectator holding position. With some code to just move players somewhere off map if it doesn't exist.
Oh and good idea merging this for further development, I was considering the idea myself :+1:
Created branch ace_spectator
for development (and updated issue).
I'd propose introducing a new marker "spectator_respawn" (or similar) to handle the spectator holding position. With some code to just move players somewhere off map if it doesn't exist.
Sure. We can also specify hardcoded default positions for common maps. I remember a list of default pen coordinates existed on an addon by Columdrum for ACE2; we could ask permission to use those as they are.
Actually, looking at the calculation for the pen position now it seems fine. It just shoves players off map. Which removes any possibility of the position being a problem in a mission. I'd probably change it to just be a fixed value and cut down on some of the code, but that's fine in my opinion.
The respawn markers being moved was presumably to avoid any weirdness with people spawning then being moved, but I'll take that code out anyway because it introduces more problems than it fixes (when respawn support is desired).
Come to think of it, do all terrains start with (0,0) in the bottom left?
I simplified the pen calculation with the assumption that they do.
Come to think of it, do all terrains start with (0,0) in the bottom left?
No. There are maps that have an offset (a certain map from Iron Front comes to mind; it was discussed on the 10 digit gps thread).
Hmm, that fixed default position should only be an issue in very edge case situations then. I'll leave it as is, but if anyone feels it's worth changing I have no objections :smile:
Hmm, that fixed default position should only be an issue in very edge case situations then
Probably. We can very well wait for gps people to solve it for us and then rip off the reward.
@SilentSpike So how do we want to handle missions with proper respawn? Put a respawn timer in the corner somewhere? Is there a way of postponing the respawn menu?
R.e. gear: Ideas for preventing players from drowning without scuba gear? Maybe make a PFH to setPosASL the player floating in air (network overhead?) or attachTo a static object with an offset above the water?
Maybe make a PFH to setPosASL the player floating in air (network overhead?)
Yes, that would create large network overhead.
attachTo a static object with an offset above the water?
That'd should probably work.
Another random solution would be to actually put spectators inside bloody submarines. TBH I'm in love with that idea. It'd would also be hilarious if the respawn point is on land, but it'd still work.
@voiperr The respawn system is up to missions designers, what's needed to allow for that is just plenty of flexibility. What I'd personally consider necessary for this:
On top of that, we could develop some configurable standard respawn systems (wave respawn, life pool, etc.) as quality of life improvements for users. Though that's me planning a little far ahead :wink:
Another random solution would be to actually put spectators inside bloody submarines.
Read my mind :grinning:
I've also been considering a PFH to setOxygenRemaining 1
and figuring out a way to override the vision blurring.
Hmm, there is another possible solution:
We could delete the player unit and cache all of it's details (so that it can be recreated upon respawn). However this might not be handled well by external scripts.
Edit: Hell we could add a spectator unit to switch into, would also be an easy way to identify spectators without locality trouble. I wonder if doing so would break any other ace systems.
We could delete the player unit and cache all of it's details
That could be problematic; IDK if we can trust radio spectator modes working without the player existing.
without the player existing.
Would this be a problem if we switched into a virtual spectator unit?
Wouldn't just assigning a public objectVar be simpler?
For checking if a player is a spectator sure, but a virtual unit could bring some advantages (and solve multiple birds with one stone) if it wouldn't cause issues elsewhere.
I'm just spit balling though, I'm not going to change the code unless it's an immediate solution/improvement or an agreed design decision.
So, good news everyone: hideObjectGlobal
actually disables collision too in A3. So we technically don't even need to move spectators out of the way on respawn (which would also happen to make the rest of the code more simple).
I've seen a few mission scripts use area proximity detection for whether to count players for various reasons. I still think it's prudent to throw them out of the map area.
Hmm, that's a good point, triggers could also act unexpectedly as a result :+1:
So yeah, probably need to move them regardless.
I've implemented a basic spectator enter/exit function in ff4fce39501ab0938f8d791b4a59d2da4a4bf1d7
Submitted PR #1783 to implement method of handling object hiding into ace_common (see comment in the code as to why).
RE: Drowning, we could put the units high in the air and enableSimulation false
them?
Well I tested that and it works, but...something went wrong with the camera script and I'm unsure if it's related
Okay so I think because the player is being moved so far off map the game is running out of memory and crashing. Introducing optional marker "ace_spectator_respawn"
to define an explicit position and avoid that problem.
Currently it'll just use [0,0,0]
if the marker doesn't exist, which should avoid potential issues with triggers and things well enough for now. Once the GPS people get something done we can explicitly use the bottom corner.
I think we should consider just removing the view distance slider.
It feels a little out of place (and redundant) to me having it in the spectator interface.
Streaming/screenshots/etc would benefit from it. I'm making it optional via module.
Streaming/screenshots/etc would benefit from it. I'm making it optional via module.
Keep in mind that we have a viewdistance module already, and the plan is to include keybinds to up/down the viewdistance at any given time (those keybinds are not added yet). Maybe that could serve the same purpose here.
Aren't there plans for VD restriction, though? Some mission makers might want it so spectators can see further than living players.
Aren't there plans for VD restriction, though?
There's already a configurable (optional) viewdistance restriction. We could add independent restriction distances for playing vs spectating players on that same module.
Oops, still a few left (I blame notepad++): https://github.com/acemod/ACE3/pull/1791
Keybindssssssss: https://github.com/acemod/ACE3/pull/1794
All that's immediately left to do is get the enter/exit system to a reliable state and do some cleanup.
There are further enhancements to be made, but we can work on those after this.
Yup. Keep in mind that entering/exiting spec mode needs to bind/unbind keys now too
:+1: Good call, I'm gonna clean that stuff up in a bit
@voiperr May I ask what purpose the "killed" EH serves exactly?
@SilentSpike Local EH applied to remote units. As soon as they die, updates the tracking array, exits POV if inside that unit, and provides a death message (if markers are on). Could be inherited to base class via XEH, but I thought it would be cleaner if the "CheckUnits" PFH applies the Killed EH only when spectator is actually used.
@esteldunedain For respawn missions or all missions? Are we allowing players to exit spectator on permadeath missions...?
I mean the one in postInit :)
Handles when player initially dies, then applies in case player somehow dies in pen (unlikely) or hits respawn button in menu. No reason it can't be a function. :wink:
Isn't it redundant though? All of those things seem to be handled on respawn as far as I can tell
The hearing update and fadeout, the fade to black, all need to start on player death (assuming we're keeping those (I think we should keep the sound one, at least)). Group joining could go to respawn.
grpNull
) or BI have changed the game again to delete empty groups (they've flip-flopped on this a bunch of times). Either way, if the group is null
is just creates a new one on "respawn" so nothing's changes there. It's important not to create groups en mass because we don't want to contribute to the group limit any more than necessaryhandleRespawn
and handleKilled
functions for organisation purposes (handleRespawn
is so that we aren't using a public function - setSpectator
- as part of the base framework itself).My todo for tomorow:
forceRespawn
the player and let the game handle proper respawn procedure. This would have the benefit of supporting respawn templates by default and processing the correct event handlers. The downside would be that 2 deaths would take place which might produce unforeseen problems for external code (including mission designers) - granted, the current spectator system might produce unforeseen problems for external code anyway.Taken care of some respawn stuff, haven't pushed as I'm in the process of cleaning up the display configs.
ace_spectator now essentially supports respawn. The framework is there, but I plan to add more ease of use functionality into it.
First I want to clean up the interface code/config though. Already made good progress on the config but it's not quite in its final form.
Oh, there are also some errors present in the interface code I'll have to take a look into.
Considering stripping out the time acceleration functionality as it seems a little like feature creep, any thoughts?
It's only really useful in single player, but then you'd only enter the spectator mode via script in SP anyway as either a result of:
Is our design intent for ace_spectator to be multiplayer-centric?
Branch:
ace_spectator
isDedicated
by!hasInterface
(https://github.com/acemod/ACE3/pull/1760#discussion_r33571672)!(_x in allMapMarkers)
(https://github.com/acemod/ACE3/pull/1760#discussion_r33733952)SilentSpike's overhaul todo list (for 3.2.0):
For (3.3.0):
Provide camera locking functionalityInvestigate improved methods of keybind handlingMake the values on the display toolbar interactable