[RELz] Enhanced Economy

Post » Fri May 27, 2011 6:43 am

I am sure that I have not traded within the last 2 hours. My shopping tours are usually at about 2:00 - 3:00 pm every day, only one time per merchant.


I believe I've discovered another problem with the mod, save game bloat. I was noticing that it was taking longer and longer for my games to save to disk, to the point where it was getting rather annoying. Wanting to make some changes in the ini, and not having merchants reset from a save game BTW, I disabled the mod, did a clean save, then restarted it. My save games were once again as quick as they used to be and the OBSE save game portion went from well over 300 kb down to 10.



Thanks for more reports. I think maybe those two things are related - that something goes wrong when EE removes entries from the array - which it does whenever you load a savegame. EE then goes through the stored merchant data and removes the ones which haven't been visited within the reset timer. This is done both in order to reset merchant gold, but also with the intention of avoiding savegame bloat. But I start to think there's something wrong here - either because I have misunderstood something about OBSE arrays, or because the OBSE array functionality still has some problems when calling ar_Erase with an index in the middle of the array. There was a major error in a earlier OBSEv18 version, but is supposed to be fixed in v18b4. Anyway, I will try to test and look for problems with this myself this evening.

DWS: have you saved and then loaded a savegame between this time and the previous time you traded with those merchants, and is it possible that some other merchants have been completely reset in the meantime?
User avatar
Lloyd Muldowney
 
Posts: 3497
Joined: Wed May 23, 2007 2:08 pm

Post » Fri May 27, 2011 2:10 am

Yes.
User avatar
Philip Rua
 
Posts: 3348
Joined: Sun May 06, 2007 11:53 am

Post » Fri May 27, 2011 12:32 pm

I have a differnet problem than others it appears. While trading with a merchant, after selling a few items, their gold starts to go down more than the gold I receive. For example, I sell an ingredient that sells for 12 gold but the merchants gold goes down by like 56 gold. It is repeatable with all the merchants in the IC Market district.
User avatar
Emma-Jane Merrin
 
Posts: 3477
Joined: Fri Aug 08, 2008 1:52 am

Post » Thu May 26, 2011 11:36 pm

I have a differnet problem than others it appears. While trading with a merchant, after selling a few items, their gold starts to go down more than the gold I receive. For example, I sell an ingredient that sells for 12 gold but the merchants gold goes down by like 56 gold. It is repeatable with all the merchants in the IC Market district.


I was waiting to speak up on this one has well. Perhaps we both tweaked something in our ini values that is causing it.

Did you activate the Main Quest feature has that would most likely affect IC Ones the most. I did that has well.

Also noticed that I bought a item back and gold went down instead of going up. But have not been able to duplicate it yet.
User avatar
Ray
 
Posts: 3472
Joined: Tue Aug 07, 2007 10:17 am

Post » Fri May 27, 2011 3:05 am

I have a differnet problem than others it appears. While trading with a merchant, after selling a few items, their gold starts to go down more than the gold I receive. For example, I sell an ingredient that sells for 12 gold but the merchants gold goes down by like 56 gold. It is repeatable with all the merchants in the IC Market district.
Thanks for reporting, but if you can repeat it, please do so with debug set to 1, and report exactly what EE writes to the console for each sale.

Same for you Corepc - can you please set debug to 1 (I will have it on by default in the next update). Then, if anything like this happens, open the console and report (text or screenshot) what EE writes to the console. I have pretty extensive debugging going, and will hopefully be able to make something out of it.

It is now my main priority to get rid of any possible bugs, so any reports with debug info is very welcome.
User avatar
Josh Sabatini
 
Posts: 3445
Joined: Wed Nov 14, 2007 9:47 pm

Post » Fri May 27, 2011 7:14 am

I have now released version 2.1.2.

The main focus of it is to find the source of the 0 gold bug that some people report. To do this, I have added more debug text, and set debug on by default. So I really, really hope people can download and use this version, and report the debug text if the 0 gold bug or any other weirdness happens.

An additional, manual debug listing of the merchants currently stored by EE can be found by pressing "L" while in gamemode. This can be changed/turned off in the ini - look for "testKey". Please use this if you think some of the merchant data seems incorrect (i.e. 0 gold bug).


Finally, I have added a manual solution for those encountering the 0 gold bug. If you hold down left shift (by default, but can be changed in the ini - look for singleResetKey) when activating a merchant, his gold will be reset as if it was the first time you traded with him. So if a merchant incorrectly has 0 gold, first open the console and report the debug text. Then leave the merchant's dialog menu, and re-activate him now holding down left shift, and he should have normal gold amount.


Having said this, I will also point out that the mod seems to work as intended for most players, including myself. I haven't encountered the 0 gold bug a single time myself. So the mod is pretty safe to try out even if the problems seems to have focus now, and it is also safe to remove again afterwards, as long as you remember to reset all merchants' gold first.


Edit: TESNexus seems to be acting up - I guess it takes some time before the download will work. PES has it available though.
User avatar
Bambi
 
Posts: 3380
Joined: Tue Jan 30, 2007 1:20 pm

Post » Fri May 27, 2011 12:33 am

Is there any change regarding the mentioned save game bloat?

I will download the new version this evening and will try to encounter and hunt some errors :shifty:
User avatar
Kelvin
 
Posts: 3405
Joined: Sat Nov 17, 2007 10:22 am

Post » Fri May 27, 2011 10:02 am

TheNiceOne: Have you considered creating a debug log for EE if the user has Pluggy installed? It may help you find the 0-gold-bug faster due to the increased amount of debug info prior to the bug. From what I've read so far everytime the bug was reported and debug was provided, you asked a few things related to the interaction with that merchant prior to the bug. It seems like a good idea to (optionally) log everything EE does in a seperate file with Pluggy. But you may have already considered it and either added it or chose not to add it. :)

RE: Savegame bloat The fact that the obse co-file went from 300Kb to 10Kb makes perfect sense. Enhanced Economy (and alot of other mods these days) use OBSE's array (and string) functions and their info is stored in this file. When nothing needs to be stored the file is very tiny, only when arrays and strings are created does the size increase. For what it's worth, 300Kb is relatively low for an obse co-file, most of mine are 1.1Mb with save sizes of 14Mb (yea yikes :P).

Although I do not know why it would cause noticable longer loading times, maybe in theory if the co-file was really really big but I don't think that is the case here. Maybe ask in the OBSE thread. Or temporarily move the obse co-files and see if that lowers the loading times aswell. It should tell you if the increased loading times came from the obse co-file or (somehow) from EE itself. Ofcourse it'll break any mod relying on the data that is stored in those files but you'll only be doing it as a test. ;)

-kyoma
User avatar
Prisca Lacour
 
Posts: 3375
Joined: Thu Mar 15, 2007 9:25 am

Post » Thu May 26, 2011 11:32 pm

Is there any change regarding the mentioned save game bloat?
I did some tests and examined my code, and found one save-game bloating instance - every time you looted something, a string variable containing its name would be added.

I added a destruction of this string_var to remove bloat from looting. I cannot guarantee that there are more, but I will keep looking for it. But as Belanos indicated, this is a save game bloat that is less problematic than standard save game bloat (PlaceAtMe), because one clean save (without EE installed) will remove it.


I will download the new version this evening and will try to encounter and hunt some errors :shifty:

Thanks :)
User avatar
alyssa ALYSSA
 
Posts: 3382
Joined: Mon Sep 25, 2006 8:36 pm

Post » Thu May 26, 2011 8:38 pm

Was finally able to get all the mod updates off nexus that I wasn't able to access this weekend - except this one.

I get a really strange error - the new download window opens but then flashes gray and writing I can't read really fast.

Never seen that before.
User avatar
Scared humanity
 
Posts: 3470
Joined: Tue Oct 16, 2007 3:41 am

Post » Fri May 27, 2011 4:32 am

kyoma: Thanks for info. I agree that 300K shouldn't affect load time much. I did find one user-defined function (called each time you loot anything) that used a string_var without destroying it before returning. I guess this adds some bloat, but I guess most of it is natural from the arrays I need.

Was finally able to get all the mod updates off nexus that I wasn't able to access this weekend - except this one.

I get a really strange error - the new download window opens but then flashes gray and writing I can't read really fast.
I get the same. I think it may be since it was uploaded after the crash. It didn't help to re-upload it either (I tried). I guess I should report it. But in the meantime, you can download it from PES.
User avatar
Kitana Lucas
 
Posts: 3421
Joined: Sat Aug 12, 2006 1:24 pm

Post » Thu May 26, 2011 8:45 pm

But as Belanos indicated, this is a save game bloat that is less problematic than standard save game bloat (PlaceAtMe), because one clean save (without EE installed) will remove it.


Yes, it didn't really cause any problems, at least not at the point where I discovered it. It just started to make make my saves take an annoyingly long time to complete. It wouldn't have been a big problem even then except that I use Streamline and have it save every 10 minutes.
User avatar
Averielle Garcia
 
Posts: 3491
Joined: Fri Aug 24, 2007 3:41 pm

Post » Fri May 27, 2011 12:46 am

Although I do not know why it would cause noticable longer loading times, maybe in theory if the co-file was really really big but I don't think that is the case here.


It wasn't the loading that was taking a long time, it was the saving.
User avatar
NO suckers In Here
 
Posts: 3449
Joined: Thu Jul 13, 2006 2:05 am

Post » Fri May 27, 2011 2:08 am

Streamsaves, I guess? I do not know the root causes, but streamsaves take much longer than manual saves for me, since... years already.
User avatar
Mélida Brunet
 
Posts: 3440
Joined: Thu Mar 29, 2007 2:45 am

Post » Fri May 27, 2011 8:22 am

Streamsaves, I guess? I do not know the root causes, but streamsaves take much longer than manual saves for me, since... years already.


It was all saves, not just the ones made by Streamline. I have a feeling that the two problems might indeed be related as Nice One suspects, as it only happened after I got the 0 gold bug.
User avatar
Heather beauchamp
 
Posts: 3456
Joined: Mon Aug 13, 2007 6:05 pm

Post » Fri May 27, 2011 4:00 am

Sounds like the bug might cause it to have trouble processing the arrays for the save.
User avatar
Jessica Raven
 
Posts: 3409
Joined: Thu Dec 21, 2006 4:33 am

Post » Fri May 27, 2011 3:09 am

Yes, I now think that something goes a bit wrong with the arrays, during save, or more likely, during savegame load. I have checked and re-checked my code, and can really not see any place for the 0g bug to come in - unless the arrays get somewhat broken. And since (if I have understood things correctly) problems with array during savegame load is the main problem that is holding OBSE 18 from going final I begin to think that the problem is within OBSE and nothing I can do until the OBSE team releases a new version.

I may of course be wrong, and I very much appreciate debug message reports for anything you may think is weird in your games, be it 0 gold or anything else.
User avatar
RUby DIaz
 
Posts: 3383
Joined: Wed Nov 29, 2006 8:18 am

Post » Thu May 26, 2011 9:12 pm

Hey, I just encountered the 0 gold bug for the first time.
The bug occurred at Halfway Inn.
Here is the debug messages:

EE:Merchant of type 7, spellseller: 0
EE:Adding Pomona at 10
EE:Starting gold is calculated to zero, with investment at 0
EE:Player Merc 46, Merchant Merc 58, Disposition 49, Global economy 0.95
EE:Factorsum 0.51, Sell value 51, Buy value 211
EE:Starting barter with merchant Pomona, with 0 gold

I should also add that I haven't traded with her for at least 2 weeks (ingame).
User avatar
saharen beauty
 
Posts: 3456
Joined: Wed Nov 22, 2006 12:54 am

Post » Fri May 27, 2011 4:13 am

Hey, I just encountered the 0 gold bug for the first time.

Thanks, because this report really helps me forward. :)

What the debug text says is that you have not traded with this merchant within the reset interval (something you've already confirmed)... and that EE receives 0 from the call to GetBarterGold.

In other words, when EE sees that you activate a merchant for which it has no data, EE uses GetBarterGold to find out the merchant's regular gold. And in this case it returns 0!

The questions then are:
1) Why is GetBarterGold returning 0?
2) Can I do something to avoid it returning 0?
3) And can I avoid 0 trade gold in case it returns 0?


...and the answers so far are:

1) I don't know. But my guesses are: a) You have already traded with the merchant down to 0 gold, and EE fails to reset the gold when reset interval is passed. B) There is a bug in SetBarterGold/GetBarterGold or both.
I must admit that a sounds more likely than b, though I am pretty sure of my code here, and since I use the same code for every reset, I find it hard to believe that it fails (only) a few times.

2) That depends on the reason. I will look into it though. But a question to you (and everyone else) noticing the same. If you have a savegame from just before you activated the merchant, can you load that and then do two things: 1) before activating the merchant, open the console, click on the merchant and then write: "set tnoEE.eeTemp to GetBarterGold" followed by "show tnoEE.eeTemp" and see if the returned value is 0. 2) Activate the merchant again and see if it still is zero.

3) What I can do is to see if a merchant I don't have trade data for, has zero gold. If so, I can assume that something is wrong, and I can 1) Give it the gold as defined in the CS, or 2) Give the standard amount of gold for its mercantile skill. This is a way of completely hiding the bug instead of finding its source, but I guess that doesn't matter as long as it is not noticeable.


Anyway, thanks for the report, and please give me more of them if possible :)
User avatar
Isaiah Burdeau
 
Posts: 3431
Joined: Mon Nov 26, 2007 9:58 am

Post » Fri May 27, 2011 1:04 am

Here's your problem in that case: http://i34.tinypic.com/258phcn.jpg

Pomona is defined with zero gold.
User avatar
Julia Schwalbe
 
Posts: 3557
Joined: Wed Apr 11, 2007 3:02 pm

Post » Fri May 27, 2011 11:21 am

Here's your problem in that case: http://i34.tinypic.com/258phcn.jpg

Pomona is defined with zero gold.


Ohh..right.. :embarrass:
I feel so stupid now
User avatar
Haley Merkley
 
Posts: 3356
Joined: Sat Jan 13, 2007 12:53 pm

Post » Thu May 26, 2011 8:55 pm

Ohh..right.. :embarrass:
I feel so stupid now
Don't feel that way. A merchant being defined with zero gold is rather odd, and unexpected.

But, TheNiceOne will need that information for his debugging.
User avatar
Austin Suggs
 
Posts: 3358
Joined: Sun Oct 07, 2007 5:35 pm

Post » Fri May 27, 2011 9:17 am

The possibility of a merchant starting out with zero gold hadn't crossed my mind either. Maybe I should add a chance of at least having a little gold?

Anyway, a false report is better than no reports. I have still not received any debug reports for 2.1.2 even though it has received more than 300 downloads so far. In one way I guess I should be happy, as it indicates that the bug happens very rarely, but I still really want reports with debug text in order to really find the source...
User avatar
Vicky Keeler
 
Posts: 3427
Joined: Wed Aug 23, 2006 3:03 am

Post » Thu May 26, 2011 10:53 pm

I'm beginning to think that the problem might be in the way the mod is keeping track of the reset time values. The I've only ever encountered it when I've had the reset time value higher than one. And yes, it is a rare bug. The last time I ran into it I had been playing for hours before there was ever an issue.
User avatar
Lewis Morel
 
Posts: 3431
Joined: Thu Aug 16, 2007 7:40 pm

Post » Fri May 27, 2011 5:05 am

I'm beginning to think that the problem might be in the way the mod is keeping track of the reset time values.
I see what you mean, because the error seem to pop up together with EE saying you traded with the merchant 0.0 hours ago.

But what I do to keep track of the reset is actually very simple. Whenever you activate a merchant for the first time, I have the line:

let merchant_list[merchant_index][3] := GameDaysPassed * 24 + GameHour
, which is setting the 4th variable for that merchant to the exact time you activate him.


Then, the next time you activate him, I have the line
let eeTempF := GameDaysPassed * 24 + GameHour - merchant_list[i][3]
, i.e. simply subtracting the last visit time from the current time, to find the how long ago the last visit was.

Then the code checks if this delay is higher than the reset timer, and if so resets the gold. And the code does the same on savegame load. So this part of the code is really very simple, and yet there's something that goes wrong.

And yes, it is a rare bug. The last time I ran into it I had been playing for hours before there was ever an issue.
But when you first encountered it, would it continue to happen more often then? If so, can you (or anyone else) click "L" just before activating each merchant and check if the merchant's trade data is correct before activation? That would help.


Anyway, time for a http://www.gamesas.com/bgsforums/index.php?showtopic=1045975
User avatar
Kill Bill
 
Posts: 3355
Joined: Wed Aug 30, 2006 2:22 am

Previous

Return to IV - Oblivion