Opened 6 years ago

Last modified 4 years ago

#4839 assigned defect

StartingCamera code broken

Reported by: elexis Owned by: elexis
Priority: Nice to Have Milestone: Backlog
Component: UI – In-game Keywords:
Cc: Patch:

Description (last modified by elexis)

The camera position should always be centered in observermode. r20370 removed some code that pretends to center the camera. But that only works for observers, it should be on a per-player basis as long as the other maps 'support' that too. My impression that ParseCamera in MapReader.cpp is unusably broken. The Player component also has camera positioning code which appears unused.

The GameView code always focuses on the first CC if there exists one. Thus overwriting the StartingCamera from the (skirmish/scenario/random) map if one exists, reverting its only use case.

Change History (6)

comment:1 by elexis, 6 years ago

When starting Sicila Nomad in observermode we have the same issue. Since that is not a random map, the problem is unrelated from the rmgen/ camera centring removal and it certainly can be reproduced in alpha 22.

Still don't see the use in this StartingCamera feature at all, so it should be removed and the camera should always center in observermode (independent of maptype).

comment:2 by elexis, 6 years ago

Description: modified (diff)
Milestone: Alpha 23Backlog
Priority: Must HaveNice to Have

Perhaps the StartingCamera feature could be used in a campaign where we do have a civic center + a hero somewhere else and it should focus the hero instead.

The feature is still broken in in the map loader, in the simulation and in the gameview afaics. Most maps likely have a starting camera value that should be removed in case the code will sometime prefer the starting camera of players specified in the map.

comment:3 by elexis, 6 years ago

Summary: Broken camera placement for observersStartingCamera code broken

comment:4 by elexis, 6 years ago

nani found a factor of 4 by accident. 4 is TERRAIN_TILE_SIZE. So it probably never worked in rmgen because rmgen uses the tile coordinate system, but Terrain.cpp uses a grid that is by the factor TERRAIN_TILE_SIZE larger.

comment:5 by Imarok, 5 years ago

Component: UI & SimulationIn-game UI

Move tickets to In-game UI as UI & Simulation got some sub components.

comment:6 by elexis, 4 years ago

In 23279:

Clean Skirmish maps of default and invalid gamesetting values.

  • The gamesetup class rewrite in D2483 will enable Skirmish and Random maps to fix AIs and Civs by specifying them. Hence remove them from all maps that don't intend to fix them (i.e. all except Egypt 3v3).
  • Remove default values (and the few irrelevant non-default values) so that the player-chosen settings may be persisted between Skirmish map selection changes, refs #3120, D2483.
  • Remove invalid settings: mapType, AISeed and random map settings Script, Size, Seed, Nomad, BaseHeight, BaseTerrain, refs rP20726, rP21274.
  • Remove StartingCamera values since they are useless, refs #4839, D1098.
  • Add the "new" keyword to Atlas Valleys and Vesuvius from rP23278, so they appear in the "new" filter.
  • Unhide Barcania (3)
Note: See TracTickets for help on using tickets.