Refactor AI unit strategy assignment

Open
#359 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Stale
Tech stack
csharp, godot
Domain
game-dev

Research direction

Start by locating the unit strategy assignment code and reading its deterministic if-else chain. Compare it with the city production and strategic priority decision-making processes, which the issue describes as more sophisticated. The issue does not specify a target design or tests; clarify the intended approach and how to verify the refactor before beginning.

Written by the indexing model from the issue text.

Description

AI

Of the three AI decision-making types we have (unit strategy, city production, and strategic priority), unit strategy is currently the least sophisticated. It's essentially a deterministic if-else chain, which is not going to be very maintainable as it grows, and doesn't allow for any element of chance.

City production has a more sophisticated process of weighing each possibility and then deciding among the options, and strategic priorities have that plus an architecture that is at least in theory pluggable. They've both been worked on more recently.

Dominant language
C#
Stars
662
Forks
67
Avg merge
5d 21h
Merged PRs (30d)
26

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from C7-Game/OpenCiv3

All issues in C7-Game/OpenCiv3

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.