Saturday, 2010-01-16

*** tpb has joined #freeorion00:00
*** mithro has joined #freeorion01:04
*** bernardh has quit IRC03:10
*** mithro has quit IRC03:47
*** STalKer-X has joined #freeorion04:23
*** STalKer-Y has quit IRC04:39
*** GeofftheMedio has joined #freeorion04:50
*** GeofftheMedio_ has quit IRC05:08
*** dunno has joined #freeorion05:57
dunnohi06:11
dunnoany activity?06:11
dunnoGeofftheMedio?06:11
GeofftheMedioyes?06:11
dunnocool, you're here06:11
GeofftheMediommhmm06:11
GeofftheMediotyping my name makes it flash06:12
dunnolooks like the lead programmer hasn't commited anything for a while o_O06:12
GeofftheMedionope, tzlaine's been busy06:12
dunnowell, I was hoping to contribute code06:12
dunnoso I thought I'd stop by and talk to you first06:13
GeofftheMedioprobably a good idea06:13
dunnoso uh, yeah...expertise-wise...uh, C/C++, Perl, some ASM06:13
dunnothereabouts06:13
dunnobut I don't think you guys use Perl06:13
dunnoso nm that06:14
GeofftheMedioC++ and Python06:14
dunnobasically, I'm pretty open to do anything...probably more so engine work, though06:14
dunnosince well, that's kinda what I do at work lol06:14
GeofftheMedioif you know ogre3d, you could probably pick up some of the combat system work that tzlane's been neglecting06:15
dunnohrm...don't know ogre3d, but shouldn't be too bad06:16
dunnoat the end of the day, they're all pretty similar06:16
GeofftheMedioyou might also look at this page: http://freeorion.org/index.php/Programming_Work06:16
tpbTitle: Programming Work - FreeOrionWiki (at freeorion.org)06:16
dunnoyup, took a look earlier06:17
dunnobut I wasn't sure what needed to be worked on first06:17
dunnoanyway, I'll look into the code, and thanks for the pointer =)06:18
GeofftheMediothere's not really anything that needs to be done first...06:18
GeofftheMedioI'd rather you find something you're interested in and will be motivated to work on, at least at first06:19
dunnohow many contributors are there?06:19
dunnoor how many active ones?06:19
dunnok06:19
GeofftheMediodepends on definition of active...06:19
dunnowell, I don't think it'd be constructive for me to find something I'm interested in...I'd end up writing GPGPU work or some inner loop optimization =(06:19
dunnoI saw that code-wise, you've been the only one active for the past 2 months =P06:20
GeofftheMediosome of my commits were on behalf of others06:20
GeofftheMediobut I've done most of the code commits recently, yes06:20
dunnoah06:20
dunnoI hope I don't get confused by the templates o_O06:25
GeofftheMedioit's not the templates that are the problem really... it's the error messages they can produce06:26
dunnoI just find templates to be a problem in general06:27
dunnowe're banned from using templates at work - gets in the way of build times and runtime performance...so I don't have too much experience with it06:27
GeofftheMediobuild times, sure, but runtime performance?  how do you figure?06:28
dunnoa lot of the code in our games are low-level optimized06:28
dunnousing templates tend to mess up memory alignment and what now06:29
dunnonot*06:29
dunnoand it usually ends up being a crutch for a lot of people...and people start wandering into STL territory, which just becomes a crapfest06:29
GeofftheMediosounds like you just don't like C++ and would rather work in C and ASM ?06:30
GeofftheMedioor at least your company06:30
dunnowell, just engine06:30
dunnogameplay do their own thing06:30
dunnoI think most people in the engine group just use C++ for the friendlier syntax06:31
dunnolike, no need to typedef structs lol06:31
dunnoinheritance is somewhat of a no-no for the most part...mostly because of the tendency to use virtual functions06:31
dunnowhich is an extra lookup and potential cache miss06:32
dunnoand a pipeline stall06:32
GeofftheMediowhat are you writing...?  The next cryengine?06:32
dunnohaha, it's been this way since the PS2 days (I wasn't there)06:33
dunnosupposedly at the end of the PS2 life cycle, the entire engine was in ASM06:34
GeofftheMedioI'm skeptical that avoding all of modern c++ features is really that necessary...06:34
GeofftheMediosure, optimize your inner loops, but avoiding the STL entirely?06:34
dunnoSTL can kinda work06:34
GeofftheMediomost implementations are pretty well written, I hear...06:34
dunnolike the EASTL06:34
dunnowell, they're well written for the general case06:35
dunnobut that's kinda the problem...when something is done for the general case, it's slow across the board06:35
GeofftheMediohave you checked that with profiling recently?06:36
dunnoI mean, I'm personally not that picky...but maybe because I'm not as "advanced" as most of them06:36
dunnoI think most people just stopped profiling...they kinda know it by heart already o_O06:36
dunnoI think the canonical example for bad STL is using vector naively06:37
dunnoevery time that thing has to expand, that's thousands of cycles lost06:37
GeofftheMedioso, just reserve whatever space you'll need beforehand?06:37
dunnonew? delete? yeah, they get called...once during initialization, and once during shutdown =P06:37
dunnoright, exactly06:37
dunnobut then what's the point of using the vector?06:38
dunnowhy not just use an array?06:38
GeofftheMedioa vector can do a lot more than just automatically resizing itself06:38
dunnoright, push, pop, etc etc06:39
dunnobut the preallocation is exactly what EASTL try to solve06:39
GeofftheMediowhat do you need a custom implementation for?  there's a reserve() function in the standard06:39
dunnocustom implementation?06:42
dunnooh, EASTL06:42
GeofftheMedioI suppose they probably have their reasons.  or had them, and then stick with what they're using since that's what everyone else in EA uses...06:42
dunnowell, EASTL is just what I heard06:43
dunnothat's basically the attempt at getting it to work in consoles06:43
GeofftheMediohmm.  that would make more sense than the optmizations thing.06:44
dunnoI guess, for example, if I were to do vector.at(5) or vector[5] (doesn't matter which), what does it compile to?06:45
dunnodoes it compile to some inline function?06:45
GeofftheMediowell, vector::at and vector::operator[] aren't the same thing, since one can throw an exception if out of range06:46
dunnoah, k06:46
dunnothen the more optimized one06:46
dunnowhich I'm guessing is the []06:46
GeofftheMedioI imagine [] would be inlined most of the time06:46
dunnoso, [] sets up the stack, do the address computation, fetch, stuffs the result in the register, and return from stack06:47
GeofftheMedionot if it's inlined...06:47
dunnoI think inline still involves a couple of instruction overhead?06:48
dunnoand also, there's the extra indirect from the vector itself to access the array pointer06:49
dunnounless that's stored at offset 006:49
dunnoactually, probably not06:49
dunnooffset 0 is probably the size06:49
GeofftheMediofrom the MS STL:  vector::operator[]:   return (*(_Myfirst + _Pos));06:50
GeofftheMedio+Myfirst is a pointer to the array06:50
GeofftheMedioif inlined, it'd just be a single pointer arithmatic, which you'd also need for an array, and then a dereference06:50
dunnoright, so that'd be this+offset06:50
dunnothis+_Myfirst_offset+_Pos06:51
dunnoas opposed to array_addr+_Pos06:51
dunno(obviously, _Pos decomposes into size * n...but that's equal in both cases)06:51
dunnobut I mean, you're right, it's not too much overhead06:52
dunnobut then I see code like:06:52
dunnov.push_back(N); // append int N to the end of the array06:54
dunnoand this is just filling in the vector for a basic Sieve algorithm06:54
dunnoSieve of Erototholes (however it's spelled)06:54
dunnothat's lots of =(((06:55
dunnoI mean, I definitely sound picky06:55
dunnobut I'm really just trying to see all sides of the story...and at work, it's pretty one-sided :O06:55
GeofftheMediosure, that could be a bottleneck.06:56
GeofftheMedioif you've ever used matlab, and you do something like06:56
GeofftheMediofor n = 1:1006:56
GeofftheMediox(n) = n;06:56
GeofftheMedioend06:56
GeofftheMediothen it will actually pop up and say, hey! you're making the array bigger each time, and it migh be faster to preallocate06:56
dunnohahaha06:57
dunnooh man, matlab...so long ago :X06:57
GeofftheMediosame thing applies to C++, and you can use reserve to avoid the occasional reallocation that would result06:57
dunnoit says from your profile that you're a grad student?06:57
GeofftheMedioyes06:57
dunnofrom where, may I ask?06:57
dunnoand what field?06:57
GeofftheMedioalso, if you were filling a seive, you'd probably know how big the array was to start, and wouldn't push_back the numbers, but would instead iterate through it with a vector::iterator or using an index and operator[]06:58
GeofftheMedioUBC, medical physics06:58
dunnoright, I know...but I think the point that everyone makes is that it's so blackboxed that it's too simple to make the mistake06:59
dunnoooh, medical physics06:59
GeofftheMediocalculating primes being a somewhat optimization-centric activity, you'd actually worry about that sort of thing, but if it was something simpler and less time-critical, you'd worry06:59
GeofftheMedioand really, why worry at all unless the profiler says it's a bottleneck?06:59
GeofftheMedioer, you'd not worry06:59
dunnowell, I mean, if a piece of code is equally crappy, then I'd say the profiler would end up saying everything's the same...which some people would think "oh, that's just how long it takes to run this"07:00
dunnobut maybe that's slightly contrived07:00
dunnoso what does medical physics do? I mean, I can understand biochem...but I'm not sure how physics factor into medicine?07:01
dunno(just not familiar with the discipline)07:01
dunnosorry, ignore that question...I'm just going to do the google07:03
GeofftheMediothe profiler would tell you what functions you're spending the most time in during execution.  those are the ones you worry about optimizing.  if you run an initization routine that takes 300 ms, and could optimize it to 100, and then run 100000 iteratorion of something that takes 2 ms but could be optimized to 1 ms, which is more important?  the 1 ms gain, or the 200 ms gain?07:03
GeofftheMediomedical physics deals with medical imaging (MRI, CT, ultrasound, PET, SPECT, etc.) and radiation therapy of various types07:04
dunnothe 100000ms gain =P07:04
GeofftheMedioexactly... which the profiler would tell you, since your code is spending so much more time in that code than the initialzation code07:05
GeofftheMediobut spending any time at all on the initization optimization isn't worth the effort until you reduce the real time sink first07:05
dunnoI definitely agree07:06
dunnobut I think most of my coworkers operate at the level that everything is already optimized07:06
dunnoat least, algorithmicly07:07
GeofftheMediothen they're probably writing hard-to read code07:07
GeofftheMedioand if they're not profiling, they may be surprising about what actually takes up the most time07:07
GeofftheMediobut if they're as hard core as you're making them sound, they probably are profiling as well07:07
GeofftheMedioand just avoid unnecessary cycle wasting out of habit07:07
dunnoI think in general, most things have been taken into consideration07:09
dunnocache lines/alignment, L1/L2, prefetching, odd/even pipeline rebalancing, stalls/bubbles, load-hit-store, etc...07:10
dunnoI think most things (other than odd/even pipeline rebalancing/instruction scheduling and ASM programming) can be determined from C/C++ end07:10
dunnoso the general practice is to avoid or hide the latency07:11
GeofftheMediodepends on your compiler, I suppose.  maybe it's all very controllable on consoles...07:11
dunnoso it mostly boils down to compilers07:11
dunnoit's controllable in some ways07:12
dunnobut in other ways, it sucks07:12
dunnolike the GCC compiler on consoles suck total nads07:12
dunnowell, GCC kinda sucks in general07:12
dunnobut sometimes, it's the only thing available07:12
GeofftheMediohmm07:14
dunnoso I mean, when things are fairly optimized, then what gets inspected next are what the fundamental types are doing07:14
dunnoso if a vector is taking one more instruction, then it'll probably get gutted07:14
dunnofurthermore, how does a vector allocate its memory?07:15
dunnodoes it do "new" internally?07:15
dunnoah, you can pass it an allocator07:16
*** mithro has joined #freeorion07:16
GeofftheMedioprobably depends what it's storing...07:16
GeofftheMedioif it's POD or a complicated object with its own constructor defined07:16
dunnowell, I don't think that'd be the fault of the vector then07:17
dunnounless the vector invokes the new on the object stored in its internal array07:17
dunnoif anything does "new/malloc" or "delete/free" behind our backs, it's something that gets gutted right away07:18
GeofftheMediogenerally we don't store a lot of complicated objects in vectors... it's more likely there'd be an array of pointers, or map of pointers07:18
dunnooh no, I'm not criticizing FO07:19
dunnoI'm just speaking academically07:19
dunnoI'll just work with whatever FO has07:19
GeofftheMedioI didn't meant o imply you were07:19
dunnohaha07:19
dunnoI just really really liked MOO207:19
dunnoand THERE WAS NO MOO307:20
dunnoIT NEVER EXISTED07:20
GeofftheMedioso I haven't heard07:20
dunnohaha07:20
dunnoyou probably get that a lot07:20
dunnofor me, I just want to play the game07:20
dunnowhich is why I'm trying to see what I can do to help out07:21
GeofftheMediommhmm.07:24
GeofftheMediowell, if you don't know ogre well, jumping into the graphical combat system probably isn't practical right away07:24
dunnothat's fine07:27
dunnojust think of me as a body07:27
dunnowhereever works07:27
dunnonot like I'm godly or anything07:27
GeofftheMedioThere are a lot of UI tasks listed, some of which might be approachable to start with07:28
GeofftheMedioif you could write something to replace the graphviz stuff that's used to do the tech tree layout, that would be nice07:29
GeofftheMediobut you could also just make the tech tree look nicer, with tech panels that resemble fleet data panels in the fleets window07:29
dunnoI'll look in that general area then =)07:43
dunnoare there shortcuts to load directly into certain parts of the game?08:02
dunnosuch as combat or what not08:02
dunnowow, I think I just experienced first hand how long it takes to compile template-heavy code....08:05
GeofftheMediotypically takes about 30 minutes for me for FreeOrion itself, though I've got a laptop running at 1.8 MHz08:06
GeofftheMediothe initial stages of the 3D combat view can be started by running freeorion --tech-demo08:06
GeofftheMediootherwise you can run freeorion -q to quickstart immediately using the settings from your last game, or default settings08:06
dunnonice08:07
GeofftheMediofrom there, you can get to any "part" of the game by clicking one of the buttons to open a screen like research or design...08:07
GeofftheMediothere are no scenarios or provided test save games, though08:07
dunnothat's fine08:09
dunnoso uh, is:08:10
dunno    void RenderTechPanel(TechType tech_type, const GG::Rect& main_panel, const GG::Rect& progress_panel,08:10
dunno                         GG::Clr interior_color, GG::Clr border_color, bool show_progress, double progress)08:10
dunnothat what you're referring to as the graphvis stuff?08:10
GeofftheMediono... that just renders a tech panel08:13
dunnoright, just looked further08:14
GeofftheMedioTechTreeWnd::LayoutPanel::Layout has all the graphviz calls08:14
GeofftheMedioit's kind of a mess...08:17
GeofftheMediobut it's not that imporant since the suggestion is to replace it all with your own tech layout code08:17
dunnohuh...then I'll need to read what the criteria are for the tech tree08:18
GeofftheMediothere's not much...08:19
GeofftheMediojust position all the techs, and figure out how to draw the dependency arcs between them08:19
GeofftheMedioby which I mean decide where all the nodes in the curves are08:20
dunnoright08:20
dunnobut then there must be some sort of ordering for the techs08:20
dunnoe.g. level 1 tech, level 2 tech08:20
GeofftheMediotechs have prerequisites08:20
dunnoand those would logically be aligned08:20
GeofftheMediothat's it08:20
dunnoah ok08:20
dunnobut techs have cost08:20
GeofftheMedioit might be nice to be able to specify a rank for techs08:20
dunnoor some other attribute08:20
dunnoright, exactly08:21
GeofftheMediocost doesn't necessary equate to rank08:21
dunnoof course08:21
dunnobut there should be some sort of ordering08:21
GeofftheMedioand if you let the tech definitons specify a rank, you'll end up having to deal with inconsistent ranks and dependencies08:21
GeofftheMediolike a leve 3 tech depending on a level 5 tech08:21
dunnoright08:21
dunnoso ranks shouldn't be defined as such08:22
dunnoand should be defined as, say, the number of prerequisites08:22
dunno(+1)08:22
dunnoor this could all be sortable08:22
dunnoby cost, by "rank", etc etc08:22
GeofftheMedioalso, "cost" is tricky, since there are both minimum time to research, and maximum research applied to the tech per turn08:22
GeofftheMediothe product of which is the total cost08:22
dunnothen we can just break that down08:23
dunnoand the sorting isn't sorted by the total08:23
GeofftheMediothere is also a tech list, which needs to be made into a separate window, and made sortable, etc.08:23
GeofftheMediobut that's a separate issue...08:23
dunnosorting is, afterall, a one dimensional thing...there's no reasonable way to collapse a truly two dimensional problem down08:23
dunnohehe08:23
GeofftheMediofor the tech tree, you could position techs horizontally by total cost, although doing that naively would leave some big gaps that would look bad08:24
dunnoI think it's best to just let the user select08:24
GeofftheMedioI suppose you could do a histogram normalization to decide how to spread the techs out...08:24
dunnosince this is an information visualization problem08:24
GeofftheMediouser meaning player, or content designer?08:24
dunnoplayer08:24
GeofftheMediofor the list of techs, sure, the player should be able to sort however they want08:25
dunnoright08:25
GeofftheMediobut for the tree, it needs to respect the tech dependencies08:25
dunnoright08:25
dunnoI'm thinking along the lines of civ tech08:25
dunnociv's tech tree, that is08:26
dunnoand that the display of the tree should be based on the < operator08:27
dunnoin a left-right tree view08:27
dunnoA is on the left if A < B08:28
GeofftheMediohave looked at the current freeorion tech tree?08:28
dunnohaha08:28
dunnoI was caught08:28
dunnoI was going to say that "maybe I should look at this before I say anything else", but I got carried away08:28
GeofftheMediommhmm08:28
CIA-72FreeOrion: geoffthemedio * r3324 /trunk/FreeOrion/server/ (ServerApp.cpp ServerApp.h):08:30
CIA-72FreeOrion: -Moved server combat processing into a separate ProcessCombats function from ProcessTurns08:30
CIA-72FreeOrion: -Grooming in ServerApp.h08:30
*** mithro has quit IRC08:57
*** mithro has joined #freeorion08:58
*** mithro has quit IRC10:33
*** enigmatic has joined #freeorion12:01
*** enigmatic has quit IRC12:51
*** enigmatic has joined #freeorion12:54
*** Phazorx has joined #freeorion14:22
Phazorx.14:24
*** enigmatic has quit IRC15:43
*** enigmatic has joined #freeorion15:43
*** _Magic has joined #freeorion16:21
*** _Magic has quit IRC16:45
*** dunno has quit IRC16:46
GeofftheMedioPhazorx: ~17:18
*** dunno has joined #freeorion17:52
dunno.18:56
GeofftheMedio~19:00
*** bernardh has joined #freeorion19:43
*** mithro has joined #freeorion20:44
*** bernardh_ has joined #freeorion20:48
*** bernardh has quit IRC20:50
*** bernardh_ is now known as bernardh21:36
dunnoOH GOD22:20
dunnowhy is it so slow?!22:20
GeofftheMedio?22:20
GeofftheMediowhat is it?22:20
dunnohrm22:20
dunnoweird22:20
dunnoI tabbed out, and it's fine now, whee22:21
GeofftheMedio... not helping clarification...22:21
dunnooh22:21
dunnolooking at tech tree22:21
GeofftheMediooh22:21
dunnojust got it working22:21
GeofftheMedioyeah, it's pretty unoptimized22:21
GeofftheMedionot sure why exactly22:21
dunnoyou mean, other than all the immediate mode calls, and calculating all the curves on the fly?22:22
GeofftheMedioI think the layout gets redone for each zoom level22:22
dunnoyup22:22
dunnothat certain seems like it22:22
GeofftheMedioI haven't looked into the curve rendering, but those should probably not need to be redone each frame22:23
GeofftheMedioprobably offscreen techs shouldn't be rendered22:24
GeofftheMediowhen zoomed out, simplified panels should be swapped in as details won't be visible anyway22:24
GeofftheMediooptimized rendering would be nice, though immediate calls would be nice to retain as a backup in case people don't have sufficient opengl support22:25
dunnouh...isn't the base OGL2.0?22:25
GeofftheMedioyeah, but a lot of people don't actually have support for it22:26
GeofftheMediowith most of the rendering options turned off, FO will run under gl 1.522:26
dunnoI don't see much point in supporting 1.522:26
dunnobut whatever =P22:27
GeofftheMedioideally we wouldn't need to, but lots of video cards still don't support 2.0... particularly on netbooks, it seems22:27
dunno*sigh*22:28
dunnoI really want to rant22:28
dunnobut I don't think it's appropriate22:28
GeofftheMedioI'm not easily offended... but whatever22:29
*** mithro has quit IRC22:39
*** welterde has joined #freeorion23:05

Generated by irclog2html.py 2.5 by Marius Gedminas - find it at mg.pov.lt!