Phobos icon indicating copy to clipboard operation
Phobos copied to clipboard

Battle Points economy for super weapons

Open FS-21 opened this issue 7 months ago • 15 comments

  • 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 avatar May 16 '25 22:05 FS-21

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

FS-21 avatar May 16 '25 22:05 FS-21

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.

github-actions[bot] avatar May 16 '25 22:05 github-actions[bot]

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

FS-21 avatar May 17 '25 09:05 FS-21

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

TaranDahl avatar May 19 '25 08:05 TaranDahl

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
  • ...

FS-21 avatar May 19 '25 09:05 FS-21

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

ayylmaoRotE avatar Jun 04 '25 12:06 ayylmaoRotE

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 avatar Jun 04 '25 12:06 FS-21

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

FS-21 avatar Jun 04 '25 12:06 FS-21

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 avatar Jun 19 '25 11:06 Coronia

@FS-21 can you try and outline a base for new potential new resource system? perhaps introduce something like CustomResourceType which would have the icon definable and work from that?

Metadorius avatar Jun 29 '25 10:06 Metadorius

For now I propose to first make a mockup of how that would work in INI, and only after that implement it in code.

Metadorius avatar Jun 29 '25 10:06 Metadorius

I already posted what is missing for a full resource support (ignoring the use of the resource for repairing things because is something that could hurt my head if I try to investigate).

First I would like to fix the bug regarding the WH thresholds posted few days ago before I could start thinking in how should be designed in INI

FS-21 avatar Jun 29 '25 10:06 FS-21

If there is a new currency then why not set this currency to buy some special units?

maikhoamKv avatar Aug 10 '25 08:08 maikhoamKv

If there is a new currency then why not set this currency to buy some special units?

Because isn't supported yet and it was planned for Super Weapons not technos.

I was asked to re-make it into a generic system of new resources (like in warcraft or Age of Empires) but until I start that thing this is for now for Super Weapons.

FS-21 avatar Aug 10 '25 09:08 FS-21

If there is a new currency then why not set this currency to buy some special units?

Because isn't supported yet and it was planned for Super Weapons not technos.

I was asked to re-make it into a generic system of new resources (like in warcraft or Age of Empires) but until I start that thing this is for now for Super Weapons.

hope it will be used for technos too in the future...

maikhoamKv avatar Aug 10 '25 10:08 maikhoamKv