View Issue Details

IDProjectCategoryView StatusLast Update
0002450The Dark ModGUIpublic03.06.2011 03:58
ReporterSpringheel Assigned Tograyman  
PrioritynormalSeveritynormalReproducibilityalways
Status closedResolutionfixed 
Product VersionTDM 1.03 
Target VersionTDM 1.03Fixed in VersionTDM 1.03 
Summary0002450: Unknown Pause before Purchase Menu
DescriptionSomeone posted a while ago about a new delay before loading the purchase menu...I've seen this as well. Sometimes it's a trivial five second delay, but once it was more like twenty seconds, leading me to believe it had frozen. I don't recall any significant pause at all in 1.02.
TagsNo tags attached.

Activities

grayman

grayman

03.12.2010 05:21

viewer   ~0003362

This is due to a number of improvements I made in the shop code. (My first bug fix. 0002376)

The delay comes from needing to find out the maximum # of arrows you're allowed to have. This TODO note from 0002376 explains what's happening:

"1. Due to max_ammo processing, there's a delay (<10s) while waiting for the Shop screen to display. The delay is due to calls to FindEntityDefDict()."

The first time this routine is called, there's a 3.5s delay, which makes no sense, unless there's a ton of initialization work being done to build the dictionary of entity definitions. Subsequent calls take decreasing amounts of time until they return immediately.

My guess is this delay was already there in 1.02, when the first calls to this routine were done in the map load code (when the title graphic is being shown with the loading bars), where it was lost in the very long load time. Now it's just earlier and more exposed.

greebo mentioned looking at it when I first submitted the code for review, but I'm sure he's been busy elsewhere.
grayman

grayman

03.12.2010 14:00

viewer   ~0003363

Two ways to approach this:

1) IIRC, I'm looking for the max number of arrows one can have. If I just hardcode that to 30, it would be a way to avoid the delay. It would be a hack, but it would suffice.

2) See if I can spin off a separate thread parallel to the briefing to query FindEntityDefDict() for each arrow type. That would get the long initial delays out of the way while the player's busy with briefing/difficulty/objectives. Either save the results for use in the shop or let the shop redo the calls when response time is small.
grayman

grayman

06.12.2010 05:06

viewer   ~0003370

Implemented option 1 with hard-coded limit of 50.

Issue History

Date Modified Username Field Change
03.12.2010 01:06 Springheel New Issue
03.12.2010 05:21 grayman Note Added: 0003362
03.12.2010 06:16 greebo Status new => confirmed
03.12.2010 14:00 grayman Note Added: 0003363
03.12.2010 14:01 grayman Assigned To => grayman
03.12.2010 14:01 grayman Reproducibility have not tried => always
03.12.2010 14:01 grayman Target Version => TDM 1.03
06.12.2010 05:06 grayman Note Added: 0003370
06.12.2010 05:07 grayman Status confirmed => resolved
06.12.2010 05:07 grayman Resolution open => fixed
06.12.2010 05:07 grayman Fixed in Version => TDM 1.03
03.06.2011 03:58 greebo Status resolved => closed