code logs -> 2012 -> Fri, 15 Jun 2012< code.20120614.log - code.20120616.log >
--- Log opened Fri Jun 15 00:00:15 2012
00:00
< Rhamphoryncus>
The alternative interpretation is that storing the faces rather than the vertices is Fail, heh
00:08
< gnolam>
Tamber: I know :o
00:44
<~Vornicus>
Rham: I am /still/ not seeing where you get enough data to math this up
00:44
<~Vornicus>
What data precisely do you have.
01:01 You're now known as TheWatcher[T-2]
01:03 Number3 is now known as ShellNinja
01:07 You're now known as TheWatcher[zZzZ]
01:10 himi [fow035@D741F1.243F35.CADC30.81D435] has joined #code
01:10 mode/#code [+o himi] by ChanServ
01:12 cpux [cpux@Nightstar-c5874a39.dyn.optonline.net] has joined #code
01:40 Vash [Vash@Nightstar-241cb5d4.wlfrct.sbcglobal.net] has joined #code
01:40 mode/#code [+o Vash] by ChanServ
01:44
<~Vornicus>
Strange results of mathematics: the largest constructible polygon with an odd number of sides has 2^32-1 sides.
01:48
<~Vornicus>
(and all constructible polygons have a number of sides equal to a power of two times a factor of that same number)
01:49
< gnolam>
Are you sure that's not "the largest constructible polygon on a 32-bit machine"?~
01:50
<@ToxicFrog>
"constructible polygon"?
01:51
<&McMartin>
You can build it with nothing but compass and unmarked straightedge
01:51
<~Vornicus>
That.
01:51
< celticminstrel>
Heh.
01:51
<~Vornicus>
You can construct a polygon if, when you take out all the 2s, it's a product of distinct fermat primes.
01:51
< celticminstrel>
@ gnolam
01:53
<~Vornicus>
(or rather, these are regular polygons)
01:53
< Rhamphoryncus>
Vornicus: the normal vector is centered at 0,0,0 for the triangle. The triangle is unit length, equilateral, and the main vertex is north (+y or whatever)
01:53
<~Vornicus>
I don't see how "centering" the normal vector helps you.
01:54
<~Vornicus>
A normal vector is generally given as a unit vector for easy calculation.
01:54
< Rhamphoryncus>
the normal is unit
01:54
< Rhamphoryncus>
The size of the triangle doesn't actually matter, that's why I called it unit length
01:58
<~Vornicus>
but th...
01:58
<~Vornicus>
Okay, give me all the data you /have/, we'll figure out what we're looking at
01:59
< RichyB>
Vornicus, there might be a bigger constructible polygon with an odd number of sides, but only if there's a sixth Fermat prime?
01:59
< Rhamphoryncus>
The height of the triangle and the slope of the triangle. I can apply the height after though (it shifts the whole thing up), so all that matters here is the slope
02:02
< celticminstrel>
I keep feeling like you're saying "triangle" when you mean "tetrahedron"...
02:02
< celticminstrel>
...but also when you mean "triangle"...
02:02
< Rhamphoryncus>
no, it's a triangle
02:02
<~Vornicus>
RichyB: yes.
02:03
<~Vornicus>
But since it's widely believed that there are no more fermat primes, well
02:03
<~Vornicus>
Is this a triangle in R^2 or R^3?
02:03
< Rhamphoryncus>
Imagine you're looking at an orthographic projection from directly overhead. You cannot see the +z dimension. Now draw a triangle on your screen. What are the heights (+z) of the 3 corners?
02:04
< Rhamphoryncus>
Not sure what that means
02:04
< celticminstrel>
It's the number of dimensions.
02:04
< celticminstrel>
ie, 2D or 3D?
02:05 RichyB [MyCatVerbs@Nightstar-3b2c2db2.bethere.co.uk] has quit [[NS] Quit: Leaving]
02:05
< celticminstrel>
More specifically, is the triangle positioned in three dimensions.
02:05
< Rhamphoryncus>
It's positioned in 3d but the triangle itself is just a triangle.
02:06
<~Vornicus>
Okay, so you've got an equilateral triangle in 3 space
02:06
<~Vornicus>
equilateral, unit triangle.
02:06
< Rhamphoryncus>
Before applying the slope it's equilateral
02:06
<~Vornicus>
And you have its normal vector, and one of its points.
02:06
<~Vornicus>
Oh oh oh, I see
02:07
<~Vornicus>
You have an isometric grid.
02:07 Attilla [Obsolete@Nightstar-245c4d9c.as43234.net] has quit [Ping timeout: 121 seconds]
02:07
<~Vornicus>
You have a normal vector for each triangle in that grid.
02:07
<~Vornicus>
You need to generate heights from this.
02:07
<~Vornicus>
of the vertices.
02:08
< Rhamphoryncus>
something like that
02:09
<~Vornicus>
Okay, /this/ we can do.
02:12
< Rhamphoryncus>
hmm, I can rotate my normal. That simplifies what I need to do
02:12
<~Vornicus>
It's a pain though because technically your true normal is heavily limited by the normals of surrounding triangles.
02:12
< Rhamphoryncus>
or maybe solves it?
02:12
<~Vornicus>
So you may have trouble getting them to line up.
02:13
< Rhamphoryncus>
Vornicus: forget them. I'm going to average them out as a later step
02:13
< Rhamphoryncus>
This is more of an experiment to see what it looks like as I increase/decrease the LOD
02:13
<~Vornicus>
Okay, so you're doing the triangles independently. Got you.
02:14
< Rhamphoryncus>
It should be sufficient to flatten the 3d normal vector into a 2d one
02:16
<~Vornicus>
3d vector to gradient
02:16
<~Vornicus>
really though it's
02:17
<~Vornicus>
dot(normal, coordinate) = 0
02:20
<~Vornicus>
solve for coordinate.z and you get heights. Problem there though is that neighboring triangles don't have /jack/ to do with each other, so averaging is going to be considerably harder.
02:20
< Rhamphoryncus>
I'm lazy. Averaging will consist of adding all 6 together and dividing by 6 ;)
02:21
< Rhamphoryncus>
I'm starting to question the whole approach though
02:21
<~Vornicus>
But the thing is
02:21
<~Vornicus>
THat DFW because the positions have nothing to do with each other.
02:21
< Rhamphoryncus>
doesn't fucking work?
02:21
<~Vornicus>
Yeah
02:21
< Rhamphoryncus>
Because they're randomly generated?
02:23
<~Vornicus>
No, because the positions are only valid as relative to other positions on that same triangle.
02:24
<~Vornicus>
THey are not, in any sense, global positions.
02:24
< Rhamphoryncus>
The triangle has an overall height and the x,y are predetermined
02:24
<~Vornicus>
"overall height"?
02:24 Derakon[AFK] is now known as Derakon
02:25
< Rhamphoryncus>
the height parameter for the face
02:25
<~Vornicus>
Yeah I didn't have any idea you had that.
02:25
< Rhamphoryncus>
I've said it multiple times
02:25
<~Vornicus>
No you didn't.
02:25
<~Vornicus>
You said you had a normal vector.
02:25
< Rhamphoryncus>
[18:59:07] <Rhamphoryncus> The height of the triangle and the slope of the triangle. I can apply the height after though (it shifts the whole thing up), so all that matters here is the slope
02:26
<~Vornicus>
and at that point I was still under the impression you were doing an entirely different thing
02:26
<~Vornicus>
Okay, so here's your thing:
02:27
<~Vornicus>
dot(normal, coordinate) = dot(normal, centroid)
02:27
<~Vornicus>
Solve for coordinate.z and you have your answer.
02:27
< Rhamphoryncus>
I'll have to look that up
02:27
<~Vornicus>
that's dot product.
02:28
<~Vornicus>
By this point in your adventures you should have met it
02:28
< Rhamphoryncus>
Haven't needed it. Or I did and I found a work around because I wasn't familiar with it ;)
02:28
< Rhamphoryncus>
My brain was rejecting all math last night
02:28
< Rhamphoryncus>
Oh, I could also be doing it but not know the proper name
02:29
<~Vornicus>
dot(a, b) is, in 2 dimensions, a.x * b.x + a.y * b.y
02:29
<~Vornicus>
it's the summation of the cartesian product of two vectors.
02:30 * Rhamphoryncus nods
02:30
<~Vornicus>
the centroid of your triangle is the average of the coordinates of the corners of the triangle for x, y, and your height for z
02:30
< Rhamphoryncus>
yeah
02:31
<~Vornicus>
That should get you pretty far.
02:31
< Rhamphoryncus>
I'll definitely read up on dot product soon since I'm sure I'll be needing it
02:31
< Rhamphoryncus>
But maybe you can help answer if this is the wrong approach
02:31
<~Vornicus>
Dot product is awesome; cross product is even more awesome.
02:31
<~Vornicus>
I don't know, how are you generating your heights and normals?
02:31
< Rhamphoryncus>
There's two reasons I can see to store the face rather than the vertices
02:33
< Rhamphoryncus>
One, vertices have more peculiar edge cases, particularly at the vertices of the global icosahedron (where 5 converge rather than 6)
02:33
<~Vornicus>
Sensible
02:33
< Rhamphoryncus>
Two, when downsampling faces to reduce LOD it's natural to average across multiple, but for vertices you're at the corner anyway so it's natural to just take that corner and ignore the rest
02:34
<~Vornicus>
(also your macro-edge and macro-vertex things aren't single-authority)
02:34
< Rhamphoryncus>
The second reason I'm really doubting
02:34
< Rhamphoryncus>
hmm?
02:35
<~Vornicus>
When considering vertices, vertices along the icosahedron edge and at the vertices are (generally) duplicated.
02:35
<~Vornicus>
Okay.
02:35
< Rhamphoryncus>
yeah
02:35
<~Vornicus>
About downsampling.
02:36
<~Vornicus>
Do you remember the Most Important Thing about making solid models?
02:36 Kindamoody[zZz] is now known as Kindamoody
02:36
< Rhamphoryncus>
no :)
02:36
<~Vornicus>
OKay: The Most Important THing about making solid models is... that vertices of adjacent triangles must be coincident.
02:36
< Rhamphoryncus>
meaning the same spot exactly?
02:37
<~Vornicus>
Yes.
02:37
< Rhamphoryncus>
I know the opengl rule about vertices and edges being exactly identical
02:37
<~Vornicus>
If you cannot guarantee this, you are /doomed/
02:38
<~Vornicus>
THere will be holes in your model and those make hulk mad.
02:38
< Rhamphoryncus>
That's why to calculate a vertex I take the adjacent faces, average them, then apply in the 1, 2, or 6 places it needs
02:40
<~Vornicus>
I'm not sure it's sensible to /do/ this for face-centric worlds.
02:41
< Rhamphoryncus>
Averaging that way when I'm just storing the faces?
02:42
<~Vornicus>
I mean, sure, you could /do/ it, but the real problem then is, well, you've got this...
02:43
<~Vornicus>
I...
02:43
< Rhamphoryncus>
I realized that it was smoothing over most of the detail. My random heightmap was rendering much smoother than the detail underneath. That's dropping a good chunk of resolution
02:43
<~Vornicus>
Right. You'll live, you can't win that fight.
02:44
< Rhamphoryncus>
That's why I added the slopes. That means I store more resolution but the actual rendering is used fully
02:44
< Rhamphoryncus>
but it's an ugly way to do it
02:45
<~Vornicus>
Unless you've got some awesome handtuned LOD mipper, you're not going to get your low-detail stuff to look at all like the high-detail stuff.
02:46
< Rhamphoryncus>
No, but simply averaging the faces is *crap*. Doing it because it has a "natural" way of downsampling is simply wrong. There's plenty of other ways I can downsample
02:47
<@Alek>
hrm.
02:47
< Rhamphoryncus>
If I store vertices directly then all I have to do is the downsampling. The rendering isn't taking any more away
02:48
<~Vornicus>
I mean
02:48
<@Alek>
if I have a deck of 40 cards. what are the odds I'll draw 3 specific ones, regardless of order?
02:48
< Rhamphoryncus>
1/40 * 1/39 * 1/38
02:49
< Rhamphoryncus>
hrm
02:49
< Rhamphoryncus>
No, that's not right :)
02:49
< Rhamphoryncus>
3/40 * 2/39 * 1/38
02:49
< Rhamphoryncus>
Nice to have a clue what I'm talking about lol
02:49
<~Vornicus>
40C3 = 40! / (3! * 37!) = 40 * 39 * 38 / (3 * 2 * 1) = 20 * 13 * 38 = 980 distinct hands.
02:50
< Rhamphoryncus>
oh, more than 3 draws?
02:51
<~Vornicus>
so 1/980 chance you'll get the three cards you want.
02:53
<@rms>
9880
02:54
<~Vornicus>
er. 9800.
02:54
<~Vornicus>
I can Add.
02:54
<@rms>
How am I 80 off?
02:54
<~Vornicus>
wait, wtf, 9880?
02:55
<~Vornicus>
...oh, because I am.
02:55
<~Vornicus>
13*19 is 247, not 245
02:55
<~Vornicus>
How the hell
02:55 * Vornicus can't do math in his head at the moment apparently
02:56
< Rhamphoryncus>
afk
02:56
<~Vornicus>
http://www.wolframalpha.com/input/?i=40c3 I mean honestly this is why we have calculators and the internet, why was I trying to do it in my head
02:57
<@Alek>
o_o
03:16
< Rhamphoryncus>
back
03:20 * Alek teraflops.
03:21
<~Vornicus>
I honestly do not know whether you'll be able to get -- okay, here's my thought - when you do the detail downsample you'll probably want a sort of gaussian blur to get the right value - this is Expensive though, so you'll want to hold on to those downsamples.
03:21
< Rhamphoryncus>
yeah
03:22
< Rhamphoryncus>
Which fortunately isn't hard.
03:25
< Rhamphoryncus>
Was it you that had the geodesic dome image?
03:26
< Rhamphoryncus>
oh geodesic grid gives the good results, unlike geodesic dome
03:28
<@Alek>
heh. nice. http://notalwaysright.com/well-to-do-if-a-bit-daffy/20373
03:29 * Alek snerks mightily. http://notalwaysright.com/sudo-religious/20367
03:35
< celticminstrel>
That one's not really funny.
03:36
< celticminstrel>
The first one was though.
03:37 Kindamoody is now known as Kindamoody|working
04:07 * Rhamphoryncus goes on a tangent
04:08
< Rhamphoryncus>
If I took a totally different approach like delaunay triangulation for my map grid then the biggest issue is the lack of gridlines on which to store my vertex data
04:09
< Rhamphoryncus>
IOW, how do you break down a delaunay triangulation into triangle strips?
04:10
<&Derakon>
Start in upper-left corner, grab adjacent triangle that has leftmost vertex, repeat?
04:11
< Rhamphoryncus>
maybe
04:13
< Rhamphoryncus>
I have an urge to just use a texture.. which'd be square... funny that :P
04:21 maoranma [nbarr@Nightstar-a092c26c.pools.spcsdns.net] has joined #code
04:24 Noah [nbarr@Nightstar-a092c26c.pools.spcsdns.net] has quit [Ping timeout: 121 seconds]
04:49
< Rhamphoryncus>
http://www.flickr.com/photos/7861878@N06/3556592941/in/photostream
04:49
< Rhamphoryncus>
yup, was Vornicus
05:05
<~Vornicus>
I never got around to doing more with that. I should see what I can pull off.
05:06 * Rhamphoryncus has gone in a circle again
05:07
< Rhamphoryncus>
Probably a reason why people like cubes. Simple, even if not terribly good
05:07
< Rhamphoryncus>
I'm trying to find a way to simplify this scheme and make it more vertex-oriented than face-oriented
05:08
<~Vornicus>
I don't really see that vertex orientation is doing you much good right now.
05:08
< Rhamphoryncus>
You mean the face orientation?
05:08
< Rhamphoryncus>
Rendering uses vertices, period
05:08
<~Vornicus>
right.
05:09
<~Vornicus>
I mean if you're doing what I was planning - a Civ - face orientation is how you store shit
05:10
< Rhamphoryncus>
Most user stuff will be objects placed at real coordinates
05:10
<~Vornicus>
but vertex orientation is Where It's At when you want to do terrain generation.
05:11
< Rhamphoryncus>
But the map itself, to the degree that it's persistent and mutable, needs an ultimate level of detail. It also needs reduced LOD derived from that
05:11
< Rhamphoryncus>
yeah
05:12
< Rhamphoryncus>
So.. if I scrap this idea of recursive subdivision of the triangle.. define the grid as the whole planet from step 1, then set *arbitrary* limits on which areas are active..
05:12
<~Vornicus>
You want to do fun stuff with LOD? You can do it the hard way with crazy face shit, or you can just blur down your details using vertex data
05:13
< Rhamphoryncus>
Use fixed point math for object placement, probably with 3 axis to ensure I always have decent precision (or find something better later on)
05:13
< Rhamphoryncus>
Blur sounds like the way to go
05:15
< Rhamphoryncus>
I don't need it to be painful. I have certain goals, "OMGWTF" levels of precision in my LOD are not amongst them. Keeping it simple enough that I can throw hardware at it and render enough triangles to make it irrelevant is.
05:16
< Rhamphoryncus>
Damnit, I have an urge to play spore XD
05:18
< Rhamphoryncus>
Maybe I'm doing this all wrong
05:18
< Rhamphoryncus>
Think about this from an opengl point of view
05:19
< Rhamphoryncus>
What I want is a single global megatexture (upcoming hardware form is PRT - Partially Resident Texture)
05:19
< Rhamphoryncus>
map areas in and out as needed
05:20
< Rhamphoryncus>
mipmaps of the entire thing
05:21
<~Vornicus>
partially resident texture, like, you have a giant sparsely populated texture?
05:22
< Rhamphoryncus>
It's virtual memory for the GPU
05:22
< Rhamphoryncus>
You allocate address space for the whole thing, including the mipmaps, and it uses whatever detail is available as well as providing hooks for when you should start loading new spots
05:24
< Rhamphoryncus>
So, if I take this approach, the implication is there's only *one* problem to deal with: seamless texture edges
05:29 * Rhamphoryncus looks at cube maps
05:30
< Rhamphoryncus>
Gonna go mull it over
05:36 iospace is now known as iospacedout
06:06 Vash [Vash@Nightstar-241cb5d4.wlfrct.sbcglobal.net] has quit [[NS] Quit: I lovecraft Vorn!]
06:36
< celticminstrel>
Is it worth it to keep around a surface many times larger than the window?
06:37
< celticminstrel>
It would be something that's drawn once and then copied from as needed.
06:42 Derakon is now known as Derakon[AFK]
06:49
< Rhamphoryncus>
That's what a megatexture does. On disk you have the full texture but you only load pieces at a time
06:59
< celticminstrel>
Well, this would be keeping it in memory, not on disk.
06:59
< celticminstrel>
It's formatted text, basically.
07:01
< Rhamphoryncus>
err, is this a different subject from what I'm doing?
07:01
< celticminstrel>
Not sure?
07:02
< Rhamphoryncus>
I'm talking about my global map in opengl
07:02
< celticminstrel>
My question had nothing to do with what you were talking about before that.
07:03
< Rhamphoryncus>
okay. Ignore my response involving megatextures :)
07:04
< Rhamphoryncus>
Is yours a 2d scrolling background?
07:04
< celticminstrel>
More or less.
07:05
< Rhamphoryncus>
I suppose it depends on how much ram it takes relative to the rest of the program
07:05
< Rhamphoryncus>
As well as how rapidly you'll be switching between areas
07:05
< celticminstrel>
I don't really know the answer to the ram question.
07:05
< Rhamphoryncus>
What's the resolution?
07:06
< celticminstrel>
As for the other question, this can be accessed from anywhere just by pressing F1, but in practice I wouldn't expect it to be accessed frequently.
07:06
< celticminstrel>
800x600 currently
07:06
< Rhamphoryncus>
That's the window. How about this image?
07:06
< celticminstrel>
Oh.
07:06
< celticminstrel>
I don't know.
07:06
< celticminstrel>
Width is the same as the window.
07:07
< Rhamphoryncus>
Rule of thumb for an uncompressed image is 4 bytes/pixel. 800*600*4=1.9 megs
07:07
< celticminstrel>
Height is at least ten times the window at the moment, and it might get larger later.
07:07
< Rhamphoryncus>
So if your image is a hundred windows high then you've got ~200 megs
07:07
< celticminstrel>
Okay.
07:08
< Rhamphoryncus>
You're in the grey area in between. Obviously on a typical computer you'd be fine at 200 megs
07:08
< celticminstrel>
Okay, so quite likely worth it?
07:09
< Rhamphoryncus>
Well, what'll happen if you tile it is you'll have it on disk in compressed form, which the OS will cache into ram anyway
07:09
< celticminstrel>
Tile it?
07:09
< celticminstrel>
What?
07:09
< Rhamphoryncus>
chop it up into window-sized portions
07:10
< celticminstrel>
At the moment I'm rendering it on demand.
07:10
< Rhamphoryncus>
Oh, by surface do you mean an actual hardware surface? opengl or d3d surface?
07:11
< celticminstrel>
I don't have a separate surface at the moment. I'm rendering it straight to the screen (except for the bits where I'm scaling things down by half).
07:11 * Rhamphoryncus nods
07:11
< Rhamphoryncus>
I'd say it's cleaner to render on the fly
07:11
< celticminstrel>
Okay then.
07:11
< Rhamphoryncus>
So if you've already got it implemented.. keep it
07:12
< celticminstrel>
So now I need to find a way to input a pixel location and get a line index back,
07:12
< celticminstrel>
So I know where to start rendering.
07:13
< celticminstrel>
Currently I'm just keeping track of the line number, but that makes for somewhat irregular scrolling.
07:24
< celticminstrel>
I suppose I could just run through the entire rendering process minus the actual rendering until I get to the onscreen part... though that seems inefficient...
07:28
< celticminstrel>
Yeah, there's a noticeable lag towards the bottom if I do that.
07:33
< celticminstrel>
Maybe I can build up a list of line heights as I render...
07:33
< Rhamphoryncus>
Keep the two nearest lines and interpolate between them?
07:34
< celticminstrel>
How?
07:36
< Rhamphoryncus>
no clue :)
07:36
< Rhamphoryncus>
I really don't understand what you're doing
07:49
< celticminstrel>
I'm not sure if I understand it myself. :P
07:49
< celticminstrel>
Anyway bedtime.
07:50 celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
08:08 Kindamoody|working is now known as Kindamoody
08:48
< froztbyte>
http://developer.ubuntu.com/showdown/
09:07 Attilla [Obsolete@Nightstar-245c4d9c.as43234.net] has joined #code
09:14 Rhamphoryncus [rhamph@Nightstar-5697f7e2.abhsia.telus.net] has quit [Operation timed out]
09:14 You're now known as TheWatcher
09:32 Rhamphoryncus [rhamph@Nightstar-5697f7e2.abhsia.telus.net] has joined #code
09:33 himi [fow035@D741F1.243F35.CADC30.81D435] has quit [Ping timeout: 121 seconds]
10:14 Atreus is now known as Tarinaky
10:21 RichyB [MyCatVerbs@Nightstar-3b2c2db2.bethere.co.uk] has joined #code
--- Log closed Fri Jun 15 10:39:44 2012
--- Log opened Fri Jun 15 10:39:52 2012
10:39 TheWatcher [chris@Nightstar-3762b576.co.uk] has joined #code
10:39 Irssi: #code: Total of 26 nicks [6 ops, 0 halfops, 0 voices, 20 normal]
10:39 mode/#code [+o TheWatcher] by ChanServ
10:40 Irssi: Join to #code was synced in 43 secs
12:10 Rhamphoryncus [rhamph@Nightstar-5697f7e2.abhsia.telus.net] has quit [Client exited]
12:26 * Tarinaky WTFs at Python.
12:26
< Tarinaky>
class Menu(ui_abstract.menu.Menu):
12:26
< Tarinaky>
AttributeError: 'module' object has no attribute 'menu'
12:26
< Tarinaky>
It's right there!
12:26
< Tarinaky>
I'm looking at it!
12:28
< Tarinaky>
Changed name to be less ambiguous
12:28
< Tarinaky>
class DefaultMenu(ui_abstract.menu.Menu):
12:28
< Tarinaky>
AttributeError: 'module' object has no attribute 'menu'
12:28
< Tarinaky>
So that wasn't it :/
12:28
< Tarinaky>
ui_abstract has a module called menu... Which has the class Menu.
12:28
< Tarinaky>
I can't see why it can't 'find' this menu sub-module :/
12:29
<&jerith>
Tarinaky: Have you imported it?
12:29
<&jerith>
Pastebin the code, perhaps?
12:30
< Tarinaky>
import ui_abstract doesn't work.
12:30
< Tarinaky>
If I change it to from ui_abstract.menu import Menu it works.
12:30
<&jerith>
"import ui_abstract.menu"?
12:30
< Tarinaky>
(changing the reference from ui_abstract.menu.Menu to just Menu ofc)
12:31
< Tarinaky>
Elsewhere I'm only importing the top level module and everything else is getting imported.
12:32
<&jerith>
That only works if the top-level module imports the thing you're after.
12:33
< Tarinaky>
Ah. Interesting.
12:37 celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has joined #code
13:33 Attilla [Obsolete@Nightstar-245c4d9c.as43234.net] has quit [[NS] Quit: ]
13:45 Attilla [Obsolete@Nightstar-245c4d9c.as43234.net] has joined #code
13:58
< Tarinaky>
What does TypeError: 'builtin_function_or_method' object has no attribute '__getitem__' mean?
13:58
< Tarinaky>
Because I thought dictionaries had __getitem__... >.>
13:59
<&jerith>
Tarinaky: What code is throwing that?
14:00
<&McMartin>
Dictionaries do, but functions that return dictionaries don't until you call them.
14:00
<&jerith>
Yeah. It's complaining that you're accessing '__getitem__' on a builtin.
14:02 RichyB [MyCatVerbs@Nightstar-3b2c2db2.bethere.co.uk] has quit [Ping timeout: 121 seconds]
14:04
< Tarinaky>
Well, I deleted the code and just refactored it away anyway >.>
14:04
< Tarinaky>
But I wasn't using a method to obtain the dictionary.
14:04
< Tarinaky>
I was indexing a dictionary :/
14:04
< Tarinaky>
So I don't know what was wrong.
14:05
<&jerith>
Where did you get the dict from?
14:06
<&jerith>
Because "foo = dict; foo['blah'] = 'frobboz'" would do that.
14:06
<&jerith>
Also, in general, pastebinning the relevant code leads to more specific debugging assistance. :-)
14:22
< Tarinaky>
I assigned it {}
14:22
< Tarinaky>
Yeah, but I didn't have a test case.
14:22
< Tarinaky>
I had a sphegetti of broken python.
14:25
< iospacedout>
...
14:30
< Tarinaky>
I should probably have a better method of refactoring than just breaking it and running it... then pathing the errors as they come up.
14:30
< Tarinaky>
*patching
14:31
<&jerith>
Tarinaky: Do you have decent automated test coverage?
14:31
< Tarinaky>
No.
14:32
<&jerith>
Because that's *very* useful for refactoring.
14:32
< Tarinaky>
"Does it run?"
14:32
<&jerith>
(Useful enough that I consider it mandatory, personally.)
14:32
< Tarinaky>
If it can get as far as the first sleep without crashing or raising an exception.
14:32
< Tarinaky>
That more or less calls all of the code in the program anyway.
14:34
<&jerith>
that "more or less" scares me.
14:34
< Tarinaky>
I may implement a monkey test that generates random key and mouse events.
14:35
< Tarinaky>
Yeah, I know.
14:35
< Tarinaky>
I don't really have a clear enough idea what I'm doing for unittests though.
14:35
<&McMartin>
I tend to sketch architectures on paper before I write a single line of code.
14:35
< Tarinaky>
It's just turn into a millstone around my neck.
14:35
< Tarinaky>
*It;d
14:36
<&jerith>
Tarinaky: I find test cases often help clear that up, actually.
14:36
<&McMartin>
I don't personally accept the idea that the test is the spec
14:37
<&McMartin>
The spec comes first, but the tests *embody* the spec, ideally as directly as possible
14:37
<&McMartin>
If this doesn't work, then your spec is in some sense wrong.
14:37
< Tarinaky>
Yeah. I don't have a spec.
14:38
< Tarinaky>
I have a to do list of features.
14:38
< Tarinaky>
But no spec.
14:38
< Tarinaky>
>.>
14:38
< Tarinaky>
In case anyone cares >.> http://a6.sphotos.ak.fbcdn.net/hphotos-ak-snc7/600308_3854761981059_923582626_n. jpg
14:38
<&jerith>
I don't really do the test-first thing, because I tend to code bottom-up and rearrange interfaces as I figure out what the shape of the solution is.
14:41 Tsubaki [Phox@Nightstar-d1963151.asahi-net.or.jp] has joined #code
14:43
<&jerith>
Tarinaky: GUI code is hard to unit-test, but I find that a clean separation between GUI and game logic makes testing the latter much easier.
14:44
<&jerith>
It also makes both sides nicer to work with, because you don't have weird coupling to bite you.
14:47 Tsubaki [Phox@Nightstar-d1963151.asahi-net.or.jp] has quit [Client closed the connection]
14:47
< Tarinaky>
There isn't a whole lot of game logic tbh.
14:48 iospacedout is now known as io|driving
14:48
< Tarinaky>
That's... well... game logic is the easy part :/
14:49
<&jerith>
Not if it's buried in the GUI code. ;-)
14:51
< Tarinaky>
Anyway. Does anyone see a problem with randomly generating pygame keydown and mouse events to test the GUI?
14:54
< gnolam>
What is it supposed to accomplish?
14:56
< Tarinaky>
Making people less concerned that my only test is "Does it compile?"
14:57 Tsubaki [Phox@Nightstar-ec25ea75.asahi-net.or.jp] has joined #code
15:07
<&jerith>
Tarinaky: More directed tests are probably better.
15:07
<&jerith>
Since you can't usefully test state flows with random events.
15:09
<&jerith>
If you're going to craft events to inject, you may as well make them useful events.
15:15
<&McMartin>
That said, whitenoise is one useful test as a pathological input
15:15
<&McMartin>
BUt it can't be the only one
15:28
<&jerith>
Randomness in tests is dangerous.
15:28
<&jerith>
Because you get stuff that sometimes fails and sometimes doesn't.
15:30
<@ToxicFrog>
That's why the test harness records the seed so that it's reproduceable.
15:31 RichyB [MyCatVerbs@Nightstar-3b2c2db2.bethere.co.uk] has joined #code
15:34
< Tarinaky>
Is it possible to seed the default PRNG exposed as random in python?
15:35
< Tarinaky>
No. Wait.
15:35
< Tarinaky>
Stupid question.
15:57 * Vornicus is glad he knows how to use Excel. Makes the graph show its tick labels as for instance 3?.
16:17 gnolam [lenin@Nightstar-202a5047.priv.bahnhof.se] has quit [[NS] Quit: Reboot]
16:23 gnolam [lenin@Nightstar-202a5047.priv.bahnhof.se] has joined #code
16:29 Vash [Vash@Nightstar-241cb5d4.wlfrct.sbcglobal.net] has joined #code
16:29 mode/#code [+o Vash] by ChanServ
16:44 io|driving is now known as iofficespace
16:56 maoranma is now known as Noah
17:08 McMartin [mcmartin@Nightstar-adac7b01.pltn13.sbcglobal.net] has quit [Ping timeout: 121 seconds]
17:30 Tsubaki [Phox@Nightstar-ec25ea75.asahi-net.or.jp] has quit [Ping timeout: 121 seconds]
17:56 Tsubaki [Phox@Nightstar-e11eaaee.asahi-net.or.jp] has joined #code
18:07 celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has quit [[NS] Quit: And lo! The computer falls into a deep sleep, to awake again some other day!]
19:04 iofficespace [Alexandria@Nightstar-e67f9d08.com] has quit [Operation timed out]
19:04 franny [fran@Nightstar-e67f9d08.com] has quit [Operation timed out]
19:06 franny [fran@Nightstar-e67f9d08.com] has joined #code
19:08 iofficespace [Alexandria@Nightstar-e67f9d08.com] has joined #code
19:12 Derakon[AFK] is now known as Derakon
19:16 Kindamoody is now known as Kindamoody[zZz]
19:43 RichyB [MyCatVerbs@Nightstar-3b2c2db2.bethere.co.uk] has quit [Ping timeout: 121 seconds]
19:52 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds]
19:53 Vash [Vash@Nightstar-241cb5d4.wlfrct.sbcglobal.net] has quit [Ping timeout: 121 seconds]
20:16 Tsubaki [Phox@Nightstar-e11eaaee.asahi-net.or.jp] has quit [Ping timeout: 121 seconds]
21:18
< iofficespace>
... T________________________T
21:18
< iofficespace>
i have to test practically every option in our setup utility... there are over 650
21:19 * iofficespace commits ritual suicide
21:20
< iofficespace>
mind you some of them are tested already by virtue of being default values
21:25 Tsubaki [Phox@Nightstar-a7956243.asahi-net.or.jp] has joined #code
21:27
<&jerith>
Combinatorics?
21:31
<&Derakon>
Even if she doesn't have to test every combination, that's a lot of options to test.
21:35
< iofficespace>
jerith: each setting has to be put at every possible setting it can be, individually (thankfully i don't have to do X! tests)
21:36
< iofficespace>
there's over 650 settings i have to test, some of which are default
21:36 celticminstrel [celticminst@Nightstar-5d22ab1d.cable.rogers.com] has joined #code
21:55
< Tarinaky>
I'm having trouble with Inkscape.
21:55
< Tarinaky>
I've set the page at 128x128px
21:55
< Tarinaky>
And I've turned on a grid.
21:55
< Tarinaky>
But 1: the grid isn't aligned with the page
21:55
< Tarinaky>
2: I can't get my drawing to 'snap to grid' anyway :/
22:00 Tsubaki [Phox@Nightstar-a7956243.asahi-net.or.jp] has quit [Ping timeout: 121 seconds]
22:04 Vornicus [vorn@ServerAdministrator.Nightstar.Net] has joined #code
22:04 mode/#code [+qo Vornicus Vornicus] by ChanServ
22:06
< Tarinaky>
Ahah!
22:06
< Tarinaky>
Figured it out!
22:06
<~Vornicus>
what have we figured out?
22:08
< Tarinaky>
How to make snaping work
22:09
< Tarinaky>
Black is 0x0 right? Which... if I set an Alpha channel to 0x0 would that be invisible or visible?
22:10
<&jerith>
Being a double-agent wizard who is mean to children?
22:10
<@Tamber>
Tarinaky: Invisible, I think.
22:10
< Tarinaky>
Okay.
22:10
<&jerith>
Alpha is "opacity".
22:10
< Tarinaky>
So I've drawn a black circle as a vector graphic.
22:10
<&jerith>
Zero alpha means zero opacity.
22:11
< Tarinaky>
How do I make a white circle on a black background?
22:11
< celticminstrel>
I thought alpha was backwards and 255 was fully transparent?
22:11
< Tarinaky>
Because I want the middle to the the area that's 'visible' and the back to be invisible.
22:11
< Tarinaky>
Like a dough cutter!
22:11
< celticminstrel>
Does Inkscape do the path directions thing?
22:12
< Tarinaky>
(Obviously there's an implicit svg->png step I'm ignoring for now >.>)
22:12
< celticminstrel>
ie if you want one path to cut out from another, you make their directions opposite.
22:13
< Tarinaky>
I have no idea how to do that :/
22:15
< Tarinaky>
Ah! Found what I needed!
22:20
< Tarinaky>
Things I dislike about Inkscape: It won't 'failback' in a sensible way if you tell it to open a blank file.
22:20
< Tarinaky>
Which is silly given it's a plain-text format.
22:33 Tsubaki [Phox@Nightstar-daa59e27.asahi-net.or.jp] has joined #code
22:59 iofficespace is now known as io|driving
23:16 Vash [Vash@Nightstar-e8057de2.wlfrct.sbcglobal.net] has joined #code
23:16 mode/#code [+o Vash] by ChanServ
23:17 McMartin [mcmartin@Nightstar-3f2d52e0.pltn13.sbcglobal.net] has joined #code
23:17 mode/#code [+ao McMartin McMartin] by ChanServ
23:20 Netsplit *.net <-> *.split quits: Tsubaki, Orthia, @Vornicus, Tarinaky, Attilla, Namegduf, @Vash, celticminstrel, @McMartin, @rms, (+5 more, use /NETSPLIT to show all of them)
23:23 Netsplit over, joins: @ToxicFrog, Tarinaky, sshine, &McMartin, froztbyte, @rms, &Derakon, Attilla, Orthia, EvilDarkLord (+4 more)
23:23
< Tarinaky>
I meant logical leap >.>
23:23
<~Vornicus>
[2**a for a in range(8)]
23:23
< Tarinaky>
I want to start on 8.
23:23
<~Vornicus>
ah
23:23
< Tarinaky>
So 8->128 in powers of 2.
23:24 PinkFreud [WhyNot@NetworkAdministrator.Nightstar.Net] has quit [Ping timeout: 121 seconds]
23:24 PinkFreud [WhyNot@NetworkAdministrator.Nightstar.Net] has joined #code
23:25 mode/#code [+o PinkFreud] by ChanServ
23:25
<&Derakon>
Well, 128 is 2^7.
23:25
<&Derakon>
And 8 is 2^3.
23:25
<&Derakon>
So [2 ** n for n in xrange(3, 8)]
23:27 franny [fran@Nightstar-e67f9d08.com] has quit [Ping timeout: 121 seconds]
23:28 Netsplit *.net <-> *.split quits: Orthia, @Vornicus, Tarinaky, Attilla, Namegduf, @Vash, celticminstrel, @McMartin, @rms, EvilDarkLord, (+4 more, use /NETSPLIT to show all of them)
23:30 Netsplit over, joins: ToxicFrog, Tarinaky, sshine, McMartin, froztbyte, rms, Derakon, Attilla, Orthia
23:30 franny_ [fran@Nightstar-e67f9d08.com] has joined #code
23:30 Netsplit over, joins: EvilDarkLord, @Vash, ~Vornicus, Namegduf, celticminstrel
23:30 ServerMode/#code [+oaooaoooq ToxicFrog McMartin McMartin rms Derakon Derakon Vash Vornicus Vornicus] by *.Nightstar.Net
23:31
<&Derakon>
Okay, I can see a bug.
23:31
<&Derakon>
But what do you think is going wrong?
23:31
<&Derakon>
And what debugging steps have you taken?
23:31
< Tarinaky>
Well, I spotted a missing space on line 11. But adding that didn't help.
23:32
<&Derakon>
What goes wrong, then?
23:32
< Tarinaky>
I added the print statement on line 10 as 'debugging' and... yeah.
23:32
< Tarinaky>
I can't really see what else to try.
23:32
< Tarinaky>
Sample output:
23:32
< Tarinaky>
Exporting sample_composite.svg at size 128
23:32
< Tarinaky>
The system cannot find the path specified.
23:32
<&Derakon>
And what do you think that means?
23:32
< Tarinaky>
That either the command string is wrong, or the filename is wrong.
23:33
< Tarinaky>
But the filename appears right, and so does the inkscape invocation.
23:33
< Tarinaky>
I'm not 'used' to using Python for shell scripts.
23:33
<&Derakon>
Are you certain about both? How would you go about testing them?
23:33
< Namegduf>
21:51 -!- ZLOK [Z@Off.With.Her.HEAD] has quit [Singularized: If I had a world of my own, everything
23:33
<&Derakon>
When in doubt, simplify your test case.
23:33
< Namegduf>
Er...
23:33
< Namegduf>
Okay, I don't know how that happened.
23:33
< Tarinaky>
I'm not sure how I'm supposed to simplify 15 lines :/
23:33
< Tarinaky>
It's 15 lines.
23:33
<&Derakon>
It could be 2.
23:34
<&Derakon>
How would you test that your program invocation is correct?
23:35
< Tarinaky>
Well, aparently Windows doesn't like c:\Program%20Files any more :/
23:35
< Tarinaky>
What's the right thing you injsert on Windows for a space in a filename?
23:35
<&Derakon>
I believe you can simply quote the entire path.
23:36
<&Derakon>
E.g. "C:\Program Files\whatever"
23:36
< Tarinaky>
Yeah, but there used to be a control sequence for it...
23:36
< Tarinaky>
Like '\ ' on UNIX.
23:36
<&McMartin>
No
23:36
<&McMartin>
Windows shell is distressingly lacking in this.
23:37
< Tarinaky>
Oh.
23:37
< Tarinaky>
Where the hell did I get %20 from?
23:37
<&Derakon>
Spaces in URLs, probably.
23:39
< Tarinaky>
Which Windows 98 extended into the OS sphere :x
23:39
< Tarinaky>
I swear it was valid in 98
23:39
<&Derakon>
You might have noticed, it's been awhile since Win98 was a valid target platform.
23:40
<&Derakon>
These things change.
23:41
< Tarinaky>
How can I take a string "foo.a" and convert it to "foo.b"?
23:42
<&Derakon>
'foo.a'.replace('.a', '.b')
23:42
<&jerith>
In PHP, you can do it with "my_str++"
23:42 * jerith vomits.
23:43
<@rms>
JS: 'foo.a'.replace(/\.a$/, '.b')
23:43
< Tarinaky>
Okay! Internal error tastic!
23:45
< Tarinaky>
"c:\Program Files\Inkscape\Inkscape.exe" -zf svg/colony_transport_icon.svg -p colony_transport_icon.png -C --export-width=16 --export-height=16
23:45
< Tarinaky>
This invocation causes Inkscape to crash.
23:45
< Tarinaky>
I -assume- this is because I have messed something up.
23:45
<&Derakon>
Usually the preferable initial assumption. :)
23:46
< Tarinaky>
It appears to crash for all permutations run in the script, that's just the first one it tries.
23:47
< Tarinaky>
Any thoughts? >.<
23:48
< Tarinaky>
Sorry, that's the second one it tries.
23:48
<&Derakon>
This is an Inkscape thing, and I don't know it. Hit up the docs. *shrug*
23:50
< Tarinaky>
Yeah... I already started there >.<
--- Log closed Sat Jun 16 00:00:35 2012
code logs -> 2012 -> Fri, 15 Jun 2012< code.20120614.log - code.20120616.log >

[ Latest log file ]