Power jumps to 100 000 in campaign beta, mission 1 #1581
Comments
Per commented If you have a savegame where it reproduces the problem, please attach it and tell us how to do it. Thanks. |
Emdek uploaded file One save game before and one after power jump |
Emdek commented I don't know what I did. ;-) |
hao commented I've seen this too, but i can't provide any further info. I even think that it happened on one of the further levels (around the middle of beta campaign). |
Per commented @Emdek: "structures are build at high speed etc." Did game speed increased massively for a short while? |
Emdek commented Replying to Warzone2100/old-trac-import#1581 (comment:4):
Now I've got similar thing in last gamma mission, or it is normal that we start it with full power? |
Per changed status from |
Per set resolution to |
Per commented (In [9897]) 2.3: Add mitigation in case an underflowed value is passed into addPower(). May fix #1581 |
Emdek changed status from |
Emdek changed resolution from |
Emdek commented This still happens in beta11a. |
Safety0ff uploaded file Uploaded incase this is useful to someone, use at your own peril. |
Emdek commented Also happened once in gamma 2 mission... |
Emdek uploaded file Dump created after adding ASSERT(power < MAX_POWER, "Underflow attempt detected"); to power.c as discussed on IRC. |
Safety0ff uploaded file |
Safety0ff changed milestone from `` to |
anonymous uploaded file |
Buginator commented Ok, I'll bite. What do those savegames show? Everything is working normally from what I see. Care to give more detailed steps on how to replicate the issue? |
Emdek uploaded file New dump, using new assertion patch. |
Emdek commented Replying to Warzone2100/old-trac-import#1581 (comment:10):
|
Safety0ff changed status from |
Safety0ff set owner to |
Safety0ff commented Looks like it was introduced in [9172] (circa beta 8.) I'll let Zarel fix this. |
Safety0ff commented Replying to Warzone2100/old-trac-import#1581 (comment:11):
|
Zarel changed status from |
Zarel changed resolution from `` to |
Zarel commented (In [10769]) Fix bug #1581 - incorrect power calculation |
Zarel commented (In [10770]) 2.3: Fix bug #1581 - incorrect power calculation |
Git SVN Gateway <gateway@...> commented (In Warzone2100/warzone2100@2197ffe) Fix bug #1581 - incorrect power calculation git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@10769 4a71c877-e1ca-e34f-864e-861f7616d084 |
Per changed resolution from |
Per commented The problem is not gone. It is much worse. Just start a research that you do not have the power to pay fully, and you will immediately be granted 100 000 power. This is in 2.3/branch. |
cybersphinx changed priority from |
cybersphinx commented I removed the power ceiling hack and ran it through the debugger. At some point, |
cybersphinx uploaded file Savegame to reproduce, just wait a few seconds. |
cybersphinx commented To be more specific about "some point", it is when gameTime % (1<<16) is smaller than pResExtractor->timeLastUpdated % (1<<16) while extracting resources - and that can happen every 65536 ms. WTF was this modulo thing supposed to solve? |
cybersphinx uploaded file Proposed fix. I have no idea what the modulo was supposed to solve, but my version should always work, since timeLastUpdated should never be larger than gameTime. |
cybersphinx uploaded file Oops, this one should actually work. |
Crymson commented I was about to file a bug report on this. |
Zarel commented Your fix has rounding problems and the like. I will provide a proper fix sometime today. |
Zarel commented I mean, your patch disregards
It also reintroduces the problem of an uninitialized extractor (the "power level jumps to 100,000 when moving from cam1 to cam2 or cam2 to cam3" error). |
cybersphinx commented Replying to [comment:25 Zarel]:
Why? Previous version is aX - bX, new version is (a - b)*X. Should be exactly the same. I guess it loses some decimals due to the integer precision, but I don't see how your old version prevented that.
If the extractor is uninitialized, how about actually initializing it on campaign change? If your version prevents the problem, it is completely unobvious, so better comments would be appreciated. |
Zarel commented Replying to [comment:26 cybersphinx]:
Which means cumulative of On the other hand, your cumulative is Keep in mind that A significant drop-off, enough that some of the power upgrade tech could have practically no effect if you got unlucky with rounding, which is why I rewrote it in the first time.
Well, that's also a good solution, but you didn't do that. You did, however, remove:
which was my (admittedly fairly hacky) fix for the problem. |
cybersphinx commented Replying to [comment:27 Zarel]:
But what actually happens is not what you wrote, but int(aX - bX) + int(bX - cX). You just lose less digits. For a real solution, you'd need to keep the fractional part somewhere (maybe by setting timeLastUpdated not to gameTime, but gameTime - (the time it takes for the rest to accumulate)).
Right. I was just poking around trying to remove that modulo crap (since I have no idea about the original problem). |
Zarel changed status from |
Zarel changed resolution from `` to |
Zarel commented (In [10885]) 2.3: Third try to fix bug #1581 - problems in oil derrick code. |
Crymson changed status from |
Crymson changed resolution from |
Crymson commented Nope, still not fixed. |
Zarel commented Replying to [comment:30 Crymson]:
Were you playing 2.3.0 or svn/2.3 [10885]+? |
Safety0ff commented
|
Zarel changed status from |
Zarel changed resolution from `` to |
Zarel commented In fact, I'm pretty sure it is. Please create a new bug report. |
cybersphinx commented Replying to [comment:30 Crymson]:
I just tried to reproduce that with current svn, and it seemed to work correctly. Anyway, I guess a new ticket would be nice, since this one is getting long. |
Zarel commented Two things of relevance:
Because of this, I have reason to believe the bug originally reported by Crymson is unrelated to any recent changes we have made, and so I stand by my closing of this ticket. Why hasn't a new ticket been made for this bug? |
buginator <buginator@...> commented (In Warzone2100/warzone2100@6421c81) CHANGELOG: Fix rearming pads to actually repair units refs #1581 Fix rearming pads so they actually rearm at the speed they're intended to. Also make rearming upgrades affect rearming pad repair speed. Replaces REARM_PAD.currentPtsAdded with REARM_PAD.timeLastUpdated, but savefiles should still be compatible. git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@8865 4a71c877-e1ca-e34f-864e-861f7616d084 Conflicts:
|
buginator <buginator@...> commented In Warzone2100/warzone2100@6421c81:
|
keyword_power
resolution_fixed
type_bug
| by EmdekAfter around half of mission time power level jumped to 100 000 from 0 (some building were built and vehicles manufactured).
I can attach saves if needed. As far as I remember it occurred soon after saving game.
Very nice bug by the way. ;-)
Issue migrated from trac:1581 at 2022-04-15 21:05:33 -0700
The text was updated successfully, but these errors were encountered: