Author |
Message |
fraggeur
DieHard Guard


Joined: 31 Dec 2012
Last Visit: 09 Feb 2019
Topics: 12
Posts: 284

|
Posted: Tue Feb 21, 2017 12:41 pm
Subject: Level ratios bug
[ IP : Logged ]
|

 
|
|
I am pretty sure it has happened and been discussed several times but I can't remember where.
I get sometimes ratios over 100% at the end of level, treasure at 103% for instance. Possibly happened after a "load game". Is there a permanant fix around? |
|
|
 |
Aryan_Wolf3D
DieHard Guard

Joined: 21 Jul 2011
Last Visit: 18 Feb 2019
Topics: 6
Posts: 212

|
Posted: Tue Feb 21, 2017 12:54 pm
Subject: Re: Level ratios bug
[ IP : Logged ]
|

  
|
|
It really depends on any changes you've made to the source. In wl_act1.cpp, every treasure item is added to "gamestate.treasuretotal", and in wl_agent.cpp, when the player picks up the treasure, it adds it to "gamestate.treasurecount". I would suggest checking the "gamestate.treasuretotal/treasurecount" lines, and make sure they're correct. I think that if an item is added to the treasure count without being added to the treasure total, you'll end up with +100% treasure ratios. And also, if you're having this happen only when loading a game, make sure you have the "if (!loadedgame)" line above every "gamestate.treasuretotal/treasurecount line, since I think it prevents the item from being added again when you load a saved game.
I hope that helps. |
_________________ "Way too many #ifdefs in the code!" - John Carmack
|
|
 |
Tricob
Moderator


Joined: 14 Mar 2005
Last Visit: 8:36 ago.
Topics: 165
Posts: 8330
Location: Neo-traditions, Inc.

|
Posted: Tue Feb 21, 2017 1:34 pm
Subject: Re: Level ratios bug
[ IP : Logged ]
|

  
|
|
Are there any floor code errors in your maps? This will alter the checksum for your level ratios every time. |
|
|
 |
fraggeur
DieHard Guard


Joined: 31 Dec 2012
Last Visit: 09 Feb 2019
Topics: 12
Posts: 284

|
Posted: Tue Feb 21, 2017 2:39 pm
Subject: Re: Level ratios bug
[ IP : Logged ]
|

  
|
|
Hmmm interesting thanks, let me check those 2 points  |
|
|
 |
AlumiuN
DieHard Wolfer

Joined: 29 Nov 2007
Last Visit: 5:20 ago.
Topics: 38
Posts: 2537
Location: Christchurch, New Zealand

|
|
 |
Chris
DieHard Wolfer


Joined: 11 Mar 2003
Last Visit: 14 Feb 2019
Topics: 55
Posts: 2169
Location: Canada

|
|
 |
Tricob
Moderator


Joined: 14 Mar 2005
Last Visit: 8:36 ago.
Topics: 165
Posts: 8330
Location: Neo-traditions, Inc.

|
Posted: Tue Feb 21, 2017 7:33 pm
Subject: Re: Level ratios bug
[ IP : Logged ]
|

  
|
|
AlumiuN wrote:
Tricob wrote:
Are there any floor code errors in your maps? This will alter the checksum for your level ratios every time.
How do they do this?
It only occurs with saved games. If you never enter the room that has the floorcode problems, the checksum remains correct. |
|
|
 |
fraggeur
DieHard Guard


Joined: 31 Dec 2012
Last Visit: 09 Feb 2019
Topics: 12
Posts: 284

|
Posted: Thu Feb 23, 2017 1:18 pm
Subject: Re: Level ratios bug
[ IP : Logged ]
|

 
|
|
Thanks all.
It was simply a discrepency between treasurecount and treasuretotal...
Funny thing is that the buggy treasure items were the ones that can appear randomly with only a few odds (by breaking a crate), so I could have replayed the level hundreds of time without never reproduce the bug. |
|
|
 |
|