Page MenuHomeSchine - Phabricator

Starmade | ship and armor HP is capped
Closed, FinishedPublic

Description

If your HP goes past 2^31-1 (32 bit integer max), it will stay capped at that number:

Details

Commits
Restricted Diffusion Commit
Restricted Diffusion Commit
Restricted Diffusion Commit
Restricted Diffusion Commit
Task Type
Bug
Testing Results
Affected Gamemode(s)
Single and Multi
Reproducible
Yes
Last tested (version)
0.199.535
Category
Control Block System: Functional
First occurrence (version)
0.19289
Hardware/Software/System
OS-Specific
No
Hardware-Specific
No
Video Card Vendor
uncertain
Steps to reproduce

How to reproduce:

  1. modify SHP and AHP of a block to something very high
  2. spam that block on a ship to reach high values
Tester information (Internal use only)

AHP is working.

SHP isn't. It goes negative when crossing 2.147 billion

Serverconfig (server.cfg)
<replace this line with the file content>
Clientconfig (settings.cfg)
<replace this line with the file content>

Related Objects

StatusAssignedTask
Closedlancake

Event Timeline

lancake updated the task description. (Show Details)Jun 28 2015, 8:03 PM
lancake changed the visibility from "Custom Policy" to "Public (No Login Required)".
lancake changed the edit policy from "Task Author" to "Starmade (Project)".
lancake changed Category from none/unspecified to Control Block System: Functional.
lancake changed Affected Gamemode(s) from none/unspecified to Single and Multi.
lancake set First occurrence (version) to 0.19289.
lancake changed Reproducible from uncertain to Yes.
lancake set Last tested (version) to 0.19291 (Dev).
lancake edited a custom field.
lancake edited Serverconfig (server.cfg). (Show Details)
lancake edited Clientconfig (settings.cfg). (Show Details)
lancake added a subscriber: lancake.
lancake created this task.
lancake raised the priority of this task from to Urgent.
Restricted Application added a project: Issue Navigation. · View Herald TranscriptJun 28 2015, 8:03 PM
AndyP set Task Type to Bug.
AndyP set OS-Specific to No.
AndyP set Hardware-Specific to No.
AndyP set Video Card Vendor to uncertain.
AndyP added a subscriber: AndyP.
AndyP claimed this task.
AndyP removed AndyP as the assignee of this task.

Validated

lancake updated the task description. (Show Details)Jul 8 2015, 12:55 PM
lancake changed Last tested (version) from 0.19291 (Dev) to 0.19311 (Dev).
lancake renamed this task from negative ship and armor HP to ship and armor HP is capped.
lancake changed the task status from Open to In Queue (Game).
Restricted Application edited projects, added Game Development, Starmade; removed Issue Navigation. · View Herald TranscriptJul 8 2015, 12:55 PM

Personally, this is only an issue because ArmorHpBlockMultiplier is being edited. I don't see this issue ever effecting anyone using the game, unless they're trying to break things. Basically, unless I'm mistaken, 2.15 billion HP would never be hit by a player.

AndyP added a comment.Jul 12 2015, 6:20 PM

You can hit the cap at 25.000.000 ship blocks, this is obviously in the reach of known builds, without modification of the multiplier, if someone wants to buff the armor, by doubling it, you only need 12.500.000 blocks to hit the cap.

So, this increased modifier is only a helper, and not a real "use case" ^^°

schema added a subscriber: schema.Jul 13 2015, 6:00 AM

fixable but at the cost of a lot of bandwidth (replacing at least four 4-byte int with four 8-byte long) 2 of which update on every damage taken

AndyP added a comment.Jul 13 2015, 7:49 AM

Its not needed to extend the range. However I heard the entities hp malfunction when hittin g the limit

AndyP added a parent task: Unknown Object (Maniphest Task).Jul 15 2015, 2:11 PM
Gamel added a subscriber: Gamel.Jul 16 2015, 5:47 PM

@schema
Another possible fix:

int #1 is the main armor HP
boolean states whether another int is needed (health is > 2^31-1)
int #2 is used only if the boolean is true

Second integer would be left-shifted to create a long.

With this method all ships would use 5 bytes per HP value, instead of the 8 bytes of just using a long. Massive ships would use 9 bytes though, which of course would be rare.

good point. I'll implement that

schema added a commit: Restricted Diffusion Commit.Jul 21 2015, 3:14 PM
schema changed the task status from In Queue (Game) to Resolved by committing Restricted Diffusion Commit.
Restricted Application edited projects, added Quality Assurance; removed Game Development. · View Herald TranscriptJul 21 2015, 3:14 PM
Restricted Application added a subscriber: Megacrafter127. · View Herald Transcript
lancake changed the task status from Resolved to In Queue (Game).Jul 24 2015, 8:43 PM

Not entirely sure if this is related, but it seems armor HP is not working properly.

the AHP is set to SHP. Every block you add, adds the shp of that block to the ahp pool. Changing <ArmorHpBlockMultiplier>1.0</ArmorHpBlockMultiplier> does nothing so I assume no armor value is checked and it just uses the shp one.

Restricted Application edited projects, added Game Development; removed Quality Assurance. · View Herald TranscriptJul 24 2015, 8:43 PM
schema added a commit: Restricted Diffusion Commit.Jul 24 2015, 8:58 PM
schema changed the task status from In Queue (Game) to Resolved by committing Restricted Diffusion Commit.
Restricted Application edited projects, added Quality Assurance; removed Game Development. · View Herald TranscriptJul 24 2015, 8:58 PM
lancake changed the task status from Resolved to In Queue (Game).Aug 1 2015, 1:15 PM

Crossing the 2^31 - 1 limit will set current and max AHP to 0/0. Removing blocks so you don't get passed that limit will bring its normal value back again, unless the ship received damage.

The SHP however is working fine though as far as I can tell. Managed to get 4 billion and the SHP mechanics still worked properly.

Restricted Application edited projects, added Game Development; removed Quality Assurance. · View Herald TranscriptAug 1 2015, 1:15 PM
lancake changed Last tested (version) from 0.19311 (Dev) to 0.19355 (Dev).Aug 1 2015, 1:16 PM
schema added a commit: Restricted Diffusion Commit.Aug 1 2015, 2:30 PM
schema changed the task status from In Queue (Game) to Resolved by committing Restricted Diffusion Commit.
Restricted Application edited projects, added Quality Assurance; removed Game Development. · View Herald TranscriptAug 1 2015, 2:30 PM
lancake closed this task as Closed.Aug 1 2015, 6:33 PM
lancake claimed this task.

Fix confirmed.

Restricted Application removed a project: Quality Assurance. · View Herald TranscriptAug 1 2015, 6:33 PM
Restricted Application removed a subscriber: AndyP. · View Herald Transcript
lancake changed Last tested (version) from 0.19355 (Dev) to 0.19357 (Dev).Aug 1 2015, 6:33 PM
AndyP removed lancake as the assignee of this task.Aug 4 2015, 7:31 PM
AndyP shifted this object from the S1 Public space to the S3 Starmade space.Aug 11 2015, 11:24 PM
AndyP changed the edit policy from "Starmade (Project)" to "All Users".
lancake reopened this task as In Queue (Game).Jun 20 2016, 11:44 AM
Restricted Application added a project: Game Development. · View Herald TranscriptJun 20 2016, 11:44 AM
lancake added subscribers: AndyP, Nuclear_Doughnut.

AHP is working.

SHP isn't. It goes negative when crossing 2.147 billion

lancake updated the task description. (Show Details)Jun 20 2016, 11:46 AM
lancake edited Steps to reproduce. (Show Details)
lancake edited Tester information (Internal use only). (Show Details)
schema added a commit: Restricted Diffusion Commit.Mar 10 2017, 3:20 AM
schema changed the task status from In Queue (Game) to Resolved by committing Restricted Diffusion Commit.
Restricted Application edited projects, added Quality Assurance; removed Game Development. · View Herald TranscriptMar 10 2017, 3:20 AM
Restricted Application added a project: CBS: Functional. · View Herald TranscriptMar 10 2017, 6:31 PM
lancake changed Last tested (version) from 0.19357 (Dev) to 0.199.535.

-QA Testing-

Fix confirmed.

lancake closed this task as Closed.Jun 16 2017, 8:12 PM
lancake claimed this task.
Restricted Application removed a project: Quality Assurance. · View Herald TranscriptJun 16 2017, 8:12 PM
Restricted Application removed a subscriber: AndyP. · View Herald Transcript