#gemrb@irc.freenode.net logs for 24 Jan 2010 (GMT)

Archive Today Yesterday Tomorrow
GemRB homepage

[05:40:53] --> Gekz has joined #GemRB
[05:40:54] <-- Gekz has left IRC (Read error: 54 (Connection reset by peer))
[06:05:29] --> Gekz has joined #GemRB
[07:30:45] --> lynxlynxlynx has joined #gemrb
[07:30:45] --- ChanServ gives channel operator status to lynxlynxlynx
[08:23:42] --> xrogaan has joined #gemrb
[08:24:08] --- xrogaan is now known as Guest66088
[08:24:49] <-- Guest66088 has left IRC (Remote closed the connection)
[08:25:49] --> xrogaan_ has joined #gemrb
[10:18:45] <-- raevol has left IRC ("Leaving.")
[10:50:09] --- xrogaan_ is now known as xrogaan
[10:54:54] <-- lynxlynxlynx has left IRC (Remote closed the connection)
[11:48:44] <Nomad010> yo?
[11:48:48] <Nomad010> wjp: hello
[12:00:27] <wjp> hi
[12:10:58] <Nomad010> wjp: did you get my message yesterday?
[12:11:19] * wjp scrolls up
[12:18:05] <wjp> brb
[12:18:39] <Nomad010> ok
[12:36:16] <wjp> back
[12:36:39] <wjp> I can't remember seeing any self-intersecting polygons
[12:44:49] <Nomad010> ya
[12:45:10] <Nomad010> it's also a slow part of the algorithm
[12:45:26] <Nomad010> O(N^2) worst case
[12:46:38] <Gekz> I wish I knew what that means
[12:46:48] <Nomad010> lol
[12:46:54] <wjp> look it up :-)
[12:46:55] <Gekz> I've seen o(logn) like 100 times
[12:46:58] <Gekz> and I still dont get it
[12:47:13] <Nomad010> it means that as N increases, the running time of that part of the code increases by N*N
[12:47:27] <Gekz> and what is N in this case
[12:47:34] <Nomad010> say the size of the polygon
[12:47:39] <Gekz> ok
[12:47:51] <Gekz> if polygon = 5, then it'll take 25 "time" to finish
[12:47:57] <Nomad010> if you double the number of vertices of the polygon, the running time will increase by a factor of 4
[12:47:57] <Gekz> at worst.
[12:48:10] <Nomad010> sort of
[12:48:14] <wjp> O(...) and o(...) have a different meaning by the way
[12:48:18] <Nomad010> ya
[12:48:39] * Gekz 's mind just esploded on the big O notation page on wikipedia
[12:48:43] <Nomad010> lol
[12:48:45] <Gekz> I saw the formulas and my brain hurted.
[12:48:46] <wjp> (and strictly speaking O(N^2) only indicates an upper bound)
[12:48:50] <Gekz> I start Computer Engineering in March however
[12:48:50] <Nomad010> ya
[12:49:02] <Gekz> I failed maths before uni however
[12:49:03] <Nomad010> they don't normally teach you this stuff off the bat
[12:49:04] <Gekz> I'm fucked twice
[12:49:12] <Gekz> haha good
[12:49:17] <Gekz> >_>
[12:49:25] <Gekz> I need to slowly gain mathematical skill
[12:49:28] <wjp> and wikipedia is not a good source for learning new theoretical stuff
[12:49:31] <Gekz> we're doing Mathematical Modelling I in the first year
[12:49:35] <Gekz> which is playing with Mathematica
[12:50:01] <Gekz> and what's with mathematical notation like f(x) and g(x)
[12:50:04] <Gekz> why dont they name functions
[12:50:07] <Gekz> !
[12:50:12] <Nomad010> they are anonymous
[12:50:14] <wjp> Nomad010: which part of which algorithm are you referring to exactly?
[12:50:18] <Gekz> you're anonymous :<
[12:50:19] <Nomad010> um
[12:50:23] <Nomad010> lol
[12:50:32] <Nomad010> let me get line numbers for you
[12:50:40] <Gekz> wjp: I am proud of myself this week.
[12:50:50] <Gekz> I contributed to an open source project.
[12:50:58] <wjp> great
[12:51:05] <Gekz> I was writing a 300 line C++ program that manipulates PNGs and BMPs
[12:51:12] <Gekz> and I needed to compare a pixel with the EasyBMP library
[12:51:19] <Gekz> == operator didnt have a function
[12:51:35] <Gekz> so I edited their headers, upgraded the struct to have a bool operator=, operator== and operator!=
[12:51:40] <Gekz> and submitted the patch :)
[12:52:15] <Gekz> learning Python before i started hacking in C++ properly helped _a lot_ with the whole understanding how OOP works
[12:52:51] <Gekz> oh, and I recently began an attempt to compile GemRB on Windows 64bit
[12:52:59] <fuzzie> remember to pity those of us who learnt C++ first :)
[12:53:00] <Gekz> I got fucked over by libpng who wont compile in gcc 64bit mingw
[12:53:08] <Gekz> fuzzie: I indeed pity the fool
[12:53:09] <Gekz> haha
[12:53:10] <Nomad010> i see i've added some extra code in places so i'll give you functions
[12:53:17] <Nomad010> static bool intersectSegments(Point& a, Point& b, Point& c, Point& d, Point& s) in Polygon.cpp
[12:53:38] <Gekz> fuzzie: can I link dlls compiled with MSVC++ with GNU G++ compiled dlls?
[12:53:46] <Gekz> my brain says yes
[12:53:50] <Gekz> I just dont want to try and fail
[12:53:55] <Gekz> because it's midnight and if I dont have to get up I wont
[12:54:09] <wjp> Nomad010: ah, right the bit with "y coords of self-intersections" :-)
[12:54:16] <Nomad010> ya that one
[12:54:24] <wjp> s/, right/right,/
[12:54:52] <Nomad010> Gekz: i have a feeling that it might not work
[12:54:58] <Gekz> whais
[12:55:29] <Nomad010> ok better explaination is i have no clue
[12:56:21] <Gekz> I googled
[12:56:24] <Gekz> apparently name mangling the end
[12:56:27] <Gekz> lolol
[12:56:39] <Gekz> I hate windows
[12:56:47] <Gekz> GemRB doesnt compile in msvc anymore does it
[12:57:06] <Nomad010> i am using G++ so i have no clue lol
[12:57:36] <fuzzie> Avenger has been keeping msvc 6/7 builds going
[12:58:01] <Gekz> oh
[12:58:02] <Gekz> snap
[12:58:08] <Gekz> I found libpng precompiled
[12:58:13] <Gekz> perhaps I continue doing naughty things
[12:58:34] <Gekz> fuzzie: feel free to slap me a little, but I need the deps again
[12:58:35] <Gekz> haha
[12:59:51] <-- Forgetful_Lion has left IRC (Client Quit)
[13:00:08] <fuzzie> i don't have logs here, so i have no idea
[13:00:49] <Nomad010> eyeballing the polygons in candlekeep i can't see any self-intersecting ones, but the algorithm reports several either slightly off the line segment or sufficiently close to an endpoint
[13:01:03] <Gekz> Nomad010: do you have the deps list handy?
[13:01:16] <Nomad010> nope
[13:01:34] <Nomad010> they should be on the site
[13:14:03] <Gekz> oh god
[13:14:08] <Gekz> finding openal in 64bit
[13:14:10] <Gekz> the world is ended
[13:14:51] <Gekz> oh shit
[13:14:52] <Gekz> I found it
[13:14:52] <Gekz> :D
[13:15:17] <Gekz> oh MSVC :<
[13:15:51] <Nomad010> i absolutely hate msvc
[13:16:59] <Nomad010> we were doing a game programming competition and using msvc
[13:17:38] <Nomad010> when it was time for submitting i compiled in release mode and had random crashes everywhere
[13:18:01] <Nomad010> because we were always compiling in debug mode
[13:26:31] <Nomad010> wjp: so whats going to happen to that code?
[13:32:56] <wjp> hm
[13:33:37] <wjp> do you mean intersectSegments finds non-intersections?
[13:35:13] <Nomad010> yes
[13:35:49] <Nomad010> due to rounding errors
[13:36:51] <wjp> but that's part of the function specification
[13:38:07] <Nomad010> but the actual intersection occurs slightly off the line segments
[13:38:26] <Nomad010> which means that they shouldn't intersect
[13:38:35] <wjp> intersectSegments only does rounding to report the coordinates, though
[13:39:01] <wjp> determining if there is an intersection is all integer arithmetic
[13:39:57] <wjp> if it returns true while there is no intersection, that would be a bug, but I don't see it
[13:40:14] <Nomad010> i wrote some other code which operates using doubles from the start
[13:40:31] <Gekz> haha oh god
[13:40:33] <Gekz> I feel retarded
[13:40:37] <Gekz> I just worked out why nothing would compile correctly
[13:40:41] <Gekz> I had no headers
[13:40:43] <Gekz> >:|
[13:40:45] <Nomad010> nice
[13:40:50] <Gekz> critical fail
[13:40:52] <Gekz> but it's windows
[13:40:56] <Gekz> so I've already failed by trying
[13:40:58] <wjp> doubles? why?
[13:41:34] <Nomad010> well surely there shouldn't be any self-intersections
[13:41:58] <wjp> ?
[13:42:04] <Nomad010> of the polygons
[13:42:17] <Nomad010> so when i found that the function reported an intersection
[13:42:23] <Nomad010> i tested it
[13:43:19] <wjp> so wouldn't the double implementation be the one with rounding errors?
[13:43:36] <Nomad010> ok i think i see the problem
[13:44:45] <Nomad010> i used epsilons, but the intersection points calculated are sometimes quite a bit off the lines
[13:45:44] <Nomad010> when you go `s.x = (short) ((b.x*A1 + a.x*A2) / (A1 + A2));` it truncates it all giving you the possibility of a wrong answer
[13:46:16] <wjp> that's what the function definition says
[13:46:30] <wjp> "The point returned has the actual intersection coordinates rounded down to integers"
[13:46:45] <Gekz> isn't a short half an int?
[13:47:05] <Nomad010> yeah
[13:47:09] <wjp> on typical modern platforms, yes
[13:47:32] <Nomad010> but the actual intersection point isn't being tested if it lies between the two endpoints of the line segments
[13:47:36] <Nomad010> i think
[13:49:50] <wjp> tested?
[13:52:02] <Nomad010> i'm 99% sure my code is correct
[13:52:03] <Nomad010> http://pastebin.com/m6f2542d
[13:53:34] <Nomad010> entering in lines that are identified as intersecting gives no intersection there
[13:54:13] <wjp> do you have two example line segments?
[13:54:27] <Nomad010> yeah i had some, but i closed the terminal
[13:54:36] <Nomad010> let me try find them again
[13:55:32] <Gekz> right
[13:55:33] <Gekz> I give up
[13:55:44] <Gekz> OpenAL will not compile for me
[13:56:04] <Nomad010> (4709, 3084) to (4701, 3087) and (4709, 3086) to (4702, 3072)
[13:56:31] <Nomad010> Gekz: do you need to compile openAL?
[13:56:35] <Gekz> yes.
[13:56:49] <Gekz> because the only 64bit versions on the internet were compiled with msvc
[13:56:57] <Gekz> meaning I wont be able to link it with gemrb
[13:57:09] <Nomad010> lol
[13:57:47] <wjp> hm, those two intersect, don't they?
[13:58:22] <Nomad010> my code reports that it isn't on the first line
[13:59:17] <Nomad010> hmm ok i might need to test my code more
[13:59:19] <Nomad010> soz lol
[14:00:14] <Nomad010> oh right
[14:00:25] <Nomad010> that point is an end-point of the one line
[14:03:43] <Nomad010> ok i see all the reported intersections are near an endpoint
[14:15:30] <Nomad010> wjp: ok i think my code fails near an endpoint
[14:16:29] <Gekz> http://dscarts.com/images/sc/test-headers.png
[14:16:39] <Gekz> a little python app I wrote that shows a kinda tree of headers
[16:49:45] --> tombhadAC has joined #gemrb
[17:14:14] <-- Nomad010 has left IRC (Read error: 104 (Connection reset by peer))
[17:29:25] <-- Gekz has left IRC (Read error: 60 (Operation timed out))
[17:30:11] --> Gekz has joined #GemRB
[17:48:21] <-- Gekz has left IRC (Connection timed out)
[18:39:39] --> Nomad010 has joined #GemRB
[19:07:09] --> Edheldil_ has joined #gemrb
[20:02:33] --> tomprince has joined #gemrb
[20:33:18] --> lynxlynxlynx has joined #gemrb
[20:33:19] --- ChanServ gives channel operator status to lynxlynxlynx
[22:58:13] <-- lynxlynxlynx has left IRC (Remote closed the connection)
[23:14:37] --> Forgetful_Lion has joined #GemRB