Open varjla opened 6 years ago
bad_alloc is thrown when you don't have enough memory to allocate for saving expanded lineups. You could free up memory by closing other applications, but more importantly, you should restrict number of heroes/monsters used. Increase the lower follower count to 100k, if that doesn't work increase more.
I have 32gb ram installed. Near 60% is free memory. Really this code is so consuming to eat near 18gb of memory with 5 bosses and 31 mobs? Could I have the binaries to try make an improvement, or isn't freeware?
Okay, your case does seem to call termination. It works fine with my VC compiled version, so it must be something to do with gcc compilation. I will look into it. Meanwhile you are, of course, free to edit and compile your own version.
Meanwhile we cannot find the error, could you create a new fork / update of that VC compiled version? Thanks.
EDIT: dont do that I compiled it my self with VC and...well, so slow. :D Maybe I did it bad. I had similar (but not the same) error with VC compile... but it took 3 hours to run the calculation until reach stop place.
It's very well known that this will always crash with this same error. Has been this way since the prog was written. Latas even says not to select to many heroes on his add-on . At a certain point even 5 heroes might be to much. But yeah, I'd love to have a working version with VC compilation.
Termination is certainly intended, since the code does not really capture bac_alloc exceptions anywhere. The one I use has some experimental code which I have not fully tested. I'd rather not have two incomplete versions out there while I am not 100% sure the issue is compiler related (I'm guessing it is). For now, keep the number of units involved small, as always, until I figure out something, which should be soonish, hopefully.
Your app brokes when running against moak:31:
C:\Users\casa\AppData\Local\Temp\WERE198.tmp.WERInternalMetadata.xml [...] <-ProblemSignatures> <-EventType>APPCRASH<-/EventType> <-Parameter0>CosmosQuest.exe<-/Parameter0> <-Parameter1>0.0.0.0<-/Parameter1> <-Parameter2>5aa903ee<-/Parameter2> <-Parameter3>CosmosQuest.exe<-/Parameter3> <-Parameter4>0.0.0.0<-/Parameter4> <-Parameter5>5aa903ee<-/Parameter5> <-Parameter6>40000015<-/Parameter6> <-Parameter7>000498fe<-/Parameter7> <-/ProblemSignatures> <-*ProblemSignatures> [...]
C:\Users\casa\AppData\Local\Temp\WERFAF2.tmp.appcompat.txt [...] <-*EXE NAME="CosmosQuest.exe" FILTER="CMI_FILTER_PRIVACY">
<-*/EXE> [...] C:\Users\casa\AppData\Local\Temp\WERFB03.tmp.mdmp
Working output After-crash:
Welcome to Diceycle's PvE Instance Solver! If you are new to using this Calculator I recommend reading the Github README.
Using specified File...
Enter your Heroes with levels. Press enter after every Hero. Press enter twice or type done to proceed without inputting additional Heroes. Enter Hero 1: veildur:8 Enter Hero 2: valor:99 Enter Hero 3: rokka:99 Enter Hero 4: pyromancer:99 Enter Hero 5: nicte:99 Enter Hero 6: bavah:1 Enter Hero 7: done Set a lower follower limit on monsters used: 50000 Set an upper follower limit that you want to use: 1898280 Enter Enemy Lineup(s): moak:31
Calculating with 29 available Monsters and 6 enabled Heroes. Starting loop for armies of size 1 Starting loop for armies of size 2 Starting loop for armies of size 3 Starting loop for armies of size 4
Best Solution so far: [Followers: 1718000 | veildur:8 nicte:99 pyromancer:99 f12 <==] Damage Done: 577 Continue calculation? (y/n): y
Preparing to work on loop for armies of size 5 Currently considering 260199 normal and 470616 hero armies. Calculating Dominance for non-heroes... Done! ( 0 seconds) Calculating Dominance for heroes... Done! ( 0 seconds) Expanding Lineups by one... Done! ( 0 seconds) Moving Data... Done! ( 0 seconds) Starting loop for armies of size 5 Simulating 607869 non-hero Fights... Done! ( 0 seconds) Simulating 4238799 hero Fights... Done! ( 1 seconds) Calculating Dominance for non-heroes... Done! ( 0 seconds) Calculating Dominance for heroes... Done! ( 13 seconds) Expanding Lineups by one... terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc
This application has requested the Runtime to terminate it in an unsual way. Please contact the application's support team for more information.
EDIT1 : I tryied to use only your app without Latas interface, and I configure the default.cqinput file: veildur:8 // Example Hero input valor:99 rokka:99 pyromancer:99 nicte:99 bavah:1 done // End Hero input 50000 // Lower Follower Limit 1898280 // Upper Follower Limit moak:31 // Enemy Lineup goes here
Same result:
Welcome to Diceycle's PvE Instance Solver! If you are new to using this Calculator I recommend reading the Github README.
Using default Configfile...
Enter your Heroes with levels. Press enter after every Hero. Press enter twice or type done to proceed without inputting additional Heroes. Enter Hero 1: veildur:8 Enter Hero 2: valor:99 Enter Hero 3: rokka:99 Enter Hero 4: pyromancer:99 Enter Hero 5: nicte:99 Enter Hero 6: bavah:1 Enter Hero 7: done Set a lower follower limit on monsters used: 50000 Set an upper follower limit that you want to use: 1898280 Enter Enemy Lineup(s): moak:31
Calculating with 29 available Monsters and 6 enabled Heroes. Starting loop for armies of size 1 Starting loop for armies of size 2 Starting loop for armies of size 3 Starting loop for armies of size 4
Best Solution so far: [Followers: 1718000 | veildur:8 nicte:99 pyromancer:99 f12 <==] Damage Done: 577 Continue calculation? (y/n): y
Preparing to work on loop for armies of size 5 Currently considering 260199 normal and 470616 hero armies. Calculating Dominance for non-heroes... Done! ( 0 seconds) Calculating Dominance for heroes... Done! ( 0 seconds) Expanding Lineups by one... Done! ( 0 seconds) Moving Data... Done! ( 0 seconds) Starting loop for armies of size 5 Simulating 607869 non-hero Fights... Done! ( 0 seconds) Simulating 4238799 hero Fights... Done! ( 1 seconds) Calculating Dominance for non-heroes... Done! ( 0 seconds) Calculating Dominance for heroes... Done! ( 13 seconds) Expanding Lineups by one... terminate called after throwing an instance of 'std::bad_alloc' what(): std::bad_alloc
This application has requested the Runtime to terminate it in an unsual way. Please contact the application's support team for more information.
EDIT2: no heros works well: Welcome to Diceycle's PvE Instance Solver! If you are new to using this Calculator I recommend reading the Github README.
Using default Configfile...
Enter your Heroes with levels. Press enter after every Hero. Press enter twice or type done to proceed without inputting additional Heroes. Enter Hero 1: Enter Hero 1: Set a lower follower limit on monsters used: done Set a lower follower limit on monsters used: 50000 Set an upper follower limit that you want to use: 1898280 Enter Enemy Lineup(s): moak:31
Calculating with 29 available Monsters and 0 enabled Heroes. Starting loop for armies of size 1 Starting loop for armies of size 2 Starting loop for armies of size 3 Starting loop for armies of size 4
Best Solution so far: [Followers: 1780000 | f11 f8 f7 f7 <==] Damage Done: 417 Continue calculation? (y/n): y
Preparing to work on loop for armies of size 5 Currently considering 260199 normal and 0 hero armies. Calculating Dominance for non-heroes... Done! ( 0 seconds) Calculating Dominance for heroes... Done! ( 0 seconds) Expanding Lineups by one... Done! ( 0 seconds) Moving Data... Done! ( 0 seconds) Starting loop for armies of size 5 Simulating 607869 non-hero Fights... Done! ( 1 seconds) Simulating 0 hero Fights... Done! ( 0 seconds) Calculating Dominance for non-heroes... Done! ( 0 seconds) Calculating Dominance for heroes... Done! ( 0 seconds) Expanding Lineups by one... Done! ( 0 seconds) Moving Data... Done! ( 0 seconds) Starting loop for armies of size 6 Simulating 1719003 non-hero Fights... Done! ( 0 seconds) Simulating 0 hero Fights... Done! ( 0 seconds)
Solution for [Followers: 0 | moak:31 <==]: [Followers: 1804000 | f11 f7 f7 f7 f7 f7 <==]
Boss Damage Done: 540 2601816 Fights simulated. Total Calculation Time: 1 Calc Version: 2.9.7.1
Battle Replay (Use on Ingame Tournament Page): eyJ3aW5uZXIiOiJVbmtub3duIiwibGVmdCI6IlNvbHV0aW9uIiwicmlnaHQiOiJJbnN0YW5jZSIsImRhdGUiOjE1MjMwMzk3NjcsInRpdGxlIjoiUHJvcG9zZWQgU29sdXRpb24iLCJzZXR1cCI6Wz QyLDI2LDI2LDI2LDI2LDI2LDQyLDI2LDI2LDI2LDI2LDI2LDQyLDI2LDI2LDI2LDI2LDI2LDQyLDI2LDI2LDI2LDI2LDI2LDQyLDI2LDI2LDI2LDI2LDI2XSwic2hlcm8iOlswLDAsMCwwLDAsMCww LDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMC wwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMF0sInBsYXllciI6Wy04OSwtMSwtMSwtMSwtMSwtMSwtODksLTEsLTEsLTEsLTEs LTEsLTg5LC0xLC0xLC0xLC0xLC0xLC04OSwtMSwtMSwtMSwtMSwtMSwtODksLTEsLTEsLTEsLTEsLTFdLCJwaGVybyI6WzAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLD AsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCwwLDAsMCww LDAsMCwwLDAsMCwwLDAsMCwwLDMxLDAsMCwwLDAsMCwwLDAsMF19
Do you want to calculate more lineups? (y/n):
EDIT3: With up to 4 heroes it works, but with 5, it crash.
I guess is a overflow of any variable. Maybe a bigint or something similar?
I hope you can solve it.
Thank you in advance.