Re: Reflection in game engine (c++)
Darren Grant <[email protected]> Thu, 14 Mar 2013 17:52:03 -0700
| Newsgroups | gmane.games.devel.sweng |
|---|---|
| Message-ID | <CA+jD6SjvufWh0F62aR9whU2bn4q8-orEjA9qDyqdq0T3Y15ntw@mail.gmail.com> |
--===============1485189947== Content-Type: multipart/alternative; boundary=047d7b3a98e6337a1204d7ec0ce8 --047d7b3a98e6337a1204d7ec0ce8 Content-Type: text/plain; charset=ISO-8859-1 Just a cautionary tale: The trap I've fallen into in the past is not having the tools to really make the underlying system shine; results vary greatly depending on which team and resources you have at your disposal. For instance, when designing a reflective CES it is challenging to come up with a dialect that allows closely related concepts to map closely together in code, and this has an impact on the ability to debug and maintain the product later that is proportional to the complexity of the component ecosystem. For what it's worth, this is more of a hot topic with language design in general. Cheers, Darren On Thu, Mar 14, 2013 at 1:34 PM, Tinco Andringa <[email protected]> wrote: > Sorry, Component Entity System, it's a way of organizing your game > engine that has some popularity amongst in the industry. Here's a > quick overview from someone who worked on the Tony Hawk games: > http://cowboyprogramming.com/2007/01/05/evolve-your-heirachy/ > > I just read Gabriel's linkedin and he's got years of experience on big > games so I guess he really has a good reason to check if reflection > can optimize his pipeline. > > > On Thu, Mar 14, 2013 at 7:55 PM, Thatcher Ulrich <[email protected]> wrote: > > "CES"? > > > > On Thu, Mar 14, 2013 at 2:09 PM, Gabriel Sassone <[email protected]> > wrote: > >> Hello gents, > >> I wanted to experiment with reflection and I found different way to > >> obtain it: > >> > >> 1) Invasive macro based registration > >> 2) Reflection visitor pattern > >> 3) Parsing pdb/clang stuff and create a manual table of what you > want/need > >> 4) c++ custom parser that uses tags to create reflection informations > >> (like a comment near a member, ...) (exuberant ctags???) > >> 5) create serializable/reflected classes in a data format, then run a > tool > >> that generates headers and cpps > >> > >> I am trying to figure out flaws and merits of each kind, and even if > there > >> are other solutions. > >> I love the idea to have the possibility to serialize in and out > structures, > >> access fields and change values, stream in/out stuff from network ,and > maybe > >> link with scripting. > >> > >> My goal is to have fast iteration times, both artists and programmers, > and I > >> achieved it for rendering programmers already with having json binarized > >> configurable rendering, but still there are code stuff that are not > easy to > >> achieve. > >> > >> Here are my thoughts, but I would like to hear your ideas and > experiences! > >> > >> 1) Very precise on what you can register/serialize, but painful to > maintain > >> or plug into an existing codebase > >> 2) Less precise but you just need one method per class, that you can > use to > >> serialize/reflect. Still bad in maintaining, but better in plugging in. > >> 3) You make the compiler do the work, then translate the informations > you > >> need in your format. Easy to maintain, to plug...maybe slow in parsing? > Slow > >> your build pipeline? > >> 4) maybe easier than using pdbs, but less powerful (you cannot invoke > >> methods on objects). should be faster than 3. > >> 5) crazy idea. requires generation of code from outside...powerful like > 4, > >> so data reflection, but you cannot invoke methods if you want. > >> > >> What are your experiences/thoughts? > >> > >> Thanks to everyone that read this mail! > >> > >> Gabriel > >> > >> > >> _______________________________________________ > >> Sweng-Gamedev mailing list > >> [email protected] > >> > http://lists.midnightryder.com/listinfo.cgi/sweng-gamedev-midnightryder.com > >> > > _______________________________________________ > > Sweng-Gamedev mailing list > > [email protected] > > > http://lists.midnightryder.com/listinfo.cgi/sweng-gamedev-midnightryder.com > _______________________________________________ > Sweng-Gamedev mailing list > [email protected] > http://lists.midnightryder.com/listinfo.cgi/sweng-gamedev-midnightryder.com > --047d7b3a98e6337a1204d7ec0ce8 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div style>Just a cautionary tale:</div><div style><br></d= iv>The trap I've fallen into in the past is not having the tools to rea= lly make the underlying system shine; results vary greatly depending on whi= ch team and resources you have at your disposal. For instance, when designi= ng a reflective CES it is challenging to come up with a dialect that allows= closely related concepts to map closely together in code, and this has an = impact on the ability to debug and maintain the product later that is propo= rtional to the complexity of the component ecosystem.<div> <br></div><div style>For what it's worth, this is more of a hot topic w= ith language design in general.</div><div style><br></div><div style><br></= div><div style>Cheers,</div><div style>Darren</div><div style><br></div> <div style><br></div></div><div class=3D"gmail_extra"><br><br><div class=3D= "gmail_quote">On Thu, Mar 14, 2013 at 1:34 PM, Tinco Andringa <span dir=3D"= ltr"><<a href=3D"mailto:[email protected]" target=3D"_blank">[email protected]</= a>></span> wrote:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex">Sorry, Component Entity System, it's a w= ay of organizing your game<br> engine that has some popularity amongst in the industry. Here's a<br> quick overview from someone who worked on the Tony Hawk games:<br> <a href=3D"http://cowboyprogramming.com/2007/01/05/evolve-your-heirachy/" t= arget=3D"_blank">http://cowboyprogramming.com/2007/01/05/evolve-your-heirac= hy/</a><br> <br> I just read Gabriel's linkedin and he's got years of experience on = big<br> games so I guess he really has a good reason to check if reflection<br> can optimize his pipeline.<br> <div class=3D"HOEnZb"><div class=3D"h5"><br> <br> On Thu, Mar 14, 2013 at 7:55 PM, Thatcher Ulrich <<a href=3D"mailto:tu@t= ulrich.com">[email protected]</a>> wrote:<br> > "CES"?<br> ><br> > On Thu, Mar 14, 2013 at 2:09 PM, Gabriel Sassone <<a href=3D"mailto= :[email protected]">[email protected]</a>> wrote:<br> >> Hello gents,<br> >> =A0 =A0I wanted to experiment with reflection and I found differen= t way to<br> >> obtain it:<br> >><br> >> =A0 1) Invasive macro based registration<br> >> =A0 2) Reflection visitor pattern<br> >> =A0 3) Parsing pdb/clang stuff and create a manual table of what y= ou want/need<br> >> =A0 4) c++ custom parser that uses tags to create reflection infor= mations<br> >> (like a comment near a member, ...) (exuberant ctags???)<br> >> =A0 5) create serializable/reflected classes in a data format, the= n run a tool<br> >> that generates headers and cpps<br> >><br> >> I am trying to figure out flaws and merits of each kind, and even = if there<br> >> are other solutions.<br> >> I love the idea to have the possibility to serialize in and out st= ructures,<br> >> access fields and change values, stream in/out stuff from network = ,and maybe<br> >> link with scripting.<br> >><br> >> My goal is to have fast iteration times, both artists and programm= ers, and I<br> >> achieved it for rendering programmers already with having json bin= arized<br> >> configurable rendering, but still there are code stuff that are no= t easy to<br> >> achieve.<br> >><br> >> Here are my thoughts, but I would like to hear your ideas and expe= riences!<br> >><br> >> 1) Very precise on what you can register/serialize, but painful to= maintain<br> >> or plug into an existing codebase<br> >> 2) Less precise but you just need one method per class, that you c= an use to<br> >> serialize/reflect. Still bad in maintaining, but better in pluggin= g in.<br> >> 3) You make the compiler do the work, then translate the informati= ons you<br> >> need in your format. Easy to maintain, to plug...maybe slow in par= sing? Slow<br> >> your build pipeline?<br> >> 4) maybe easier than using pdbs, but less powerful (you cannot inv= oke<br> >> methods on objects). should be faster than 3.<br> >> 5) crazy idea. requires generation of code from outside...powerful= like 4,<br> >> so data reflection, but you cannot invoke methods if you want.<br> >><br> >> What are your experiences/thoughts?<br> >><br> >> Thanks to everyone that read this mail!<br> >><br> >> =A0 =A0 Gabriel<br> >><br> >><br> >> _______________________________________________<br> >> Sweng-Gamedev mailing list<br> >> <a href=3D"mailto:[email protected]">Sweng-Gam= [email protected]</a><br> >> <a href=3D"http://lists.midnightryder.com/listinfo.cgi/sweng-gamed= ev-midnightryder.com" target=3D"_blank">http://lists.midnightryder.com/list= info.cgi/sweng-gamedev-midnightryder.com</a><br> >><br> > _______________________________________________<br> > Sweng-Gamedev mailing list<br> > <a href=3D"mailto:[email protected]">Sweng-Gamedev= @lists.midnightryder.com</a><br> > <a href=3D"http://lists.midnightryder.com/listinfo.cgi/sweng-gamedev-m= idnightryder.com" target=3D"_blank">http://lists.midnightryder.com/listinfo= .cgi/sweng-gamedev-midnightryder.com</a><br> _______________________________________________<br> Sweng-Gamedev mailing list<br> <a href=3D"mailto:[email protected]">Sweng-Gamedev@list= s.midnightryder.com</a><br> <a href=3D"http://lists.midnightryder.com/listinfo.cgi/sweng-gamedev-midnig= htryder.com" target=3D"_blank">http://lists.midnightryder.com/listinfo.cgi/= sweng-gamedev-midnightryder.com</a><br> </div></div></blockquote></div><br></div> --047d7b3a98e6337a1204d7ec0ce8-- --===============1485189947== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Sweng-Gamedev mailing list [email protected] http://lists.midnightryder.com/listinfo.cgi/sweng-gamedev-midnightryder.com --===============1485189947==--