--- Log opened Sun Feb 03 00:00:39 2008 |
00:03 | <@McMartin> | That reminds me, I should do my colortable haxxings tomorrow. |
00:03 | <@McMartin> | Since I head off for birthdays, lasers, and general r0xx0r soonish. |
00:03 | <@Derakon> | Colortables? What for? |
00:05 | <@McMartin> | UQM |
00:05 | <@Derakon> | Is this so you can do palette-swapping or something? |
00:06 | <@McMartin> | We already do. |
00:06 | <@McMartin> | This is specifically for the 57 kinds of planets. |
00:06 | <@Derakon> | Hyper/quasispace? |
00:06 | <@Derakon> | Ah. |
00:06 | <@McMartin> | And that |
00:06 | <@McMartin> | And some of the shield/warp effects. |
00:06 | | * Derakon nods. |
00:06 | <@McMartin> | So yeah, basically everything's paletted or fakes it |
00:06 | <@Derakon> | Heh. |
00:06 | <@McMartin> | However, planetary palettes include a fair number of hideously ungodly hacks, and a few dozen lines of python to generate the requisite index and header files should sort that right out. |
00:07 | <@Derakon> | Heh. |
00:07 | <@McMartin> | Then I can move on towards actually having the *code* refer to things like "planet.selenic.colortable" and such instead of 0x23e007f06L. |
00:08 | <@Derakon> | Having code right code is kinda like reflection; used properly, it's really neat. Used incorrectly, it makes me tear my hair out. |
00:08 | <@Derakon> | Yowza. Yeah, no hex plzkthx. |
00:08 | <@Derakon> | And, uh, s/right/write/ |
00:09 | <@McMartin> | Making this bit Not Suck has been on our TODO list since 0.2 was released. |
00:09 | | You're now known as TheWatcher |
00:09 | <@McMartin> | And on the "it'll be in the next release, for sure" list since 0.3~ |
00:09 | <@McMartin> | But it's so tightly tied into the code that we've had to do huge amounts of analysis and refactoring just to figure out where to apply the pressure. |
00:09 | <@McMartin> | And now we can. |
00:10 | <@McMartin> | I believe I noted a couple months ago that finally, after five years, we were able to just use pointers everywhere and thus use malloc and free instead of the weird memory-handle system they had. |
00:10 | <@McMartin> | (And that actually broke a plot element which was deliberately leaking memory to get a desired effect. wtf, yo) |
00:11 | <@McMartin> | http://bugs.uqm.stack.nl/show_bug.cgi?id=1028 |
00:12 | <@Finerty> | That was a couple /weeks/ ago. |
00:12 | <@McMartin> | OK. |
00:12 | <@McMartin> | Work on that removal started in early December. |
00:12 | <@McMartin> | I guess I didn't crow about it until it was done, in mid-January. |
00:13 | <@Finerty> | What happens on e camelopardis? |
00:13 | <@McMartin> | ... and that means my rent is due on Tuesday. |
00:13 | | * Derakon tries to figure out the FK code he wrote last time he was working on Lamarkand. |
00:13 | <@McMartin> | It would, instead of taking off, just start giving the "This vault is empty now" message over and over and over and over. |
00:14 | <@McMartin> | And actually it was supposed to just give the message once and ignore it ever after, like the 'synth ruins. |
00:14 | <@Finerty> | Oh, that's where the, uh, what'chacallems are? |
00:14 | <@Finerty> | the rat-girls. |
00:14 | <@Derakon> | Syreen ships? |
00:14 | <@McMartin> | The fleet of Space Dildoes. |
00:14 | <@Finerty> | Oh. |
00:14 | <@Derakon> | Heh. |
00:14 | <@McMartin> | The rat-girls are in Cerenkov. |
00:14 | <@Derakon> | Shofixti maidens is what you were thinking of. |
00:14 | <@McMartin> | (ribbed for her pleasure) |
00:15 | | * Derakon takes out half of McM's fleet with some judicious hypotization. |
00:15 | | * McMartin is a pretty fair pilot with them himself. |
00:15 | <@McMartin> | The classic counter is of course the unmanned Probe. |
00:15 | <@Derakon> | Which I never got the hang of flying. |
00:16 | <@McMartin> | (Well, OK. The *classic* counter is the Mycon Podship, but.) |
00:16 | <@Derakon> | Heh. |
00:16 | <@Derakon> | Why the Podship? Just because it can regenerate? |
00:16 | < UndeadAnno> | In Soviet Russia, you can control the Probe. |
00:16 | <@Derakon> | Or because the Mycon were in SC1? |
00:16 | <@McMartin> | Speed and range advantage. |
00:16 | <@McMartin> | And yeah. |
00:16 | <@McMartin> | There was an SC1 scenario built around it. |
00:17 | <@McMartin> | Hierarchy restricted to Podship and Blazer; Alliance restricted to Skiff and Penetrator. |
00:17 | <@McMartin> | "Match your strength against the enemy's weakness" |
00:17 | <@Derakon> | Heh. |
00:17 | <@Derakon> | How is the Penetrator good against the Blazer? |
00:17 | <@McMartin> | The Penetrator has a bit of a speed advantage over the Podship, but not enough of one. |
00:18 | <@Derakon> | Skiff vs. Podship is obvious. |
00:18 | <@McMartin> | The Siren call *shreds* them, and the only time the 'Synth can recover them is if it's not attacking at the time. |
00:18 | | * gnolam would distrust anything named "The Penetrator". |
00:18 | <@Derakon> | Ah. |
00:18 | <@Derakon> | Would you rather we called it the Giant Space Dildo? |
00:18 | <@McMartin> | Because the bubbles will typically wipe it out, and if it tries to recover crew in Blazer mode, it just fries them. |
00:18 | <@McMartin> | Not that it could hit them to begin with. |
00:19 | <@Derakon> | Ah. |
00:19 | <@McMartin> | (likewise, the bubbles make life Difficult for the Skiff) |
00:19 | <@McMartin> | (That said, that scenario was skewed heavily in the Alliance's favor) |
00:27 | <@Derakon> | Ragh...I don't see that I can do this FK without knowing the dimensions of the sprites involved. Which I can only do in C++. >.< |
00:28 | <@ToxicFrog> | FK? |
00:28 | <@Derakon> | Forward kinematics. |
00:28 | <@ToxicFrog> | Aah. |
00:28 | <@ToxicFrog> | Easy enough to bind them to Lua./ |
00:28 | <@Derakon> | Yeah. It's just ugly. |
00:29 | <@ToxicFrog> | Depends on how you do it. |
00:30 | <@Derakon> | Oh, it's not the bindings that are the problem. |
00:30 | <@Derakon> | It's the aesthetics of going to C++ for game data. |
00:31 | <@Derakon> | It's kinda like a Lua object needing to know where it is in the quad tree. |
00:31 | <@ToxicFrog> | How so? |
00:32 | <@ToxicFrog> | Also, how are the sprites already bound to Lua? |
00:32 | <@Derakon> | Lua shouldn't need to care about this kind of thing. |
00:32 | <@Derakon> | There's a "sprite" object in the engine that handles visual representations, animations, detecting collisions, and the like. |
00:32 | <@ToxicFrog> | ...there's no way to have it not care about the physical properties of the objects it's manipulating and perform a physics simulation on them. |
00:32 | <@Derakon> | It basically just goes out to Lua for the update cycle. |
00:33 | <@Derakon> | Well, up to now physical dimensions weren't a relevant physical property. |
00:33 | <@Derakon> | Since I'd neatly abstracted that away via bounding polygons. |
00:33 | <@ToxicFrog> | Aah. |
00:34 | <@ToxicFrog> | So, I'd guess that the update cycle looks something like getting the update function, push the sprite object and then lua_pcall it? |
00:34 | <@Derakon> | Buuuut now I have to say "rotate this sprite about its center. Now find this coordinate on its perimeter somewhere, and make it have this location". |
00:34 | <@Derakon> | Actually, game-relevant state is stored on the Lua side. |
00:35 | <@Derakon> | So it's "find the global Lua update function, and call it. It then calls each game object's update function." |
00:35 | <@Derakon> | Then when it's done, I grab the state for each object out of its table and push the relevant bits (location and rotation angle, mostly, but also aliveness state and other random bits) back onto the sprites. |
00:36 | <@ToxicFrog> | Aha. |
00:36 | <@ToxicFrog> | So, Lua contains the game state; C++ calls the master update function, which calls the object update functions, and when it returns, goes through all the objects copying relevant fields into C++ for further use? |
00:36 | <@Derakon> | Mind you, I can't remember why I do it this way, because at this point I'm basically working with my very own legacy codebase. ¬.¬ |
00:36 | <@Derakon> | Right. |
00:37 | <@Derakon> | I do this in part because there can be game objects that don't have any logical representation on the C++ side but still need to have their update functions called. I think. |
00:38 | <@ToxicFrog> | Fair enough. |
00:39 | <@ToxicFrog> | And now you're trying to do physics in Lua and finding out that it requires the use of data previously stored entirely in C++. |
00:39 | <@Derakon> | FK isn't physics, really...it's skeletal animation. |
00:40 | <@ToxicFrog> | Well, ok. |
00:40 | <@Derakon> | And the image data is in C++ because there was no reason to go around mucking with SDL_Surfaces in Lua before...and I see no reason to do it now. I'm just adding member fields to store the dimensions explicitly, and I'll write up a script to auto-generate module templates later when I need to make more. |
00:40 | <@Derakon> | Since, for this game, I won't be changing a sprite mid-stream. |
00:42 | <@ToxicFrog> | Right. |
00:42 | <@ToxicFrog> | And in that case you don't actually need to call out to C++ for the dimensions. |
00:42 | <@Derakon> | Right. |
00:42 | <@ToxicFrog> | You just store them in the table when it's first created. |
00:43 | <@Derakon> | Right. As a general-purpose solution, though, it doesn't scale. |
00:43 | <@Derakon> | It only works here because I'm not animating my sprites with multiple frames. |
00:43 | <@Derakon> | I'm just using translation and rotation. |
00:49 | <@Derakon> | Bah lack of a -= operator. |
00:53 | | gnolam [lenin@Nightstar-10613.8.5.253.static.se.wasadata.net] has quit [Quit: Z?] |
00:53 | <@ToxicFrog> | Lua doesn't have mutator operators, period. |
00:53 | <@ToxicFrog> | Although there's a patch that adds them. |
00:55 | <@Derakon> | Wow, that was a lot of syntax errors. |
00:55 | <@Finerty> | Heh. |
00:56 | <@ToxicFrog> | ...perhaps you should apply that patch? |
00:56 | <@Derakon> | No, no, got them sorted out. |
00:56 | <@Derakon> | The lack of minus-equals was only a minor problem. |
00:57 | <@Finerty> | what was the major problem? |
00:57 | <@Derakon> | Now my code simply doesn't do what I want it to do, instead of not doing anything at all. |
00:57 | <@Derakon> | The major problem was that I'd written more than five lines of code since I'd last run the program. |
00:58 | <@Finerty> | pff. |
01:20 | <@Derakon> | It's simultaneously amusing and a bit scary that I can generate 14k lines of logging in about five seconds. |
01:22 | <@Finerty> | Heh |
01:25 | <@Derakon> | Frickin' 1-indexed lists... |
01:34 | | * ToxicFrog patpats |
01:34 | <@Derakon> | Got a question for ya, TF... |
01:34 | <@Derakon> | http://rafb.net/p/5jr4wb25.html |
01:34 | <@Derakon> | That's a transformation matrix class I wrote. |
01:34 | <@Derakon> | I don't see how the output matches what I'm doing. |
01:35 | <@Derakon> | Specifically, how matrix[3][2] isn't zero. |
01:35 | <@Derakon> | ....oh, wait, nemmind. |
01:35 | | * Derakon coughs. |
01:35 | <@Derakon> | Output function is wrong. |
01:35 | <@Derakon> | Thank you! |
01:35 | <@Derakon> | TF is taking the place of my old CS prof's teddy bear. |
01:36 | <@Finerty> | Heh |
01:36 | <@Derakon> | (Back when one of my profs was in college, there was a teddy bear outside the TA's room. You told your problem to the bear before you talked to the TA. It worked quite well. When I was in college, I susbstituted composing emails to the TA/prof, most of which I never needed to send) |
02:45 | <@Derakon> | Argh, my transformation matrix is taking points in the wrong direction. |
02:45 | <@Derakon> | <56, -74> in computer coordinates rotated by 2 degrees counterclockwise should not be <58.55, -72.00>. |
02:46 | <@ToxicFrog> | Yes it should. |
02:47 | <@Derakon> | That's in the first quadrant. Rotating it should reduce X and increase Y. |
02:47 | <@ToxicFrog> | Plot (56,-74) in your head and rotate it - x increases and y decreases. |
02:47 | <@ToxicFrog> | It's in the lower right quandrant. |
02:47 | <@ToxicFrog> | I don't recall if that's also the first quadrant. |
02:47 | <@Derakon> | No, that's for positive Y. |
02:47 | <@Finerty> | Looks right to me. |
02:47 | <@ToxicFrog> | ...your Y value increases as you move down? |
02:47 | <@Derakon> | First quadrant in computer coordinates is <+, -> |
02:48 | <@Derakon> | This is probably my problem. |
02:48 | <@ToxicFrog> | "computer coordinates" are dependent on your libraries, rendering context, and UI conventions. |
02:48 | <@Derakon> | This is true. |
02:48 | <@ToxicFrog> | So that doesn't really help. |
02:49 | <@ToxicFrog> | Regardless, the quadrants are: |
02:49 | <@ToxicFrog> | -+ ++ |
02:49 | <@ToxicFrog> | -- +- |
02:49 | <@ToxicFrog> | And it's in +- |
02:49 | <@Finerty> | So it should go up and right |
02:50 | <@ToxicFrog> | Ergo, a counterclockwise rotation - towards ++ - will increase both x and y (which decreases the magnitude of y) |
02:50 | <@Derakon> | Yeah, yeah. |
02:50 | <@Derakon> | I'm not arguing that. |
02:50 | <@Derakon> | It looks like my quadrants are bazorkenated. |
02:50 | <@Derakon> | Hah! Got it! |
02:51 | < C_tiger> | Probably a signswap. |
02:51 | | * Derakon now has a core module with a wing module attached. |
02:51 | <@Derakon> | Yep. |
02:51 | <@Derakon> | Just swapped the sign before and after transforming, since the transform matrix is the only thing in "normal" coordinate space. |
02:51 | <@Derakon> | It's generally more convenient for me to have Y increase as you go down. |
02:53 | <@Derakon> | http://derakon.dyndns.org/~chriswei/temp2/fk.png |
02:53 | < C_tiger> | I still have trouble... I'm so used to the right-hand coordinate system where Z is up and Y is "in". |
02:53 | <@Derakon> | At some point I should give those actually plausible bounding polygons. They're auto-generated ATM. |
02:53 | <@Derakon> | Z? You have a Z axis? |
02:54 | <@Derakon> | Take your three-dimensional ways and get out! |
02:54 | <@Finerty> | If you're rotating the wrong way, Der, no matter the handedness of you thing, switch the signs of your xy/yx matrix points. |
02:54 | <@Derakon> | No, if I do that, then rotating by 0° isn't a null-op any more. |
02:55 | < C_tiger> | But either way, if you have x as left-to-right and y from top-to-bottom, that's a left hand coordinate system and that just FEELS wrong. |
02:55 | < C_tiger> | (I think. I'm confused.) |
02:55 | <@Finerty> | Der: uh... then you're doing it wrong? |
02:56 | <@Derakon> | Maybe I misunderstood what you were saying, Vorn. |
02:56 | <@Finerty> | In your rotation matric |
02:56 | <@Finerty> | if you're rotating the wrong way |
02:57 | <@Finerty> | Switch the signs on x->y and y->x... the 'sin' terms in the matrix |
02:57 | <@Derakon> | Hunh. How about that. |
02:58 | <@Derakon> | Could've sworn I tried that...but I guess I got the wrong combination of signs. |
02:58 | <@Derakon> | Thanks. |
02:58 | < C_tiger> | Totally a side question do any of you know of a simple way to turn an array into a string separated with commas and "and". i.e. ('a','b','c',34) -> 'a, b, c and 34' |
02:59 | <@Derakon> | Perl has a "join" function which would mostly do the trick. Probably similar functions exist in Python etc. |
03:00 | < C_tiger> | Well, minus the whole "and" part. |
03:00 | < C_tiger> | I can join, I'm not that dense. |
03:00 | <@Derakon> | So what's the problem, then? |
03:01 | < C_tiger> | I guess I can nuke the last comma... except my terms may include a comman. |
03:01 | < C_tiger> | comma. |
03:01 | < C_tiger> | It's not quite as simple as that. |
03:01 | < C_tiger> | join would give: 'a, b, c, 34' |
03:02 | < C_tiger> | nuking the last comma-space would be an easy regexp except if my final term includes a comma-space. |
03:03 | <@Finerty> | ', '.join(my_list[:-1]) + ' and ' + my_list[-1] |
03:03 | <@Finerty> | in Python |
03:03 | <@Derakon> | Yeah, just pop the last element off, do the join, then stick the last element onto the end. |
03:03 | < C_tiger> | Does that decompose nicely if list has one element? |
03:03 | < C_tiger> | Hmmm... |
03:03 | <@Finerty> | No. |
03:04 | < C_tiger> | Yeah, that's also very important. |
03:04 | < C_tiger> | I'll do the pop-join-add thing, I guess, with a good number of checks. |
03:04 | <@Finerty> | actually... |
03:05 | <@Finerty> | ...no, that doesn't work either, you get an empty string that it then joins. |
03:07 | <@Derakon> | ...naturally, the ship will not appear to move if the camera stays centered on it and it is the only object on-screen. |
03:10 | <@Derakon> | Hrm...I'm generating about 100 log lines per frame. |
03:10 | <@Derakon> | Go me! |
03:10 | <@Derakon> | And this is with all of four objects. |
03:12 | <@Derakon> | And now, I have not eaten anything in...seven hours. Dinnertime! |
03:12 | <@Finerty> | Heh |
03:50 | <@Derakon> | ...this is a circumstance that I did not anticipate. FK has mucked with my turrets' ability to aim. |
03:51 | <@Reiver> | FK? |
03:51 | <@Derakon> | They're inheriting rotation from their parents, which means that they have an inherent 90° rotation applied to everything they do. |
03:51 | <@Derakon> | Forward kinematics. |
03:51 | <@Derakon> | Basically the way you tell your wrist to move properly when your shoulder rotates. |
03:52 | <@Reiver> | Oh, right. |
03:53 | <@Finerty> | "recursive skeletal transforms" |
04:06 | <@Derakon> | There, that's fixed too. |
04:08 | <@Derakon> | http://derakon.dyndns.org/~chriswei/temp2/fk2.png |
04:09 | <@Derakon> | I see I have a minor drawing order problem...bah. |
04:32 | | You're now known as TheWatcher[zZzZ] |
06:28 | | Finerty is now known as Vornicus |
06:44 | | * Derakon tries to figure out how to make a symmetrical ship. |
06:44 | <@Derakon> | The problem being that some modules need to be rotated 180° relative to each other, while others do not. |
06:44 | <@Derakon> | Actually, really what I'll have to do is define some mirror transforms. :\ |
06:44 | <@Derakon> | Blast. |
07:25 | | Derakon is now known as Derakon[AFK] |
08:09 | | Doctor_Nick [~nick@Nightstar-23600.hsd1.fl.comcast.net] has quit [Client exited] |
10:02 | | You're now known as TheWatcher |
10:30 | < UndeadAnno> | Is there anything interesting to say about the address and data buses of the Intel 8051? |
10:31 | < UndeadAnno> | It's one of the points on this here compilation of mine, and all I have are two sentences. |
10:36 | | Reiver is now known as Orthia |
11:02 | < UndeadAnno> | Ah-HA! Wikibooks has something on the topic. |
11:46 | < UndeadAnno> | LOL. This guy's lecture notes include a comment on the first page "Egzamin (chyba ustny :/)", meaning "Exam (probably oral :/)". This amuses me for some reason. |
11:55 | | gnolam [lenin@85.8.5.ns-20483] has joined #Code |
11:55 | | mode/#code [+o gnolam] by ChanServ |
12:23 | | Serah [~Z@87.72.35.ns-26506] has joined #Code |
16:15 | | * TheWatcher eyes strftime, buhs |
16:18 | <@TheWatcher> | okay, this is bizzare. If I do |
16:18 | <@TheWatcher> | perl -e "use POSIX qw(strftime); print strftime('%a, %d %b %Y %T', localtime());" |
16:18 | <@TheWatcher> | I get |
16:18 | <@TheWatcher> | Sun, 03 Feb 2008 16:18:51 |
16:19 | <@TheWatcher> | If I do the same thing inside this cgi script, I get |
16:19 | <@TheWatcher> | Sunday, 03 February 2008 16:18:51 |
16:42 | <@ToxicFrog> | /exec date +'%a, %d %b %Y %T' |
16:42 | <@ToxicFrog> | Sun, 03 Feb 2008 11:26:43 |
17:02 | | You're now known as TheWatcher[afk] |
18:24 | | Derakon[AFK] is now known as Derakon |
18:52 | | Serah [~Z@87.72.35.ns-26506] has quit [Ping Timeout] |
18:54 | | Syloqs-AFH [~Syloq@NetAdmin.Nightstar.Net] has quit [Connection reset by peer] |
19:03 | | You're now known as TheWatcher |
19:16 | | Serah [~Z@87.72.35.ns-26506] has joined #Code |
22:01 | | UndeadAnno [AnnoDomini@83.21.52.ns-26733] has quit [Ping Timeout] |
22:08 | | UndeadAnno [AnnoDomini@83.21.1.ns-26447] has joined #Code |
23:14 | | Orthia is now known as Reiver |
--- Log closed Mon Feb 04 00:00:45 2008 |