Commit Graph

96 Commits

Author SHA1 Message Date
Scott Anderson 228539ba78 Merge main into nations-ai 2025-04-23 03:04:49 -04:00
evanpelle 71849b47cd better transport ship spawn (#587)
## Description:

Taken from PR #506

Improve transport source tile by considering border extremums

Only calculate better spawn tile for humans, and have the sender
calculate it and send the src tile in the intent for better performance.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

## Please put your Discord username so you can be contacted if a bug or
regression is found:

<DISCORD USERNAME>
evan

Co-authored-by: evan <openfrontio@gmail.com>
2025-04-21 19:49:17 -07:00
Scott Anderson ae30c88b03 Merge main into nations-ai 2025-04-18 02:09:56 -04:00
Scott Anderson 1b672420b3 Combine Bot and Nation behaviors in to a shared class (#434)
This is the first move in the effort to combine the redundant logic that
exists between BotExecution and FakeHumonExecution.

This commit:
1. Combines the alliance request handler, moving bots to use the same
logic as nations for acceptance.
2. Combines the sendAttack() functions, which may later be reworked.
3. Introduces selectEnemy() function to wrap enemy selection logic that
nations use.
4. Blocks nations from nuking bots.
5. Alters enemy selection to prefer neighboring bots if there are any.

## Description:

Fixes #467 

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

## Please put your Discord username so you can be contacted if a bug or
regression is found:

fake.neo

---------

Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
2025-04-17 19:37:16 -07:00
Scott Anderson ccadd7f6a8 Nations target structures with nukes (#393)
## Description:

Nations will prefer to target their nukes at structures. This updates
the existing logic, which attempts ten times to randomly select a
coordinate 15 tiles inside the border, to instead generate a list of ten
random tiles in addition to a list of all of the tiles of relevant
structures. The two lists are concatenated to create a set of tile
candidates. These candidates are scored, and the tile with the highest
score, if one is found, is nuked.

The scoring function considers three factors:
1. Damage potential: values of structures with 25 tiles of the target
tile.
2. Distance from silo to target (hang time).
3. Recently nuked locations.


![image](https://github.com/user-attachments/assets/10c7bd96-ad51-404c-84c9-c0840dc8250c)

Fixes #471 

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

## Please put your Discord username so you can be contacted if a bug or
regression is found:

fake.neo

---------

Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
2025-04-17 19:22:35 -07:00
Scott Anderson 6af9e32157 Merge main into nations-ai 2025-04-16 01:06:00 -04:00
Evan 0dbc246a63 reduce transport frequency for fakehumanexecution, make transport render more efficient 2025-04-05 17:14:56 -07:00
Scott Anderson 01ac56e62a Merge main into nations-ai 2025-04-04 20:41:22 -04:00
Scott Anderson 11d7eaee99 wip 2025-04-04 20:40:36 -04:00
Evan 2cb8c239cf make sendBoat() more efficient: find random tiles instead of doing a breadth first search 2025-04-04 16:04:57 -07:00
Scott Anderson 0a3397b8c6 wip 2025-04-04 00:06:41 -04:00
Scott Anderson 8e9d6ce07e refactor bot attacking 2025-04-03 19:45:24 -04:00
Scott Anderson 10c411b1ee bug: lastEmojiSet is never used (#406)
## Description:

In the existing code, lastEmojiSent can only ever be set if it is
already set, causing it to never be used. This change updates the logic
to work as intended.

## Please complete the following:

- [x] I have added screenshots for all UI updates
- [x] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [x] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

## Please put your Discord username so you can be contacted if a bug or
regression is found:

fake.neo

Co-authored-by: Scott Anderson <662325+scottanderson@users.noreply.github.com>
2025-04-03 16:12:07 -07:00
Scott Anderson 52542baa63 Remove unnecessary casts 2025-04-03 01:35:29 -04:00
Scott Anderson 7df6f271ed maybeSpawnStructure 2025-04-03 01:24:02 -04:00
Scott Anderson 6ee58f4191 cost 2025-04-03 01:23:42 -04:00
Scott Anderson b27ac3ae87 refactor tick 2025-04-03 00:59:31 -04:00
Scott Anderson 2778d1e480 Refactor attack rate 2025-04-02 23:55:08 -04:00
Scott Anderson 769080e289 Merge branch 'nations-nuke' into nations-ai 2025-04-02 22:22:35 -04:00
Scott Anderson fe9b6c2801 bug: lastEmojiSet is never used 2025-04-02 22:02:00 -04:00
Scott Anderson 564ebcab4d Nations target structures with nukes 2025-04-01 18:14:39 -04:00
Evan 8b6895d745 add prettier import plugin 2025-03-31 13:09:27 -07:00
PilkeySEK d6e596f7d8 fix: Make bots not attack teammates (#368)
Bug report:
https://discord.com/channels/1284581928254701718/1355194642592694412
## Please complete the following:

- [X] I have added screenshots for all UI updates
- [X] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced
- [X] I understand that submitting code with bugs that could have been
caught through manual testing blocks releases and new features for all
contributors

## Please put your Discord username so you can be contacted if a bug or
regression is found:
PilkeySEK
2025-03-30 10:43:24 -07:00
evanpelle d8fe41de7a teams (#349) 2025-03-27 20:43:56 -07:00
Readixyee e02361c2f4 Disable nukes option (#237)
This makes it possible to disable all nukes as well as missile silos
from the game in privat lobbies and singleplayer games
2025-03-21 13:52:36 -07:00
Ilan Schemoul 70c3c43a5f feat: handle embargo fake human (#240) 2025-03-13 14:53:27 -07:00
Evan 3dd02ec4df remove max boat distance 2025-03-07 10:38:26 -08:00
Evan e3896127d5 bugfix: full sending with boat makes you lose troops 2025-02-18 18:55:26 -08:00
Evan 64d13a46bd bugfix: bots were not losing troops in attack. rebalanced difficulties. 2025-02-13 11:50:15 -08:00
Evan 40966ca3b9 format all files with prettier 2025-02-12 08:28:15 -08:00
Evan 8d690c0130 NPCs break alliances less frequently 2025-02-09 10:37:10 -08:00
Evan 4182eaa449 rebalance difficulties 2025-02-08 20:59:44 -08:00
Evan 1594a45dac have buildings take time to construct 2025-02-08 13:53:58 -08:00
Evan bbf72bd14f simply start population calculation 2025-02-03 12:37:04 -08:00
Evan c109d23f9f combine battleship + destroyer => warship. 2025-02-02 14:31:30 -08:00
Evan af0d6a289a rename cansendlliance request fix ally self bug 2025-02-01 20:18:57 -08:00
Evan 4ee37323f9 format codebase with prettier 2025-02-01 12:05:11 -08:00
evanpelle 2af3c2a115 fix rebase errors 2025-02-01 12:05:11 -08:00
evanpelle de1dbff570 combine Game & MutableGame 2025-02-01 12:05:11 -08:00
evanpelle 7d15c0c065 combine Player & MutablePlayer interfaces 2025-02-01 12:05:11 -08:00
Evan b91d9d4148 fix bugs from using tilerefs 2025-02-01 12:05:11 -08:00
Evan f0f5bae79f thread_split: convert all tile to tileref 2025-02-01 12:05:11 -08:00
evanpelle c42cc2a9b4 have Game delegate to GameMap for cleaner API 2025-02-01 12:05:11 -08:00
evanpelle a17ae48cd3 use TileRef instead of tile 2025-02-01 12:05:11 -08:00
Evan 8616e9bfcb game runs in seperate thread 2025-02-01 12:05:11 -08:00
Evan dab427d614 put methods onto terraintile 2025-02-01 12:05:11 -08:00
Evan 8443095d89 create game runner 2025-02-01 12:05:11 -08:00
evanpelle ea1e2c99a0 NPCs send emojis less frequently 2025-01-06 07:53:23 -08:00
Evan 5e0367ae55 bufix: NPC is targeted at the same time it allies with targeter, causing it to try to attack itself 2025-01-05 20:04:55 -08:00
Evan 4800e0dd29 NPCs only send emojis to players 2025-01-05 12:59:14 -08:00