Configure camera boundaries based on map size
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 14.4k
- Forks
- 1.3k
- PR merge metrics
- No merged PRs in 30d
Description
Required Skills: C++
Difficulty: Hard
Since the implementation of https://github.com/SFTtech/openage/issues/1682, the area the camera can move in can be limited by boundary coordinates. Currently, the boundaries are hardcoded into the initialization of the camera manager to exactly match the (also hardcoded) map size of our demo game. However, for the future, it would be nice if the camera boundaries would adjust dynamically based on the current map size. This requires that we can transfer the map size and coordinates to the renderer thread and the camera manager.
Passing the information to the renderer should follow the exact same flow as the other simulation -> renderer communication in the level 2 renderer (see the associated architecture documentation).
Tasks:
- Renderer thread:
- Create a new render entity subclass for the camera that can receive updates from the game simulation. The only update the renderer entity needs to receive for now is the 4 coordinates of the terrain map.
- Check for updates from the render entity in the camera manager and, if there are any, update the camera boundaries
- Simulation thread:
- Let the simulation thread create camera render entities via the
RenderFactory - Update the render entity with information from the simulation, i.e. pass it the map coordinates. For now, this only has to be done once, when the map is initialized first. Later, we can make this update more dynamic, so that the render entity is updated if the map size changes
- Let the simulation thread create camera render entities via the
Further Reading
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the renderer level 2 architecture documentation and libopenage/renderer/render_factory.h, then trace the existing simulation-to-renderer flow and the camera manager initialization. Implement the listed renderer-thread and simulation-thread tasks so the camera receives the map's four coordinates and uses them for its boundaries; verify the demo camera limits match the initialized map size.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-graphics, game-dev
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100