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

Utility AI - framework and Editor [wip] #6323

Draft
wants to merge 33 commits into
base: master
Choose a base branch
from

Conversation

Scoppio
Copy link
Collaborator

@Scoppio Scoppio commented Dec 28, 2024

Development of a Utility AI framework to be implemented with a bot (preferably on top of princess, preferably creating a new way to have her make decisions).

This PR currently only implements a few considerations and an AI Editor, this PR intends to allow people to test and evaluate the usability of the AI Editor.


TODO: More information on the Utility AI, how it works, how it integrates with Princessm etc.

Copy link

codecov bot commented Dec 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 28.19%. Comparing base (77b532e) to head (c3228f0).
Report is 21 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6323      +/-   ##
============================================
- Coverage     28.55%   28.19%   -0.37%     
- Complexity    14465    14506      +41     
============================================
  Files          2815     2881      +66     
  Lines        277311   281148    +3837     
  Branches      48973    49340     +367     
============================================
+ Hits          79175    79258      +83     
- Misses       193436   197169    +3733     
- Partials       4700     4721      +21     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Scoppio Scoppio force-pushed the feat/tinkering-princess-ai branch from 82be31d to 572a2a2 Compare December 30, 2024 02:30
}

public static DefaultCurve fromCurve(Curve curve) {
if (curve instanceof LinearCurve) {

Check notice

Code scanning / CodeQL

Chain of 'instanceof' tests Note

This if block performs a chain of 6 type tests - consider alternatives, e.g. polymorphism or the visitor pattern.
@Scoppio Scoppio self-assigned this Dec 31, 2024
@Scoppio Scoppio force-pushed the feat/tinkering-princess-ai branch from 2f32e50 to 448b792 Compare December 31, 2024 02:34
@Scoppio Scoppio added Princess/AI ACAR Any Issues related to the ACAR (Abstract Combat Auto Resolve) System labels Jan 14, 2025
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

var splitPosition = hex.length() / 2;

int x = Integer.parseInt(hex.substring(0, splitPosition)) - 1;
int y = Integer.parseInt(hex.substring(splitPosition)) - 1;

Check notice

Code scanning / CodeQL

Missing catch of NumberFormatException Note

Potential uncaught 'java.lang.NumberFormatException'.

int x = Integer.parseInt(hex.substring(0, splitPosition)) - 1;
int y = Integer.parseInt(hex.substring(splitPosition)) - 1;

Check notice

Code scanning / CodeQL

Missing catch of NumberFormatException Note

Potential uncaught 'java.lang.NumberFormatException'.
return;
}
int unitID = Integer.parseInt(unitIdString);

Check notice

Code scanning / CodeQL

Missing catch of NumberFormatException Note

Potential uncaught 'java.lang.NumberFormatException'.
var splitPosition = hex.length() / 2;

int x = Integer.parseInt(hex.substring(0, splitPosition)) - 1;
int y = Integer.parseInt(hex.substring(splitPosition)) - 1;

Check notice

Code scanning / CodeQL

Missing catch of NumberFormatException Note

Potential uncaught 'java.lang.NumberFormatException'.

int x = Integer.parseInt(hex.substring(0, splitPosition)) - 1;
int y = Integer.parseInt(hex.substring(splitPosition)) - 1;

Check notice

Code scanning / CodeQL

Missing catch of NumberFormatException Note

Potential uncaught 'java.lang.NumberFormatException'.
return this;
}

public DebugReporter append(Object s) {

Check notice

Code scanning / CodeQL

Confusing overloading of methods Note

Method DebugReporter.append(..) could be confused with overloaded method
append
, since dispatch depends on static types.
return finalScore;
}

public List<Consideration<IN_GAME_OBJECT, TARGETABLE>> getConsiderations() {

Check notice

Code scanning / CodeQL

Exposing internal representation Note

getConsiderations exposes the internal representation stored in field considerations. The value may be modified
after this call to getConsiderations
.
return id;
}

public List<Decision<A, B>> getDecisions() {

Check notice

Code scanning / CodeQL

Exposing internal representation Note

getDecisions exposes the internal representation stored in field decisions. The value may be modified
after this call to getDecisions
.

public interface Intelligence<IN_GAME_OBJECT, TARGETABLE, RANKED> {

void update(Intelligence<IN_GAME_OBJECT, TARGETABLE, RANKED> intelligence);

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'intelligence' is never used.
@HammerGS HammerGS added the For New Dev Cycle This PR should be merged at the beginning of a dev cycle label Jan 31, 2025
@Scoppio Scoppio force-pushed the feat/tinkering-princess-ai branch from 3864b40 to 918cfca Compare February 4, 2025 02:59
public void testErrorLoggingWithExceptionNoParams() {
automaticallyDismissDialog();
Exception e = new Exception("Test exception");
testMMLogger.error(e, "Error message: noparameter accepted", "test");

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note

Invoking
MMLogger.error
should be avoided because it has been deprecated.
}

@Override
public boolean isEnabled(Level level, Marker marker, String message, Object p0) {

Check notice

Code scanning / CodeQL

Confusing overloading of methods Note

Method CustomLogger.isEnabled(..) could be confused with overloaded method
isEnabled
, since dispatch depends on static types.
Method CustomLogger.isEnabled(..) could be confused with overloaded method
isEnabled
, since dispatch depends on static types.
}

@Override
public boolean isEnabled(Level level, org.apache.logging.log4j.Marker marker, Object message, Throwable t) {

Check notice

Code scanning / CodeQL

Confusing overloading of methods Note

Method CustomLogger.isEnabled(..) could be confused with overloaded method
isEnabled
, since dispatch depends on static types.
Method CustomLogger.isEnabled(..) could be confused with overloaded method
isEnabled
, since dispatch depends on static types.
Method CustomLogger.isEnabled(..) could be confused with overloaded method
isEnabled
, since dispatch depends on static types.
}

@Override
public boolean isEnabled(Level level, Marker marker, CharSequence message, Throwable t) {

Check notice

Code scanning / CodeQL

Confusing overloading of methods Note

Method CustomLogger.isEnabled(..) could be confused with overloaded method
isEnabled
, since dispatch depends on static types.
Method CustomLogger.isEnabled(..) could be confused with overloaded method
isEnabled
, since dispatch depends on static types.
Method CustomLogger.isEnabled(..) could be confused with overloaded method
isEnabled
, since dispatch depends on static types.
@Scoppio Scoppio force-pushed the feat/tinkering-princess-ai branch 4 times, most recently from 04d846a to 54b383d Compare February 4, 2025 04:01
@Scoppio Scoppio force-pushed the feat/tinkering-princess-ai branch from 54b383d to 91ee7b2 Compare February 4, 2025 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ACAR Any Issues related to the ACAR (Abstract Combat Auto Resolve) System For New Dev Cycle This PR should be merged at the beginning of a dev cycle Princess/AI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants