IRC logs for #openttd.dev on OFTC at 2013-03-03
⏴ go to previous day
05:46:34 *** Supercheese has joined #openttd.dev
08:22:16 *** Alberth has joined #openttd.dev
08:22:16 *** ChanServ sets mode: +v Alberth
10:17:40 *** frosch123 has joined #openttd.dev
10:17:40 *** ChanServ sets mode: +v frosch123
10:20:47 *** DorpsGek has joined #openttd.dev
10:20:47 *** ChanServ sets mode: +v DorpsGek
10:20:53 *** ChanServ sets mode: +o DorpsGek
10:59:43 <frosch123> but reduce the size
11:00:04 <frosch123> i have no idea though, how to display this problem to the user in a useful way
11:00:15 <frosch123> displaying an error message on every start does not sound right
11:00:23 <frosch123> and permanently reducing the spritecache neither
11:02:01 <frosch123> alternatively we can also try to allocate twice the requested size first
11:02:12 <frosch123> so we only ever use at most 50% for the spritecache
11:07:40 <Alberth> std::bad_alloc& oom swap & and the space
11:08:56 <frosch123> hmm, work disease again :s
11:09:33 <Alberth> we throw a warning of missing sprites in the user his face, which seems less serious than lack of memory
11:09:58 <frosch123> well, but he can update to get rid of it :p
11:10:11 <frosch123> i am not sure whether editing the config file is a fair solution
11:10:44 <frosch123> ideally he only gets the message when already playing a nightly :p
11:11:01 <Alberth> oh, that could be, I don't know :)
11:11:23 <frosch123> usually ogfx manages a release before our releases
11:11:28 <frosch123> though i am worried about zbase
11:12:24 <Alberth> I cannot change the sprite cache size from the program, can I?
11:12:35 <Alberth> ie I would need to edit the config
11:13:26 <Alberth> wouldn't I also need to edit the config to get in trouble with claiming I have more memory than I have in reality?
11:14:46 <frosch123> yes, the spritecache size can only be changed via the config file
11:14:50 <frosch123> not even via ingame console
11:15:07 <frosch123> and when using a 32bpp baseset ottd defaults to 512MiB spritecache
11:15:18 <frosch123> which has been too much for various reporters
11:15:45 <Alberth> imho throwing an error on startup would be fine then, as I messed with the config file
11:16:19 <frosch123> well, do you want to throw an error for all netbook users who have less than 512 MiB ?
11:17:07 <Alberth> Silently changing it back would be a step too far, but perhaps report the correct line in the message?
11:17:20 <Alberth> do they sell that kind of machines????? :o
11:17:22 <frosch123> what do you mean with "changing back"?
11:18:09 <frosch123> but ok, we can just throw errors for people with netbooks :)
11:18:16 <frosch123> better than crashing in any case :p
11:18:33 <Alberth> hmm, what about we interpret the number as 'desired', and do as well as possible,
11:18:53 <Alberth> ie if we find less memory, it's ok too
11:18:53 <frosch123> you end up with 5 frames per second in the titlegame :)
11:19:02 <frosch123> that will cause bug reports as well
11:19:27 <frosch123> we got multiple reports for 1.2.0 before we increased the default size
11:20:31 <Alberth> I mean, set it to any size, eg 512MB, we try to reach that, but ignore the error
11:20:57 <Alberth> maybe we should have some minimum that we really want to have though :p
11:21:13 <frosch123> as said, ignoring the error and not reporting anything to the user will result in bug reports "i upgraded ottd, and it runs at 5 fps"
11:21:54 <frosch123> Alberth: we were fine with 4 MiB of spritecache for years, then someone implemented 32bpp and extra zoom :p
11:22:42 <Alberth> make a timer-ish thingie that we report the error once every two weeks?
11:23:35 <frosch123> maybe there is a wiki page about editing the config file, so i could add an URL in the message how to get rid of it :p
11:23:53 <Alberth> on the other hand, throwing it in the face is a good way of telling "you're insane to try this, but go ahead" :p
11:24:59 <Alberth> or we refuse to start up
11:25:53 <Alberth> or refuse to switch to 32bpp blitter
11:26:49 <Alberth> which is somewhat of a problem when your machine does not have 8bpp blitter support :p
11:27:34 <Alberth> well, perhaps changing the config is not that bad, together with an error
11:27:51 <frosch123> yeah, i'll go for that then :)
11:28:01 <Alberth> ie it's the best you can do for that machine
11:28:34 <Alberth> hmm, start many apps, start openttd, and get a broken mem-config :p
11:29:22 <Alberth> add a 'has run successfully with this mem config' ?
11:30:51 <frosch123> i'll go with just always displaying the error
11:31:02 <frosch123> and see whether we get any complains :p
11:31:53 <Alberth> the alternatives are not that good, that one is safe, at least
12:06:09 <frosch123> displays error on startup or when swithcing to 32bpp in game
12:06:18 <frosch123> also limits the spritecache to 50% of the possible size
12:08:01 <Alberth> is the latter useful? /me reads back for the idea
12:09:37 <Alberth> alternatively we can also try to allocate twice the requested size first <-- why not + 10% or 1MB extra or so?
12:10:55 <Alberth> .. You can try to disable .. -> .. To reduce memory use, you can disable ..
12:10:57 <frosch123> i have no idea how much memory the rest of ottd needs :p
12:11:02 <frosch123> 50% just feels easy
12:12:40 <Alberth> /* Remember 'target_size' from the previous allocation attempt, so we d <-- make that in a doxygen-ish description
12:12:59 <frosch123> doxygen within functions?
12:14:06 <Alberth> is 'uint' enough to store the number?
12:14:56 <frosch123> _sprite_cache_size is 128 max
12:15:38 <frosch123> err, i mean 512 max, so target_size is 2 GB max
12:16:21 <frosch123> that will fail with the 50% thingie
12:17:33 <frosch123> let's change it to 66% then :p
12:18:27 <Alberth> Try to allocate twice the amount than requested to make sure we allocate 50% at most <-- something like "Try to allocate twice the requested amount, to ensure the sprite cache and the other program parts have sufficient space" ?
12:18:47 <frosch123> don't worry, i'll change it completely :p
12:18:57 <frosch123> does the new[] operator use uint or int?
12:19:56 <Alberth> <byte*> needs a space (there are several of these cases, some with other data types)
12:22:44 <Alberth> perhaps add an assert on the final allocation (it would be weird if that fails)
12:26:19 <Alberth> ah, it already has an assert thus :)
12:26:19 <Alberth> That line still has a <MemBlock*>, and please add some '.' at the end of comments.
12:27:27 <frosch123> now only the removed line has a MemBlock* :p
12:27:48 <Alberth> he, we have {BYTES}? nice :)
12:27:58 <frosch123> since content download :)
12:28:55 <frosch123> it does all this GiB, MiB, KiB fancy busyness
12:48:50 *** ntoskrnl has joined #openttd.dev
12:58:39 <frosch123> what do you do after 10000 years?
13:04:13 <Alberth> nothing, the code should never go beyond the last entry :p (hence the '+ 1' in "while i + 1 < len(time_descriptions)")
14:33:57 *** fonsinchen has joined #openttd.dev
14:33:57 *** ChanServ sets mode: +v fonsinchen
15:53:21 *** fonsinchen has joined #openttd.dev
15:53:21 *** ChanServ sets mode: +v fonsinchen
16:08:09 *** Yexo has joined #openttd.dev
18:34:27 *** Ristovski has joined #openttd.dev
19:55:02 *** Supercheese has joined #openttd.dev
19:58:30 *** fonsinchen has joined #openttd.dev
19:58:30 *** ChanServ sets mode: +v fonsinchen
21:57:09 *** Alberth has left #openttd.dev
22:26:16 *** Ristovski has joined #openttd.dev
23:35:12 *** Aphid has joined #openttd.dev
23:36:04 *** Aphid has joined #openttd.dev
continue to next day ⏵