Sunday, 2007-02-18

*** tpb has joined #tp00:00
*** ChanServ sets mode: +o tpb00:00
nash_anyone around?00:49
*** nash has quit IRC02:38
*** nash has joined #tp02:39
mithronash: am now03:29
nash_still there?03:53
* nash_ pokes mithro 03:54
mithroyes03:54
mithroif you say my name my xchat flashes madly at me :)03:55
nash_They generally do... ;-)03:56
nash_Anyway... silly question... why is the server sending me multiple objects which are the same?03:58
mithrohrm?03:58
mithroexample?03:59
nash_I'm sending the server a request (0.4.0) for all objects.03:59
mithrohow?03:59
tpbSomebody said how is the test, mithro03:59
nash_I then take the response, and send it straight back to the server asking for details of all the objects in the list...03:59
nash_And I get many objects back...04:00
nash_Including 5 object '0's (name: The Universe), and 2 "Milky Way Galaxys"04:00
mithrodid you check your list of get objects04:00
nash_I haven't yet, but as I said, I litterally pass the list of objects I get from the server and hand it straight back.04:01
mithronash: what arguments did you give the get object ids?04:01
nash_The list from the server has 9 objects.  I get 6 back, and three 'message failed' messages04:01
mithroGet ID Sequence Frame04:02
mithroGet ID Sequence frame consist of:04:02
mithro    * a SInt32, the sequence key04:02
mithro    * a UInt32, the starting number in the sequence04:02
mithro    * a SInt32, the number of IDs to get04:02
mithroso you sent (-1, 0, -1)04:03
nash_Oh I'm ignoring the sequence frame...04:03
mithro?04:03
nash_MsgListOfObjectIDs04:04
nash_ number 3104:04
nash_Wait a second... hmm..04:04
mithromy recommendation is to print out a list of ids04:06
nash_This really doesn't make sense then...04:06
mithrobtw remeber the id sequence returns a list of (id, last mod time)04:07
mithroie04:07
mithro[[0, 0], [1, 3456734], [5, 2345677543]]04:07
mithronot04:07
mithro[[0, 1, 5], [0, 3456734, 2345677543]]04:08
nash_this is weird.04:08
nash_Okay - startup, I just want to get the lot...04:09
mithroso your sending a Get Object ID Sequence Frame?04:09
nash_No, it's a GetByID frame04:10
mithroid 2804:10
nash_meg #504:10
nash_msg #5 that is04:10
mithrofirst you need to get which ids exist right?04:11
nash_yes04:12
mithrowhich you are using the Get Object ID Sequence Frame to do04:13
mithro(ID 28)04:13
nash_which is MsgGetObjectIDs... which returns a sequence frame?04:13
mithrowhich returns an ID Sequence frame (ID 31)04:14
nash_Right... damn, I need to expand my message parser.04:16
nash_Out of curisity, has anyone tried to port the server to a platform that doesn't emulate unaligned loads?04:16
mithrounaligned loads?04:16
mithroyou mean on a platform which doesn't have bytes as it's smallest value?04:17
nash_An int which is not aligned to a address which is a multiple of sizeof(int) is illegal operation at the hardware level.  Archs like x86 catch it in microcode, do two loads, align and producde something that works.04:18
nash_The reason I ask is that strings in the middle of messages mean you have values which aren't aligned from then on (75% of the time)04:18
nash_And it's expensive to emulate on x86, on archs like MIPS it generates a bus error, unless the kernel emulates (which is ~1000x slower)04:19
mithroit's only a real problem if you are trying to use the same datastructures for in-memory as sending over the wire (which is bad in my opinion)04:19
nash_Not quite... You need to de-serialise, and since you are sending in binary formats04:19
nash_So you are doing something like <int><3char><int>.04:20
mithroyes, but de-serialising is simple bit/byte shifting really04:20
nash_The only wat to get that second int safely in C (or C++) is to do a memcpy or two integer accesses, and a annoying shifting04:20
mithrode-serialising by using memcpy and a C struct is bad04:20
* nash_ never mentioned structs04:21
nash_What is wrong with memvpy (aside from performance)?04:21
mithrobecause the format on the wire might change but your internal data structures shouldn't necesarily04:22
nash_Yes, but that has nothing to do with my point/question.04:22
mithrowell the only reason that non-aligned stuff should byte you is if you are trying to use the same right?04:23
mithros/byte/bite/04:23
mithrobecause otherwise your internal data structures would be all aligned correctly?04:23
nash_For instance on the wire for objects you have <int (type)><int (oid)><int strlen)>strlen*<char><otherdata>04:23
nash_Internal data structures are fine... I'm talking about parsing the data that arrives from a message.04:24
mithroget 4 bytes -> put in internal data structure at type04:24
mithroget x bytes -> put in internal data structure at xyz04:25
mithro?04:25
nash_So copy from buffer one byte at a time, aligning as you go?04:25
mithrohow else would you do it?04:25
mithro(you could copy strings a whole bunch at a time I guess)04:25
nash_Well if everything was aligned to 32bits, on 98% of modern archs, you can just seek in the buffer to get what you want, and don't need to process the whole thing...04:26
nash_The only that ruins this is strings04:26
nash_If they were padded, it would all be good04:26
mithrowhy can't you seek as is? most modern archs have some form of byte access support (it's just so important for strings)04:27
mithroand wouldn't it be tempting to use the same structures if you could just use a memcpy :)04:28
nash_No, must modern archs emulate anything smaller then the hardware bus width, unaligned loads may or may not be emulated04:28
* nash_ is looking at tpserver-cpp now...04:28
nash_And packInt* uses memcpy04:29
nash_You have an x86 I assume04:30
nash_?04:30
mithroyes04:30
mithroand ppc04:30
mithroo and amd 6404:30
nash_amd64 == x84 for this context04:30
nash_On x86 the following may be allowed:04:30
nash_short a[10];04:31
nash_int i = *((int *)a[3]);04:31
nash_depending on if the unaligned register is set on the bus register.04:31
nash_If it's not set... SIGBUS on linux04:31
nash_Other archs always genrate or never generate...04:32
mithrookay, so where is that used?04:32
nash_If the protocol is adjusted so that strings are padded to the nearest 4, means you don't need to memcpy data out (4 bytes at a time!) you can just assign it out...04:32
mithrobut you waste bytes then :)04:33
nash_Pfft04:33
nash_MTU is 80+ bytes anyway - most of the messages are smaller - who cares?04:34
mithrowho cares about byte alignment, only some weird person would be using an archic language like C ;)04:34
nash_or C++...04:35
nash_Which has exactly the same problem04:35
* nash_ notes tpserver is using realloc and memcpy to pack and unpack data...04:35
* mithro notes he didn't write tpserver-cpp :)04:35
* nash_ notes he avoids the reallocs ;-)04:35
* mithro notes he doesn't like C/C++ :)04:36
mithrobtw, is it really bothering you that much?04:36
nash_It just seems silly.  Most protocols either are string based to avoid the problem all together, or are aligned for fast acess.  tp03 as it is written has neither property04:37
mithrobecause I could make you cry by pointing out that in protocol version 1 it was word aligned :)04:37
nash_I know04:38
mithrofrom protocol.php04:38
mithroAll data will be 32 bit aligned. Strings will be prefixed by the 32 bit integer length (include null terminator) and then padded with nulls ('\0') to the next 32 bit boundary (if necessary).04:38
nash_Which is kinda why I was curious why it took a step backwards04:38
nash_(and requiring at least one null means you can strdup straight out of a message too ;-)04:39
mithroyou have a length, you shouldn't be tempted to use a null terminater too04:40
nash_Sorry, that should be 'nil' terminated... NULLs are (sizeof(void*), NIL is the first ASCII character04:40
nash_strndup gives you best of both worlds ;-)04:40
nash_But the termination issue is minor compared to the alignment issue04:40
mithrohow often does unalignment occur?04:41
nash_100% of packets containing a string04:42
nash_Which includes all Objects for instance04:42
mithrocouldn't you just pad right after a string till it aligns again?04:43
mithroand what happens if the smallest unit is 64?04:44
nash_That would make the protocol aligned again - yes.. all good.04:44
mithrowouldn't it break on that?04:44
mithros/you/*you*/04:44
nash_As for 64bit archs... nope... loading an 4 byte align type if it is 4 byte aligned is safe.04:45
nash_Same as loading a 16 bit short ona 32 bit arch... all fine04:45
* nash_ notes you have 64 bit types mixed in there as well, which means you should really 8 byte align everything.. but they are relatively rare04:46
mithrowhy?04:46
mithrowouldn't the 64 bytes be aligned to 8 byte boundaries?04:46
nash_Not in the current protocol04:47
nash_Or just fixing what we have been talking about04:47
mithrowhat happens if we add a 128bit int, would we then need to align to 16 byte boundaries?04:47
nash_Yep...04:47
nash_Now you see why string protocols are popular ;-)04:47
nash_Still safe 32 bit access is going to be with us for a long time just to support existing software... *cough* *windows* *cough* *packed* *cough* *structs*04:48
mithroit's just a "packed" format, just because it bears some reseamblance to memory organisation doesn't mean it is :)04:48
nash_Yes, but my point s your format is as slow as string format, but as annoying to access as a binary one... Worst of both worlds04:49
mithroi find it less annoying then string formats - as you know exactly where everything will be04:50
mithro(ie you know a int is exactly 4 bytes long)04:50
mithrobut i guess each to their own04:51
nash_Yes, it is even better if you can use that int as int, not a set of 4 random bytes that can;t access04:51
nash_without a memcpy into another buffer04:52
mithronash: when your client becomes really popular you'll then be able to force us to do word aligned stuff :)04:52
nash_The earlier it is fixed the better...04:53
mithrobtw what performance problems is this causing you?04:53
nash_I've already mostly solved the problem... but memcpys are annoying04:53
nash_And slow04:53
nash_With one line 'aligned to 4 bytes' most archs can be quick on everything but 64bit types...04:54
nash_And it saves casting and alignment issues on bigger types04:54
mithrobut i bet you'll see the following, memcpy(<my data structure>, <network buffer>)04:55
nash_So?  I can do the same now: attribute(packed,0);04:56
mithroadding padding is annoying from my end :)04:56
nash_It's not portable in either case... There is nothing you can do to stop people writing bad code... So why put up barrier to make sure everyone writes bad code?04:56
mithrowhy not call it a "packed string" format then? :)04:57
nash_Why not use nil termination, so you can save 0-3 bytes on every string sent?04:58
mithros/everyone/everyone who is silly enough to use C or C++/ ;)04:58
mithronash: because nil termination is horrible and doesn't tell you how much you have to get04:59
* nash_ notes your python interpreter is written in C...04:59
mithroPyPy will fix that ;)04:59
nash_Which will be compiled with a conmpiler written in which language?04:59
mithroasm ;)04:59
* mithro pretend language05:00
* nash_ notes it is not particularly portable...05:01
* nash_ also notes the problems he is talking about are going to have most affect on your most complete server ;-)05:01
mithronash: the most complete server uses memcpy which works does it not?05:02
mithrohttp://sourceforge.net/projects/cleese/ <- muahahaha05:02
tpbTitle: SourceForge.net: Cleese - An Operating System in Python (at sourceforge.net)05:02
nash_Yes, but you most complete server could be faster and use less code if you changed your protocol by 10 or so words...05:02
mithronash: and not work on 64bit aligned platforms? and still need to special case 64bit ints?05:03
nash_No, it works fine on 64bit platforms as I said... But all platforms need to handle 64bit types carefully05:04
nash_ie: Method which is currently in place05:04
nash_But then again they need to take care with 64 bit types and endian issues, as endian on the wire for > 32 is not defined by TCP05:05
mithronash: how often are you going to write a protocol library?05:06
nash_s/TCP/IP/05:06
nash_mithro: Not often, which is why it is worth the time to make sure it si simple and fast05:06
mithroonce it's out of your protocol library it's all aligned however the CPU prefers right?05:08
nash_Yes05:08
mithroso if we decided 0.4.0 should be 32 bit aligned then it makes no difference to the user of your library (or any of the other libraries)05:09
mithrobut it we decided otherwise, it still makes no difference05:09
mithroexcept speedwise of your library?05:09
nash_This is mostly correct, although my lib allows peple to get raw messages if they want them05:10
mithroand as 0.3.0 is deemed "complete" we aren't going to be adding it to 0.3.005:10
nash_Not just speed, also simplifies the code.05:10
nash_I'll agree with not changind tp0305:10
nash_That would be stupid ;-)05:10
mithroso you have to impliment it anyway05:11
nash_mithro: I have05:11
nash_Which is why I know how dumb it is ;-)05:11
nash_I jsut hate to see code like:05:12
mithroso I assume you have written some nice code so that you only have to worry about this problem in 1 place05:12
nash_memcpy(tmp,idata,8);05:12
nash_(*adest)[i].updates = ntohll(tmp);05:12
nash_Yep05:12
nash_Still hurts me to know I could save up to 3 emulated loads per data item.05:13
* nash_ notes he often optimises memory accesss for video codecs... and this makes him cringe.05:13
* mithro notes nash isn't writing a video codec05:14
mithroout of intrest don't you need the memcpy (or atleast some type of copy anyway) ?05:14
nash_No reason for this to be slower however ;-)05:14
mithroIE you can't keep the data around in the incoming network buffer?05:15
nash_Only for types larger then alignment guarantee... otherwise you can assign individual elements out (or use them directly if you only need them once)05:15
nash_For instance the time message I use remaining seconds directly (wrapped in a ntohl())05:15
nash_For things like sequence messages you only need the messages transitory, so you can read the values directly, and update other structures as you need.05:16
nash_Currently however I need to run along hte whole message, copy into a new structure, use the structure once, then free it.05:17
mithroi sure if you wanted you could optomise that to only use a memcpy when needed :)05:17
nash_It's not worth it - only can avoid 25% of the time.05:17
nash_The extra complexity of code is a maintanance nightmare05:17
nash_Things like lists of ints are particularly annoying - all the data is there, but I need to copy it before the bulk of the application can use it.05:18
mithronash: well just count it down to us being stupid :)05:19
nash_mithro: Or not experienced enough C programmers ;-)05:19
nash_Will you consider it for tp04?05:19
mithronash: or caring about C programmers ;)05:19
nash_mithro: No, it slows down your python programs too05:19
mithronash: i think you'll find that Int's being real objects in python programs make it lost in that noise05:20
mithroand strings being imutable would also hurt05:21
nash_If so python is worse then I thought... I know it's not that bad, and the real cost of Int's vs ints is small in a decent language05:21
mithroinfact I think the cost of an extra if might make it slower :P05:21
nash_Also immutable data is a reason to care... it means extra copies can hurt - a lot05:21
nash_This doesn't add any ifs05:22
mithroif i % 4 != 0: <add padding>05:22
nash_bah...05:23
mithrobtw in Python Ints are first class objects - so they are really quite slow05:23
mithroanyway I've yet to encounter speed problems with the network code05:23
nash_Just use a int aligned buffer and update by strlen(x) >> 205:24
nash_Wait to you get bigger games05:24
nash_with non-trivial objects etc05:24
mithromost of the speed problems come from the fact that pipelining is a brain fuck :)05:24
nash_Really?05:24
nash_protocol for it gives me grief.. but otherwise... whatever...05:24
mithroyes, because things have dependecies05:25
nash_example?05:25
mithroie have to send get_ids before get_x05:25
mithroI know a better way to do it, I just havn't implimented it yet05:25
mithronash: btw just send an email to the list with good reasons why you think it should be 32bit aligned05:26
mithro(code examples and real stats would be nice too :)05:27
nash_code examples are easy... real stats are a little harder, but I could probably quote from intel's literature on the x86 which says "don't do this" ;-)05:28
nash_As an aside... I'm still curious why there is an htonl and ntohl05:29
mithrohrm?05:29
nash_Why two different byte swap commands... h(ost)t(o)n(etwork)l(ong) and ntohl05:29
nash_both do the same thing05:30
mithrohost -> network05:30
mithronetwork -> host05:30
mithrobecause it makes more sense :)05:31
mithro(even if they are implimented in the same code)05:31
nash_Yes, but they are the same byte swapping either way does the same thing htonl(htonl(x)) is a NOP05:31
nash_It is the same code ;-)05:31
mithronash: htonl is probably an alias for ntohl05:31
nash_It is - they are the same macro05:32
mithrobut it makes more sense to a programmer who doesn't care what ntohl05:32
mithrodoes05:32
nash_swap32, swap64, swap16 would make more sense05:32
mithroon a bigendian system the macro's evalutate to nothing05:32
nash_I know05:32
nash_nswap32 then05:32
mithroso swap32 is stupid name05:33
mithrobecause on a bigendian system swap32 does nothing05:33
nash_nswap (netswap)05:33
mithronetswap is also stupid, because swap impliese it does something05:33
nash_true I guess05:34
mithroplus why are you swapping on a bigendian system?05:34
nash_Portable code?05:34
mithrohence the name network2host and host2network05:34
mithronash: but swapping on a bigendian system is wrong - you want a noop05:35
nash_I know05:36
mithrogood coding is about hiding implimentation details from people who don't need to know05:36
nash_true (as long as you really hide it)05:36
mithrohence a person doesn't need to know what htonl does in reality05:36
mithro(ie on little endian it does byte swap, on big endian it does a nop and on middle endian is does something else)05:37
nash_I have to say... middle endian deserves all the pain it gets05:37
mithrowhat happens if you had a weird computer which stored all data as BCD, then htonl would do quite a bit of work05:37
mithroanyway i'll be back in a bit05:37
mithrohave to go have a shower and stuff05:37
nash_that is somnething I hadn't thought od05:38
nash_okay05:38
mithroand btw machines which work prodminately with BCD actually exist <shudder> they are/where used for banking05:45
mithrointresting story about them, it turned out that converting to/from decmial was more costly (cpu wise) then just keeping everything in decimal in the first place05:48
mithrowhich is why CPU's have BCD instructions (when you think, WTF who would want that :)05:51
*** tpb has joined #tp06:00
*** ChanServ sets mode: +o tpb06:00
nash_mithro: I know they used to exist... i'd forgotten all about them.. ;-)06:10
nash_And x86 has instructions for bcd.. 'aaa' (ascii adjust for addition) comes to mind06:11
mithronash: your brain is most probably trying to protect you ;)06:11
nash_blanked out I06:12
nash_'m sure06:12
nash_Still not exactly a unique example... eg Java processors...06:13
nash_Pure stack architectures.06:13
nash_bingo... Parsing sequences, and Objects fine...06:16
mithronash: cool06:22
CIA-11Lee Begg <[email protected]> * tpserver-cpp/modules/games/minisec/fleet.cpp :06:24
CIA-11Fixed removing ships so that when zero the key is deleted from the map:06:24
CIA-11 Before this fix, it was possible for a fleet with a frigate to have colonise orders06:24
CIA-11 after the frigate had been used to colonise06:24
CIA-11Lee Begg <[email protected]> * tpserver-cpp/tpserver/ (playertcpconn.cpp playertcpconn.cpp):06:24
CIA-11Removed compile warning, and get error type on failed read:06:24
CIA-11 So now read and write both record the failure error.06:24
*** llnz has joined #tp06:24
CIA-11 Just a newline at the end of the file to get rid of the compile warning.06:24
mithrohowdy Lee06:25
llnzhi mithro06:25
mithronash has been complaining about the non-32bit aligned protocol :)06:26
llnzhehehe06:26
llnznash: blame mithro06:27
llnzgrrr... still can't figure out what is going wrong in minisec combat06:44
* llnz adds more logging06:47
mithrollnz: i'm thinking of upgrading the memory in verbal06:55
llnzahhh06:55
llnzfound it06:55
llnzok06:55
mithrollnz: going to cost a once of $US 7506:56
llnzouch06:56
mithrothe LA grant request got turned down too :/06:57
llnzoh dear06:57
llnzdamn, going to have to break minisec persistence to fix this bug06:58
llnzhumm... actually....06:58
mithroo, what did you do?06:58
llnzspelling mistake in property name06:59
llnzwhich is in the db06:59
llnzactually, there is a way for me to not break the db persistence....07:00
mithrollnz: do you still have a "blog"07:09
llnzvaguely07:09
llnzhehe, minisec combat has been broken since July 13 last year07:14
llnz7 months07:14
mithroouch :)07:16
mithrohopefully we'll have AI's playing so we don't have this problem07:17
CIA-11Lee Begg <[email protected]> * tpserver-cpp/modules/games/minisec/ (7 files):07:20
CIA-11Fixed spelling of property name, but accept both in Fleet::hit:07:20
CIA-11 This fixes the bug in minisec combat, and has been present for 7 months.07:20
CIA-11 It is hard to pick up these problems sometimes.07:20
CIA-11Lee Begg <[email protected]> * tpserver-cpp/modules/games/minisec/ (7 files):07:22
CIA-11Logging in RSPCombat for debugging minisec combat:07:22
CIA-11 Might come in useful in future.07:22
CIA-11Lee Begg <[email protected]> * tpserver-cpp/modules/games/minisec/rspcombat.cpp : rspcombat copyright07:31
mithrocombat working now?07:38
CIA-11Lee Begg <[email protected]> * tpserver-cpp/tpserver/ (prng.cpp prng.cpp):07:39
CIA-11Fix getInRange methods to include the max number:07:39
CIA-11 Should make combat a little more even.07:39
llnzmithro: yes07:39
mithromaybe time for a point release?07:39
mithrollnz: your website is a bit out of date :)07:40
llnzhehe07:40
mithrosetting up a blog/personal website07:43
llnzcool07:43
mithroupdating my Resume too07:44
mithroI'm going to need a job in ~6 months :)07:45
llnzhehe07:45
* llnz is still waiting to hear about a job07:45
mithrollnz: is that the teaching/assistance stuff at uni you where talking about?07:46
llnzyeah07:46
mithrowould you think a "muse" relationship is "romantic"?07:50
llnzsomewhat, but not always or exactly07:51
llnzmore about inspiration07:51
mithroI just found it intresting that WordPress puts "muse" relationship under "romatic" category07:53
llnzhehe07:55
llnzi know where that classification comes from, let me see if i can find the page08:01
llnzhttp://gmpg.org/xfn/1108:05
tpbTitle: XFN 1.1 profile (at gmpg.org)08:05
mithroI really need to redo my resume08:11
nash_Is the universe always square?08:30
llnznash_: it's actually a sphere08:30
nash_So... is the universe always a perfect sphere?08:31
llnzwell, the universe object has a centre, and a diameter, so yes08:31
nash_okay - just working out how to display things sanely always...08:32
nash_I want to avoid using 64 bit types, and trying to ind nice ways to simplyfy things...08:32
* llnz checks something08:34
llnzyou could, with checks, assume that the universe, and the galaxy, are "very large" and just deal with the contents of the galaxy08:35
nash_indeed08:35
nash_I'm just trying to work out the best way to do it08:36
nash_Next thing to deal with is precision of objects08:37
nash_y = 1784964813 is still bloody big08:37
nash_What does a distance of '1' represent?08:37
nash_Can I make any assumptions about that for displaying?08:38
llnzit doesn't make a lot of difference, but when i was originally doing it, it was 1 unit was 10,000km08:39
mithronash: I would work out the biggest number and then scale using it08:39
nash_Yeah, but that can change...08:39
* nash_ can't help but feel the distances are a little 'over-precise'08:40
llnzthere are reasons for it08:41
llnzsuch as slowing down jump ships08:41
nash_?08:41
mithronash: i mean dynamicly find the biggest number08:41
nash_mithro: I know08:41
nash_Just later a new object might appear at a higher number, and I need to tweak.08:42
mithronash: an object with a higher number will only appears at a new turn08:42
mithro(ie objects can't appear in the middle of a turn)08:42
nash_True.  Objects will only change on a new turn.08:42
nash_Still... irritating... If I had a bounding box to begin with it would be useful08:43
llnzeverything is inside the universe08:43
llnzthat could be your bounding sphere08:44
llnz(or circle, if you only want to deal with 2d08:44
llnz)08:44
mithrohowever the universe could be much bigger then it's actual contents08:44
nash_The ones I'm seeing, the universe is >> then the objects inside08:45
mithroyour best bet is to work it out yourself :)08:48
mithrowhy don't you want to use int64's?08:51
nash_Slow...08:53
nash_Annoying... have to be careful to promote everywhere.08:53
nash_Can't be passed to var_args without care08:53
nash_Can't be stored in void*'s (not that I need that now)08:53
nash_in short... ugly08:54
mithrostoring in void*!?08:54
nash_;-) You need to use more C.08:54
llnzmithro: nash_ is using C08:54
mithroyes but a void* is a pointer to something, not a storage for an integer08:55
llnzparticularly on 64bit systems08:55
mithroor any system08:56
nash_mithro: You may store a uintptr_t value in a void * pointer... It normally ain't 64 bit08:57
nash__very_ useful for callbacks - since they normally pass you an void *, if you can use a uintptr_t value there is no need to alloc anything08:58
mithronash: why are you storing anything apart from a pointer to something in a void pointer!?08:58
nash_mithro: callbacks08:58
nash_I don't need it yet in this program... but you never know08:58
mithrocallbacks are pointers to functions?08:59
nash_In any case... 64 bit values are _slow_08:59
nash_callbacks use pointers to functions, yes08:59
mithroso what does that have to do with ints?08:59
nash_so I tell a particualr object, hey when you are done, call this function, and pass me this void * back too...08:59
nash_Cause uintptr_t's can be stored in void*s portably and safely.09:00
nash_sizeof(int64_t) >> sizeof(uintptr_t) on all 32bit archs09:00
* nash_ cares not about porting to 16bit archs09:00
mithronash: your definition of portable is dubous09:01
nash_mithro: Probably not as dubious as you think09:01
mithrosizeof(void *) >> sizeof(uint) is not guarenteed09:01
mithroand it seems of dubious usefulness anyway?09:02
nash_mithro: I never said uint, I said uintptr_t, which is something differnt09:02
mithrowhat is it?09:02
nash_An integer type which can be safely stored in a void*, part of C9909:03
nash_On all archs BTW.  I can use it a 16bit arch, it will most likely be 15bits in storage size09:03
mithrohe he - a google of uintptr_t gives a whole bunch of pages about how it isn't portable :)09:04
nash_It's on the internet, so it must be true?09:04
mithronash: sure!09:04
mithrogoogle is the master of all knowledge ;)09:05
nash_based on what I saw... mostly related to the fact most places don't implement C99...09:05
mithrowell it's your grave as they say ;)09:06
nash_In anycase... back to the original point... still like to stcik to 'int' - whatever size that is, and ignore int64_t.  The canvas I am using is limited to 65000 pixels in width and height in the current version, so passing it raw 64bit values probably won't work as well as expected09:06
nash_So my original problem still stands... is there a nice way to drop precision, without a random divider...09:07
mithronash: your divider would be related to zoom level, no?09:08
nash_Yes09:08
nash_base zoom would be 'everything currently in the universe on the screen'09:08
mithroso all you need to find is a default zoom level?09:08
mithroand you already have to loop over all objects to get them from the wire?09:09
mithrowhy not just store x, y, z min/max09:09
nash_I am storing a bounding box as I see objects...09:09
nash_So I can use that.09:09
* nash_ was wondering if there was a canonical method, rather then every client coming up with their own path to chaos09:10
mithroso... the problem is? :)09:10
mithronope09:10
mithrohopefully the most sane path to chaos will end up being the default ;)09:11
* nash_ likes mithro's idea, and would like to subscrbe to his newsletter09:11
mithrobtw, you'll most probably want a LOD culler09:11
nash_mithro: You think?09:11
mithronash: well it's a little be harder then it would first seem, the universe "tree" doesn't exactly match a LOD tree09:12
nash_Well at least some thresholding to turn systems into point objects09:12
nash_I know09:12
nash_But my hope is to use pretty much the code I had for the freestars client09:12
mithrowhich caught me of guard a few times09:13
mithros/of/off09:13
nash_http://nash.id.au/Software/FreeStars/images/loadmapzoomin.png09:13
tpb<http://ln-s.net/J2i> (at nash.id.au)09:13
nash_http://nash.id.au/Software/FreeStars/images/loadmapzoomout.png09:13
tpb<http://ln-s.net/J2k> (at nash.id.au)09:13
mithronash: do you have a blog btw?09:14
nash_Not currently09:14
nash_I probably will in a week or two09:14
nash_Ay particualr reason09:15
mithrome and JLP are planing to setup a planet.tp.net :)09:15
nash_right09:15
nash_I'll let you know then09:15
* nash_ says bugger it... zoom by factors of 2, he can fix it later09:22
nash_Ohh.. divide by zero... all good09:27
nash_BTW: I have no intention of showing anything but fleets in space, and stars on the map at this point09:31
*** mithro has quit IRC10:04
*** mithro has joined #tp10:44
*** mithro has quit IRC11:20
*** mithro has joined #tp11:47
JLPhi all13:09
* JLP has enough of translation for today :)13:09
llnzhi JLP13:10
JLPllnz: i've submited an ebuild for libtprl to Gentoo13:13
llnzcool13:13
JLPnow i'm going to do one for tpserver-cpp13:13
JLPand after that for client stuff13:13
JLPlibtprl bug report is here: http://bugs.gentoo.org/show_bug.cgi?id=16742613:15
tpbTitle: Gentoo Bug 167426 - libtprl-0.1.2.ebuild (New Package) (at bugs.gentoo.org)13:15
JLPoh nice, ti looks like ranting at my ISP helped, now they offer Upload Speed Booster, doubles the speed of UL13:19
JLPfor 4? i'll can now get UL speed for my package doubled from 768k to 1,5M13:20
llnznice13:23
JLPbtw, should the packages with ebuilds also be added to sourceforge files and to TP Downloads page?13:33
llnzi guess so13:34
JLPok, when i make ebuild for c++ server i will add both to SF and TP13:37
JLPi wil also add some default configuration file so that it can work out of the box13:46
JLPwhat dou you think would be the best way to do this?13:46
JLPshould I just include AI competition conf file and install it?13:47
llnzyeah, that might be the best13:47
JLPyou posted it into forums/MLs right?13:47
llnzyeah13:48
llnzthere is a link on the competition page13:49
JLPok, i think i have enough info now, let's try to make ebuild for tpserver-cpp now13:49
JLPllnz: what is the minimum mysql version that is supported13:54
llnzumm....13:54
llnzprobably 4.0.0 or something like that, it is fairly basic13:54
JLPok i'll set it ot >=virtual/mysql-4.013:55
*** Demitar has joined #tp14:09
llnzi should sleep, 3:42am here14:40
* llnz wanders off14:41
*** llnz has quit IRC14:41
*** JLP has quit IRC20:17
*** nash_ has quit IRC20:38
*** Demitar has quit IRC21:13
*** Demitar has joined #tp21:17
*** Demitar has quit IRC21:24
*** Demitar has joined #tp21:25
*** Demitar has quit IRC21:32
*** Demitar has joined #tp21:33
*** mithro has quit IRC21:40
* nash waves22:04
*** JLP has joined #tp22:19

Generated by irclog2html.py 2.5 by Marius Gedminas - find it at mg.pov.lt!