--- Log opened Mon Jan 05 00:00:35 2009 |
00:01 | | Finerty is now known as Vornicus |
00:04 | | You're now known as TheWatcher[t-2] |
00:06 | | You're now known as TheWatcher[zZzZ] |
00:26 | <@Derakon> | Okay, the 'aim' direction type is implemented. |
00:26 | | gnolam [lenin@Nightstar-1382.A163.priv.bahnhof.se] has quit [Quit: Z?] |
00:28 | | * Derakon fires a random spray of bullets, each of which waits 30s before firing a bullet directly at the player. |
00:36 | <@Derakon> | And there's the 'sequence' direction type done. |
00:36 | <@Derakon> | Lemme tell you, an emitter firing a spiral of bullets that themselves fire bullets at the player? Hard to dodge. |
00:40 | <@Consul> | Is the idea to make the game impossible to beat? |
00:40 | <@GeekSoldier> | Bullet Hell indeed. |
00:40 | <@Derakon> | The idea is to exercise the features I'm implementing. |
00:40 | <@Derakon> | The fact that it's killing me is an unintended bonus~ |
00:40 | <@Consul> | Oh, okay. |
00:42 | <@Consul> | Okay, I now have to google "Ode to ODEs" just to see if someone wrote one. |
00:43 | <@Consul> | Crap, it gets confused with "An Ode to Odes", which is so not what I'm looking for. |
00:46 | <@Consul> | I guess the ODEous task shall fall upon me, then. |
00:46 | | * Consul ducks and runs. |
00:46 | <@Derakon> | ...hrm. |
00:47 | <@Derakon> | I have no idea how to go about doing the 'relative' direction type. |
00:47 | <@Derakon> | Or, wait, actually I might. |
00:47 | <@McMartin> | Is it degrees, or cartesian translation? |
00:47 | <@Derakon> | It's degrees. |
00:47 | <@Derakon> | And it's relative to the direction of the firing bullet. |
00:47 | <@Derakon> | (i.e. fire a new bullet at right-angles to the current one) |
00:47 | <@McMartin> | Aha. |
00:47 | <@Derakon> | s/i.e./e.g./ |
00:48 | <@McMartin> | Probably for more like "five degrees, and wait 1" |
00:48 | <@McMartin> | For the "flywheels" |
00:48 | <@Derakon> | Yeah. |
00:50 | | Alek [~omegaboot@Nightstar-23762.dsl.emhril.sbcglobal.net] has joined #code |
00:53 | <@Derakon> | Hrm. Well, that's not right. |
00:53 | <@Derakon> | I implemented <vanish>, and as soon as it triggers, every bullet dies. |
00:53 | <@Derakon> | I suspect I have a problem here with objects sharing each others' actions or something. |
00:55 | <@Derakon> | Ahh, yeah, that'd be it. copy.deepcopy() to the rescue! |
00:56 | | * Derakon makes a spiral of bullets which, after 50 frames, make hard right turns. |
00:59 | <@Derakon> | That's actually kinda neat. Put this into the BulletML demo (inside the <bulletml> tags): http://paste.ubuntu.com/99930/ |
01:02 | <@Derakon> | Hmm...my system as implemented can't handle circular references. |
01:08 | <@Derakon> | And I'm honestly not sure how to fix it |
01:09 | <@Derakon> | (For example: I want to define two bullets "left" and "right" which submunition into their opposites after 50 frames) |
01:46 | | * Derakon fixes it! |
01:46 | <@Derakon> | And that is a dang cool pattern. |
01:47 | <@Derakon> | (Fix: lazy evalution FTW) |
02:41 | < ASCII> | der- now you relize that you need to create a ai solver for your game |
02:41 | <@Derakon> | Psh. |
02:56 | < ASCII> | either that or buy an korean teenager and a case of soda |
02:56 | | * Derakon has a sandwich made from fresh-baked bread. |
02:58 | | * ASCII has an entire loaf of fresh baked bread |
02:58 | < ASCII> | plus a tin of moderately freshly baked cookies and two slightly fresh rolls |
02:59 | <@Derakon> | Well, yes, I'm not eating the entire loaf. That would be gluttony. |
03:29 | < ASCII> | and glutenous |
03:55 | | * Derakon cackles maniacally at his latest bullet pattern. |
03:55 | <@Derakon> | I've taken a page from Kobo Deluxe~ |
03:55 | <@Derakon> | Namely: having a bunch of bullets fired to the side of your ship is very annoying. |
03:56 | <@Derakon> | Mind you, in this game you don't actually have to move, so sitting pretty is a fairly effective strategy. |
04:00 | <@McMartin> | Today in #code, Derakon reinvents the concept of "covering fire"~ |
04:00 | | * Derakon snorts. |
04:14 | <@Derakon> | Hrm. Reading up on __getitem__ and __setitem__, it seems like I should be able to treat any instances as a class to access its member fields direction, but I'm getting the error "AttributeError: Bullet instance has no attribute '__getitem__'" |
04:15 | <@Derakon> | C.f. http://paste.ubuntu.com/100034/ |
04:21 | <@McMartin> | You access memberfields with ., not with [] |
04:21 | <@McMartin> | That's Obvious Problem. |
04:21 | <@McMartin> | There may be Subtle Problem; one moment while I check that |
04:21 | <@Derakon> | I don't think "obj.self.type" would do what I want here. |
04:21 | <@Derakon> | And putting parens in doesn't make Python happy. |
04:22 | <@McMartin> | Drop the .self |
04:22 | <@Derakon> | Wouldn't it then try to look up the 'type' field in obj? |
04:23 | <@Derakon> | Instead of "look up the field whose name is whatever type is"? |
04:23 | <@Derakon> | Basically, I'm trying to adjust either a bullet's speed or its direction here. |
04:23 | <@McMartin> | http://paste.ubuntu.com/100040/ |
04:24 | <@Derakon> | Yeah, see, I want to do "r = 'z'; print a.r" and get 3 out. |
04:24 | <@Derakon> | Except of course that wouldn't work. |
04:24 | <@McMartin> | Sec while I recall the syntax for that. |
04:24 | <@Derakon> | self.type is 'speed' or 'direction', depending; I want to modify the field in obj that has the same name as what type is. |
04:24 | <@McMartin> | setattr(a, 'r', 'z') |
04:25 | <@Derakon> | So, setattr(obj, self.type, new speed/direction)? |
04:26 | <@McMartin> | "type" is the name of the field? |
04:26 | <@McMartin> | Oh, wait, n/m, I see |
04:26 | <@McMartin> | Yeah, that would be right. |
04:27 | <@Derakon> | Cool. |
04:30 | <@Derakon> | ...well, that's not what I expected, but it is damned cool. |
04:30 | <@Derakon> | I have orbit! |
04:30 | <@Derakon> | Anyway, get/set appear to work now. Thanks! |
04:47 | <@Derakon> | Couple notes: a) don't update the bullet's direction twice per frame; b) keep your directions in the region [0, 2pi] lest you calculate excessively large changes of heading. |
05:18 | <@Derakon> | Okay, changeDirection and changeSpeed are implemented. |
05:19 | <@Derakon> | I think all that's left is accel now. |
05:38 | <@Derakon> | Simple acceleration done. Sequence and relative accel are going to be a bit more annoying. |
05:40 | <@McMartin> | How is homing handled? |
05:41 | <@Derakon> | <direction> tags have a type, which can be 'absolute' (value is an offset from 0 degrees), 'relative' (value is an offset from parent object's direction), or 'aim' (value is an offset from vector aimed at the player). |
05:42 | <@ToxicFrog> | That doesn't sound like you can make projectiles that are smart enough to lead the target. |
05:42 | <@Derakon> | It isn't. |
05:43 | <@Derakon> | As a general rule, the player in shmups does not have a velocity; just a position that gets modified if directional inputs are keyed. |
05:43 | <@Derakon> | If you want to lead the player, just bracket his position. |
05:45 | | Alek [~omegaboot@Nightstar-23762.dsl.emhril.sbcglobal.net] has quit [Quit: reboot... effing updates.] |
05:45 | <@Derakon> | ...the docs aren't clear at all on what relative or sequential acceleration mean, and I don't see any examples that use non-absolute acceleration. |
05:46 | <@McMartin> | Relative is presumably as always |
05:47 | <@Derakon> | So, what, rotate the provided acceleration vectors to be aligned with the bullet's current direction? |
05:47 | <@Derakon> | All the docs say is "If the type is "relative", the acceleration is relative to the acceleration of this bullet." |
05:47 | <@Derakon> | But my bullets don't have inherent acceleration; their velocities are mucked with by ChangeFuncs and AccelFuncs. >.< |
05:53 | | * Derakon chokes at QC. |
06:09 | | AnnoDomini [~farkoff@Nightstar-84.neoplus.adsl.tpnet.pl] has joined #Code |
06:09 | | mode/#code [+o AnnoDomini] by ChanServ |
06:11 | | Alek [~omegaboot@Nightstar-23762.dsl.emhril.sbcglobal.net] has joined #code |
06:20 | | Tarinaky [~Tarinaky@Nightstar-16638.plus.com] has joined #code |
06:22 | | Derakon is now known as Derakon[AFK] |
08:17 | | Vornicus [~vorn@Admin.Nightstar.Net] has quit [Quit: ] |
08:30 | < Tarinaky> | Does anyone know a few good guides to SDL? |
08:31 | < Tarinaky> | I know libsdl.org has some documentation. |
08:39 | | KBot [AnnoDomini@Nightstar-29734.neoplus.adsl.tpnet.pl] has joined #Code |
08:41 | | KarmaBot [AnnoDomini@Nightstar-84.neoplus.adsl.tpnet.pl] has quit [Ping Timeout] |
08:41 | | AnnoDomini [~farkoff@Nightstar-84.neoplus.adsl.tpnet.pl] has quit [Ping Timeout] |
08:42 | | KBot is now known as KarmaBot |
08:48 | | AnnoDomini [~farkoff@Nightstar-29734.neoplus.adsl.tpnet.pl] has joined #Code |
08:48 | | mode/#code [+o AnnoDomini] by ChanServ |
09:21 | | You're now known as TheWatcher |
11:55 | | gnolam [lenin@Nightstar-1382.A163.priv.bahnhof.se] has joined #Code |
11:55 | | mode/#code [+o gnolam] by ChanServ |
14:50 | <@ToxicFrog> | Tarinaky: I just use the SDL docwiki linked from there. |
16:09 | | gnolam [lenin@Nightstar-1382.A163.priv.bahnhof.se] has quit [Ping Timeout] |
16:14 | | gnolam [lenin@Nightstar-1382.A163.priv.bahnhof.se] has joined #Code |
16:14 | | mode/#code [+o gnolam] by ChanServ |
16:37 | | Syloqs_AFH [~Syloq@Admin.Nightstar.Net] has joined #code |
16:38 | | Syloqs_AFH is now known as Syloqs-AFH |
17:03 | < Tarinaky> | I'm playing around with the different SDL functions. Anyway, when one of these demo programs ends my terminal is reporting a Segmentation Fault. The program behaves pretty much how I expect despite this. How should I go about finding the bit of code that's causing the problem? |
17:04 | <@AnnoDomini> | Check if you are overwriting bits of tables that are in fact not in the tables. |
17:04 | <@AnnoDomini> | C arrays are fun like that. |
17:04 | < Tarinaky> | I'm not (explicitly) using any arrays. |
17:04 | < Tarinaky> | Unless one of the SDL functions is doing it behind my back. |
17:05 | < Tarinaky> | Best I can come up with is it might be something dodgy in a destructor somewhere. |
17:05 | < Tarinaky> | Oh wait. |
17:06 | < Tarinaky> | Hahaha. |
17:06 | < Tarinaky> | I see the problem. |
17:06 | < Tarinaky> | I'm calling SDL_FreeSurface twice on the same surface. |
17:09 | <@AnnoDomini> | Heh. |
17:09 | | * Tarinaky >.>s |
17:09 | < Tarinaky> | Maybe not. Now I just broke it completely. |
17:15 | | MyCatVerbs [~mycatverb@Nightstar-13709.lurkingfox.co.uk] has joined #code |
17:15 | | mode/#code [+o MyCatVerbs] by ChanServ |
17:19 | | You're now known as TheWatcher[afk] |
17:22 | | * Tarinaky blinks. Why does giving a harmless integer the value of 1 cause a segfault... |
17:23 | < Tarinaky> | More importantly, why does giving that integer a value of 0 some of the time cause me to avert a memory based segfault. |
17:23 | | Consul [~consul@Nightstar-2535.dsl.sfldmi.ameritech.net] has quit [Quit: Leaving] |
17:24 | <@MyCatVerbs> | Tarinaky: it's adjacent to something important and you're crapping on it. |
17:25 | <@MyCatVerbs> | Tarinaky: either run your program through valgrind (quick, inaccurate way) or check all of your pointer arithmetic and array indexing. |
17:25 | <@AnnoDomini> | Tarinaky: Pastie your program? |
17:26 | < Tarinaky> | I'm not using any pointers and my day long 'fuck about with SDL and try out cool things' has turned into an OOP sprawl spread across far too many files to pastebin easily. |
17:27 | <@AnnoDomini> | You use many files. ._. |
17:27 | <@AnnoDomini> | I wrote my snake in a single file. <_< |
17:27 | <@ToxicFrog> | Tarinaky: step one, deploy gdb |
17:27 | <@ToxicFrog> | Run program inside gdb and obtain a stack trace |
17:27 | <@ToxicFrog> | Step two, deploy valgrind, it's like lint but for memory access |
17:27 | < Tarinaky> | AnnoDomini: I know. I like using make to make my life harder though :P |
17:28 | < Tarinaky> | Also: make clean fixed my problem >.> |
17:28 | <@ToxicFrog> | That's a sign that your make dependencies are screwed up and you need to revise your makefile~ |
17:29 | <@MyCatVerbs> | Or delete your Makefiles and use automake or cmake or scons or something. |
17:30 | | Consul [~consul@Nightstar-2535.dsl.sfldmi.ameritech.net] has joined #code |
17:30 | | mode/#code [+o Consul] by ChanServ |
17:30 | < Tarinaky> | Eh. I'll learn one of those when I'm not writing something more sexy than just dumping bits of a screenshot I made this morning all over an SDL surface. |
17:31 | < Tarinaky> | *when I'm writing something more sexy than |
17:34 | | * ToxicFrog uses Prime Mover for build management |
17:57 | <@McMartin> | Tarinaky: I learned SDL mainly from what is now the docwiki, and from http://cone3d.gamedev.net/cgi-bin/index.pl?page=tutorials/gfxsdl/index |
18:06 | | Vornicus [~vorn@Admin.Nightstar.Net] has joined #code |
18:06 | | mode/#code [+o Vornicus] by ChanServ |
18:24 | | * MyCatVerbs snerks at Prime Mover's website ( http://www.cowlark.com/prime-mover/index.html ). "Due to magic..." |
18:25 | <@AnnoDomini> | Well, technology is slowly going towards magic anyway. |
18:26 | <@AnnoDomini> | Given that today's people, judging from my fellow students, don't think understanding how the x86 architecture works is useful, or that they need to know any language beside Java... |
18:27 | <@AnnoDomini> | ...I predict that eventually, everything will be done by rote, with precious few having any incling towards comprehending why they are doing things they are doing. |
18:29 | | * Vornicus thinks knowing how x86 works is not that useful usually. How "most processors" work on the other hand is pretty good. |
18:30 | <@AnnoDomini> | That's what I meant. :P |
19:15 | | You're now known as TheWatcher |
19:55 | <@TheWatcher> | "slowly going towards magic"? |
19:56 | <@TheWatcher> | I'd argue that, for the majority of the population, most technology is essentially magic. They have no real clue how it works, anyway |
19:57 | | * TheWatcher is occasionally tempted to get his business cards printed with "Technomage" on them, as it's not far from the truth normally. |
20:13 | <@gnolam> | Heh. |
20:20 | <@gnolam> | It's surprising how often you can get away with blaming something on "a problem with the flux capacitors". |
20:26 | <@TheWatcher> | Indeed. |
20:26 | | * Vornicus declares his surprise that python's random module doesn't have a binomial distribution. |
20:48 | | Tarinaky [~Tarinaky@Nightstar-16638.plus.com] has quit [Client exited] |
21:22 | <@McMartin> | Only knowing Java will also get you much further than only knowing pretty much any other language. |
21:22 | <@McMartin> | The only other one-trick pony I can think of that's at all reasonable would be C++ |
21:22 | <@McMartin> | Which isn't reasonable at all. |
21:23 | <@McMartin> | (Mediocre Java programmers are much less worrying than mediocre C++ programmers) |
21:37 | < simontwo> | I was at an interesting talk at school today |
21:37 | < simontwo> | given by a Sun spokesman about the future of Java |
21:38 | <@McMartin> | Just a spokesman, or an actual bigwig? |
21:38 | < simontwo> | well, Thorbj?rn Fritzon. not sure what a bigwig is. :) |
21:39 | < simontwo> | one of his slides said: A question I get asked a lot: Will Ruby kill Java? |
21:39 | <@McMartin> | ... that's the most ridiculous question I've ever heard. |
21:39 | < simontwo> | yeah, it was kinda put on edge |
21:39 | <@McMartin> | ("bigwig" would have been, say, Gosling or Steele) |
21:39 | < simontwo> | but I guess what he meant was: does he think that Java will survive newer, domain-specific languages? |
21:39 | < simontwo> | ah |
21:40 | < simontwo> | yeah, I guess we're not that special. :P |
21:40 | <@McMartin> | Or that local~ |
21:40 | < simontwo> | (this was a guest speaker at an entry course on OO) |
21:40 | <@McMartin> | That's still a bizarre question, though. Domain-specific languages by definition cannot displace general-purpose ones. |
21:40 | < simontwo> | so anyway, his answer was that the JVM might when the Java language won't. |
21:40 | <@McMartin> | That's why the latter are called, you know, "general purpose". |
21:40 | <@McMartin> | That's pretty reasonable. |
21:40 | < simontwo> | yeah |
21:40 | <@McMartin> | The JVM is full of spiders. |
21:41 | < simontwo> | especially after he showed how cool it is |
21:41 | <@McMartin> | The JVM spec has actual footnotes that boil down to "whoops, our bad" |
21:41 | < simontwo> | it supposedly supports bytecode compilation from something like twenty languages already |
21:41 | < simontwo> | heh, okay |
21:41 | <@McMartin> | Yeah, and there are some other cool tricks you can do with it since it can reoptimize code while it's running. |
21:41 | < simontwo> | I only read parts of the java spec which is worrysome. |
21:41 | < simontwo> | ah |
21:42 | <@McMartin> | I could easily see the JVM being superceded by a Better JITted Bytecode System. |
21:42 | < simontwo> | I wanted to ask him a question but never got around to it. |
21:42 | < simontwo> | definitely |
21:42 | <@McMartin> | But compiling to bytecode that gets JITted is no longer the "what is wrong with you" that it was in '96. The point's been proven. |
21:42 | <@McMartin> | They have, in a sense, Shown Them All |
21:42 | < simontwo> | not sure exactly what you mean by that. |
21:43 | <@McMartin> | In the early days of Java, the idea of shipping in bytecode and either interpreting it or compiling to native code at load time was widely derided as insanity. |
21:43 | < simontwo> | one cool fact from the talk was: JRuby runs three times faster than Matz' native thing. |
21:44 | <@McMartin> | Yeah, good odds that Ruby's terp is not tuned for speed |
21:44 | < simontwo> | right |
21:44 | < simontwo> | but still used in a production environment :) |
21:45 | <@McMartin> | Efficiency is nothing until you can prove you don't have it. |
21:45 | < simontwo> | so there's companies adding more servers to their farms because of a program that is more a proof-of-concept interpreter than an optimized environment. |
21:46 | < simontwo> | right |
21:46 | <@McMartin> | It's cheaper than hiring more programmers to write and maintain it in a language that compiles stuff faster |
21:46 | <@McMartin> | "proof-of-concept" also here means "guaranteed to get the right answers" |
21:48 | < simontwo> | hey, I've got a Java question if anyone is up for it |
21:48 | <@McMartin> | Shoot |
21:48 | <@McMartin> | (though I'm actually more comfortable at the bytecode level, for odd reasons) |
21:49 | | * simontwo finds some code that speaks for itself |
21:50 | < simontwo> | so, paste.ubuntu.com/100594 (apparently I'm not authed to post URLs.) |
21:50 | | mode/#code [+v simontwo] by McMartin |
21:50 | <+simontwo> | thanks. |
21:51 | <@McMartin> | Hrm, Swing |
21:51 | <+simontwo> | I'm sort of abusing the ActionListener to load files specified from a dynamically generated menu. |
21:51 | <+simontwo> | right. |
21:52 | <@McMartin> | That doesn't look all that abused to me; you're just having config_manager subscribed to a bunch of actions. |
21:52 | <+simontwo> | yeah |
21:52 | <+simontwo> | but at the same time, part of the assignment is trying to keep MVC-true |
21:53 | <@McMartin> | I assume config_manager is calling getActionCommand() to figure out what needs doing here. |
21:53 | <@McMartin> | That looks fine to *me*, since it looks like you're generating a View out of the Model, which is what you're supposed to do |
21:53 | <@McMartin> | Butif you think it violates your assignment, check with your TA |
21:53 | <+simontwo> | and config_manager is part of the model, which means the view is speaking directly to the model. all other Swing stuff (buttons) speak through the controller because clicking them is just one command. |
21:53 | <@McMartin> | Aha. |
21:53 | <+simontwo> | well, I already did that and they agree. |
21:54 | <@McMartin> | If you're worried about that, though, make a forwarding class that basically just takes the actionPerformed() call, extracts the command, and passes that in as a String to the manager proper. |
21:54 | <+simontwo> | like "Exit" or "Stop Simulation" and so on. |
21:54 | <+simontwo> | ah, right. |
21:54 | <@McMartin> | That'll give you the buffer you want. |
21:54 | <@Vornicus> | Ruby will not replace Java any time soon. |
21:54 | <+simontwo> | that's true. |
21:55 | <@McMartin> | (And that wasn't clear from the code you pasted; I'd have the buffer just so that I could more easily do CLI unit tests without linking in Swing) |
21:55 | <@Vornicus> | If at all. Ruby is quite good at making the language look like what you're trying to do, but everybody extends teh language. |
21:55 | <@Vornicus> | So you can't integrate stuff nearly as well as you can in Java. |
21:56 | <+simontwo> | McMartin, yes. well, thanks for the advice... I hadn't thought about it, but it would work. |
21:57 | <@McMartin> | It's a little outside my specialty, but glad to be of service. |
22:23 | | ASCII [~none@Nightstar-7066.dyn.optonline.net] has quit [Ping Timeout] |
22:45 | | Alek [~omegaboot@Nightstar-23762.dsl.emhril.sbcglobal.net] has quit [Quit: reboot. :(] |
23:37 | | AnnoDomini [~farkoff@Nightstar-29734.neoplus.adsl.tpnet.pl] has quit [Quit: I like my random encounters like I like my tea and my women - deadly.] |
23:47 | | You're now known as TheWatcher[T-2] |
23:52 | | You're now known as TheWatcher[zZzZ] |
23:58 | | Attilla [~The.Attil@Nightstar-9469.cdif.cable.ntl.com] has quit [Connection reset by peer] |
23:58 | | Attilla [~The.Attil@Nightstar-9469.cdif.cable.ntl.com] has joined #code |
23:58 | | mode/#code [+o Attilla] by ChanServ |
--- Log closed Tue Jan 06 00:00:29 2009 |