Re: Reflection in game engine (c++)
Douglas Cox <[email protected]> Mon, 18 Mar 2013 13:45:55 -0400
| Newsgroups | gmane.games.devel.sweng |
|---|---|
| Message-ID | <CA+i4re5OwyE+LSOafD9OCfrfk0s4ARz6HHZz_=QHDX6ggE7sEg@mail.gmail.com> |
--===============1393159403== Content-Type: multipart/alternative; boundary=047d7b2e0c2b8fa66304d8368f43 --047d7b2e0c2b8fa66304d8368f43 Content-Type: text/plain; charset=ISO-8859-1 That sounds pretty similar to the goals of the engine that we're working on -- basically faster iteration times for everyone (this includes engine programmers as well). All of our code (including the compiler) is written in a C#-like language, so we have perfect reflection from that. Attributes are pretty much required for providing additional information to property editors for things like valid ranges of a field or notifications of a property change (most of which can go away in Final builds). Another thing to consider may be allowing for data derivation. This can save quite a bit of work when the need for copies of objects come up that only need one or two properties changed. If you pick a serialization format for the editable data that knows about the data (fieldtype + fieldname + value), it makes it a lot easier to get this working. In the past, we've used Macros and they worked fine. They're a bit more annoying to extend with optional parameters and you have to repeat the field/property name, but that's not terrible since you can generally get it down to compile-time errors if you get something wrong (other than forgetting to add a new field). -Doug On Fri, Mar 15, 2013 at 3:45 AM, Tinco Andringa <[email protected]> wrote: > I think the point of the discussion is to not just assume C++ isn't > going to do it. As far as I understand the goal is to have the ability > to develop tools that aid programmers and artist in iterating rapidly. > This means for artists that they can swap artwork in at runtime or > quickly boot the game from a serialized state with new artwork, not > just on his/her own computer but also over a network to perhaps a > console. For programmers this may mean that they can view the game > state easily, launch the game in various states easily, swap in/out > scripts easily, maybe even change code without fully recompiling or > even restarting the game. > > Am I missing something important? > > On Fri, Mar 15, 2013 at 8:33 AM, Massimo Del Zotto <[email protected]> > wrote: > > I have limited experience but I have been very impressed by the > separation > > provided by scripting languages. > > Considering the goals: > > > > My goal is to have fast iteration times, both artists and programmers > > > > It appears to me C++ isn't going to do it. Especially on the artist side > of > > the thing. > > > > By the way, I would like to have an insight on how this reflection > > information is to be used. If it is used to simulate duck typing I'd use > a > > tool which supports duck typing natively. > > > > Massimo > > > > _______________________________________________ > > 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 > --047d7b2e0c2b8fa66304d8368f43 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">That sounds pretty similar to the goals of the engine that= we're working on -- basically faster iteration times for everyone (thi= s includes engine programmers as well).<div><br></div><div>All of our code = (including the compiler) is written in a C#-like language, so we have perfe= ct reflection from that. =A0Attributes are pretty much required for providi= ng additional information to property editors for things like valid ranges = of a field or notifications of a property change (most of which can go away= in Final builds).</div> <div><br></div><div style>Another thing to consider may be allowing for dat= a derivation. =A0This can save quite a bit of work when the need for copies= of objects come up that only need one or two properties changed. =A0If you= pick a serialization format for the editable data that knows about the dat= a (fieldtype + fieldname + value), it makes it a lot easier to get this wor= king.</div> <div style><br></div><div style>In the past, we've used Macros and they= worked fine. =A0They're a bit more annoying to extend with optional pa= rameters and you have to repeat the field/property name, but that's not= terrible since you can generally get it down to compile-time errors if you= get something wrong (other than forgetting to add a new field).</div> <div style><br></div><div style>-Doug</div><div style><br></div></div><div = class=3D"gmail_extra"><br><br><div class=3D"gmail_quote">On Fri, Mar 15, 20= 13 at 3:45 AM, Tinco Andringa <span dir=3D"ltr"><<a href=3D"mailto:mail@= tinco.nl" 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">I think the point of the discussion is to no= t just assume C++ isn't<br> going to do it. As far as I understand the goal is to have the ability<br> to develop tools that aid programmers and artist in iterating rapidly.<br> This means for artists that they can swap artwork in at runtime or<br> quickly boot the game from a serialized state with new artwork, not<br> just on his/her own computer but also over a network to perhaps a<br> console. For programmers this may mean that they can view the game<br> state easily, launch the game in various states easily, swap in/out<br> scripts easily, maybe even change code without fully recompiling or<br> even restarting the game.<br> <br> Am I missing something important?<br> <div class=3D"HOEnZb"><div class=3D"h5"><br> On Fri, Mar 15, 2013 at 8:33 AM, Massimo Del Zotto <<a href=3D"mailto:ma= [email protected]">[email protected]</a>> wrote:<br> > I have limited experience but I have been very impressed by the separa= tion<br> > provided by scripting languages.<br> > Considering the goals:<br> ><br> > My goal is to have fast iteration times, both artists and programmers<= br> ><br> > It appears to me C++ isn't going to do it. Especially on the artis= t side of<br> > the thing.<br> ><br> > By the way, I would like to have an insight on how this reflection<br> > information is to be used. If it is used to simulate duck typing I'= ;d use a<br> > tool which supports duck typing natively.<br> ><br> > Massimo<br> ><br> </div></div><div class=3D"HOEnZb"><div class=3D"h5">> __________________= _____________________________<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> _______________________________________________<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> --047d7b2e0c2b8fa66304d8368f43-- --===============1393159403== 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 --===============1393159403==--