Skip to content

Battle Points economy for super weapons #1670

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

Open
wants to merge 21 commits into
base: develop
Choose a base branch
from

Conversation

FS-21
Copy link
Contributor

@FS-21 FS-21 commented May 16, 2025

  • This system displayes a new currency to be used (optionally) in Super Weapons.
  • The new currency will be modified by the kills against other players and the system is enabled.
  • If set BattlePointsCollector in any structure then the system will be enabled if the structure is built.
  • If set BattlePoints in houses they will have the system enabled by default.
  • If set [General] -> BattlePoints enables/disables the system for every player in the scenario, overriding the country preferences & BattlePointsCollector setting.
  • If set [General] -> BattlePoints.DefaultValue and the enemy destroyed object doesn't have a value then this generic value will be used instead.
  • If set [General] -> BattlePoints.DefaultFriendlyValue and the friendly destroyed object doesn't have a value then this generic value will be used instead. This tag doesn't work with the own objects of the player.
  • If is set BattlePoints.CanUseStandardPoints and the destroyed object doesn't have the BattlePoints value then the points are obtained from the Points tag of the destroyed object. If BattlePoints.DefaultValue is present then this will be ignored.
  • If set BattlePoints in the destroyed object the calculation is made with this value. Self-Kills done by the own player doesn't count in this system.
  • If BattlePoints.Amount is set with a value different from 0 then the super weapon is influenced by this system. If the value is positive then this super weapon won't be launched until the affected player gathered the required ammount.

In uimd.ini:

[Sidebar]
BattlePointsSidebar.Label=<none>                ; CSF entry key `★ <VALUE>`, code U+2605
BattlePointsSidebar.Label.InvertPosition=false  ; bool, `<VALUE> ★`, code U+2605

[ToolTips]
BattlePoints.Label=<none>                       ; CSF entry key, default to `★: <VALUE>`, code U+2605

In rulesmd.ini:

[General]
BattlePoints=                            ; bool
BattlePoints.DefaultValue=               ; int
BattlePoints.DefaultFriendlyValue=       ; int

[SOMESIDE]                               ; Side
Sidebar.BattlePoints.Offset=0,0          ; X,Y, pixels relative to default
Sidebar.BattlePoints.Color=              ; integer - R,G,B
Sidebar.BattlePoints.Align=Left          ; Left, Right, Center/Centre

[SOMECOUNTRY]                            ; HouseType
BattlePoints=false                       ; bool
BattlePoints.CanUseStandardPoints=false  ; bool

[SOMEBUILDING]                           ; BuildingType
BattlePointsGenerator=                   ; bool

[SOMETECHNO]                             ; TechnoType
BattlePoints=                            ; int

[SOMESW]
BattlePoints.Amount=0                    ; int

FS-21 added 8 commits May 12, 2025 12:16
Improved & splitted the code in auxiliar functions.
Now the SW can modify the house points.
Now a new General tag is added for default value when the tag isn't established in the techno.
Added hook SuperClass_IsReady_BattlePoints for disabling the use of the SW if it doesn't have enough points (in reality is a rewrite of that IsReady() method adding this check) .
- Now friendly objects can have it's own default value.
- Renamed the default value tag,
- Realtime sidebar counter indicator.
- New tag: Sidebar.BattlePoints.Offset
- New tag: Sidebar.BattlePoints.Color
- New tag: Sidebar.BattlePoints.Align
- Now Chronoshere tele-kill will register the points (why not the nuke... :@ ).
…oints requisite.

- Removed code used for optionally show this value. Now depends on the activation of the feature, since is weird to hide the current gathered points having a requisite in a SW that needs it.
- Fixed bugs
- Added documentation
@FS-21
Copy link
Contributor Author

FS-21 commented May 16, 2025

battlepoints-demo-02

Tested in online and AI respect the points requisite.
I painted this symbol for the code U+2605 for the test in the game.fnt file:
Star symbol for Battle Points

Copy link

github-actions bot commented May 16, 2025

Nightly build for this pull request:

This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.

@TaranDahl TaranDahl added ❓New feature ⚙️T2 T2 maintainer review is sufficient labels May 17, 2025
From BattlePointsGenerator to BattlePointsCollector
@FS-21
Copy link
Contributor Author

FS-21 commented May 17, 2025

Renamed tag from BattlePointsGenerator to BattlePointsCollector and updated docs and first message

@TaranDahl
Copy link
Contributor

It would be best if it could optionally display a FlyingString when obtaining BattlePoints, just like the bounty of Ares.

@TaranDahl TaranDahl added the Interaction Something related to interaction with other extension, program etc. label May 19, 2025
@FS-21
Copy link
Contributor Author

FS-21 commented May 19, 2025

It would be best if it could optionally display a FlyingString when obtaining BattlePoints, just like the bounty of Ares.

I prefer keeping the base foundation of the feature simple for a faster merge and in new PRs adding other features (or let other devs to develop them), like:

  • Oil Derrick style for generating points overtime.
  • Points in crates
  • Map Events/Actions for checking & manipulating values.
  • Support for non-SW (structures & units like if it was "money")
  • Flying strings as you suggested
  • ...

Copy link
Contributor

@TaranDahl TaranDahl left a comment

Choose a reason for hiding this comment

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

LGTM.

@TaranDahl TaranDahl requested a review from a team May 22, 2025 06:12
@ayylmaoRotE
Copy link

ayylmaoRotE commented Jun 4, 2025

These 2 tags are not working:

BattlePointsCollector=true
BattlePointsGenerator=true

Is not working for me at the Techno level (building), can only get it to work at [General] with BattlePoints=true, the documentation states otherwise that you can enable this system with a building instead - can you please confirm. Side also does not work with BattlePoints=true

@FS-21
Copy link
Contributor Author

FS-21 commented Jun 4, 2025

I just tested now in my mod and it works.

With default settings, if you want a structure that enables the logic just put in teh structure:
BattlePointsCollector=yes

As soon as it is built your value indicator appears in the sidebar.
AAAAAAAND, by default you get no points, unlike Ares bounty logic that forces you to put the value in all objects here just put a default value in:
[General]
BattlePoints.DefaultValue= ; int
And done (if you wanted it a bit simple for testing purposes)
For example 100:
[General]
BattlePoints.DefaultValue=100

So the counter will appear and enable the count after new kills (+100 each enemy kill) when the structure is built.
If the collector structure is sold or destroyed the counter dissappears from the sidebar (and resumed the counter) when built again.

If you want it always enabled in a specific house istead of waiting to build a structure then:
[SOMECOUNTRY]
BattlePoints=true

With my mod settings (when the collector is built the system is enabled):
https://github.com/user-attachments/assets/f7148390-a727-41b6-9bfc-b07497f48740

@FS-21
Copy link
Contributor Author

FS-21 commented Jun 4, 2025

What I missed is the updated documentation here in the first post so I'll update because it isn't called generator, now is collector

@Coronia Coronia added ⚙️T3 and removed ⚙️T2 T2 maintainer review is sufficient labels Jun 19, 2025
@Coronia
Copy link
Contributor

Coronia commented Jun 19, 2025

Increase the rank of this PR to T3, since the essential of this is about adding a 'secondary resource' to the game, which need careful design for its functionality, interaction with various things and method of implementation first. We could indeed merge this PR first, but a rough structure of its future development needs to be decided I think. Hope @Metadorius and others could give some thought about it

@Coronia Coronia requested review from Metadorius and removed request for a team June 20, 2025 03:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Interaction Something related to interaction with other extension, program etc. ❓New feature ⚙️T3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants