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 map view is very laggy with high no. of units #2514

Closed
gienkov opened this issue Sep 18, 2015 · 11 comments
Closed

Spectator map view is very laggy with high no. of units #2514

gienkov opened this issue Sep 18, 2015 · 11 comments
Assignees
Labels
Milestone

Comments

@gienkov
Copy link
Contributor

gienkov commented Sep 18, 2015

ACE3 Version: 3.3.1

Mods:

  • @CBA_A3
  • @ace

Placed ACE3 Modules:

  • Spectator

Description:

  • On mission when there was over 200 units on map switching to map view while spectating lowers FPS to very low values (around 3-9). It may be cause of drawing unit markers in real time (no delay?).*

Steps to reproduce:

  • Enter map view while spectating on mission with high amount of units.

Where did the issue occur?

  • "Multiplayer"*

RPT log file:

@kymckay kymckay added this to the 3.4.0 milestone Sep 26, 2015
@kymckay
Copy link
Member

kymckay commented Sep 26, 2015

I think the only way to alleviate this is some sort of compromise.

Possible idea: Only draw AI units in vicinity of the camera and then all player units.

@gienkov
Copy link
Contributor Author

gienkov commented Sep 26, 2015

Maybe just don't draw each icon per frame as PFH is used on each one. You have 100 spectatable units - 100 PFHs - frame's drop. You don't need such precision for spectator so updating map markers let's say every 1 second could be way better and that's how other spectator scripts I used were working.

@jokoho48
Copy link
Member

or every frame one unit

@kymckay
Copy link
Member

kymckay commented Sep 26, 2015

Dude what, I don't have 100PFHs running 😆 It uses the map "draw" event

You need to draw the icons every frame otherwise there wouldn't be any icons

@gienkov
Copy link
Contributor Author

gienkov commented Sep 29, 2015

Maybe draw each unit marker only if you zoom enough? Otherwise only whole group marker.

@kymckay
Copy link
Member

kymckay commented Sep 30, 2015

That's not a bad idea! 😄 👍

@kymckay
Copy link
Member

kymckay commented Sep 30, 2015

Wonder what the best way is to check which units are currently on-screen on the map

@commy2
Copy link
Contributor

commy2 commented Sep 30, 2015

distance of the current center of map converted to world coordinates combined with current map zoom?

@PabstMirror
Copy link
Contributor

Maybe something like this, untested. I forget if it's faster to check allUnits + vechicles or do a nearEntities scan.

_center = _mapCtrl ctrlMapScreenToWorld [0.5,0.5];
_radius = (_mapCtrl ctrlMapScreenToWorld [safeZoneX,safeZoneY]) distance2d _center;
{
    if ((_x distance 2d _center) < _radius) then {
    draw
    };
} forEach allUnits;

@commy2
Copy link
Contributor

commy2 commented Sep 30, 2015

(allUnits + allDeadMen to include dead units)

@kymckay
Copy link
Member

kymckay commented Sep 30, 2015

We can use the array of spectatable units (or the corresponding group one - used to cut down on number of iterations for icon related stuff) anyway 😄

GVAR(unitList)
GVAR(groupList)

@kymckay kymckay self-assigned this Oct 10, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants