code logs -> 2013 -> Thu, 28 Nov 2013< code.20131127.log - code.20131129.log >
--- Log opened Thu Nov 28 00:00:36 2013
00:15
< JustBob>
Today's XKCD appears to, err.
00:15
< JustBob>
Yeah. Just with less obscenity.
00:19
<@gnolam>
My commits have an 03:00 surrealism peak.
00:22
< JustBob>
I don't git, so, it's just my comments that tend to have swearing.
00:27 * Tarinaky proceeds to swear at his computer for being a bit shit.
00:31
<@TheWatcher>
My commit messages tend to include things like "Apparently I shouldn't be coding right now" and "Well, this is irritating"
00:31
<@TheWatcher>
But no actualy swaering
00:32
<@TheWatcher>
fucking
00:32
<@TheWatcher>
*swearing
00:33
<@Tarinaky>
I try to avoid swearing because I like to put a link to my github in my CV
00:33
<@Tarinaky>
And Profeshunalizm.
00:34
<@Tarinaky>
I'd prefer it if people actually had to take 15 minutes out of their life to schedule an interview with me to find out I'm a fuck up.
00:35 You're now known as TheWatcher[T-2]
00:35
< JustBob>
At least you don't rename variables mid-code to spell obscene things in the, wossname.
00:35 VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has joined #code
00:35
< JustBob>
In the equations.
00:36
<@Tarinaky>
c*l*i*t*o*r*i*s**2
00:37 Turaiel[Offline] is now known as Turaiel
00:37 You're now known as TheWatcher[zZzZ]
00:38
< JustBob>
More like fuck(it) = this*sucks(it) + exp(erience(it) + live(it));
00:54 himi [fow035@Nightstar-q9amk4.ffp.csiro.au] has joined #code
00:54 mode/#code [+o himi] by ChanServ
01:53
< simon>
I try to actually make informative commit messages... :-P
01:57 * simon reads up on implementing pattern matching in functional languages
02:15
<&McMartin>
Is that (implementing pattern matching) in (functional languages), as in regexes in Haskell, or implementing (pattern matching in functional languages), as in, SML's function definition semantics?
02:22 Derakon is now known as Derakon[AFK2]
02:54 Harlow [Harlow@Nightstar-2dbe3d64.il.comcast.net] has joined #code
03:30 VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has quit [[NS] Quit: Program Shutting down]
03:35 Derakon[AFK2] is now known as Derakon
03:59 Kindamoody|autojoin [Kindamoody@Nightstar-05577424.tbcn.telia.com] has joined #code
03:59 mode/#code [+o Kindamoody|autojoin] by ChanServ
04:00 Kindamoody|autojoin is now known as Kindamoody
04:21 Harlow [Harlow@Nightstar-2dbe3d64.il.comcast.net] has quit [[NS] Quit: BED]
04:24 Reiver [quassel@Nightstar-ksqup0.co.uk] has joined #code
04:29 Attilla [uid13723@Nightstar-ed0oqj.irccloud.com] has quit [[NS] Quit: Connection closed for inactivity]
05:03 Derakon is now known as Derakon[AFK2]
06:16 ErikMesoy|sleep is now known as ErikMesoy
06:30 RichyB [RichyB@Nightstar-c6u.vd5.170.83.IP] has quit [[NS] Quit: Gone.]
06:33 RichyB [RichyB@Nightstar-c6u.vd5.170.83.IP] has joined #code
06:39 himi [fow035@Nightstar-q9amk4.ffp.csiro.au] has quit [Ping timeout: 121 seconds]
06:39 Stalker [Z@Nightstar-484uip.cust.comxnet.dk] has joined #code
07:09 You're now known as TheWatcher
07:10 Vornotron [Vorn@Nightstar-sn7kve.sd.cox.net] has joined #code
08:09 You're now known as TheWatcher[afk]
08:24 Kindamoody is now known as Kindamoody|out
08:26 Vornotron [Vorn@Nightstar-sn7kve.sd.cox.net] has quit [[NS] Quit: Leaving]
08:36 himi [fow035@Nightstar-v37cpe.internode.on.net] has joined #code
08:36 mode/#code [+o himi] by ChanServ
09:06 Turaiel is now known as Turaiel[Offline]
09:12 Vornicus [vorn@Nightstar-sn7kve.sd.cox.net] has quit [[NS] Quit: ]
09:41 You're now known as TheWatcher
10:49 Attilla [uid13723@Nightstar-ed0oqj.irccloud.com] has joined #code
10:53 You're now known as TheWatcher[d00m]
11:38
< simon>
McMartin, as in SL's "case-of"
11:38
< simon>
SML's*
11:40
< simon>
with the simplifying assumption that I only have to match binary trees, the complicating requirement that I'm generating machine code for it, and the complicating assumption that the generated code needs a chunk of code at the end that does something weird recording of which branch I went through.
12:48
<@Tarinaky>
Okay. I'm having a massive derp moment.
12:49
<@Tarinaky>
I am using OpenGL 1.4/immediate mode to draw a square, rotated 45 degrees - to give a faux-isometric perspective of it.
12:50
<@Tarinaky>
I have also drawn three axes onto my figure for reference.
12:50
<@Tarinaky>
However, only one of the axes is perpendicular to any of the lines of the square.
12:50
<@Tarinaky>
Which looks wrong.
12:51
<@Tarinaky>
Wait, no. I'm thinking about this wrong.
12:51
<@Tarinaky>
Okay...
12:51
<@Tarinaky>
One of the axes doesn't look 'right'.
12:51
<@Tarinaky>
And I am confused about it.
12:51
<@Tarinaky>
I've put it into Ortho mode to make it as simple as possible.
12:53
<@Tarinaky>
Oh hang on...
12:53
<@Tarinaky>
There we go!
12:55 * Tarinaky was drawing the square in x,y (and rotating it) instead of x,z, so the square was on its side.
12:55
<@Tarinaky>
So the 'height' axis was going sideways.
12:57 You're now known as TheWatcher
13:03 VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has joined #code
13:13
<@Tarinaky>
Whee! I got OpenGL to make a thing.
13:13
<@Tarinaky>
I don't completely suck at life.
13:38
< RichyB>
\o/
13:38 * RichyB hugs a Tarinaky.
13:48 Alek [omegaboot@Nightstar-qa936g.il.comcast.net] has quit [Ping timeout: 121 seconds]
13:51 Alek [omegaboot@Nightstar-qa936g.il.comcast.net] has joined #code
13:51 mode/#code [+o Alek] by ChanServ
14:01
< simon>
hmm
14:02
< simon>
I'm modelling a sort of binary tree that perhaps is better modelled as a trinary tree
14:02
< simon>
I should draw this..
14:02
<@Tarinaky>
You can represent any n-ary tree as a binary tree.
14:02
<@Tarinaky>
By using the right pointer to create a list of siblings and the left pointer to point to the first child only.
14:03
<@Tarinaky>
You either 1) Know this or 2) This is irrelevant.
14:12
< Syka>
https://lh3.googleusercontent.com/-MxPeYq28Hkc/UpDtIksJQ8I/AAAAAAAADAU/nXMBVUTEC nM/s540-no/99+bugs.png
14:13
< Syka>
this was posted by Microsoft Developers
14:13
< Syka>
you make your own joke here
14:15 You're now known as TheWatcher[afk]
14:17
< simon>
Tarinaky, I know this, thank you :) but yeah, I'm not sure what will look nicest.
14:17
< simon>
/ will be easiest to work with.
14:18
<@Tarinaky>
Straightforward/first one is a good place to start ;V
14:19
< simon>
I'll go with binary then.
14:21
< simon>
this is the most complex tree structure I've had to come up with myself. it's very interesting. basically, I'm converting the abstract syntax of a "case Exp of ..." construction into a match-tree that can be pre-order traversed while generating the code necessary for performing that pattern match. the different cases within the match should occur on that tree traversal path in the right order and contain the necessary information to construct ...
14:21
< simon>
... the lexical scope of each case body.
14:23
<@Tarinaky>
I'm distracted by thoughts of an L-System describing rooms and corridors.
14:24
< RichyB>
Tarinaky, pretty sure that that's a pretty reliable way of randomly-generating quake1-style levels :)
14:24
< RichyB>
(use a probabilistic L-system if you want them to be really random)
14:25
<@Tarinaky>
Why Quake1?
14:27
< simon>
Tarinaky, do L-systems always generate trees?
14:28
<@Tarinaky>
Generally.
14:29
<@Tarinaky>
I'm not sure it's as strong as always.
14:34
< RichyB>
Tarinaky, 'cuz they have that room â corridor â room shape
14:43
<@Tarinaky>
Anyway, general idea is that the L-System gives you some rooms with coordinates... Then you try to draw them on a 2D map and have some rules for handling collisions
14:43
<@Tarinaky>
Which gives you intersections and alcoves.
14:45
< RichyB>
IIRC nethack works the other way around
14:46
< RichyB>
it has a bunch of different level generators in it
14:48
< RichyB>
I believe that the ordinary dungeon levels are created by slapping down a bunch of rectangles for rooms then randomly drawing corridors between. The mine levels are created by running something that looks like a cellular automaton to decide where to carve walls out. The mazes in Gehennom are created by a special maze generator; the maps have a hardcoded shape with a bunch of rectangles marked PUT SOME MAZE HERE
15:40 iospace is now known as io\parents
16:35 Vornicus [vorn@Nightstar-sn7kve.sd.cox.net] has joined #code
16:35 mode/#code [+qo Vornicus Vornicus] by ChanServ
16:53 Kindamoody [Kindamoody@Nightstar-180u8i.tbcn.telia.com] has joined #code
17:18 Xon2 [Xon@Nightstar-q4s.ku7.252.119.IP] has quit [[NS] Quit: No Ping reply in 180 seconds.]
17:20 Xon [Xon@Nightstar-q4s.ku7.252.119.IP] has joined #code
17:25 Xon [Xon@Nightstar-q4s.ku7.252.119.IP] has quit [Connection closed]
17:25 Xon [Xon@Nightstar-q4s.ku7.252.119.IP] has joined #code
17:33 Xon [Xon@Nightstar-q4s.ku7.252.119.IP] has quit [[NS] Quit: No Ping reply in 180 seconds.]
17:33 Xon [Xon@Nightstar-q4s.ku7.252.119.IP] has joined #code
17:57
<@Tarinaky>
Okay so. Drawing a dungeon in OpenGL, in immediate mode, 'tile by tile' is expensive.
17:58
<@Tarinaky>
So logically I should try to draw them room-by-room.
17:58
<@Tarinaky>
But I'm not sure how to represent a room in memory.
17:58
< ErikMesoy>
It's a floor and a set of walls around it. A door is a kind of wall.
17:59
<@Tarinaky>
That was unhelpful. Even by your standards.
18:00
< ErikMesoy>
No, unhelpful would be saying "as a bunch of tiles".
18:02
< RichyB>
Is there a reason why you're working in immediate mode?
18:02
< RichyB>
The fixed-function pipeline is pretty much dead.
18:02
<@Tarinaky>
My laptop has old hardware.
18:02
< RichyB>
aw
18:03
<@Tarinaky>
And requiring not-old-hardware for a Roguelike seems silly.
18:03
< RichyB>
eh
18:03
< ErikMesoy>
Floor and walls is meant to be serious. Define a bounding box for the room; everything touching the edge is a wall; everything else is a floor.
18:03
< RichyB>
I'd go with, if I'm going to write anything which demands 3d accel at all, demand modern 3d accel.
18:04
<@Tarinaky>
Well my laptop still doesn't have modern 3d accel.
18:04
< RichyB>
Yeah.
18:05
< ErikMesoy>
This is why I write text-based games. :-P
18:06
< RichyB>
Anyway. Your immediate-mode performance woes
18:06
< RichyB>
maybe you're just making more calls to glVertex3f() than you want to.
18:06
<@Tarinaky>
Hence why I want to get the vertexes down.
18:07
<@Tarinaky>
By only calling once for a (large) rectangle.
18:07
< RichyB>
I was thinking go the other direction.
18:07
<@Tarinaky>
?
18:07
< RichyB>
Stop rendering by calling glBegin() glVertex3f() glVertex3f() glVertex3f() glEnd()
18:07
< RichyB>
move to filling up a Vertex Buffer Object with vertex positions and then submitting it to the driver all in one go
18:08
<~Vornicus>
Tarinaky: build a -- a -- shit, what is it nowadays. There's things where you can throw the card a whole mesh at once.
18:08
<@Tarinaky>
Isn't that the only way of rendering in immediate mode?
18:08
<@Tarinaky>
I thought vao/vbos needed modern GL?
18:08
< RichyB>
vertex buffer object
18:08
<~Vornicus>
Immediate mode is dead
18:08
< RichyB>
Nah
18:08
<@Tarinaky>
Vornicus: My laptop doesn't support GL2.
18:08
<~Vornicus>
Still, GL1 supports non-immediate modes
18:08
<@Tarinaky>
Vornicus: If you want me to stop caring about this, send me a new laptop.
18:08
< RichyB>
Modern GL with just the non-deprecated stuff throws away all mechanisms for getting vertexes in other than VBOs
18:09
< RichyB>
but they started out life with the fixed-function pipeline
18:10
<@Tarinaky>
Wikipedia says VBOs were only standardised in OpenGL1.5 (my laptop does 1.4) and only gives an example in 2.1
18:10
< RichyB>
at one point, the thing that everyone was doing for scenery was uploading a small number of large VBOs to the graphics card, setting the perspective transform matrices so that the card's HW T&L can do the perspective transform, then pushing the "go" button on entire buffers at a time.
18:10
< RichyB>
They were a widely-used extension before they were standardised.
18:11
< RichyB>
can you get your card to print a list of supported extensions? GLEW for example will do that.
18:12
<@Tarinaky>
I'm err... not on my laptop right now.
18:13
< RichyB>
worth looking into, later
18:13
<@gnolam>
Tarinaky: you can still do vertex arrays.
18:13
< RichyB>
Also more helpful than having #code interject at you; you should be able to find old copies of GPU gems online because I think that the back archives were published for free at one point
18:14
< RichyB>
oh actually
18:15
< RichyB>
I was going to recommend that because I thought that GPU gems predated the rise of widespread shader hardware
18:15
< RichyB>
but maybe it doesn't. :|
18:18
< RichyB>
sorry dude
18:18
< RichyB>
every one of these has HLSL or GLSL in it
18:22
<@Tarinaky>
Idly: how do I change the colour of the syntax hilighting of comments in python in vim?
18:22
<@Tarinaky>
It's the most ridiculously unreadable shade of blue possible.
18:23
< ErikMesoy>
http://vim.wikia.com/wiki/Change_the_color_scheme ?
18:23
<@Tarinaky>
That will have undesirable side-effects.
18:23
<@Tarinaky>
Namely making something else unreadable.
18:24
<@Tarinaky>
I just want to change comments to be bright pink or something.
18:25
< RichyB>
You should be able to dig up the colour scheme that you're using right now, make a small edit to it, save it somewhere and then reference it from ~/.vimrc
18:26
< RichyB>
buggered if I know how, though
18:28
<@Tarinaky>
:hi Comment ctermfg=5
18:28
<@Tarinaky>
Obviously.
18:48
<@Tarinaky>
I'm having trouble getting ctypes to play with me :/
18:49
<@Tarinaky>
I need a ctype array of 4*3 floats.
18:49
<@Tarinaky>
I've tried a bunch of different things I've found on StackOverflow.
18:49
<@Tarinaky>
But none of them are actually working.
18:49
<@Tarinaky>
50 FloatArray12 = ctypes.c_float*12
18:49
<@Tarinaky>
51 square = FloatArray12(-1.0,0.0,1.0, -1.0,0.0,-1.0, 1.0,0.0,-1.0, 1.0,0.0,1.0)
18:50
<@Tarinaky>
Results in: glDrawArrays(GL_QUADS, square, 4)
18:50
<@Tarinaky>
ctypes.ArgumentError: argument 2: <type 'exceptions.TypeError'>: wrong type
18:56
<@Tarinaky>
Oh hang on.
18:56
<@Tarinaky>
Misread :/
19:04
< RichyB>
Was your problem just that you didn't set glDrawArrays.argtypes?
19:13
<@Tarinaky>
No, the problem was I fundamentally didn't understand how DrawArrays worked.
19:13
<@Tarinaky>
Anyway. It's a little faster now.
19:13
<@Tarinaky>
But I'm still making ridiculous calls to DrawArrays.
19:21
< RichyB>
glDrawArraysInstanced?
19:21
< RichyB>
oh, shaders
19:22
<@Tarinaky>
I think the calls to drawarrays might not be a problem actually.
19:22 * Tarinaky goes for a quick walk.
19:23
<@Tarinaky>
I'll need to find my laptop and test before I go any further though.
19:39
<~Vornicus>
If itt's still being slow, try fewer, larger arrays
19:40
<~Vornicus>
This reduces the overhead ratio
19:40
<@Tarinaky>
That requires me to represent a room as something other than tile-by-tile :p
19:40
<@Tarinaky>
Which was the original problem.
19:58 Pandemic [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has quit [Connection closed]
20:01 VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has quit [Connection closed]
20:02 VirusJTG [VirusJTG@Nightstar-6i5vf7.sta.comporium.net] has joined #code
20:05
<~Vornicus>
well, no, you can consider it tile-by-tile but you set up the array to handle all the tiles at once. Load the tile map into the array.
20:31 Kindamoody [Kindamoody@Nightstar-180u8i.tbcn.telia.com] has left #code ["Whoops, wrong window focus again!"]
20:32 Kindamoody|out is now known as Kindamoody
20:35 Turaiel[Offline] is now known as Turaiel
20:40
<@Tarinaky>
I don't think my laptop supports vbos :/
20:40 Kindamoody is now known as Kindamoody[zZz]
20:54 Vornotron [Vorn@Nightstar-sn7kve.sd.cox.net] has joined #code
21:09
<@Tarinaky>
I've reverted back to using immediate mode. I don't think the vbo was actually much faster anyway.
21:12
< Vornotron>
it probably was, you just weren't using it, uh, enough
21:12
< Vornotron>
If you pass more than about 100 vertices it's probably a lot faster to use a single vbo than immediate mode
21:12
<@Tarinaky>
While this is true, it turns out I can't use it at all.
21:12
<@Tarinaky>
Feel free to buy me a better craptop :p
21:13
<@Tarinaky>
But being able to work on this on my laptop is kindof a big deal.
21:13
<&McMartin>
What OS is this?
21:13
<@Tarinaky>
Linux.
21:14
<&McMartin>
What does glxinfo say when you grep "version string"?
21:14
<@Tarinaky>
Hold on, let me power my laptop on again :/
21:15
<&McMartin>
And then, "what commands were you using for buffers?"
21:15
<&McMartin>
I associate this tech with OpenGL, uh, 1.5
21:15
<@Tarinaky>
1.4 Mesa 9.1.4
21:15
<@Tarinaky>
The card is a GMA 900
21:15
<&McMartin>
Welp
21:16
<@Tarinaky>
According to wikipedia, ARB support for vertex buffers was added for the 950.
21:17
<&McMartin>
Oh man, what was that old ARB thing that VBOs replaced.
21:17
<&McMartin>
CompiledVertexArrays?
21:18
< Vornotron>
How old is this laptop?
21:18
<@Tarinaky>
Unknown. It was refurbished when I got it.
21:18
<@Tarinaky>
McMartin: It has the same function name, just with ARB tacked on the end.
21:20
< Vornotron>
Ok your laptop has what appears to be a 9-year-old graphics card in it, and an integrated one at that.
21:21
<@Tarinaky>
Why do you think I call it the craptop?
21:21
<@Tarinaky>
I can actually play a lot of games on it.
21:21
<@Tarinaky>
I'm replaying Quake and Arcanum during breaks.
21:21
<&McMartin>
I'm mostly amazed Mesa isn't handling it in software.
21:23
< Vornotron>
Quake was software rendered~
21:23
<&McMartin>
Tarinaky: There was this thing I used in Sable back in '04 when my hot-shit graphics card supported OpenGL 1.2
21:23
<@Tarinaky>
Isn't the linux port of Quake GL?
21:23 * McMartin consults ARGLE.
21:23
<&McMartin>
Pretty sure even the original Quake was GL. Isn't that where "Glide" came in?
21:24
<&McMartin>
glLockArraysEXT, part of GL_EXT_compiled_vertex_array
21:24
<@Tarinaky>
WinQuake was software, GLQuake was OpenGL, then there was GlideQuake for Voodoo cards.
21:25
<&McMartin>
Ah
21:25
<@Tarinaky>
Glide, now, is basically only good as a placeholder for dll hacks :p
21:26
<&McMartin>
Woo, LD_PRELOAD
21:26
<&McMartin>
Anyway, you sound like you're under serious version constraints. You might find ARGLE useful.
21:26
<&McMartin>
It's GLEW backwards~
21:26
<&McMartin>
https://github.com/michaelcmartin/argle
21:27
<@Tarinaky>
I think my best bet is to generate fewer vertexes by doing /clever stuff/
21:27
<@Tarinaky>
Since a lot of the vertexes are superfluous.
21:27
<&McMartin>
ENABLE VIEW FRUSTUM CULLING
21:28
<@Tarinaky>
Is that a switch?
21:28
<&McMartin>
No, it's a technique, it just sounds like something Picard would order LaForge to do
21:28
<&McMartin>
It involves not drawing vertices that won't be in the viewing volume
21:28
<@Tarinaky>
Ah, yeah.
21:29
<@Tarinaky>
That would /probably/ be enough to be honest.
21:29
<@Tarinaky>
But it's gone past nine, so I'm going to let myself play Path of Exile and spazz out for a bit.
21:29
<&McMartin>
s/not drawing vertices/not submitting polygons/
21:51
< Vornotron>
Marathon, when rendering the map, would cull thingswhere all the vertices were off screen
21:52
< Vornotron>
This wasn't perfect; large rooms would disappear because the vertices are off the top and bottom...
22:03
<&McMartin>
Yeah, if you do that trick you have to have tiles
22:03
<&McMartin>
You can't just have one megapoly for The Floor
22:03
<&McMartin>
... macropoly, as it is large, not that there are a million of 'em
22:29 Vornotron [Vorn@Nightstar-sn7kve.sd.cox.net] has quit [Ping timeout: 121 seconds]
22:42
< RichyB>
Can you hg on github?
22:42
< RichyB>
Oh no worries, already have a bitbucket account.
22:44 Turaiel is now known as Turaiel[Offline]
22:51 Vornotron [Vorn@Nightstar-sn7kve.sd.cox.net] has joined #code
22:53 himi [fow035@Nightstar-v37cpe.internode.on.net] has quit [Ping timeout: 121 seconds]
22:59 ErikMesoy is now known as ErikMesoy|sleep
23:10
< RichyB>
fuuuuck hg is a bit slow
23:12
< Syka>
no it isnt, you just need to dilate time
23:12
< Syka>
use the --break-relativity cli option
23:13
<@Tarinaky>
Not to be confused with dilating Thyme, which is when you help a hippy give birth.
23:14 AnnoDomini [abudhabi@Nightstar-4ji.fl3.98.208.IP] has quit [Ping timeout: 121 seconds]
23:18 AnnoDomini [abudhabi@Nightstar-4ji.fl3.98.208.IP] has joined #code
23:25 Stalker [Z@Nightstar-484uip.cust.comxnet.dk] has quit [Ping timeout: 121 seconds]
23:27 Derakon[AFK2] is now known as Derakon
23:27 mode/#code [+ao Derakon Derakon] by ChanServ
--- Log closed Fri Nov 29 00:00:52 2013
code logs -> 2013 -> Thu, 28 Nov 2013< code.20131127.log - code.20131129.log >

[ Latest log file ]