Dev Meeting Minutes (2011-01-10)

Dev Meeting Minutes (2011-01-10)

Minutes of the meetings between Spring developers are archived here.
Post Reply
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Dev Meeting Minutes (2011-01-10)

Post by hoijui »

Date: 10-1-2011 & 11-1-2011
Present: hoijui, abma (late), zerver, jK, Kloot, Tobi

__ Agenda _____________________________________

  • Welcome
  • Release plan
  • Who wants to do what in big refactor?



Welcome
<Tobi> hey
<hoijui> hello :-)
<hoijui> hehe :D
<hoijui> zerver new rank :D
<zerver> :)
<hoijui> guess we should start


Release plan
<hoijui> about a .8:
<hoijui> last week, we decided to make a .8 with bump water shader fixes, the path finder fix for S44, and jk's shadow space linearization (or something like that ;-) )
<zerver> ok
<hoijui> i ported them to the release branch, but the bunp water stuff .. i somehow did it wrong
<hoijui> i forgot what exactly.. but i think it hangs GML build or something
<zerver> u want me to look at it?
<hoijui> or maybe the one who made the commits in the first place...
<hoijui> that would be kloot
<hoijui> i did not upload my ported comits yet, i will do so on my own github repo..
<Kloot> I cannot debug gml builds on my current box
<hoijui> ok
<Kloot> but I assume it's a deadlock
<hoijui> yeah
<zerver> oh yeah, i remember some of your commits adding some locks recently
<hoijui> so it dead-locks in master too?
<zerver> adding locks is risky business :P
<Kloot> more riskier than it should be tbh
<zerver> it probably does lock in master too
<hoijui> https://github.com/hoijui/spring/commits/tmp
<zerver> lua is the reason why locking is such a nightmare in spring
<hoijui> the last 4 commits on that branch (based on current release branch)
<hoijui> should we discuss lua mutli state again? ;-)
<zerver> actually, in my lua split branch, there are some improvements to locking
<zerver> i made a debugger to analyze the locking order and find problem points
<hoijui> wel..
<zerver> and then tried to make the lua mutexes be the one that always lock first
<hoijui> lets move that to end of meeting? or make new point?
<hoijui> btw.. jk and tobi, you here?
<jK> sure
<Kloot> afaict in this there is only ever one mutex involved when creating & reinstancing a water renderer
<hoijui> ok
<Kloot> +case
<hoijui> anythign else to say about 0.82.8.0?
<Kloot> lua doesn't enter into it
<zerver> yeah, but what about opengl calls from the wrong thread?
<hoijui> i guess it is most likely somethign i did wrong when fixing cherry-pick conflicts
<zerver> 82.x does not have glShareLists enabled
<Kloot> doesn't matter either here
<Kloot> only difference is that GL calls from the destructor are now in another thread
<Kloot> but the ctor also makes them
<zerver> that does make a difference
<Kloot> hoijui: can you test master then?
<hoijui> ah yeah, can do that
<hoijui> i'll report back to you when i did that
<hoijui> can we go on then?
<Kloot> k

main points:
  • hoijui will test bump-water changes in master (and maybe temporary release branch)
  • kloot and/or zerver will try to fix stuff

Who wants to do what in big refactor?
<hoijui> i already started to do some stuff with projectiles
<hoijui> moving rendering code to separate files
<zerver> about previous point: any ogl calls from sim thread (not issued by lua) can hang spring
<hoijui> .. just saying so.. nobody else would do big changes there, or coordinate with me
<zerver> did no start any work wrt big refactor
<zerver> and this idea i had earlier about big refactor and possible threading of sim by disallowing all object to directly modify themselves wont work i think
<zerver> and the reason is... guess what... lua :P
<hoijui> what i am doing is basically, moving the Draw() and DrawOnMinimap() into separate files
<hoijui> :-)
<zerver> it is kind of hard to disallow lua to directly modify itself
<hoijui> well.. as a first step, what i change is only going to change something at compile time, really
<Kloot> are you just moving the code into separate files, or also into separate classes?
<hoijui> also separate classes
<hoijui> but the methods are called in the same places, wiht the same effect
<hoijui> i'll upload to a branch on my repo too
<Kloot> so p->DrawOnMinimap(*lines, *points); becomes drawp->DrawOnMinimap(*lines, *points); and drawp stores p?
<hoijui> "make -j4 all" on spring really brings my PC down!
<hoijui> 4 core machine
<hoijui> it becomes:
<hoijui> pOnMinimapDrawer->Render(*p)
<hoijui> while lines and points are handed over to the drawer before that
<zerver> actually it just loads the cpus, machine only becomes unresponsive for real when there is heavy disk access also
<hoijui> theres also pDrawer->Redner(*p)
<hoijui> Render*
<Kloot> ah that works too
<jK> it would be much smarter w/o dynamic casting
<jK> -smarter +faster
<hoijui> cants see how it makes a difference really
<hoijui> its like cast + 100+ lines of code which are all much heavier
<jK> meh gamedev is down
<jK> they have a article about it
<jK> dynamic casting is a problem
<hoijui> yeah.. if there is a nicer way... sure
<hoijui> that is.. dynamic_cast?
<jK> spring uses it ways too often
<hoijui> i dont use that one
<Kloot> for weapon projectiles you would not even need to dyncast, just a switch on WeaponProjectile::projectileType
<jK> dynamic casting can also be indirect via class inherit
<zerver> dynamic_cast is very slow yes
<Tobi> any numbers?
<jK> gamedev is down :<
<jK> their article has numbers
<zerver> if you look in object.h i made some attempt at a faster method
<hoijui> as said, i dont use that
<hoijui> i just cast a pointer
<hoijui> the branch: https://github.com/hoijui/spring/commit ... Separation
<hoijui> the most interesting commit:
<hoijui> https://github.com/hoijui/spring/commit ... Separation
<hoijui> arg
<hoijui> https://github.com/hoijui/spring/commit ... dea5dc80de
<hoijui> this one
<hoijui> this is where i cast:
<hoijui> https://github.com/hoijui/spring/commit ... 80de#L5R11
<Tobi> hmm so only static casts
<jK> virtual functions aren't static
<Tobi> they aren't casts either
<jK> they are something similar
<jK> nearly the same
<jK> from the ops needed
<zerver> they have the same performance impact at least :P
<Tobi> so then there is no performance need to avoid dynamic casts <_<
<zerver> nope
<hoijui> you say, we should not use virtual functions either?
<zerver> if we need performance, no
<hoijui> i can't imagine that this really matters
<Tobi> IMO, what you want first is correctness and good design, once you got that you can optimize the bottlenecks
<hoijui> its like the inlineing thing
<hoijui> inlineing a 40 lines functions makes no sense
<hoijui> yeah
<zerver> it only matters if it is called often
<hoijui> i agree with tobi
<zerver> performance difference is about 10 times
<hoijui> and as we use C++, we should use OO, and i cant imagine nice OO design without inheritance
<hoijui> that is not what matters, it matters in relation to the code inside the function
<zerver> number of lines is not the key point
<hoijui> it is a godo estimate
<hoijui> good*
<hoijui> i know it is not linear to that :P
<zerver> the key point is if the function call needs data to be copied etc, which could be avoided by making it inline
<hoijui> i am pretty sure that there is some optimization at runtime
<hoijui> i mean.. Java is pretty fast by now, and it has all functions virtual, plus it allows t change class structure at runtime, which C++ does not. so C++ can be optimized even better
<zerver> sure, compiler makes lots of stuff inline without asking
<hoijui> i mean, "cacheing" which function is used
<hoijui> mm ok maybe not doing that
<hoijui> but what now...
<hoijui> should we have a vote? or .. jk.. are you going to find reference? or do you agree with what Tobi said?
<hoijui> i dont want to discuss low level shit for hours now
<jK> meh can't find the article with their changed design
<hoijui> you cant remember anything?
[22:42:34] ** Kloot left the channel( Ghosted ).
[22:42:35] ** Kloot joined the channel.
<zerver> i know from testing that dynamic cast is 10 times slower than some custom method, but i dont think we should avoid dynamic casts
<hoijui> ok :-)
<hoijui> i did not do this in master, or merge it there yet so we can discus it first, and in case we need to do fixes in that code that woudl have ot go to 0.82 still
<hoijui> but once everyone is ok with it, i would like to put it in master
<Kloot> I'm not sure I like two drawer classes for _every_ projectile subtype being added
<hoijui> no big hurry as long as nobody else wants to change projectiles a lot
<hoijui> most do not have a minimap drawer class
<hoijui> there is a common one that most use
<Kloot> that's true but all projectile types can use a common minimap and a common world drawer (although the code in them would become uglier)
<hoijui> i think it is 2 minimap drawers for the ~10 projectiles i already did
<jK> meh can't find it, I give it up for today
<hoijui> not sure what exactly yo umean kloot, you mean one class with two methods?
<Kloot> no, I mean this: (sec)
<hoijui> ahh i think i know what you mean
<hoijui> that would mean a lot of "engineering" though, right?
<zerver> i dont like the null checks in GetMinimapDrawer() and GetDrawer()
<hoijui> ah.. or a big switch
<zerver> you should always create the drawers, and remove the null checks
[22:52:00] Error: Command (// Note: This is never deleted, but it is to be (re-)moved anyway) does not exist, use /help for a list of available commands.
<hoijui> // Note: This is never deleted, but it is to be (re-)moved anyway
<Kloot> hoijui: http://pastebin.com/nXBjKMVZ
<hoijui> both these methods will be removed anyway zerver
<zerver> ok
<hoijui> just need to be there for the transition period\
<hoijui> mm ok kloot
<Kloot> so indeed a big switch
<hoijui> well... i do not care much
<hoijui> jk.. could that be the way they did it?
<Tobi> do put the code for each case in a separate method though, please :)
<hoijui> i think the way i did it is nicer, purely OO design wise, but if you want to keep new files lower, that is better
<hoijui> Kloot, is that your main concern, too many classes/files?
<Kloot> yeah your design is more OO-ish, but I dislike so many special-purpose files
<Tobi> since it's C++ we could stuff a bunch of classes in a single file :-)
<hoijui> :D
<Kloot> files and classes* :x
<hoijui> :P
<Tobi> ah :)
<jK> yeah such a switch is a way to solve it
<hoijui> my aproach would allow the smae btw.
<hoijui> or say.. would allow it to mix
<hoijui> similar projectiles coudl share a drawer, using a switch internally (eg, all the laser ones)
<hoijui> and others coudl have separate ones
<hoijui> hmm.. woudl not make it much nicer i guess :D
<Kloot> heh no, there are only two laser types and all the others differ
<Kloot> three lasers*
<hoijui> yeah .. also.. it would possibly be harder to find the drawer that fits a (sim-)projectile
<zerver> yeah, u need a cabinet if the projectile is too big
<Tobi> single drawer class may be nice for stuff that can be shared among projectiles
<hoijui> that would be done with inheritance
<Tobi> yeah but that could get a bit messy in practice, I think (hard to follow the flow without a good IDE, as it might jump from class to class)
<hoijui> yeah that is true
<hoijui> if you use a good IDE, well defined methods, well documented...
<hoijui> i mean...
<hoijui> the idea of making methods is, to not have to know what the method does exactly
<hoijui> method name (plus possibly docu) shoudl be enough
<hoijui> my model also allows to change a renderer at runtime
<hoijui> easily/nicely
<zerver> one other think i dislike is the slight increase in dereferenced pointers "->"
<zerver> -think +thing
<hoijui> it also allows for easier profiling and the like
<Tobi> yeah true from OO POV your solution is nicest
<jK> k found it:
<hoijui> zerver, you mean the getters?
<jK> http://webcache.googleusercontent.com/s ... en&ct=clnk
<jK> http://webcache.googleusercontent.com/s ... en&ct=clnk
<zerver> yeah, u need to read member variables from the drawer classes
<jK> only available via google cache (not copied to new gamedev yet)
<Tobi> getters would be inlined in release build anyway I presume?
<jK> yup, as long as they aren't virtual
<zerver> from a performance pov, no difference, "this" pointer or some other pointer, i just mean for code readability
<hoijui> exactly
<jK> but not all derefernces are optimized, so having "->" in a for-loop is not always auto-optimized
<hoijui> but these getters surely all get inlined.. always
<hoijui> i is like.. the most simple optimization that would be done
<hoijui> could*
<Tobi> nothing of this matters anyway unless its _measured_ to be a bottleneck (sorry I'm so harsh on this but I really really hate premature optimization ;-))
<hoijui> mmm
<jK> it's bad to continue bad designs :x
<hoijui> ?
<zerver> no, im just saying that "variable" is more readable than "p->variable"
<jK> when you know that something is slow, then you shouldn't continue to write it like that
<hoijui> thing is, if the virtual functions would proove to be bad, it could be changed to a compile time polymorphism still
<jK> we know that rendering is slow atm
<hoijui> also.. as the first article mentions, compilers do optmize
<jK> and we even know that minimap particle rendering is slow
<jK> and minimap particle rendering is pure c++ polymorphism
<Tobi> jK: unless the code is more readable with the slower code, or easier to get correct, or cleaner designed (re when you know that something is slow, then you shouldn't continue to write it like that)
<hoijui> so if the class you call the virtual function on has no classes that derive from it, it can be converted to a non-virtual cast
<hoijui> which would be the case in .. i think all the cases so far
<hoijui> ah . not for minimap maybe, but it coudl be done there too
<hoijui> having a defaultMinimapDrawer instead of using the parent one directly
<zerver> typically, if you write a function and there is a hundred "proj->" in it, then this means the function should be a member of the class in question
<hoijui> aehh.. no :P
<hoijui> in the engine we want sim and rendering splitted
<hoijui> drawing of a thing is not an integral part to it
<hoijui> therefore everything rendering related can not be a part of it/in it
<hoijui> guys.. you seem kind of .. absent
<hoijui> all doing other stuff too?
<hoijui> ahh nm, forget that
<zerver> this data duplication we spoke about earlier, do we really need it
<hoijui> can't remember
[23:20:32] Error: Command (/don't know what you mean) does not exist, use /help for a list of available commands.
<zerver> i mean, if you move rendering related variables into the rendering class, there will be less "proj->"
<jK> yeah, else multi-threading will always be buggy
<hoijui> ah yeah zerver.. that is true
<hoijui> the thing is... i see it this way:
<hoijui> a projectile consists of synced, unsycned and renderign related members
<hoijui> rendering related is really only what .. basically is opengl specific stuff
<hoijui> or say..
<jK> ? I thought hoij wanted to just move the functions to a diff class and reuse the data from the synced classes (when possible)
<zerver> i think strictly speaking we do not need this split, we could just make object deletion unsynced
<hoijui> if you want to have .. say... a directX renderer in the future, you would need all the unsycned stuff of a projectile too, like color
<hoijui> yeah jk, thats what i want
<hoijui> zerver, we want rendering code out of Sim
<hoijui> you cant do that without .. moving rendering code out of sim (hence, splitting it off from these classes)
<hoijui> splitting*
<hoijui> about special purpose classes: we alreayd have different classes for different projectiles, so i cant see why having the mfor drawing these projectiles is bad. it also allwos for stuff like:
<hoijui> having a kind of bundle of projectile class plus projectile rendering class as a compile-time-plugin
<hoijui> or say... having projectile types .. optional.. or however you want to put it
<hoijui> that means you could easily do special build of the engine, with.. for example only one projectile type
<Kloot> what would be the hypothetical purpose of that?
<hoijui> could be useful for testing or sync debugging or even for builds of the engine for low end systems, maybe
<hoijui> like.. having a mod that has only laser projectiles, running on a special build of the engine with a simplified rendering env

to be continued ...
(max message length reached, see next post)
Last edited by hoijui on 11 Jan 2011, 11:05, edited 1 time in total.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Dev Meeting Minutes (2011-01-10)

Post by hoijui »

<hoijui> testing would be the most important benefit i guess
<zerver> for MT we do not need this split i think, it will not make anything less buggy
<zerver> but i have no real objections otherwise, other than code readability
<hoijui> a side note about the next topic: zerver, you re-added it
<hoijui> (Broadcast two additional NETMSG to clients?)
<zerver> yeah, u already discussed it?
<hoijui> i though BD already asked all of us, and we all accepted it?
<zerver> oh
<zerver> sry missed the meeting
<hoijui> he did not speak to you?
<Kloot> what would you test with such a simplified build that you could not (easily) do with a normal one?
<hoijui> if i want to test only one projectile type, i woudl compile only that in
<hoijui> i mean specifically unit testing now
<zerver> so should i merge BDs stuff?
<hoijui> though it could be useful in general
<hoijui> it is already merged, zerver
<hoijui> is even in 7.1
<zerver> kk, ima slow :)
<hoijui> no prob :-)
<Kloot> I don't how, for unit-testing you would just enable/run the single test for the projectile type of interest
<hoijui> you also have to compile unit tests
<hoijui> having to compile less is better
<Kloot> so don't compile all the other projectile test classes
<hoijui> and you could be sure that other code does not interfere
<hoijui> but i still need the projectile classes and their drawers
<hoijui> can you give an argument why you dont want the many files
<hoijui> except.. "i dont like"?
<Kloot> because code should not be so specific when it isn't needed?
<hoijui> i guess what tobi said.. it will be less nice to code without an IDE, in some cases
<hoijui> mmm.. dont get what you mean
<hoijui> i listed quite some benefits now
<Kloot> you want to prepare for every potential grand future idea that might ever be implemented
<hoijui> they make up a need, in my eyes
<hoijui> most of it would be available from the moment it is done
<hoijui> we might just not use most of it rigth away, but it could be
<hoijui> unit testing for example, would be
<Kloot> what is there to unit-test in a projectile class really?
<hoijui> you can unit-test everything?
<hoijui> ?->.
<Kloot> yes, you could test i = i + 1 if you wanted to
<hoijui> so you say, we never had any bugs in projectiles?
<hoijui> or it is close to impossible that there are any?
<Kloot> no, just none that a unit test would catch
<zerver> most bugs have been rendering bugs, and those will slip through unit test
<Kloot> certainly not a test of one class in isolation from the rest of the sim
<hoijui> ok
<hoijui> well, that is not true
<hoijui> but of course i can neither prove that
<hoijui> there are also unit tests for graphical stuff btw (not that i think we'd ever see that ;-) )
<hoijui> theres also still the other benefits, of runtime change of drawer, compile time plugin-ness
<hoijui> and the most general benefit of cleaner design
<hoijui> so i ask again for arguments against it
<Kloot> the possibility of runtime drawer changes is nice yes, but not for each individual type
<hoijui> why not?
<Kloot> because it's not generic??
<hoijui> if you have it all on one place, and you want to change only drawing of one type, you would have to do something ugly
<hoijui> why not?
<Kloot> there are 10 or so types of weapon projectiles alone
<Kloot> if each of those needs 3 renderers for whatever purpose, that's 30 classes to maintain
<hoijui> most use only one, as i said
<hoijui> if you replace at runtime, it may likely be somethign in lua
<hoijui> if not... i mean, i dont envision different drawers for one type in the core engine repo
<hoijui> in C++
<Kloot> and how exactly do you envision lua would change the drawer type at runtime?
<hoijui> drawers*
<hoijui> something like: registerProjectileDrawer(projType, someLuaClassOrFile)
<Kloot> uhuh
<hoijui> :P
<hoijui> yeah, i know.. detailed :P
<hoijui> if it is not at all possible to do with lua, it would still make sense
<hoijui> lets say you want to compare two different drawing methods
<hoijui> but you did kind of not make your point yet, why it would be bad to have each type separate, to replace at runtime
<Kloot> cause it is over-designing for a need that likely will never exist
<hoijui> maybe we should stop here and give you time to think till next week?
<hoijui> it is cleaner design, and you cal lit over-design
<hoijui> but you still did not give an argument why it is too much
<hoijui> you just try to attack my pro arguments
<Kloot> I'll give you one from a rendering perspective: state changes
<hoijui> it feels a bit like when you defended your typo this week
<Kloot> and to me it feels like you don't want to hear any opposition
<hoijui> explain state changes please
<Kloot> ex you rejected low-level arguments...
<Tobi> you lose the overview when rendering is split over many classes
<hoijui> i showed that they would not apply here, and even if they would, and it would show in the future, we could still apply the compile-time polymorphism later on
<Tobi> I think I agree with Kloot at the moment (as long as the switch statement has at most 2 statements per case label), just KISS and optionally expand later if the need arises
<hoijui> need is already here, for unit testing
<Tobi> you could still unit test the drawer class
<Tobi> it is just a little bit bigger unit
<hoijui> i want the other stuff though
<Tobi> I think in a single class its indeed easier to make it clear to the reader which OGL state changes happen throughout the whole projectile rendering process
<hoijui> btw, for the overview argument, you could also say we should merge the projectile classes into a single one
<Tobi> and it may make it easier to perform optimizations based on rendering batches of projectiles or so
<hoijui> this should not be a problem in a clean design
<hoijui> i mean.. if the state changes happen where they should happen, in an OO structured model
<hoijui> that basically says: it makes it easier to use hacks
<hoijui> theres a nicer way to do every hack
<hoijui> and if you want to do a hack in an otherwise nicely design model, you still can, it just makes it look even uglier there
<hoijui> which is good
<zerver> tbh i no longer think MT benefits from this "big refactor" at all
<hoijui> the main purpose of the refactor would be, to have cleaner code
<zerver> what MT needs is that synced objects can have their life extended and be deleted some time later
<hoijui> which in turn has multiple benefits
<hoijui> guess we are at the end of the meeting
<hoijui> no point left
<hoijui> anything else?
<zerver> hoi, i would vote for your commit if i felt we needed the data duplication we spoke about earlier, but i dont
<zerver> but imma think about it
<hoijui> there is no data duplication
<zerver> exactly
<hoijui> this is nothing related to MT zerver
<zerver> for me it is :P
<hoijui> it does not change anything about MT, so .. it cant be :P
<hoijui> rendering will be moved out of sim, no question
<hoijui> question is just how
<hoijui> looks like the big switch way is gonna be used
<zerver> you consider all projectiles to be "sim"
<hoijui> yes
<zerver> however, i only consider certain functions and data of the projectile to be sim
<hoijui> you mean synced/unsynced, not sim/non-sim
<hoijui> that split might be done too somewhen, somehow, but that is not what this is all about here
<zerver> i think we should instead make a subclass of projectile that contains all the sim stuff
<hoijui> */
<Tobi> some projectiles are completely unsynced (actually, only weapon projectiles and a few more are synced iirc)
<zerver> CProjectile: public CProjectileSim
<zerver> and drawing methods in CProjectile...
<hoijui> that is not something to do instead, but in addition
<hoijui> NO!
<Tobi> in particular for unsynced projectiles I think you want to leave open the option for these "hacks" (e.g. disabling them completely and both simulating + rendering them on gpu)
<zerver> well, it eliminates all the 70 "proj->" in your commit (plus the macroed ones i did not count)
<hoijui> rendering has to be separate from the sim at compile time
<Tobi> I think that kind of techniques will be a pain if there are #projectiles x #renderers projectilerenderer classes
<zerver> ok, for headless etc?
<hoijui> yeah exactly
<hoijui> in general for modularization, and in particular for headless
<hoijui> Tobi, how would that be done? i mean...
<Tobi> that is a major reason I think projectile rendering shouldn't really be split in #projectiles different classes
<hoijui> it is switching from CPU code to shader code for all (unsycned) projectiles at once?
<Tobi> possibly
<zerver> you can do this #if headless #define CProjectile CProjectileSim #endif
<Tobi> in the C++ code there will definitely not be a notion anymore of a single unsynced projectile object in such a case
<hoijui> would mean unregistering CPU classes and registering shader class(es)
<Tobi> of course it may require some more refactoring like a factory pattern for making unsynced particles
<hoijui> as said, you dont HAVE to use one per class. you could have a ShaderBasedRenderer with the same switch you would otherwise have in the central class
<hoijui> and register it for all the unsynced types
<hoijui> or more general: if the centralized pattern is better, it can still be used
<Tobi> for consistency I think in that case its better if the default renderers aren't spread over #projectiles classes
<hoijui> :/
<hoijui> makes no sense for me
<hoijui> that is killing flexibility for consistency
<Tobi> not really
<hoijui> you mean.. if then all unsynced projectiles would be handled in one class, the other projectiles should be in one class too?
<Tobi> flexibility is the same as I see it, as you could still e.g. split one renderer into two renderers, if the projectiles can be classified into two groups that have totally different rendering requirements
<hoijui> .. then it would not be consistent anymore though
<Tobi> not sure how to exactly express myself though; I think having potential combinatorial explosion of tiny classes feels like an antipattern to me
<hoijui> :D
<hoijui> explosions.. do you mean... explosion of classes or projectiles?
<Tobi> classes, i.e., say you have an OGL renderer, a DX renderer and a brand new OGL3 renderer, then to keep things consistent you would have an OGLLaserBeamProjectileRenderer, a DXLaserBeamProjectileRenderer, a OGL3LaserBeamProjectileRenderer, an OGLLighningRenderer, a DXLightningRenderer, a OGL3LightningRenderer, etc. :)
<hoijui> yes true
<Tobi> probably each of them has 1 method with only a few statements
<hoijui> but they would be in totally different dirs
<hoijui> most likely different repositories
<hoijui> i mean the whole DX rendering env would be separate from the ogl one
<hoijui> it could use a different scheme
<hoijui> simulation will not know about the redering classes
<Tobi> yeah of course
<hoijui> most likely thing we would see, is:
<hoijui> LaserBeamProjectileRenderer & ExperimentalLaserBeamProjectileRenderer
<hoijui> stuff like that
<hoijui> it also makes sense if you dont think about different render impls for one type
<hoijui> to disable all projectile renderers of one type for example
<Tobi> hmm yeah true, for specifying different renderers e.g. in the mod the one class per type is nicer probably
<Tobi> in particular when combined with creg
<hoijui> you could easily test performance impacts of different types renderers
<hoijui> :D never would have though that creg could work for me
<hoijui> ahh an other idea:
<Tobi> do you intent to keep the call to the renderer class in the projectile class?
<hoijui> no
<hoijui> would be removed
<hoijui> and only called from CProjectileRenderer
<Tobi> ok
<Tobi> btw are the projectile renderers singletons or is a new renderer object created for every projectile?
<hoijui> but how exactly to do that would need OGL knowledge (states and such)
<hoijui> singletons
<Tobi> ok
<hoijui> maybe we want some projectiles to have a special effect.. like glow.. or maybe list some internal data in the simulation
<hoijui> so we could make a renderer that prints some properties, and takes an other renderer as argument
<hoijui> you can then register that renderer with the types native renderer as internal renderer for a certain type
<hoijui> and you could see eg current speed of the projectile printed next to it in the sim
<hoijui> or add a glowy effect.. or whatever may make sense
<hoijui> that should even be easy to do from lua.. just selecting the effects
<Tobi> nasty thing though if you want to do that for all projectiles is that you need to register for all types of renderers
<hoijui> yeah true
<hoijui> but for that you can write utility methods
<hoijui> applyEffectToAllProjectiles(EffectRednerer*)
[00:42:27] ** abma_irc joined the channel.
<hoijui> hey! :D
<abma> hey! :D
<hoijui> hmm... so now...
<hoijui> i am pretty sue that any state changes can also be incorporated nicely into this design
<hoijui> either in a base class or using something like the effect class mentioned above
<hoijui> think it is a pattern even
<Tobi> a problem is that although code can be shared by renderer classes, renderer instances can not be if every projectile type has its own renderer
<Tobi> and to share state you need an instance
<Tobi> I think we are missing something like visitor pattern but I don't know yet how to fit it in
<Tobi> without creating pointless extra complexity
<hoijui> mm ok
<hoijui> so it is about state changes that work the same way for all projectile types, but depend on the projectile instance?
<Tobi> not the projectile instance, but global state (i.e. OGL)
<hoijui> ahh ok
<hoijui> yeah that could be done in something like the mentioned effects class
<hoijui> or a StateRenderer
<hoijui> that takes an internal renderer, plus a class that does pre- and post- internal-renderer stuff
<hoijui> or is it .. state changes happens before the first proj is drawn, and after the last one is drawn?
<Tobi> that too
<Tobi> also the global renderer may want to have control over the order the projectiles are rendered
<hoijui> yeah that is no problem
<hoijui> in my design
<Tobi> both to be able to combine projectiles of the same type to reduce OGL state switching and/or for painters algo (z sort) or who knows what else
<hoijui> projectile renderer has a list of projectiles, loops over them however it wants, and draws each one through its registered drawer
<hoijui> (ah btw, my design could also easily be extended to register renderers for specific projectile instances)
<hoijui> hmm...
<Tobi> right, so then the drawer could easily have a pre/post method, called before/after rendering batch of that projectile type
<hoijui> yeah true
<Tobi> only thing I see that remains a bit hard is coupling (due to OGL state) between renderers of different type, but I guess thats something you don't really want anyway
<hoijui> yeah.. i though about that too.. would probably require something like grouping preferences
<hoijui> or grouping flags
<hoijui> might be too complex though
<hoijui> ah.. or using an AdapterRenderer (like the effects one) that defined pre and post rendering methods .. might not work
<hoijui> but there should be a way to do everything
<hoijui> never heard of a problem that is not possible to solve in a clean way in OO
<hoijui> except maybe if you do quantum physics or the like
<Tobi> if you want to have useful during-game renderer changing using Lua for e.g. effects then a renderer needs to be bound to a projectile instance, not a type
<Tobi> the Render method should have the type of the projectile the renderer is for I think
<Tobi> hmm
<Tobi> or maybe not
<hoijui> maybe i should add asserts at the start of the Render() function impls
<hoijui> that checks the projectile type
<Tobi> I'm thinking the renderer should actually be like a visitor, with separate RenderLaserBeam(CLaserBeamProjectile*) etc. methods
<Tobi> that way (+ pointer to renderer per projectile) there can be a single instance & single class default renderer, and still for every projectile everything can be overridden if desired :D
<hoijui> Redner(WorldObjecct* obj) { RenderLaserBeam((CLaserBeamProjectile*)obj); }
<hoijui> like this?
<Tobi> hmm although generic pre-/post- effects are harder then
<hoijui> you were thinking about having these methods in the Renderer interface class?
<Tobi> yes, as if the renderer is a visitor
<hoijui> isnt it a visitor already without that, with the Render() method?
<Tobi> but it has cons too
<Tobi> in a way, yes
<hoijui> would also be bad if you want to add a new projectile type
<Tobi> yeah true, that is one of the cons of visitor pattern :)
<Tobi> well I dunno, I think in the end I would KISS and simply ensure each renderer is in a separate method at least, and out of the sim class
<Tobi> anything else is easy to refactor later on
<hoijui> UMMMMM!!!!!
<hoijui> only to have it all in one file really?
<hoijui> or do you still think some stuff is not possible nicely?
<Tobi> I believe more in not implementing what isn't absolutely necessary than in designing something for some future that we can't predict
<hoijui> all the examples i gave are very realistic and useful
<hoijui> and they even come fro free with my design, or are very easy to add
<hoijui> with it
<hoijui> i am even doing the work to get there
<Tobi> yes but you'll never know if your set of example is complete - i.e. covers every possible thing that may come up
<hoijui> as said.. i can't imagine there is something not possible to do in the OO way
<Tobi> so if some sucky thing comes up that we didn't think about yet you/we may have to refactor anyway :)
<hoijui> and if there would be, the same hack as otherwise can still be used
<Tobi> :)
<hoijui> .. for real?
<hoijui> common
<Tobi> what is that re too?
<hoijui> you dont want to have the cleaner design because you can not foresee everything?
<hoijui> have you ever heard that a clean design prevented any technique from being used?
<hoijui> i have not
<hoijui> and again.. even if so, using a hack for that thing in particular would still be an option
<Tobi> I have seen designs that looked like clean design when they were made break down later on anyway
<Tobi> because of changing requirements/assumptions/whatever
<hoijui> my design is just more modular, it can't be worse then less modular
<hoijui> is impossible
<Tobi> well break down sounds very bad, but had to be changed a little anyway :)
<hoijui> you can just have a structure that statically puts it together in the non-modular way
<hoijui> while you can not do the reverse
<Tobi> you can always refactor :)
<Tobi> anyway
<Tobi> anything is better than what we have now I guess
<hoijui> i would have to refactor to do it in kloots way
<Tobi> I was arguing as if no code had been written yet
<hoijui> we now have all rendering split over many fiels aswell already, so that woudl not get worse
<Kloot> because you started this work before discussing it
<hoijui> mm ok
<hoijui> i just hate to refactor from something ugly to something half ugly, while i could do it to something 10% ugly with the same workload, with lots of benefits, and so shallow cons (in my eyes)
<hoijui> more files and possible unforseen unsolvable (nicely) problems (which i am sure do not exist)
<hoijui> it's not like i don't listen to arguments against my ideas, but there is really no viable one around in my eyes
<Kloot> key phrase there is "in my eyes", you always have large-scale design ideas with only advantages and any cons that others bring up you consider shallow when you don't even know the details of what they entail
<hoijui> exactly that is not true
<hoijui> i have let you overthrow many of my ideas already
<hoijui> cause you had good reason
<hoijui> stuff i did not think about
<hoijui> the low level stuff was all ruled out already as contra
<hoijui> i accept the many files argument, but it is shallow compared to the pros
<Kloot> no, but you are convinced that it is unimportant (btw, opengl stuff counts as low-level too)
<hoijui> yeah, which we found solutions for already too
<hoijui> i am not convinced that it is unimportant
<hoijui> but it will either not even come into play, cause of compiler optimization, or it can be worked around by substituting it with compile time mechanism proposed in the second document jk linked
<hoijui> which would still use the general structure i propose
<hoijui> and we found multiple ways to solve the opengl state stuff
<hoijui> i can not accept your feeling of many files being bad as a good argument
<Kloot> the point was that issue had to be explicitly mentioned because you didn't see all the cons/didn't think there were any, and only then did the discussion shift to incorporating
<hoijui> if it was the sole argument.. ok, but it is not
<Kloot> and again with a focus on minimally changing what you had already settled for
<hoijui> incorporation?
<hoijui> ah.. my branch into master you mean?
<hoijui> i did not see all the cons, true, you mentioned some stuff to me i did not think about
<Kloot> s/incorporating/adapting your structure to account for efficiently dealing with ogl state
<hoijui> we then looked at that, and now we are at a point where these are no issue anymore
<hoijui> so why do you bring it up?
<hoijui> if your arguments would have invalidated my approach, it would look different now, but they have not
<hoijui> we have been invalidating your arguments against my approach
<hoijui> as not being an issue
<hoijui> including the ogl one
<Kloot> you have not been invalidating, you have been considering alternatives
<hoijui> i want the best approach, and as nobody else does that, i am defending the approach i chose in that branch
<Kloot> only you seem to think we are at the non-issue point
<hoijui> if it was invalid, i would not do it anymore
<hoijui> as said, the virtual function problem would hardly ever arise due to optimization by the compiler, and if it does, we switch to the other method -> not an issue anymore
<Kloot> personally for now I just want a KISS way of getting rendering code out of the simulation
<hoijui> what is wrong there?
<hoijui> personally i want is not a valid argument
<Kloot> as a principle KISS applies to the whole engine
<Kloot> of which I am a developer, so yes
<Kloot> do you really want to claim 100% objectivity on your part?
<hoijui> that is the con of having many files
<hoijui> all my arguments are so
<hoijui> at least there have been no objection to that
<hoijui> has*
<Kloot> I believe I raised maintenance, but no doubt that's a "shallow" concern
<hoijui> there would not be more maintenance
<hoijui> you would not have less code, just worse structure
<hoijui> you would even give up structure that is now in place
<hoijui> and munch it together into something uglier
<hoijui> demodularization
<Tobi> IMO it is simply structuring the code in a different way and not necessarily in a worse way (i.e. group by aspect instead of by object)
<Kloot> the current structure is not at all modular, moving all projectile drawing code to one place aka module is far from "munching it together into something uglier"
<hoijui> trading something clean for something ugly cause it is simpler is not KISS
<Tobi> having all rendering code close to each other improves locality
<hoijui> with the same reasoning you would have to combine all projectile classes into a single one
<Tobi> no
<hoijui> in my approach it would all be under Rendering
<Tobi> that does not solve anything
<Tobi> rendering code together actually helps to solve some things in easy way
<hoijui> sure, it would reduce number of files
<Tobi> also clean and ugly are subjective I would say
<abma> (side note, what is KISS: http://www.makinggoodsoftware.com/2009/ ... code-kiss/ )
<hoijui> it is not grouping in a different way, it is more grouping
<Tobi> which may be good
<hoijui> no.. because there is nothing that can be done this way that can not be done the other way
<hoijui> but there is in reverse
<hoijui> -> bad
<hoijui> i am not adding unnecessary code, just useful structure
<hoijui> i gave enough examples why it is useful
<Kloot> why you think it might at some point in the future be useful*
<hoijui> WTF!?
<hoijui> read meeting again
<hoijui> i said, it will be useful from the moment it is done already
<abma> imo: better structured, easier to maintain + better to understand for noobs like me
<hoijui> unit testing, profiling, runtime de-/registering, special engine builds, special stuff rendering (effects), debuggability
<hoijui> btw, does anyone else get a lot of double messages from github RSS feeds?
<abma> which rss? http://github.com/spring/spring/commits/master.atom ?
<abma> no...
<Tobi> yeah I often get doubles in my reader too
<hoijui> https://github.com/hoijui.private.atom
<abma> hmm, on the "public" feed i didn't get dups... maybe because it has fewer updates
<hoijui> so should we close here as undecided?
<hoijui> is getting a bit late
<Tobi> yeah guess so
<hoijui> i feel like voting on it does not make sense now
<abma> hm, yes its a bit late...
<hoijui> ok
<hoijui> i'll do minutes
<hoijui> so i can draw a nice conclusion! :D :D
<hoijui> ;-)
<hoijui> nah without
<hoijui> good night
<Kloot> nite
<Tobi> gn

main points:
  • two proposals are presented:
    1. all projectiles are rendered in a single class, using a big switch
    2. each projectile type (may) have its own class for rendering
  • no consensus reached
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Dev Meeting Minutes (2011-01-10)

Post by smoth »

Wow lots of good stuff.

So question: if jk fixed shadows, would behes roam be ready to go? as in is this the fix he needs? are you guys wanting to only take on one major change wtr rendering at a time?
Post Reply

Return to “Meeting Minutes”