-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCameraModule.cpp
628 lines (573 loc) · 16.9 KB
/
CameraModule.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
#include "CameraModule.h"
#include <iostream>
#include "sc2api/sc2_api.h"
#include "sc2api/sc2_proto_interface.h"
// Radius to detect groups of army units
const float armyBlobRadius = 10.0f;
// Movement speed of camera
const float moveFactor = 0.1f;
// Only smooth movemnt when closer as...
const float cameraJumpThreshold = 30.0f;
// When is a unit near a start location
const float nearStartLocationDistance = 50.0f;
// Camera distance to map (zoom). 0 means default.
const float cameraDistance = 50.0f;
CameraModule::CameraModule(sc2::Client * const bot) :
m_initialized(false),
m_client(bot),
cameraMoveTime(200),
cameraMoveTimeMin(75),
watchScoutWorkerUntil(7500),
lastMoved(0),
lastMovedPriority(0),
lastMovedPosition(sc2::Point2D(0, 0)),
cameraFocusPosition(sc2::Point2D(0, 0)),
cameraFocusUnit(nullptr),
followUnit(false)
{
}
void CameraModule::onStart()
{
if (m_client->Control() && m_client->Control()->GetObservation())
{
if (lastMoved)
{
lastMoved = 0;
lastMovedPriority = 0;
lastMovedPosition = sc2::Point2D(0, 0);
cameraFocusUnit = nullptr;
followUnit = false;
}
setPlayerIds();
setPlayerStartLocations();
cameraFocusPosition = (*m_startLocations.begin()).second;
currentCameraPosition = (*m_startLocations.begin()).second;
m_initialized = true;
}
}
void CameraModule::onFrame()
{
// Sometimes the first GetObservation() fails...
if (!m_initialized)
{
onStart();
return;
}
moveCameraFallingNuke();
moveCameraNukeDetect();
// moveCameraIsUnderAttack();
moveCameraIsAttacking();
if (m_client->Observation()->GetGameLoop() <= watchScoutWorkerUntil)
{
moveCameraScoutWorker();
}
moveCameraDrop();
moveCameraArmy();
updateCameraPosition();
}
void CameraModule::moveCameraFallingNuke()
{
const int prio = 6;
if (!shouldMoveCamera(prio))
{
return;
}
for (auto & unit : m_client->Observation()->GetUnits())
{
if (unit->unit_type == sc2::UNIT_TYPEID::TERRAN_NUKE)
{
moveCamera(unit, prio);
return;
}
}
}
void CameraModule::moveCameraNukeDetect()
{
const int prio = 5;
if (!shouldMoveCamera(prio))
{
return;
}
for (auto & effects : m_client->Observation()->GetEffects())
{
if (effects.effect_id == uint32_t(7)) // 7 = NukePersistent NOT TESTED YET
{
moveCamera(effects.positions.front(), prio);
return;
}
}
}
void CameraModule::moveCameraIsUnderAttack()
{
const int prio = 4;
if (!shouldMoveCamera(prio))
{
return;
}
for (auto & unit : m_client->Observation()->GetUnits())
{
if (isUnderAttack(unit))
{
moveCamera(unit, prio);
}
}
}
void CameraModule::moveCameraIsAttacking()
{
const int prio = 4;
if (!shouldMoveCamera(prio))
{
return;
}
for (auto & unit : m_client->Observation()->GetUnits())
{
if (isAttacking(unit))
{
moveCamera(unit, prio);
}
}
}
void CameraModule::moveCameraScoutWorker()
{
const int highPrio = 2;
const int lowPrio = 0;
if (!shouldMoveCamera(lowPrio))
{
return;
}
for (auto & unit : m_client->Observation()->GetUnits())
{
if (!IsWorkerType(unit->unit_type))
{
continue;
}
if (isNearOpponentStartLocation(unit->pos, unit->owner))
{
moveCamera(unit, highPrio);
}
else if (!isNearOwnStartLocation(unit->pos, unit->owner))
{
moveCamera(unit, lowPrio);
}
}
}
void CameraModule::moveCameraDrop()
{
const int prio = 3;
if (!shouldMoveCamera(prio))
{
return;
}
for (auto & unit : m_client->Observation()->GetUnits())
{
if ((unit->unit_type.ToType() == sc2::UNIT_TYPEID::ZERG_OVERLORDTRANSPORT || unit->unit_type.ToType() == sc2::UNIT_TYPEID::TERRAN_MEDIVAC || unit->unit_type.ToType() == sc2::UNIT_TYPEID::PROTOSS_WARPPRISM)
&& isNearOpponentStartLocation(unit->pos, unit->owner) && unit->cargo_space_taken > 0)
{
moveCamera(unit, prio);
}
}
}
void CameraModule::moveCameraArmy()
{
int prio = 1;
if (!shouldMoveCamera(prio))
{
return;
}
// Double loop, check if army units are close to each other
sc2::Point2D bestPos;
const sc2::Unit * bestPosUnit = nullptr;
int mostUnitsNearby = 0;
for (auto & unit : m_client->Observation()->GetUnits())
{
if (unit->owner == 1)
{
int a = 1;
}
if (!isArmyUnitType(unit->unit_type.ToType()) || unit->display_type != sc2::Unit::DisplayType::Visible || !(unit->owner == 1 || unit->owner == 2))
{
continue;
}
sc2::Point2D uPos = unit->pos;
int nrUnitsNearby = 0;
for (auto & nearbyUnit : m_client->Observation()->GetUnits())
{
if (!isArmyUnitType(nearbyUnit->unit_type.ToType()) || unit->display_type != sc2::Unit::DisplayType::Visible || !(unit->owner == 1 || unit->owner == 2) || Dist(unit->pos, nearbyUnit->pos) > armyBlobRadius )
{
continue;
}
nrUnitsNearby++;
}
if (nrUnitsNearby > mostUnitsNearby) {
mostUnitsNearby = nrUnitsNearby;
bestPos = uPos;
bestPosUnit = unit;
}
}
if (mostUnitsNearby > 1) {
moveCamera(bestPosUnit, prio);
}
}
void CameraModule::moveCameraUnitCreated(const sc2::Unit * unit)
{
if (!m_initialized)
{
return;
}
int prio;
if (isBuilding(unit->unit_type))
{
prio = 2;
}
else
{
prio = 1;
}
if (!shouldMoveCamera(prio) || unit->unit_type.ToType() == sc2::UNIT_TYPEID::TERRAN_KD8CHARGE || unit->unit_type.ToType() == sc2::UNIT_TYPEID::ZERG_LARVA || unit->unit_type.ToType() == sc2::UNIT_TYPEID::PROTOSS_INTERCEPTOR)
{
return;
}
else if (!IsWorkerType(unit->unit_type))
{
moveCamera(unit, prio);
}
}
bool CameraModule::shouldMoveCamera(const int priority) const
{
const int elapsedFrames = m_client->Observation()->GetGameLoop() - lastMoved;
const bool isTimeToMove = elapsedFrames >= cameraMoveTime;
const bool isTimeToMoveIfHigherPrio = elapsedFrames >= cameraMoveTimeMin;
const bool isHigherPrio = lastMovedPriority < priority || (followUnit && !cameraFocusUnit->is_alive);
// camera should move IF: enough time has passed OR (minimum time has passed AND new prio is higher)
return isTimeToMove || (isHigherPrio && isTimeToMoveIfHigherPrio);
}
void CameraModule::moveCamera(const sc2::Point2D pos, const int priority)
{
if (!shouldMoveCamera(priority))
{
return;
}
if (followUnit == false && cameraFocusPosition == pos)
{
// don't register a camera move if the position is the same
return;
}
cameraFocusPosition = pos;
lastMovedPosition = cameraFocusPosition;
lastMoved = m_client->Observation()->GetGameLoop();
lastMovedPriority = priority;
followUnit = false;
}
void CameraModule::moveCamera(const sc2::Unit * unit, int priority)
{
if (!shouldMoveCamera(priority))
{
return;
}
if (followUnit == true && cameraFocusUnit == unit) {
// don't register a camera move if we follow the same unit
return;
}
cameraFocusUnit = unit;
lastMovedPosition = cameraFocusUnit->pos;
lastMoved = m_client->Observation()->GetGameLoop();
lastMovedPriority = priority;
followUnit = true;
}
void CameraModule::updateCameraPosition()
{
if (followUnit && isValidPos(cameraFocusUnit->pos))
{
cameraFocusPosition = cameraFocusUnit->pos;
}
// We only do smooth movement, if the focus is nearby.
float dist = Dist(currentCameraPosition, cameraFocusPosition);
if (dist > cameraJumpThreshold)
{
currentCameraPosition = cameraFocusPosition;
}
else if (dist > 0.1f)
{
currentCameraPosition = currentCameraPosition + sc2::Point2D(
moveFactor*(cameraFocusPosition.x - currentCameraPosition.x),
moveFactor*(cameraFocusPosition.y - currentCameraPosition.y));
}
else
{
return;
}
if (isValidPos(currentCameraPosition))
{
updateCameraPositionExcecute();
}
}
// Utility
//At the moment there is no flag for being under attack
bool CameraModule::isUnderAttack(const sc2::Unit * unit) const
{
return false;
}
bool CameraModule::isAttacking(const sc2::Unit * attacker) const
{
if (!isArmyUnitType(attacker->unit_type.ToType()) || attacker->display_type != sc2::Unit::DisplayType::Visible || !(attacker->owner == 1 || attacker->owner == 2))
{
return false;
}
// Option A
// return unit->orders.size()>0 && unit->orders.front().ability_id.ToType() == sc2::ABILITY_ID::ATTACK_ATTACK;
// Option B
// return unit->weapon_cooldown > 0.0f;
// Option C
// Not sure if observer can see the "private" fields of player units.
// So we just assume: if it is in range and an army unit -> it attacks
std::vector<sc2::Weapon> weapons = m_client->Observation()->GetUnitTypeData()[attacker->unit_type].weapons;
float rangeAir = -1.0;
float rangeGround = -1.0;
for (auto & weapon : weapons)
{
if (weapon.type == sc2::Weapon::TargetType::Any)
{
rangeAir = weapon.range;
rangeGround = weapon.range;
}
else if (weapon.type == sc2::Weapon::TargetType::Air)
{
rangeAir = weapon.range;
}
else if (weapon.type == sc2::Weapon::TargetType::Ground)
{
rangeGround = weapon.range;
}
}
const int enemyID = getOpponent(attacker->owner);
for (auto & unit : m_client->Observation()->GetUnits())
{
if (unit->display_type != sc2::Unit::DisplayType::Visible || unit->owner != enemyID || !(attacker->owner == 1 || attacker->owner == 2))
{
continue;
}
if (unit->is_flying)
{
if (Dist(attacker->pos, unit->pos) < rangeAir)
{
return true;
}
}
else
{
if (Dist(attacker->pos, unit->pos) < rangeGround)
{
return true;
}
}
}
return false;
}
bool CameraModule::IsWorkerType(const sc2::UNIT_TYPEID type) const
{
switch (type)
{
case sc2::UNIT_TYPEID::TERRAN_SCV: return true;
case sc2::UNIT_TYPEID::TERRAN_MULE: return true;
case sc2::UNIT_TYPEID::PROTOSS_PROBE: return true;
case sc2::UNIT_TYPEID::ZERG_DRONE: return true;
case sc2::UNIT_TYPEID::ZERG_DRONEBURROWED: return true;
default: return false;
}
}
bool CameraModule::isNearOpponentStartLocation(const sc2::Point2D pos, const int player) const
{
return isNearOwnStartLocation(pos, getOpponent(player));
}
bool CameraModule::isNearOwnStartLocation(const sc2::Point2D pos, const int player) const
{
return Dist(pos, m_startLocations.at(player)) < nearStartLocationDistance;
}
bool CameraModule::isArmyUnitType(const sc2::UNIT_TYPEID type) const
{
if (IsWorkerType(type)) { return false; }
if (type == sc2::UNIT_TYPEID::ZERG_OVERLORD) { return false; } // Excluded here the overlord transport etc to count them as army unit
if (isBuilding(type)) { return false; }
if (type == sc2::UNIT_TYPEID::ZERG_EGG) { return false; }
if (type == sc2::UNIT_TYPEID::ZERG_LARVA) { return false; }
if (type == sc2::UNIT_TYPEID::PROTOSS_INTERCEPTOR) { return false; }
return true;
}
bool CameraModule::isBuilding(const sc2::UNIT_TYPEID type) const
{
switch (type)
{
// Terran
case sc2::UNIT_TYPEID::TERRAN_ARMORY:
case sc2::UNIT_TYPEID::TERRAN_BARRACKS:
case sc2::UNIT_TYPEID::TERRAN_BARRACKSFLYING:
case sc2::UNIT_TYPEID::TERRAN_BARRACKSREACTOR:
case sc2::UNIT_TYPEID::TERRAN_BARRACKSTECHLAB:
case sc2::UNIT_TYPEID::TERRAN_BUNKER:
case sc2::UNIT_TYPEID::TERRAN_COMMANDCENTER:
case sc2::UNIT_TYPEID::TERRAN_COMMANDCENTERFLYING:
case sc2::UNIT_TYPEID::TERRAN_ENGINEERINGBAY:
case sc2::UNIT_TYPEID::TERRAN_FACTORY:
case sc2::UNIT_TYPEID::TERRAN_FACTORYFLYING:
case sc2::UNIT_TYPEID::TERRAN_FACTORYREACTOR:
case sc2::UNIT_TYPEID::TERRAN_FACTORYTECHLAB:
case sc2::UNIT_TYPEID::TERRAN_FUSIONCORE:
case sc2::UNIT_TYPEID::TERRAN_GHOSTACADEMY:
case sc2::UNIT_TYPEID::TERRAN_MISSILETURRET:
case sc2::UNIT_TYPEID::TERRAN_ORBITALCOMMAND:
case sc2::UNIT_TYPEID::TERRAN_ORBITALCOMMANDFLYING:
case sc2::UNIT_TYPEID::TERRAN_PLANETARYFORTRESS:
case sc2::UNIT_TYPEID::TERRAN_REFINERY:
case sc2::UNIT_TYPEID::TERRAN_SENSORTOWER:
case sc2::UNIT_TYPEID::TERRAN_STARPORT:
case sc2::UNIT_TYPEID::TERRAN_STARPORTFLYING:
case sc2::UNIT_TYPEID::TERRAN_STARPORTREACTOR:
case sc2::UNIT_TYPEID::TERRAN_STARPORTTECHLAB:
case sc2::UNIT_TYPEID::TERRAN_SUPPLYDEPOT:
case sc2::UNIT_TYPEID::TERRAN_SUPPLYDEPOTLOWERED:
case sc2::UNIT_TYPEID::TERRAN_REACTOR:
case sc2::UNIT_TYPEID::TERRAN_TECHLAB:
// Zerg
case sc2::UNIT_TYPEID::ZERG_BANELINGNEST:
case sc2::UNIT_TYPEID::ZERG_CREEPTUMOR:
case sc2::UNIT_TYPEID::ZERG_CREEPTUMORBURROWED:
case sc2::UNIT_TYPEID::ZERG_CREEPTUMORQUEEN:
case sc2::UNIT_TYPEID::ZERG_EVOLUTIONCHAMBER:
case sc2::UNIT_TYPEID::ZERG_EXTRACTOR:
case sc2::UNIT_TYPEID::ZERG_GREATERSPIRE:
case sc2::UNIT_TYPEID::ZERG_HATCHERY:
case sc2::UNIT_TYPEID::ZERG_HIVE:
case sc2::UNIT_TYPEID::ZERG_HYDRALISKDEN:
case sc2::UNIT_TYPEID::ZERG_INFESTATIONPIT:
case sc2::UNIT_TYPEID::ZERG_LAIR:
case sc2::UNIT_TYPEID::ZERG_LURKERDENMP:
case sc2::UNIT_TYPEID::ZERG_NYDUSCANAL:
case sc2::UNIT_TYPEID::ZERG_NYDUSNETWORK:
case sc2::UNIT_TYPEID::ZERG_SPAWNINGPOOL:
case sc2::UNIT_TYPEID::ZERG_SPINECRAWLER:
case sc2::UNIT_TYPEID::ZERG_SPINECRAWLERUPROOTED:
case sc2::UNIT_TYPEID::ZERG_SPIRE:
case sc2::UNIT_TYPEID::ZERG_SPORECRAWLER:
case sc2::UNIT_TYPEID::ZERG_SPORECRAWLERUPROOTED:
case sc2::UNIT_TYPEID::ZERG_ULTRALISKCAVERN:
// Protoss
case sc2::UNIT_TYPEID::PROTOSS_ASSIMILATOR:
case sc2::UNIT_TYPEID::PROTOSS_CYBERNETICSCORE:
case sc2::UNIT_TYPEID::PROTOSS_DARKSHRINE:
case sc2::UNIT_TYPEID::PROTOSS_FLEETBEACON:
case sc2::UNIT_TYPEID::PROTOSS_FORGE:
case sc2::UNIT_TYPEID::PROTOSS_GATEWAY:
case sc2::UNIT_TYPEID::PROTOSS_NEXUS:
case sc2::UNIT_TYPEID::PROTOSS_PHOTONCANNON:
case sc2::UNIT_TYPEID::PROTOSS_PYLON:
case sc2::UNIT_TYPEID::PROTOSS_PYLONOVERCHARGED:
case sc2::UNIT_TYPEID::PROTOSS_ROBOTICSBAY:
case sc2::UNIT_TYPEID::PROTOSS_ROBOTICSFACILITY:
case sc2::UNIT_TYPEID::PROTOSS_STARGATE:
case sc2::UNIT_TYPEID::PROTOSS_TEMPLARARCHIVE:
case sc2::UNIT_TYPEID::PROTOSS_TWILIGHTCOUNCIL:
case sc2::UNIT_TYPEID::PROTOSS_WARPGATE:
case sc2::UNIT_TYPEID::PROTOSS_SHIELDBATTERY:
return true;
default: return false;
}
}
bool CameraModule::isValidPos(const sc2::Point2D pos) const
{
// Maybe playable width/height?
return pos.x >= 0 && pos.y >= 0 && pos.x < m_client->Observation()->GetGameInfo().width && pos.y < m_client->Observation()->GetGameInfo().height;
}
float CameraModule::Dist(const sc2::Unit * A, const sc2::Unit * B) const
{
return std::sqrt(std::pow(A->pos.x - B->pos.x, 2) + std::pow(A->pos.y - B->pos.y, 2));
}
float CameraModule::Dist(const sc2::Point2D A, const sc2::Point2D B) const
{
return std::sqrt(std::pow(A.x - B.x, 2) + std::pow(A.y - B.y, 2));
}
void CameraModule::setPlayerStartLocations()
{
m_startLocations.clear();
sc2::Units bases = m_client->Observation()->GetUnits(sc2::IsUnits({ sc2::UNIT_TYPEID::TERRAN_COMMANDCENTER, sc2::UNIT_TYPEID::ZERG_HATCHERY, sc2::UNIT_TYPEID::PROTOSS_NEXUS }));
// If we are not an observer
// Assumes 2 player map
if (bases.size() == 1)
{
m_startLocations[bases.front()->owner] = bases.front()->pos;
m_startLocations[getOpponent(bases.front()->owner)] = getInvertedPos(bases.front()->pos);
}
else
{
for (auto & unit : bases)
{
m_startLocations[unit->owner] = unit->pos;
}
}
}
void CameraModule::setPlayerIds()
{
for (auto & player : m_client->Observation()->GetGameInfo().player_info)
{
if (player.player_type != sc2::PlayerType::Observer)
{
m_playerIDs.push_back(player.player_id);
}
}
}
int CameraModule::getOpponent(const int player) const
{
for (auto & i : m_playerIDs)
{
if (i != player)
{
return i;
}
}
return -1;
}
const sc2::Point2D CameraModule::getInvertedPos(const sc2::Point2D pos) const
{
return sc2::Point2D(m_client->Observation()->GetGameInfo().width - pos.x, m_client->Observation()->GetGameInfo().width - pos.y);
}
CameraModule::~CameraModule()
{
}
///////////////////////// For observers
CameraModuleObserver::CameraModuleObserver(sc2::ReplayObserver * const observer) :CameraModule(observer), m_observer(observer)
{
}
void CameraModuleObserver::onStart()
{
// This should work once it is implemented on the proto side.
sc2::GameRequestPtr request = m_observer->Control()->Proto().MakeRequest();
SC2APIProtocol::RequestObserverAction* obsRequest = request->mutable_obs_action();
SC2APIProtocol::ObserverAction* action = obsRequest->add_actions();
SC2APIProtocol::ActionObserverPlayerPerspective * player_perspective = action->mutable_player_perspective();
player_perspective->set_player_id(0); // 0 = everyone
m_client->Control()->Proto().SendRequest(request);
m_client->Control()->WaitForResponse();
CameraModule::onStart();
}
void CameraModuleObserver::updateCameraPositionExcecute()
{
m_observer->ObserverAction()->CameraMove(currentCameraPosition, cameraDistance);
}
///////////////////////// For agents
CameraModuleAgent::CameraModuleAgent(sc2::Agent * const agent) :CameraModule(agent)
{
}
void CameraModuleAgent::updateCameraPositionExcecute()
{
sc2::GameRequestPtr camera_request = m_client->Control()->Proto().MakeRequest();
SC2APIProtocol::RequestAction* request_action = camera_request->mutable_action();
SC2APIProtocol::Action* action = request_action->add_actions();
SC2APIProtocol::ActionRaw* action_raw = action->mutable_action_raw();
SC2APIProtocol::ActionRawCameraMove* camera_move = action_raw->mutable_camera_move();
SC2APIProtocol::Point* point = camera_move->mutable_center_world_space();
point->set_x(currentCameraPosition.x);
point->set_y(currentCameraPosition.y);
m_client->Control()->Proto().SendRequest(camera_request);
m_client->Control()->WaitForResponse();
//m_client->Debug()->DebugMoveCamera(currentCameraPosition);
//m_client->Debug()->SendDebug();
}