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

Record history of cost changes in pathfinder #1680

Open
2 tasks
heinezen opened this issue Aug 25, 2024 · 4 comments
Open
2 tasks

Record history of cost changes in pathfinder #1680

heinezen opened this issue Aug 25, 2024 · 4 comments
Labels
area: simulation Involved in the game mechanics and simulation good first issue Suitable for newcomers lang: c++ Done in C++ code nice new thing ☺ A new feature that was not there before

Comments

@heinezen
Copy link
Member

heinezen commented Aug 25, 2024

Required Skills: C++

Difficulty: Hard

At the moment, changes to the movement cost of cells in the openage pathfinder always overwrite the old values. The old values are not saved anywhere, so going back to a previous state of the grid is currently not possible. Ideally, the grid should support going back in time, so we can roll back changes e.g. for multiplayer matches.

openage already provides the curve data types for storing values over time, so changes could be recorded using the same methods. An array curve (see #1678) would probably be the best option for storing values for a grid.

To try out the current pathfinder, check out pathfinding demo 1 by running the following command:

./run test -d pathfinding.tests.path_demo 1

Tasks:

  • Add a cost record storage for cells to the CostField implementation. The cost record should use curve. For performance reasons, the recorded values should be stored separately from the current cost values (so not in the cells vector).
  • Record the changed cost whenever a modifying operation occurs for CostField, e.g. setting a cell value.

Further Reading

@heinezen heinezen added nice new thing ☺ A new feature that was not there before lang: c++ Done in C++ code area: simulation Involved in the game mechanics and simulation good first issue Suitable for newcomers labels Aug 25, 2024
@heinezen heinezen moved this to pathfinder in openage beginner tasks Aug 25, 2024
@heinezen heinezen added the hacktoberfest For newcomers from Hacktoberfest event label Sep 20, 2024
@HmbleCreator

This comment was marked as outdated.

@heinezen

This comment was marked as outdated.

@heinezen heinezen removed the hacktoberfest For newcomers from Hacktoberfest event label Dec 7, 2024
@jere8184
Copy link
Contributor

jere8184 commented Dec 11, 2024

We would need to know the size of cost field at compile time right if we want to give it a curve::Array ? template it?

@heinezen
Copy link
Member Author

The size of the fields will be fixed at compile time later on by enforcing a fixee terrain chunk size. Currently it's 10x10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: simulation Involved in the game mechanics and simulation good first issue Suitable for newcomers lang: c++ Done in C++ code nice new thing ☺ A new feature that was not there before
Projects
Status: pathfinder
Status: 📋 Backlog
Development

No branches or pull requests

3 participants