--- Log opened Thu Jul 11 00:00:16 2013 |
00:08 | <@Tarinaky> | RichyB: I don't know how to do a memory buffer with PyGlet/OpenGL... |
00:08 | <@Tarinaky> | I'm not even sure if you can. |
00:09 | <&McMartin> | OpenGL has extensions for render-to-texture and the DX10-equivalent levels (which most OpenGL libraries don't expose by default, because OpenGL) have render-to-texture capability explicitly. |
00:10 | < RichyB> | You can render from opengl or direct3d into a texture. |
00:10 | <@Tarinaky> | How? |
00:10 | <@gnolam> | Since... err... 3.0?, said extensions are no longer extensions but in core. |
00:11 | < RichyB> | You can *definitely* copy a memory buffer to a texture; that's how loading textures from disk works. |
00:11 | <&McMartin> | I would not lay heavy odds on PyGlet supporting 3.0. |
00:11 | <@gnolam> | The "easy" way is to use FBOs. |
00:11 | < RichyB> | In OpenGL, that's done with FrameBufferObjects. |
00:11 | < RichyB> | Specifically, redner to texture is done with FBOs. |
00:12 | <&McMartin> | Yeah, I mean, really, the problem here is "turn raster image to texture" |
00:12 | <&McMartin> | that's a *lot* easier |
00:12 | <&McMartin> | That's TexImage2D |
00:12 | | * gnolam reads up properly. |
00:13 | <@gnolam> | Ah, seems to be a question about texture /management/. |
00:13 | <&McMartin> | The best solution may be "find a PyGlet-based extension that does all the GUI spiders, use that", but I don't know the ecosystem well enough to opine |
00:13 | <@Tarinaky> | There isn't one. |
00:14 | <@Tarinaky> | I've spent the last month umming and arring trying to find something, anything, in the ecosystem for this and I can't :/ |
00:14 | | * McMartin nods |
00:14 | <&McMartin> | >_< |
00:15 | <&McMartin> | Anyway, yeah, if you want bitmappy buttons of varying size, the nine-texture trick is basically how Qt does custom windows, and I expect it generalizes. |
00:15 | <&McMartin> | You can drop nine to three if the buttons are constant height or constant width but not both, and you can drop three to one if it's both. |
00:15 | <&McMartin> | But your questions lead me to believe it is not both. :) |
00:16 | <@Tarinaky> | Any advice on either texture management or actually drawing before I go get a coffee? |
00:17 | <&McMartin> | I'm basically out of tricks on this point, and I don't know PyGlet at all, just some very casual use of OpenGL through C and C++. |
00:17 | <@Tarinaky> | Okay. |
00:19 | <&McMartin> | If you aren't going totally nuts, though, generating nine 32x32 textures or whatever and having all your buttons use them is not going to blow out any GPUs you target. |
00:28 | <&McMartin> | http://i.imgur.com/xrmZn1Q.jpg |
00:35 | <@Alek> | oldie but a goodie. |
00:35 | | Derakon[AFK] is now known as Derakon |
00:40 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds] |
00:48 | | Turaiel[Offline] is now known as Turaiel |
00:52 | | Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code |
00:52 | | mode/#code [+qo Vornicus Vornicus] by ChanServ |
00:56 | <&McMartin> | The Internet is now largely obsolete. |
00:56 | <&McMartin> | The Last Necessary Site is now done. |
00:56 | <&McMartin> | http://placekitten.com/ |
00:57 | <~Vornicus> | Nice. |
00:59 | | Typh|offline is now known as Typherix |
01:09 | <@gnolam> | Tarinaky: what part of texture management is it that you need help with? |
01:10 | <@Tarinaky> | I don't know what I'm doing. |
01:11 | <@gnolam> | Well, at what level? Is it "how do I even get a texture into this thing?" or is it "how should I handle having hundreds of different textures and dividing the responsibility for them"? |
01:11 | <@Alek> | http://www.youtube.com/watch?v=OXx1qxH247k |
01:11 | <@Tarinaky> | I think I understand how to actually apply a texture to a Quad. It's mostly of the "what should the textures look like/how should I make them" nature. |
01:13 | <@gnolam> | For a nine-texture resizeable widget thingy? |
01:14 | <@Tarinaky> | For... not looking like ass. |
01:16 | <&ToxicFrog> | That's an art question, not a programming question, and Art Is Hard. |
01:19 | | ktemkin[awol] is now known as ktemkin |
01:20 | | Turaiel is now known as Turaiel[Offline] |
01:23 | <&McMartin> | Look at NES, SNES, or PS1-style tile-based windows for a start, I guess |
01:42 | | Typherix is now known as Typh|offline |
01:49 | | RichyB [RichyB@D553D1.68E9F7.02BB7C.3AF784] has quit [[NS] Quit: Gone.] |
01:50 | <&Derakon> | Yeah, texturing is hard. |
01:51 | <&Derakon> | A commercial game development studio may well have artists who specialize in just doing textures. |
01:51 | <&Derakon> | (Just as they have modelers and concept artists) |
01:51 | <&Derakon> | (Though many artists are able to do all three to a greater or lesser extent) |
01:52 | | RichyB [RichyB@D553D1.68E9F7.02BB7C.3AF784] has joined #code |
01:54 | | gnolam [lenin@Nightstar-b2aa51c5.cust.bredbandsbolaget.se] has quit [Connection reset by peer] |
01:55 | | gnolam [lenin@Nightstar-b2aa51c5.cust.bredbandsbolaget.se] has joined #code |
01:55 | | mode/#code [+o gnolam] by ChanServ |
01:56 | | Orthia [orthianz@3CF3A5.E1CD01.B089B9.1E14D1] has quit [Ping timeout: 121 seconds] |
02:01 | <@Tarinaky> | Derakon: At the risk of stating the obvious... |
02:04 | <&Derakon> | ...yes? |
02:10 | <@Tarinaky> | I felt the rest of the sentence was too obvious to need a completion. |
02:12 | <&Derakon> | Well, then you're not really at risk of anything, are you? |
02:12 | <&Derakon> | That particular phrase has to be followed by the thing you actually state. |
02:13 | <@Tarinaky> | Pick one of "... I don't have that liberty." |
02:13 | <@Tarinaky> | Or "I am not a commercial game development studio" |
02:14 | <&Derakon> | Hey, I just said it was hard and gave you some context. |
02:14 | <&Derakon> | Independent game development isn't easy, especially for 3D games. Why do you think MInecraft is composed solely of cubes? |
02:14 | <@Tarinaky> | Sorry, I wasn't trying to be a dick. >.< |
02:14 | <&Derakon> | You weren't, just intentionally obtuse. :p |
02:15 | <@Tarinaky> | I assure you, I don't have to be intentionally obtuse. |
02:15 | <@Tarinaky> | If I were any more obtuse I'd be a straight line. |
02:15 | <&ToxicFrog> | Tarinaky: so, for basics, just hack together something that gives you an idea of what it will look like in the GIMP. McMartin's suggestion is a good one. |
02:15 | <&ToxicFrog> | For something that looks pretty, you either need an actual artist, or existing artwork for this that has a suitable license. |
02:17 | <&McMartin> | There isn't a programmatic solution to the problem of "programmer art" - hence, the entire notion of "programmer art" |
02:21 | <@Tarinaky> | Yeah, okay. |
02:30 | | Turaiel[Offline] is now known as Turaiel |
02:34 | | himi [fow035@D741F1.243F35.CADC30.81D435] has joined #code |
02:34 | | mode/#code [+o himi] by ChanServ |
02:49 | | * Derakon works on loading savefiles in Pyrel, gets to what looks like an infinite loop in deserializing the Player. Hunh. |
02:58 | | Derakon [Derakon@Nightstar-a3b183ae.ca.comcast.net] has quit [Client exited] |
03:08 | | Karono [Karono@Nightstar-0e4527e4.optusnet.com.au] has joined #code |
03:24 | | celticminstrel [celticminst@Nightstar-8403057e.dsl.bell.ca] has quit [[NS] Quit: KABOOM! It seems that I have exploded. Please wait while I reinstall the universe.] |
03:26 | | Orthia [orthianz@3CF3A5.E1CD01.B089B9.1E14D1] has joined #code |
03:26 | | mode/#code [+o Orthia] by ChanServ |
03:29 | | celticminstrel [celticminst@Nightstar-8403057e.dsl.bell.ca] has joined #code |
03:29 | | mode/#code [+o celticminstrel] by ChanServ |
03:52 | | * McMartin starts setting up an OS upgrade on Iodine. |
04:04 | < [R]> | What's the perl package manager thing called again? |
04:05 | <&ToxicFrog> | cpan |
04:06 | < [R]> | Thanks |
04:07 | | Kindamoody[zZz] is now known as Kindamoody |
04:10 | < Xon> | ToxicFrog, hell also works |
04:14 | | Karono [Karono@Nightstar-0e4527e4.optusnet.com.au] has quit [[NS] Quit: bbl] |
04:39 | | * Vornicus gets around to poking at his mor optimizer again |
04:45 | | Derakon [Derakon@Nightstar-a3b183ae.ca.comcast.net] has joined #code |
04:45 | | mode/#code [+ao Derakon Derakon] by ChanServ |
04:46 | | VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has quit [[NS] Quit: Program Shutting down] |
04:52 | | Turaiel is now known as Turaiel[Offline] |
04:59 | <~Vornicus> | Today's first puzzle: the merge iterator. |
05:23 | | Derakon is now known as Derakon[AFK] |
05:44 | <~Vornicus> | Okay. The merge iterator takes a vector of frontier maps; it then appears to be a standard input iterator of pairs. |
05:46 | <~Vornicus> | The add iterator takes just two frontier maps (of the same type) and appears to be a standard input iterator of pairs. |
05:55 | | Namegduf [namegduf@Nightstar-5c10d129.beshir.org] has quit [Operation timed out] |
05:55 | | Namegduf [namegduf@Nightstar-5c10d129.beshir.org] has joined #code |
05:55 | | mode/#code [+o Namegduf] by ChanServ |
05:56 | | Karono [Karono@10AAA2.FD2B33.7F4978.5FBCA7] has joined #code |
06:04 | | Alek [omegaboot@Nightstar-56dbba0f.in.comcast.net] has quit [[NS] Quit: brb] |
06:08 | | Alek [omegaboot@Nightstar-56dbba0f.in.comcast.net] has joined #code |
06:09 | | mode/#code [+o Alek] by ChanServ |
06:22 | <~Vornicus> | Okay. I have a function that takes an input iterator of pairs, and produces a map using /some/ of those pairs; the key type is always the same. |
06:25 | | AnnoDomini [abudhabi@Nightstar-c53de59e.adsl.inetia.pl] has quit [Ping timeout: 121 seconds] |
06:33 | <~Vornicus> | The value type however can vary, and the actual input iterator's type can vary. |
06:40 | <~Vornicus> | Four signatures: map<MOR, GalaxyDescription> optimize(AddIterator<GalaxyDescription>); map<MOR, GalaxyDescription> optimize(MergeIterator<GalaxyDescription>); map<MOR, SubSystemDescription> optimize(MergeIterator<SubSystemDescription>); map<MOR, SubSystemDescription> optimize(AddIterator<SubSystemDescription>) |
06:45 | | McMartin [mcmartin@Nightstar-7130bbf8.pltn13.sbcglobal.net] has quit [[NS] Quit: OS upgrade time] |
07:05 | | abudhabi [abudhabi@Nightstar-edb9fb3d.adsl.inetia.pl] has joined #code |
07:25 | | * Vornicus ...tries to figure out how to actually implement that iterator. |
07:32 | <~Vornicus> | or rather, how to actually implement it so it's like your typical iterators, which pretend to be a pointer to a pair |
07:34 | < [R]> | In Java? |
07:34 | <~Vornicus> | C++. |
07:35 | | celticminstrel [celticminst@Nightstar-8403057e.dsl.bell.ca] has quit [[NS] Quit: KABOOM! It seems that I have exploded. Please wait while I reinstall the universe.] |
08:06 | < Xon> | ugh, this project has some /warts/ who the fuck stores integers as doubles in a strongly typed language |
08:08 | < [R]> | I see your incorrect type storage and raise you an if/else-chain command processor. |
08:09 | < Xon> | That is kinda evil |
08:10 | < [R]> | It's part of a function that will sometimes call an overloaded version of itself, that overloaded version then just calls the original again. |
08:10 | < [R]> | The only function that ever calls the overload is the original. |
08:12 | < Xon> | O_o |
08:14 | < Xon> | [R], what is frustrating is that I've repeatedly communicated that this shit needs to store integers =\ |
08:14 | < Xon> | And I don't have the tiem just to refactor it all |
08:15 | < [R]> | Sounds like a job for Pavlov. |
08:24 | | Orth [orthianz@3CF3A5.E1CD01.B089B9.1E14D1] has joined #code |
08:25 | | Orthia [orthianz@3CF3A5.E1CD01.B089B9.1E14D1] has quit [Ping timeout: 121 seconds] |
08:26 | | McMartin [mcmartin@Nightstar-7130bbf8.pltn13.sbcglobal.net] has joined #code |
08:26 | | mode/#code [+ao McMartin McMartin] by ChanServ |
08:46 | | Kindamoody is now known as Kindamoody|out |
09:17 | | himi [fow035@D741F1.243F35.CADC30.81D435] has quit [Ping timeout: 121 seconds] |
09:39 | | You're now known as TheWatcher |
09:50 | | AverageJoe [evil1@Nightstar-4b668a07.ph.cox.net] has joined #code |
10:34 | <~Vornicus> | VAST CONFUSION |
10:57 | | Orth [orthianz@3CF3A5.E1CD01.B089B9.1E14D1] has quit [[NS] Quit: Going dooooown...] |
10:57 | | Orthia [orthianz@3CF3A5.E1CD01.B089B9.1E14D1] has joined #code |
10:57 | | mode/#code [+o Orthia] by ChanServ |
11:22 | | AverageJoe [evil1@Nightstar-4b668a07.ph.cox.net] has quit [[NS] Quit: Leaving] |
11:30 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code |
11:30 | | mode/#code [+o himi] by ChanServ |
12:01 | | Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: Leaving] |
13:26 | | Pandemic [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has quit [Ping timeout: 121 seconds] |
13:28 | | Pandemic [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has joined #code |
13:28 | | mode/#code [+o Pandemic] by ChanServ |
14:35 | | Karono [Karono@10AAA2.FD2B33.7F4978.5FBCA7] has quit [Connection closed] |
14:35 | | Karono [Karono@Nightstar-0e4527e4.optusnet.com.au] has joined #code |
15:05 | | celticminstrel [celticminst@Nightstar-8403057e.dsl.bell.ca] has joined #code |
15:06 | | mode/#code [+o celticminstrel] by ChanServ |
15:30 | | ktemkin is now known as ktemkin[awol] |
15:34 | | * TheWatcher eyes this |
15:34 | <@TheWatcher> | @$_{@keys} = @values for \my %hash; |
15:34 | <@TheWatcher> | That is both utterly hideous and extremely neat |
15:34 | < jeroud> | So many sigils. |
15:35 | <&ToxicFrog> | What does that do? |
15:35 | < jeroud> | That can only be the pathologically eclectic rubbish lister. |
15:36 | <@TheWatcher> | constructs a hash with the scalars contained in @keys as the keys, and the contents of @values as the values. So if you have my @keys = ("foo", "bar"); my @values = ("A", "B"); then you end up with %keys = ("foo" => "A", "bar" => "B"); |
15:37 | <@TheWatcher> | It's another way of doing `my %hash; @hash{@keys} = @values;` |
15:38 | <@TheWatcher> | Or plain old `for(my $i = 0; $i < scalar(@keys); ++$i) { $hash{$keys[$i]} = $values[$i]; }` |
15:39 | <@TheWatcher> | (and yes, jerith, perl indeed) |
15:39 | < RichyB> | In Python, that is phrased as: dict(zip(keys, values)) |
15:40 | < RichyB> | Look ma, no sigils! Just a name swiped from ML ("zip") and a convention swiped from Lisp (the association list). |
15:45 | | Netsplit *.net <-> *.split quits: @Pandemic, @Derakon[AFK], ktemkin[awol], @Orthia, @Reiv, @PinkFreud, @himi, sshine, Typh|offline, Azash, (+7 more, use /NETSPLIT to show all of them) |
15:46 | | Netsplit over, joins: @PinkFreud, @Pandemic, jeroud, &jerith, @Orthia, &Derakon[AFK], @himi, sshine, @Reiv, &McMartin (+7 more) |
15:47 | | Typh|offline [Typherix@Nightstar-7dc8031d.mi.comcast.net] has quit [Ping timeout: 121 seconds] |
15:47 | | Typherixf [Typherix@Nightstar-7dc8031d.mi.comcast.net] has joined #code |
15:47 | | jeroud [uid10043@Nightstar-7774ea6e.irccloud.com] has quit [Ping timeout: 121 seconds] |
15:47 | | jeroud [uid10043@Nightstar-7774ea6e.irccloud.com] has joined #code |
15:48 | | Reiv [NSwebIRC@Nightstar-95746c1f.kinect.net.nz] has quit [Ping timeout: 121 seconds] |
15:50 | | PinkFreud [WhyNot@NetworkAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds] |
15:51 | | PinkFreud [WhyNot@NetworkAdministrator.Nightstar.Net] has joined #code |
15:51 | | mode/#code [+o PinkFreud] by ChanServ |
15:52 | | McMartin [mcmartin@Nightstar-7130bbf8.pltn13.sbcglobal.net] has quit [Ping timeout: 121 seconds] |
15:52 | | Karono_ [Karono@Nightstar-0e4527e4.optusnet.com.au] has joined #code |
15:52 | | McMartin [mcmartin@Nightstar-7130bbf8.pltn13.sbcglobal.net] has joined #code |
15:52 | | mode/#code [+ao McMartin McMartin] by ChanServ |
15:53 | <&ToxicFrog> | (zipmap keys vals) |
15:55 | | Karono [Karono@Nightstar-0e4527e4.optusnet.com.au] has quit [Ping timeout: 121 seconds] |
15:56 | | Karono_ is now known as Karono |
16:05 | <@froztbyte> | hahaha |
16:05 | <@froztbyte> | it still astounds me that TheWatcher is a perl person |
16:05 | <@froztbyte> | it just doesn't click |
16:06 | <@TheWatcher> | Heh, why's that? |
16:06 | <@froztbyte> | two parts to the reason |
16:07 | <@froztbyte> | part 1) when perl's the answer, something almost definitely went terribly wrong |
16:07 | <@froztbyte> | part 2) you seem otherwise sane |
16:07 | <@Tamber> | That's because you don't have the fonts to render the Text From The Beyond, so you're not seeing all the really strange stuff. |
16:08 | <@froztbyte> | Tamber: a very likely hypothesis |
16:08 | <@froztbyte> | TheWatcher: but I've asked you about this before, and have subsequently chalked it up to different mental models of serving things |
16:08 | <@froztbyte> | err |
16:08 | <@froztbyte> | solving |
16:09 | <@froztbyte> | herp derp friday. |
16:09 | <@Tamber> | You never could get the hang of Thursdays? |
16:09 | <@froztbyte> | see |
16:09 | <@froztbyte> | that by itself is evidence of why this week should be shot in the face already |
16:10 | <@froztbyte> | fortunately I'm not working tomorrow |
16:10 | <@froztbyte> | unfortunately I'm dealing with the license department tomorrow :( |
16:11 | | * TheWatcher passes froztbyte the whiskey |
16:15 | <@froztbyte> | can I mix the vodka? |
16:16 | <@TheWatcher> | Knock yourself out. |
16:18 | < Syka_> | it's thursday??? |
16:18 | < Syka_> | woah it is |
16:18 | < Syka_> | i am so late for bin day |
17:58 | | Derakon [chriswei@Nightstar-a3b183ae.ca.comcast.net] has joined #code |
17:58 | | mode/#code [+ao Derakon Derakon] by ChanServ |
17:58 | | * Derakon mutters at Python. |
17:59 | <&Derakon> | print u"%s" % self.members |
17:59 | <&Derakon> | That throws an error "'ascii' codec can't encode character u'\xe1' in position 28: ordinal not in range(128)" |
17:59 | < [R]> | yeah |
17:59 | < [R]> | its got the high bit set |
18:00 | <&Derakon> | But I shouldn't be trying to use ASCII here; the string is flagged as unicode. |
18:01 | | Karono [Karono@Nightstar-0e4527e4.optusnet.com.au] has quit [[NS] Quit: sleep] |
18:01 | <&Derakon> | Also I can do 'print u"\xe1"' just fine. |
18:02 | < Syka_> | um |
18:02 | < Syka_> | does % need a special thing for a unicode string |
18:04 | <&Derakon> | I don't think so, but I can never manage to track down that particular bit of documentation. |
18:05 | < Syka_> | u"{0}".format(self.members) maybe? |
18:05 | <&Derakon> | I use the "%s" % self.members syntax. |
18:06 | < Syka_> | well, you don't if it doesn't work |
18:06 | <&Derakon> | (Mostly because it's close to the old printf syntax, which is an ad-hoc standard) |
18:07 | < Syka_> | here we go |
18:07 | < Syka_> | "%s - String (converts any Python object using str())." |
18:07 | < Syka_> | http://docs.python.org/2/library/stdtypes.html#string-formatting |
18:08 | <&Derakon> | See note 6. |
18:08 | < Syka_> | "If the object or format provided is a unicode string, the resulting string will also be unicode." |
18:08 | <&Derakon> | And I'm working with nothing but unicode strings here AFAICT. |
18:08 | < Syka_> | hum |
18:10 | <&Derakon> | The other weird thing is that I can print each individual object just fine. |
18:10 | < Syka_> | what if you wrap self.members in unicode() :P |
18:10 | <&Derakon> | Tried that. No good. |
18:10 | <&Derakon> | I can print each individual member just fine, but printing unicode(self.members) fails. |
18:11 | < Syka_> | hmm |
18:11 | <&Derakon> | NB self.members is a set. |
18:11 | < Syka_> | "print u"hello %s" % "?"" |
18:11 | < Syka_> | this fails |
18:11 | < Syka_> | "print "hello %s" % "?"" does not |
18:11 | < Syka_> | get rid of the u? |
18:12 | <&Derakon> | Uh, both of those work for me. |
18:12 | <&Derakon> | And the u is indicating a unicode string. |
18:12 | < Syka_> | wait wait |
18:12 | < Syka_> | python 2 or 3? |
18:12 | <&Derakon> | 2. |
18:12 | < Syka_> | hmm |
18:12 | <&Derakon> | Necessary third-party libraries aren't available in 3 yet. |
18:12 | < Syka_> | because the first one fails with the error you have |
18:13 | <&Derakon> | Oh, was that an accented 'o'? |
18:13 | <&Derakon> | I can reproduce the error in the REPL by using an accented 'o'. |
18:13 | < Syka_> | ...yes that's what I had? |
18:13 | <&Derakon> | The accent didn't come through in this IRC client. |
18:13 | <&Derakon> | This is bizarre. |
18:14 | < Syka_> | also, unrelated |
18:14 | < Syka_> | STEAM SUMMER SALES ARE UP |
18:14 | <&Derakon> | Why would removing a "treat this string as unicode" indicator fix a failure-to-translate-unicode error? |
18:14 | <@gnolam> | Derakon: where are you printing this to? |
18:14 | <&Derakon> | Gnolam: terminal. |
18:14 | <@gnolam> | Because Python + windows console = fail. |
18:14 | <&Derakon> | OSX terminal. |
18:15 | <&Derakon> | Again, I can print the individual members just fine, and the accents do show. |
18:15 | <@gnolam> | Ah. Don't know about OS X's terminal. |
18:15 | <&Derakon> | So it's not a terminal problem. |
18:15 | <@gnolam> | Ah. |
18:15 | <&Derakon> | It's when I try to print all the members at once that I get the error. |
18:16 | <&Derakon> | ...ha. "print self.members" doesn't work. "print unicode(self.members)" doesn't work. |
18:17 | <&Derakon> | "print map(unicode, self.members)" does work. |
18:17 | <&Derakon> | What the Christ. |
18:18 | < Syka_> | oooh. |
18:18 | < Syka_> | does self.members get called by repr |
18:18 | < Syka_> | does repr handle unicode okay? |
18:18 | <&Derakon> | It's in __repr__, yes. |
18:19 | <&Derakon> | ...oh, should I be using __unicode__ instead? |
18:19 | < Syka_> | i... don't know |
18:20 | <&Derakon> | Changing __repr__ to __unicode__ does seem to have fixed the problem in this case. |
18:26 | <&Derakon> | Whoof, writing the savefile took almost 10 seconds this time. I think my previous serializations were incomplete. |
18:26 | <&Derakon> | (And the savefile itself is 14MB...) |
18:27 | <@Tarinaky> | Is this before or after you mangle it through a compressor? |
18:27 | <&Derakon> | Compression brings it down to 1MB. |
18:27 | <&Derakon> | Oh, this is with profiling turned on, forgot about that. |
18:27 | <@Tarinaky> | That's a lot of save file. |
18:28 | <@Tarinaky> | RPG or something? |
18:28 | <&Derakon> | My time is split pretty evenly between the "analyze data and convert to JSON-acceptable formats" and "actually encode the data with the json library". |
18:28 | <&Derakon> | It's the Debug Town for Pyrel, which is a roguelike. |
18:28 | <&Derakon> | But it's saving things in a rather abstract way. |
18:28 | <@Tarinaky> | Ah-hah. Not just a save file then. |
18:29 | <&Derakon> | Since the engine is trying to be agnostic about how things are arranged. |
18:29 | <@Tarinaky> | Since it also contains the world and maps and stuff as well. |
18:29 | <&Derakon> | Well, Pyrel doesn't have persistent levels, but yeah. |
18:31 | <&Derakon> | The main thing is that it's encoding all of the object interrelationships automatically. |
18:32 | <&Derakon> | So e.g. this wall is a Terrain datatype that contains a Stats object that contains two StatMod objects. |
18:39 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has quit [Ping timeout: 121 seconds] |
18:47 | < RichyB> | Pyrel ? |
18:49 | < RichyB> | Derakon: I'm not going to do it tonight, but would you like to remind me at some later point to do the work to wrap a proper ordinary C extension about the "heatmap" code so that it just builds with ordinary setup.py instead of you having to work out how to bundle the .dll or .so file? https://github.com/RichardBarrell/heatmap-for-Derakon |
18:50 | <&Derakon> | RichyB: that would be awesome, yes. |
18:51 | <&Derakon> | There's no rush, though; we have a system that basically works for the developers (who all have the necessary compilation tools). |
18:51 | | * RichyB stuffs that into the middle of ~/.plan |
18:51 | <&Derakon> | But more simple = more better, as always. :) |
18:51 | <&Derakon> | Thanks again for your work on the heatmap. :) |
18:51 | < RichyB> | No worries. |
18:52 | < RichyB> | PyRel is on Github too, right? |
18:52 | <&Derakon> | Bitbucket. |
18:52 | <&Derakon> | https://bitbucket.org/derakon/pyrel |
18:52 | <&Derakon> | But it uses Git. |
18:53 | <&Derakon> | (Much to my dismay, I couldn't convince the other devs to figure Mercurial out...) |
18:53 | < RichyB> | Ah cool. I use bitbucket in work. |
18:53 | < RichyB> | Yeah, I used to ignore them until they added good Git support. ;) |
18:53 | < RichyB> | We use bitbucket in work because their pricing model works for us. |
18:53 | | * Derakon nods. |
18:53 | < RichyB> | They charge per-user, github charge per-repo. |
18:54 | < RichyB> | We have lotsa repos, few users. |
18:54 | <&Derakon> | Ahh. |
18:54 | <&Derakon> | Here at work we have, uh, 1 repo and 1 user. |
18:54 | < RichyB> | Also, github recently changed their UI and I fucking hate the new one. |
18:54 | | himi [fow035@Nightstar-5d05bada.internode.on.net] has joined #code |
18:54 | | mode/#code [+o himi] by ChanServ |
18:54 | < RichyB> | All the buttons that I used to know where to click on them have now moved. |
18:54 | <&Derakon> | Is this change for the sake of change, or are there any objective improvements? |
18:54 | < RichyB> | Some thundering retard appears to have deliberately reduced the prominence of the goddamn clone URL. |
18:55 | <&Derakon> | D'oh. |
18:55 | < Syka_> | it's right in the corner |
18:55 | < Syka_> | you use the clone URL once per project |
18:55 | <&Derakon> | And it's the first thing you do in that project, before you know your way around. |
18:55 | < RichyB> | I don't know, I assume that it's probably objectively better according to some metric. |
18:55 | < Syka_> | right at the top, it took like |
18:55 | < Syka_> | 60px |
18:56 | < Syka_> | that's terrible |
18:56 | < RichyB> | I don't really care, because it's personally worse for me right now. |
18:56 | < RichyB> | So yeah, woo bitbucket. |
18:56 | <&Derakon> | Heh. |
19:21 | <&ToxicFrog> | Yeah, personally I don't mind no longer having the useless clone URL taking up a huge chunk of screen right at the top. |
19:21 | <&ToxicFrog> | And I'm feeling pretty charitable towards github right now because they reinstated downloads~ |
19:23 | < RichyB> | Jenkins is really nice... |
19:28 | < Syka_> | jenkins is ok |
20:05 | <&McMartin> | It aggros all the build targets |
20:05 | <&McMartin> | 10:53 <&Derakon> And it's the first thing you do in that project, before you know your way around. |
20:06 | <&McMartin> | There's a blog on this; and yeah, that was why they originally did it that way, but they determined that this was not the part people were mostly using on the site |
20:15 | | Kindamoody|out is now known as Kindamoody |
20:25 | <&Derakon> | Erk, my deserializer has a problem. It can't differentiate between sets and custom classes that inherit from sets. |
20:25 | <&Derakon> | And as a result, when deserializing, you always get sets out. |
20:25 | <&ToxicFrog> | Oops. |
20:26 | <&ToxicFrog> | Oh, that reminds me. Rogue Legacy, as a procedurally generated platformer, may be relevant to your interests if you haven't already played it. |
20:26 | <&Derakon> | The problem here is that a custom class that descends from set doesn't pass isinstance(object, types.InstanceType). |
20:26 | <&Derakon> | TF: yes, I've been keeping an eye on it. |
20:26 | <&Derakon> | I'm hoping that by the time I finish with AP, there'll be a Mac port~ |
20:27 | <&ToxicFrog> | FWIW, it works flawlessly in wine under linux |
20:27 | <&Derakon> | Since it's liable to be the kind of game that I'd play for 15-30 minutes at a stretch, not really worth rebooting for. |
20:37 | | Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code |
20:37 | | mode/#code [+qo Vornicus Vornicus] by ChanServ |
20:39 | | * Derakon asks in #python on Freenode, gets knowledgeable but not really helpful response. |
20:40 | <~Vornicus> | What's the question? |
20:41 | <&Derakon> | How do I detect that an object is an instance of a class when the class it is an instance of inherits from a builtin like set or dict? |
20:41 | <&Derakon> | isinstance(object, types.InstanceType) fails in that case. |
20:42 | <~Vornicus> | um. |
20:44 | <&Derakon> | Slightly more complicated question than you were hoping for, I think. :) |
20:45 | | Kindamoody is now known as Kindamoody[zZz] |
20:46 | <~Vornicus> | Yes. |
20:46 | <~Vornicus> | You just want to know that it is a class other than a builtin? |
20:47 | <~Vornicus> | Whether or not it inherits from a builtin? |
20:49 | | Turaiel[Offline] is now known as Turaiel |
20:52 | | Typherixf is now known as Typherix |
20:53 | <&Derakon> | Yes. |
20:54 | <&Derakon> | The workaround I'm using for now is "hasattr(object, '__class__') and object.__class__.__name__ in my registry of serializable objects". |
20:54 | <&Derakon> | s/objects/object types/ |
20:56 | <&Derakon> | ...unfortunately, object.__class__.__name__ appears to be 'type' in one case. WTF? |
20:56 | <~Vornicus> | wtf |
21:00 | <&Derakon> | Oh, dumbass mistake on my part. |
21:00 | <&Derakon> | "lambda **kwargs: Categories" is not the same thing as "lambda **kwargs: Categories()". |
21:02 | <~Vornicus> | haha |
21:02 | <~Vornicus> | Yeah, that one's caught me more than a few times |
21:03 | <&Derakon> | It's caught me several times while implementing save/load. |
21:03 | <&Derakon> | Stupid class/instance distinction. |
21:05 | | Turaiel is now known as Turaiel[Offline] |
21:09 | | Turaiel[Offline] is now known as Turaiel |
21:25 | | You're now known as TheWatcher[afk] |
21:44 | <&Derakon> | Haha! Loading worked! |
21:44 | <&Derakon> | 8.3s to save, 4.2s to load. |
21:44 | <&Derakon> | This is not great. |
21:45 | <&Derakon> | But it works! |
22:00 | | Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [[NS] Quit: Leaving] |
22:08 | | Typherix is now known as Typh|offline |
22:15 | <&Derakon> | Interesting. A save of the largely-empty Debug Town is 14MB; a save of a dungeon full of walls and corridors and creatures and so on is 16MB. |
22:16 | <&ToxicFrog> | I kind of suspected that a lot of the size of the empty town is overhead that you'll have in any save file. |
22:16 | <&Derakon> | Yeah, my expectation is that much of this cost is just storing the map grid. |
22:18 | <&Derakon> | Y'know, for all the inefficiencies in this system, this is Really Cool. |
22:20 | <&Derakon> | All an object needs to do to be [de]serializable is: 1) have a unique ID across all objects; 2) have a function that creates a new blank instance of the object type; 3) (optional) have a function that populates a blank instance with data (otherwise, setattr is used); 4) have a function that returns a dict of the object's data for serialization (ofter, this is simply object.__dict__); 5) register with the serialization module. |
22:20 | <&Derakon> | Saving the game involves making a Serializer instance, handing it the GameMap, and telling it to write to a file; it tracks down all the object dependencies itself, converts everything into a JSON-friendly format, and creates the dump. |
22:20 | <&Derakon> | Loading the game involves pointing a Deserializer instance at the savefile and calling the load() method. |
22:21 | <&Derakon> | Then the getGameMap() function on the result. |
22:34 | <&Derakon> | Hmph, somewhere in here a Cell is morphing into a Container, and I have no idea why. |
22:35 | <&Derakon> | (Cells are just extended Containers) |
22:42 | <&Derakon> | Ah, the problem is likely down to trying to re-use IDs somehow. |
22:54 | | Reiv [NSwebIRC@Nightstar-95746c1f.kinect.net.nz] has joined #code |
22:54 | | mode/#code [+o Reiv] by ChanServ |
23:02 | <&Derakon> | Yep, the problem is that when the GameMap is told to add an entity to a Container with a specific ID, it creates a Container with that ID if it doesn't already have one. |
23:02 | <&Derakon> | Thus leading to overlapping Containers. |
23:05 | | VirusJTG [VirusJTG@Nightstar-09c31e7a.sta.comporium.net] has joined #code |
23:23 | | Typh|offline [Typherix@Nightstar-7dc8031d.mi.comcast.net] has quit [Ping timeout: 121 seconds] |
23:24 | | Turaiel [Brandon@Nightstar-7dc8031d.mi.comcast.net] has quit [Ping timeout: 121 seconds] |
23:25 | | ktemkin[awol] is now known as ktemkin[work] |
23:27 | | Derakon [chriswei@Nightstar-a3b183ae.ca.comcast.net] has quit [[NS] Quit: leaving] |
23:35 | | Typh|offline [Typherix@Nightstar-7dc8031d.mi.comcast.net] has joined #code |
23:37 | | Turaiel [Brandon@Nightstar-7dc8031d.mi.comcast.net] has joined #code |
23:42 | <&McMartin> | ... hey, an excuse to use Clojure at work |
23:42 | <&McMartin> | \o/ |
23:45 | | Typh|offline [Typherix@Nightstar-7dc8031d.mi.comcast.net] has quit [Ping timeout: 121 seconds] |
23:46 | | Turaiel [Brandon@Nightstar-7dc8031d.mi.comcast.net] has quit [Ping timeout: 121 seconds] |
--- Log closed Fri Jul 12 00:00:31 2013 |