[BUG?] Revenue calculation weirdness


#1

I was doing one of the profit challenges (I’m a completionist, so I’m doing all the Beginner scenario challenges before any of the others, this was the last one :slight_smile: ), so, after I did my last big improvements on the production lines, I was playing close attention to the company tab, my revenue, costs and profit. And I noticed that my profit, while normally climbing steadily, would drop significantly about once a month.

I have a save, where 2 days from the save, the revenue drops about 100 000$, the costs drop about 50 000$, and so the profit drops 50 000$. I don’t think I ever had a day with 100 000$ of revenue, so that is not the normal “last day gets subtracted”.

I guess it could be that the last month gets subtracted, but if that’s what’s happening, that’s silly. First of all, it’s the middle of the month, so it’s weird for it to happen then, the increases happen every day so why should that be different. Also, storing 360 days revenue and costs would hardly take more memory than storing it for 12 months, so it doesn’t make sense to me programming the game that way.

Since the forum doesn’t allow uploading .sav files, I put it up on dropbox.
https://www.dropbox.com/s/z52ouli09ffnoec/CT7%20-%20Revenue%20bug.sav?dl=0

By the way, love the game, thanks for making it! :slight_smile: That’s why I’m reporting bugs, it’s the programmer in me seeing problems and wanting to solve them :slight_smile:


#2

Your third paragraph is bang on. It’s the last month being subtracted.

It’s the middle of the month because the way the month system works in-game is that the period runs from the middle of one month to the middle of the next, this is so that the dots on the graphs appear in the middle of the month. I know this does not affect cashflow but the whole data structure is based on this middle-to-middle structure. Perhaps a bit weird, but it’s too late now.

I had this talk with Cliff about a month ago about the fact that I only store 12 month’s data rather than 365 days. Yeah, it’s probably an unnecessary efficiency saving. It’s less about memory and more about the amount of data I would have to save in the save file (remember there’s up to 4 companies too!). You have to admit that the saves load and save nice and quick. That’s because I’ve been careful to design systems to not need that much saved data.

I don’t think it has an effect on gameplay because the objectives can be fulfilled on any day IE the last day before the 12th historic month is taken out of the calculation. The only time it would affect the outcome is if you would have won in the last 15 days of the entire game, which is cutting it very fine indeed!

Anyway, I won’t be changing it now as it’s likely to introduce more bugs than it fixes. I won’t be changing anything deep in the structure of the game unless it is incredibly broken at this point.


#3

I won one (Master level) of the intermediate levels I think it was on December 28th, right before the Jan 1st cutoff. So it definitely happens! :slight_smile:


#4

Okay, I guess this kinda makes sense to me, but only because your save files a plaintext JSON without even zipping them :slight_smile:

Cheers!

(Of course, even 4 times 365 numbers that are 5 digits each would only take about 9 kB extra space in my save that is already 280 kB on the Beginner scenario save I posted above, so it’s like a 3% increase in size, but this is just me being obnoxious, you probably didn’t know that when you made the decision :slight_smile: And if there were other decisions like this, they might make a real difference in total I guess.)


#5

Ha ha! :stuck_out_tongue_winking_eye: