Home » MODDING HQ 1.13 » v1.13 Bug Reports » BUGZILLA report all bugs here!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: BUGZILLA report all bugs here![message #325071]
|
Thu, 12 September 2013 00:53
|
|
Moa |
|
Messages:58
Registered:September 2013 |
|
|
There is something wrong since the changes related to not enough APs to drop off an item attached to cursor.
Accessing Map inventory with couple of items takes longer to load. for 100 items its allready some seconds in debug build for 6394.
Also after autoresolve battle it takes forever to continue (because the items are accessed/dropped/merged here as well). There are around 300 items in that sector and it took around 4 minutes to continue.
random break during 'hang' after autoresolve:
Toggle Spoiler
JA2_EN_Debug.exe!_nh_malloc_dbg_impl(unsigned int nSize, int nhFlag, int nBlockUse, const char * szFileName, int nLine, int * errno_tmp) Line 239 + 0x19 bytes C++
JA2_EN_Debug.exe!_nh_malloc_dbg(unsigned int nSize, int nhFlag, int nBlockUse, const char * szFileName, int nLine) Line 302 + 0x1d bytes C++
JA2_EN_Debug.exe!malloc(unsigned int nSize) Line 56 + 0x15 bytes C++
JA2_EN_Debug.exe!operator new(unsigned int size) Line 59 + 0x9 bytes C++
JA2_EN_Debug.exe!std::_Allocate >::_Node>(unsigned int _Count, std::_List_nod >::_Node * __formal) Line 36 + 0x15 bytes C++
JA2_EN_Debug.exe!std::allocator >::_Node>::allocate(unsigned int _Count) Line 187 + 0xb bytes C++
JA2_EN_Debug.exe!std::_List_val >::_List_val >(std::allocator _Al) Line 495 + 0xd bytes C++
JA2_EN_Debug.exe!std::list >::list >() Line 608 C++
JA2_EN_Debug.exe!StackedObjectData::StackedObjectData() Line 876 + 0x4a bytes C++
JA2_EN_Debug.exe!std::_Uninit_def_fill_n,StackedObjectData>(StackedObjectData * _First, int _Count, const StackedObjectData * __formal, std::allocator & _Al, const StackedObjectData * __formal, const StackedObjectData * __formal) Line 631 + 0xb bytes C++
JA2_EN_Debug.exe!std::_Uninitialized_default_fill_n >(StackedObjectData * _First, int _Count, const StackedObjectData * _Pval, std::allocator & _Al) Line 672 + 0x40 bytes C++
JA2_EN_Debug.exe!std::_List_val >::_Buynode(std::_List_nod >::_Node * _Next, std::_List_nod >::_Node * _Prev) Line 531 + 0x3e bytes C++
JA2_EN_Debug.exe!std::list >::_Insert(std::_List_const_iterator > > _Where) Line 990 + 0x1b bytes C++
JA2_EN_Debug.exe!std::list >::resize(unsigned int _Newsize) Line 854 + 0x4a bytes C++
JA2_EN_Debug.exe!OBJECTTYPE::initialize() Line 1252 C++
JA2_EN_Debug.exe!OBJECTTYPE::OBJECTTYPE() Line 1240 C++
JA2_EN_Debug.exe!std::_Uninit_def_fill_n,OBJECTTYPE>(OBJECTTYPE * _First, int _Count, const OBJECTTYPE * __formal, std::allocator & _Al, const OBJECTTYPE * __formal, const OBJECTTYPE * __formal) Line 631 + 0xb bytes C++
JA2_EN_Debug.exe!std::_Uninitialized_default_fill_n >(OBJECTTYPE * _First, int _Count, const OBJECTTYPE * _Pval, std::allocator & _Al) Line 672 + 0x40 bytes C++
JA2_EN_Debug.exe!std::_List_val >::_Buynode(std::_List_nod >::_Node * _Next, std::_List_nod >::_Node * _Prev) Line 531 + 0x3e bytes C++
JA2_EN_Debug.exe!std::list >::_Insert(std::_List_const_iterator > > _Where) Line 990 + 0x1b bytes C++
JA2_EN_Debug.exe!std::list >::resize(unsigned int _Newsize) Line 854 + 0x4a bytes C++
JA2_EN_Debug.exe!StackedObjectData::Load(unsigned int hFile) Line 2638 C++
JA2_EN_Debug.exe!OBJECTTYPE::Load(unsigned int hFile) Line 2717 + 0x13 bytes C++
JA2_EN_Debug.exe!WORLDITEM::Load(unsigned int hFile) Line 2492 + 0xf bytes C++
JA2_EN_Debug.exe!LoadWorldItemsFromTempItemFile(short sMapX, short sMapY, char bMapZ, WORLDITEM * pData) Line 716 + 0x15 bytes C++
> JA2_EN_Debug.exe!AddItemsToUnLoadedSector(short sMapX, short sMapY, char bMapZ, int sGridNo, unsigned int uiNumberOfItemsToAdd, OBJECTTYPE * pObject, unsigned char ubLevel, unsigned short usFlags, char bRenderZHeightAboveLevel, char bVisible, unsigned char fReplaceEntireFile) Line 840 + 0x18 bytes C++
JA2_EN_Debug.exe!SOLDIERTYPE::DropSectorEquipment() Line 15990 + 0x48 bytes C++
JA2_EN_Debug.exe!RemoveAutoResolveInterface(unsigned char fDeleteForGood) Line 2751 C++
JA2_EN_Debug.exe!AutoResolveScreenHandle() Line 704 + 0x7 bytes C++
This was not the case before rev.6367.
Note that the callstack above is just a random break, those functions are not compulsory bugged.
Somewhere inbetween those versions something went wrong.
Edit: loading sector inventory with 250 items in rev 6394 takes 14 seconds, in rev 6367 it takes 9 seconds. Both using debug versions with debugging on, no breakpoints.
Edit2: its caused by Bobby Ray's shippment. If there is one arrived but not yet opened this increases the loading time of any sector inventory.
[Updated on: Thu, 12 September 2013 03:39] by Moderator Report message to a moderator
|
Corporal
|
|
|
|
|
|
|
|
|
Re: BUGZILLA report all bugs here![message #325164]
|
Fri, 13 September 2013 22:07
|
|
Moa |
|
Messages:58
Registered:September 2013 |
|
|
Moaits somewhere in between 6367 (ok) and 6394 (~40% longer loading). These are the only revisions I have compared with that savegame.
Strictly speaking the huge increase in loading time is caused by bobby ray's. But this different bug actually made the performance lost measureable. I will keep that save till weekend when testing some more revisions.
I am sorry, this was not true and I appologize for that quick assumtion. A more precise test showed that the loading times vary in a large range:
Toggle Spoiler
timings for opening and closing sector inventory with 251 items at D13 when Booby Rays shipment has arrived but not yet oppened.
because of rondomness on loading times I repeated it 5 times for each revision I tested.
After each test I reloaded the save.
I accessed inventory via left Btn mouseclick and closed via [ESC].
rev open1 close1 open2 close2 open3 close3 open4 close4 open5 close5
6401 11248 6911 9360 7285 10421 7332 12527 7878 12293 7411
6387 11559 7394 12839 7067 11435 7130 9282 7800 10842 7129
6382 9017 6724 10749 7254 10499 7347 10655 7348 12074 6958
6375 9017 6974 10030 7301 11498 7520 11607 7269 13042 6958
6370 11248 7020 11279 7332 10671 7192 9843 7394 10640 7379
6367 10499 7222 9001 7160 10920 7332 9438 7191 12948 7145
The difference between the versions is negligible.
I have a guess: there might be some racing condition -> gameloop was told to render inventory, inventory renders but in meantime the view got changed by some code:
BOOLEAN AutoPlaceObjectToWorld(SOLDIERTYPE * pSoldier, OBJECTTYPE * pObj, INT8 bVisible)
..
fShowMapInventoryPool = FALSE;
..
then the map screen gets rendered again by gameloop because it is not shown anymore
Might be totaly wrong, just a wild guess...
Edit:
identified a part of the long delay for opening the inventory, I will check the closing delay on Sunday.
But I have not figured out why there is such a huge increase when Bobby Ray has shipped something.
(do not commit, needs to be double checked by flugente, the debugging stuff in game loop needs to be removed and some more changes needs to be done):
Toggle Spoiler
Index: gameloop.cpp
===================================================================
--- gameloop.cpp (revision 6401)
+++ gameloop.cpp (working copy)
@@ -220,7 +220,7 @@
// rain
static BOOLEAN gfSkipFrame = FALSE;
-
+extern void ScreenMsg( UINT16 usColor, UINT8 ubPriority, STR16 pStringA, ...);
void GameLoop(void)
{
// DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"GameLoop");
@@ -377,8 +377,11 @@
//DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"GameLoop: screen changed");
AssertNotNIL (GameScreens[guiCurrentScreen].HandleScreen);
+ UINT32 time = GetClock();
uiOldScreen = (*(GameScreens[guiCurrentScreen].HandleScreen))();
-
+ time = GetClock()-time;
+ if (time>1000)
+ ScreenMsg( FONT_MCOLOR_LTYELLOW, 0, L"Handle Screen completed in %d",time);
// if the screen has changed
if( uiOldScreen != guiCurrentScreen )
{
Index: Strategic/Map Screen Interface Map Inventory.cpp
===================================================================
--- Strategic/Map Screen Interface Map Inventory.cpp (revision 6401)
+++ Strategic/Map Screen Interface Map Inventory.cpp (working copy)
@@ -798,7 +798,8 @@
// Flugente: certain features need to alter an item's temperature value depending on the time passed
// if we do these functions here and adjust for the time passed since this sector was loaded last, it will seem to the player
// as if these checks are always performed in any sector
- SectorInventoryCooldownFunctions(sSelMapX, sSelMapY, ( INT16 )( iCurrentMapSectorZ ));
+ //Moa: removed this function and stripped the relevant code into BuildStashForSelectedSector to decrease loading time
+ //SectorInventoryCooldownFunctions(sSelMapX, sSelMapY, ( INT16 )( iCurrentMapSectorZ ));
// build stash
BuildStashForSelectedSector( sSelMapX, sSelMapY, ( INT16 )( iCurrentMapSectorZ ) );
@@ -1869,8 +1870,11 @@
uiTotalNumberOfSeenItems = uiItemCount;
+ //Flugente: update Temperature & Food (Moa: moved from SectorInventoryCooldownFunctions)
+ HandleSectorCooldownFunctions( sMapX, sMapY, (INT8)sMapZ, pTotalSectorList, uiTotalNumberOfSeenItems, TRUE );
+ SetLastTimePlayerWasInSector( sMapX, sMapY, (INT8)sMapZ );
- // now allocate space for all the unseen items
+ // now allocate space for all the unseen items
if( guiNumWorldItems > uiItemCount )
{
pUnSeenItems = new WORLDITEM[ guiNumWorldItems - uiItemCount ];
@@ -1912,6 +1916,9 @@
// now load into mem
LoadWorldItemsFromTempItemFile( sMapX, sMapY, ( INT8 ) ( sMapZ ), pTotalSectorList );
+ //Flugente: update Temperature & Food (Moa: moved from SectorInventoryCooldownFunctions)
+ HandleSectorCooldownFunctions( sMapX, sMapY, (INT8)sMapZ, pTotalSectorList, uiTotalNumberOfRealItems, TRUE );
+ SetLastTimePlayerWasInSector( sMapX, sMapY, (INT8)sMapZ );
}
@@ -5223,8 +5230,9 @@
}
}
+//Moa:moved relevant code of this function to BuildStashForSelectedSector and enterSector to increase loading time
// Flugente: handle various cooldown functions in a sector
-void SectorInventoryCooldownFunctions( INT16 sMapX, INT16 sMapY, INT16 sMapZ )
+/*void SectorInventoryCooldownFunctions( INT16 sMapX, INT16 sMapY, INT16 sMapZ )
{
UINT32 uiTotalNumberOfRealItems = 0;
WORLDITEM * pTotalSectorList = NULL;
@@ -5270,9 +5278,9 @@
//Save the Items to the the file
SaveWorldItemsToTempItemFile( sMapX, sMapY, (INT8)sMapZ, uiTotalNumberOfRealItems, pTotalSectorList );
-}
+}*/
-// Flugente: handle various cooldwon functions over an array of items in a specific sector.
+// Flugente: handle various cooldown functions over an array of items in a specific sector.
// if fWithMinutes = true, adjust cooldown for time since sector was last entered
// otherwise its used for a turn-precise cooldown
void HandleSectorCooldownFunctions( INT16 sMapX, INT16 sMapY, INT8 sMapZ, WORLDITEM* pWorldItem, UINT32 size, BOOLEAN fWithMinutes )
Index: Strategic/strategicmap.cpp
===================================================================
--- Strategic/strategicmap.cpp (revision 6401)
+++ Strategic/strategicmap.cpp (working copy)
@@ -2883,6 +2883,8 @@
#endif
}
+extern void SetLastTimePlayerWasInSector(INT16 sMapX, INT16 sMapY, INT8 sMapZ);
+//Moa: 09-14-2013 this function modifies the temperature of items in that sector as well \calls HandleSectorCooldownFunctions
BOOLEAN EnterSector( INT16 sSectorX, INT16 sSectorY , INT8 bSectorZ )
{
INT32 i;
@@ -3015,8 +3017,15 @@
// Flugente: certain features need to alter an item's temperature value depending on the time passed
// if we do these functions here and adjust for the time passed since this sector was loaded last, it will seem to the player
// as if these checks are always performed in any sector
- SectorInventoryCooldownFunctions(sSectorX, sSectorY, bSectorZ);
+ //Moa: removed this function and replaced by the handling function. Since we have allready loaded the items previously we can use the globals here.
+ //SectorInventoryCooldownFunctions(sSectorX, sSectorY, bSectorZ);
+ //moved from SectorInventoryCooldownFunctions, unvisible items are cooled down here as well. Since we are entering the sector this should not be a problem(?)
+ HandleSectorCooldownFunctions( sSectorX, sSectorY, (INT8)bSectorZ, gWorldItems, guiNumWorldItems, TRUE );
+ SetLastTimePlayerWasInSector( sSectorX, sSectorY, (INT8)bSectorZ );
+ //Moa: scatter items which have not yet been placed on the map
+ //ScatterUnplacedItems();
+
return TRUE; //because the map was loaded.
}
[Updated on: Sat, 14 September 2013 07:30] by Moderator Report message to a moderator
|
Corporal
|
|
|
|
Pages (42): [ 21 ] |
|
Goto Forum:
Current Time: Mon Oct 14 09:21:07 GMT+3 2024
Total time taken to generate the page: 0.03783 seconds
|