01:32 < dav1d> Drainedsoul: it cannot exist, except you initialize it with an argument 01:32 < dav1d> @disable this(); 01:32 < dav1d> default constructor isn't alloed 01:32 < Drainedsoul> yeah, that's what C++ does as well. 01:32 < dav1d> File file; ← compiler errors 01:32 < dav1d> File file = File("lol"); ← fine 01:33 < dav1d> ^ forced initialization 01:33 < tehme> yo 01:33 < tehme> do i have to send keep alive packets as a client? 01:33 < Drainedsoul> my point is that in C++ you can't do things like this.file=File("lol"); because that would invoke operator = on an object that's uninitialized 01:34 < Drainedsoul> tehme: You have to reply to the servers' keep alive packets unless you want to be kicked 01:34 < tehme> i see server does not kick me 01:34 < dav1d> Drainedsoul: which I consider a bad design 01:34 < dav1d> that shouldn't be UB 01:34 < Drainedsoul> it isn't UB, it just can't be done 01:34 < dav1d> but a lot in C/C++ is undefined begaviour :> 01:34 < dav1d> *behaviour 01:34 < dav1d> or compiler specific 01:34 < dav1d> D was made to overcome that 01:34 < tehme> i think 0x0D works as keep-alive 01:34 < Drainedsoul> well it can be done, but you have to poke holes in the object system, by using type punning or unrestricted unions 01:35 < Drainedsoul> from what you've said my issue with D would be that you have to choose between making a reference or value type when you define the class, as opposed to when you instantiate it 01:35 < Drainedsoul> but that's an "issue" I have with a lot of high-level languages anyway 01:36 < dav1d> Drainedsoul: classes are always reference types 01:36 < dav1d> structs are always value types 01:36 < dav1d> (ofc there are pointers to structs) 01:36 < Drainedsoul> I guess you can just make everything a struct in that case? 01:36 < dav1d> classes are on the heap by default, or scope if you use scoped! 01:36 < dav1d> yes you can 01:36 < Drainedsoul> I just don't understand why languages feel the need to impose that dichotomy 01:36 < dav1d> except that structs have no inheritance 01:37 < Drainedsoul> :| 01:37 < dav1d> why would I want that anyways 01:37 < Drainedsoul> want what? 01:37 < dav1d> if I have an amazing metaprogramming 01:37 < dav1d> inheritance for structs 01:37 < Drainedsoul> non-compile time polymorphism is the only thing I can think of, but that's pretty narrow 01:38 < dav1d> yep, use classes then 01:38 < Drainedsoul> I use it for implementing modules in my server 01:38 < dav1d> Drainedsoul: also GC 01:38 < dav1d> that'S the advantage of a class 01:38 < Drainedsoul> why would I want GC when I can have shared_ptr :( 01:38 < dav1d> give a shit about memory and have a destructor 01:38 < dav1d> lol 01:38 < tehme> ^ 01:38 < Drainedsoul> or auto_ptr 01:38 < dav1d> lol 01:38 < dav1d> or magic_ptr 01:39 < dav1d> or workaround_ptr 01:39 < Drainedsoul> *unique_ptr 01:39 < tehme> heh 01:40 < dav1d> a GC is a different approach which makes you less care (→ more productive) and gives you more convinience 01:40 < Drainedsoul> yeah but blindly throwing things onto the heap has the side effect of reducing spatial locality 01:40 < dav1d> and if you can't afford the speed loss (99% of times you can), don't use it 01:40 < dav1d> Drainedsoul: I agree 01:40 < dav1d> I don't like that in D either 01:40 < dav1d> stack should be used a lot more 01:41 < Drainedsoul> in C++11 the only time I think about memory management is when I'm writing a new container or when I'm interopping with C code 01:41 < Drainedsoul> and I'm pretty sure you have to do manual memory shenanigans doing C interop in D (?) 01:41 < dav1d> not really 01:41 < dav1d> either the clib cares or the gc 01:42 < Drainedsoul> I suppose. 01:42 < Drainedsoul> the only time I can think of I had to care about memory doing C interop is libcurl and overlapped structures 01:42 < Drainedsoul> because old libcurl doesn't copy strings nrrggg 01:42 < dav1d> worst thing I had was to manually call clib_free, which can be done in a dtor 01:43 < Drainedsoul> RAII is a thing in D? 01:43 < dav1d> kinda 01:43 < dav1d> it works, but it's not optimal 01:43 < Drainedsoul> it's pretty useful for dealing with C APIs 01:43 < dav1d> scope(exit) there is 01:43 < dav1d> scope(exit) free(mem) 01:44 < Drainedsoul> how does scoping work in D? 01:44 < dav1d> called on success and failure (exception) 01:44 < Drainedsoul> ah okay 01:44 < dav1d> scope(success) and scope(failure) 01:44 < dav1d> as well 01:44 < Drainedsoul> one thing I wish C++ had (does D have...?) is } finally { 01:44 < dav1d> { scope(exit) 1; scope(exit) 2 } 01:44 < dav1d> called in reverse order 01:44 < dav1d> Drainedsoul: yes 01:44 < dav1d> also no funcy throwing arbitrary types 01:45 < dav1d> *funky 01:45 < Drainedsoul> I don't understand why they've added in all sorts of wild things, like the weird stuff their doing with lambdas in C++14, but not finally 01:45 < Drainedsoul> ._. 01:45 < Drainedsoul> *they're 01:45 < dav1d> not sure whaat that is :P 01:45 < dav1d> I am not really up to date with C++ or really familiar with it 01:45 < dav1d> only did very basic things with it 01:46 < Drainedsoul> well lambdas are just anonymous functions that can capture. But they're making them into mini-templates 01:46 < dav1d> yeah 01:46 < Drainedsoul> so you can declare their parameters "auto" 01:46 < Drainedsoul> very strange 01:46 < dav1d> but lambdas are great? 01:46 < Drainedsoul> I luv lambdas 01:46 < dav1d> aha 01:47 < dav1d> I see 01:47 < Drainedsoul> the functional aspect of C++ is becoming much more robust these last two iterations of the standard 01:51 < tehme> yo Drainedsoul, do you have c++14 feature list? 01:56 < Drainedsoul> http://en.wikipedia.org/wiki/C%2B%2B14 01:56 < Drainedsoul> it's not finalized ofc 01:57 < tehme> lololololo 01:58 < tehme> i made first cheat 01:59 < tehme> damn 02:00 < tehme> application triggers break occasionally on exit 06:36 < ackpacket> wow there are actually people here. I'm desperate for some help with the new encryption clients are using 06:36 < ackpacket> Can I write a client that completely ignores the encryption request, that connects successfully? 06:44 < Drainedsoul> why would you want to do something like that 06:45 < ackpacket> omfg 06:45 < ackpacket> drained soul 06:45 < ackpacket> i have typed your name *so* many times in my code 06:45 < ackpacket> for testing XD 06:45 < ackpacket> because I know what the hex looks like 06:46 < ackpacket> anyways, i'm interested in doing that because i'm trying to write a client and the encryption portion comes with a very steep learning curve 06:46 < Drainedsoul> what language are you using? 06:46 < ackpacket> vb .net 06:47 < Drainedsoul> .NET has nice encryption abstractions. Why you'd willingly use a language like VB.NET is beyond me 06:47 < Drainedsoul> http://wiki.vg/How_to_Write_a_Client#Login this seems to suggest that there's a way to connect w/o encryption, but that may be contingent on the server being in offline mode 06:48 < ackpacket> Well mostly because it's what I code in lately at work, so i'm a tad faster than the more rusty languages 06:48 < ackpacket> besides that there are lots of time savings in .net and idc about any of the speed tradeoffs for this application 06:49 < Drainedsoul> I'm sorry to hear that you have to program in VB.NET for work 06:49 < Drainedsoul> that's even worse than having to program in PHP for work 06:49 < ackpacket> We do a lot of custom interfaces for our robots 06:49 < ackpacket> .net makes it easy and fast 06:49 < ackpacket> time is money 06:49 < Drainedsoul> C# > VB 06:49 < ackpacket> besides that, a lot of the japanese companes only make arrangements for you to create plugins for their systems in vb .net 06:49 < ackpacket> including Omron, ABB, Fanuc robotics 06:51 < ackpacket> So how familiar are you with the encryption going on between the client and server? My understanding of symmetric/asymmetric encryption is loose at best, but there are lots of things i'm unsure of in this specific scenario 06:51 < Drainedsoul> I've implemented it in C++ 06:51 < ackpacket> Once encryption begins, what is the blocksize? 06:51 < ackpacket> 1 byte? 06:52 < Drainedsoul> well, it is, but it doesn't really matter, since CFB makes a block cipher into a self-synchronizing stream cipher 06:53 < ackpacket> but i thought CFB has block sizes, like CFB8 CFB16 etc 06:53 < ackpacket> It was my understanding that CFB takes the previous ciphertext, appends it to the next block of plaintext, and feeds that through the encryption algorithm using the current key 06:54 < Drainedsoul> yeah it does, but it's still a stream cipher 06:54 < Drainedsoul> you don't need to split the plaintext up into blocks of a certain size 06:55 < ackpacket> I guess what i'm asking then is, what is the input size 06:55 < Drainedsoul> so AES128CFB8 (which is what MC uses) has a block size of 1 byte (8 bits) 06:55 < Drainedsoul> but you can input anything you want 06:55 < Drainedsoul> and you'll get exactly that size of output, encrypted 06:55 < Drainedsoul> so 32 bytes in ==> 32 bytes out 06:55 < ackpacket> Right, and the first 16 bytes wouldbe the cipher text 06:55 < ackpacket> and the last 16 are to be appended to the next input 06:55 < ackpacket> is that the way it works? 06:55 < Drainedsoul> 32 bytes in (plain text) ==> 32 bytes out (cipher text) 06:55 < Drainedsoul> the feedback part is handled internally to the implementation 06:56 < ackpacket> Hmm 06:57 < ackpacket> Does this not apply? http://youtu.be/ASR8TDIf_6c?t=1m55s 06:58 < ackpacket> I think the pony to bet on is to just try and see if I can successfully log in without encryption (just ignore the encryption request) 06:58 < Drainedsoul> it does, but your implementation of AES128CFB8 will handle that for you, you just give it a block of plaintext, it gives you a block of ciphertext, and you continue 06:58 < ackpacket> if that doesn't work then i'll try to write an implementation of encryption 07:03 < ackpacket> I see what you're saying now 07:03 < ackpacket> You're looking at this from a very abstracted view 07:04 < ackpacket> Which is fine if I can find an easy implementation of AES128CFB8 for vb .net 07:04 < ackpacket> Although I suppose I could write all of the encryption in c++ in a snap, and just throw it in a library. Hmm... 07:05 < ackpacket> Sorry if I sound like a fanboy on this, but i'm really curious since i've been staring at your name so many times going through all these tutorials. What's your background? Have you written anything useful for mc? 07:10 < Drainedsoul> I'm just writing a server as a personal project 07:11 < Drainedsoul> AesCryptoServiceProvider is probably what you're looking for 07:11 < Drainedsoul> http://msdn.microsoft.com/en-us/library/system.security.cryptography.aescryptoserviceprovider.aspx 07:11 < ackpacket> I'm creating a programmable bot, so people can add simple instructions 1 after another and make their own bots based around this 07:11 < ackpacket> they won't have to have any previous .net knowledge 07:12 < Drainedsoul> libraries/frameworks are always good things to have 07:12 < ackpacket> so for example they could do lclick, wait 500, goto start 07:12 < ackpacket> to have a player log ina nd constantly click 07:12 < pdelvo> encryption in .net for minecraft is not that easy 07:13 < ackpacket> or if they used lclick, movef 1, repeat 40, moveb 40, they could write a bot that harvests a 40 block line of sugarcane 07:13 < Drainedsoul> pdelvo: what makes encryption in .NET difficult? 07:13 < ackpacket> i want people to be able to automate tasks without learning a programming language, or anything about sockets/networking 07:13 < pdelvo> you can use bouncycastle. that works, but I really dont like it. it is almost not documented at all and written for java 07:14 < pdelvo> the aes part is easy, but rsa is not 07:14 < ackpacket> also I don't want to build upon the notchian client because for some it's not convenient to leave such a resource hog running all the time 07:14 < Drainedsoul> just because of the ASN.1, correct? 07:15 < pdelvo> jeah. parsing the rsa key from minecraft and bringing it in a format that minecraft understands is not easy 07:16 < Drainedsoul> into a format that C#'s RSA provider understands? 07:16 < Drainedsoul> *.NET's 07:17 < ackpacket> Well hopefully the encryption is a moot point and this project goes forward. I think a lot of people will pick up the opportunity to write small mc programs and really run with it 07:17 < pdelvo> this why I need this class: https://github.com/pdelvo/Pdelvo.Minecraft/blob/master/Pdelvo.Minecraft.Network/ProtocolCryptography.cs 07:19 < Drainedsoul> which direction is that targeted at, or both? 07:19 < pdelvo> both 07:20 < Drainedsoul> ah okay. I did some grotesque specially targeted DER implementing to go from OpenSSL's big integer to ASN.1 07:20 < ackpacket> pdelvo what kind of projects are on your todo list? 07:20 < Drainedsoul> https://github.com/RobertLeahy/MCPP/blob/master/src/rsa_key.cpp#L163 07:21 < ackpacket> lmao mr leahy 07:21 < ackpacket> and randy 07:21 < pdelvo> and btw. for aes you cant use the AesCryptoServiceProvider. use RijndaelManaged instead. the aes one is more strict to the parameter it supports and you cant configure it to work with minecraft 07:21 < Drainedsoul> if I ever do anything MC-related in .NET I'll just P/Invoke OpenSSL, this sounds like too much for me 07:21 < Drainedsoul> :P 07:22 < pdelvo> I have a full minecraft protocol implementation in C# which is able to work with multiple versions. and I have a proxy which is in theory able to allow players to join to a mc server with a different version then the server 07:22 < ackpacket> pdelvo, have you been listening for a while now? Is it possible to login to an online server and just ignore the encryption request? 07:22 < pdelvo> it was. I dont know if it has changed or not 07:23 < ackpacket> Wait, it was as in, it was possible to login without encryption (back before encryption existed in mc), or as in even when encryption was implemented you used to be able to ignore it 07:27 < pdelvo> it was after encryption was in. but I dont know how it was exactly. you could not send a encryption related packet. but im not sure which one 11:17 <+clonejo> Is anyone here playing with Rust? 11:37 < jast> I've looked at Rust and like the ideas... but haven't really used it yet 11:38 <+AndrewPH> uhhh Rust being the game or being something that I haven't heard of? 11:38 < jast> in my case, not the game but the programming language :) 11:38 < jast> rust-lang.org 11:38 < jast> still in design phase pretty much 11:38 < jast> but there's a working implementation of the current state 11:41 <+AndrewPH> neato 11:42 < jast> and it does pretty much all the cool things 12:04 <+pdelvo> lol. java 8 add linq and lambdas and some kind of virtual methods in interfaces. so basicly it makes java more .net 12:04 < jast> that's a good thing, right? 12:05 <+pdelvo> kind of. I have to use it in the near future so I should be happy about that 12:06 < jast> otoh it'll encourage more people to use java :/ 12:06 < SinZ> it'll only get used when java10 is released 12:09 <+AndrewPH> ^ 4 months after java 8. also java8 will break things for No Reason(tm) 12:10 < jast> I'm so sad I never have to deal with java 12:11 <+pdelvo> An article about it appeared in my twitter today 12:13 < SinZ> shit all people are using java7 still 12:14 <+pdelvo> how can someone use a language without lamdas if they are not forced to do so??? 12:19 < tehme> pdelvo: why are lambdas? the only use i know is quick and dirty anonymous function in std algorithms 12:21 <+pdelvo> because you can compress many lines of source code in a single line while increasing readability 12:23 <+pdelvo> var result = list.Where(item => item.FirstName == "John").OrderBy(item => item.LastName).Skip(5).Take(10).ToArray(); 12:23 <+pdelvo> write this without linq and lambdas. 12:25 < jast> lambdas are pretty much indispensable when you write functional-style code 12:25 < jast> and functional-style code is much shorter and easier to read than imperative-style code for a wide range of tasks 12:33 < eddyb> or array.filter(item => item.firstName == 'John').sort((a, b) => a.lastName - b.lastName).slice(5, 10) // ES6 <3 12:37 < eddyb> tehme: try working in a languages where there's no real separation between functions and lambdas 12:40 < eddyb> oh dear, I'm tired. s/languages/language 12:40 < tehme> eddyb: lua:) 12:41 < eddyb> can you do what I wrote three lines above in Lua? 12:41 < zutto> dont forget the trailing slash eddyb 12:41 < eddyb> zutto: s/$/\// are you happy? 12:41 < zutto> very 12:42 < zutto> continue! 12:43 < eddyb> Lua is quite moronic, maybe somewhat like VB. even Python is better (and I despise it) 12:44 < tehme> eddyb: why do you think so? 12:44 < eddyb> it's used by game devs who have no clue what they're doing (take a dive into WoW code sometimes if you don't believe me) 12:44 < zutto> lua is very good when you need to do things like what world of warcraft did.. small scripts 12:44 < zutto> actually didnt hl engines use lua as extension language too? 12:45 < Exio4> pdelvo: "and lambdas" 12:45 < eddyb> warcraft can be excused, v8 wasn't back then 12:45 < Exio4> more like adding functional ways to do stuff 12:45 < zutto> actually i agree with that eddyb lol 12:45 < zutto> damn it would be amazing to have v8 integrated into games 12:45 < zutto> you could actually do something and it wouldnt suck so much 12:45 < tehme> javascript? oh god no 12:46 < eddyb> I have a bindings layer which makes it trivial 12:46 < eddyb> tehme: you have no clue, since you didn't pick up on "ES6" 12:46 < tehme> wut 12:47 < eddyb> if you haven't heard of ES6, you obviously have no idea what you're talking about 12:47 < tehme> so tell me 12:49 < eddyb> zutto: look at these bindings: https://github.com/eddyb/v8-gearbox/blob/master/src/modules/GL.gear#L323 12:49 < eddyb> zutto: if I add a preprocessor on top of it, I can make them even thinner 12:50 < zutto> looks fine to me 12:50 < eddyb> nobody was using it, so it went zombie, like most of my projects 12:51 < zutto> most of my projects go zombie cause i never release them to anyone except selected few 12:51 < eddyb> I've been thinking of coming back with its framework, in competition with node.js' attempt of creating a C API (to wrap the unstable v8 C++ API) 12:52 < eddyb> but I don't like useless work, so I even forgot about that until now 12:53 < zutto> if you can beat node.js, i'll give you a golfclap 12:54 < eddyb> I've done this before node.js, it gained popularity too fast, but I can make it really easy for bindings writers 12:54 < eddyb> zutto: you can do this from C++ (assuming node.js): global["process"]["emit"]("exit", 0); 12:54 < zutto> i dont really know much about nodejs, other than that its very easy to scale for big projects ;l 12:55 < eddyb> have you seen the v8 C++ API? 12:55 < zutto> nope 12:55 < eddyb> it would take about 7 lines and a lot of code to do the same thing, without my framework 12:56 < zutto> sounds quite intresting 12:57 < eddyb> I tried to rewrite node.js with it, they wouldn't import it and it was too big for me 12:57 < eddyb> s/import/accept my trashing/ 12:57 < zutto> i used to use programs that were using spidermonkey as their scripting language, now i'm just imagining what it would be like with v8, lol 13:02 < eddyb> zutto: this is one example https://github.com/joyent/node/blob/master/src/node.cc#L3164-L3173 13:02 < eddyb> process_l["_exiting"] = true; process_l["emit"]("exit", 0); // with my framework 13:35 < jast> node.js scales easily... unless you actually have to do computations. there are environments that can do the difficult work for you even in this case, and node.js isn't one of those :) 14:18 < tehme> yo 14:18 < tehme> let's rename http://wiki.vg/Protocol#0x33 to Chunk column data 14:20 < TRocket> @tehme Chunk column data +1 14:20 < TRocket> much more descriptive as to what the packet actually represents 14:37 <+clonejo> zutto: Also nodejs isn't concurrent, just asynchronous. 14:37 < zutto> i know 14:37 < zutto> thats why its good for scaling ;l 14:38 <+clonejo> zutto: um, nodejs can only handle one event loop, eg. only one thread 14:38 < zutto> wasnt there some stabbing done for running multiple nodejs instances that shared all data 14:38 < jast> for almost completely I/O-bound applications that's fine 14:39 < zutto> that removed the problem 14:39 < zutto> i remember there was some solution 14:39 < jast> implicitly sharing all data across several instances is pretty expensive 14:40 <+clonejo> I suspect v8 to only use floats, even for integers. 14:43 <+clonejo> I once had multiple nodejs instances running with heavy integer calculations on my cpu which has 8 cores, but only 4 fpus. Each pair of cores had exactly 100% usage. 14:44 < eddyb> optimized code does integer arithmetic just fine 14:45 < eddyb> they even added support for Smi (31-bit signed integers, shifted left by one and the lowest bit is set, to distinguish from pointers) arithmetic 14:45 <+clonejo> hm, then it wasn't optimizing for some reason 14:45 < eddyb> unoptimized code tends to run like shit because there's little type info 14:45 <+clonejo> the 8 nodejs processes weren't restarted through the whole operation, jit should have worked just fine 14:45 <+clonejo> oh, ok 14:46 < eddyb> are you sure you weren't using floating-point anywhere, not even for intermediary values? 14:46 <+clonejo> idk, the nodejs code wasn't written by me 14:47 < eddyb> chances are it wasn't that smart 14:47 <+clonejo> ^^ 14:49 < eddyb> I don't know if anyone's tried this, but forking (to create cluster workers) *after* setting up most of the work environment should reduce memory usage 14:50 < eddyb> because of CoW. and fuck windows 16:24 < tehme> fuck chunks! 16:28 < TkTech> clonejo: V8 and JavaScriptCore both have some extensions for explicit typing. 16:36 < eddyb> TkTech: can you expand on that? 16:37 <+pdelvo> does it improve performance or is it just to help the developer like explicit typing in typescript? 16:37 < eddyb> I haven't seen it, for the record 16:37 < dx> maybe stuff like asm.js 16:37 < eddyb> v8 uses first-tier JIT to capture type info for second-tier optimized JIT 16:38 < TkTech> eddyb: V8::Int32 / V8::Number 16:38 < eddyb> dx: not supported by v8, which aims at better performance for non-auto-generated code :P 16:38 < eddyb> TkTech: ah, you misunderstood that. they're just constructors 16:40 < dx> eddyb: i don't think you can get the performance of asm.js with dynamically typed javascript code, but yeah, auto-generated code is not an ideal path to aim to i guess 16:41 < eddyb> dx: the idea is that without supporting asm.js, asm.js should be almost as fast as in a supporting engine, without restricting it as in the specs 16:41 < dx> eddyb: ideally! 16:42 < eddyb> it's pretty much about logistics :P 16:46 < dav1d> asm.js? 16:46 < dav1d> ah 16:46 < dav1d> nvm 20:42 < tehme> can anyone compress a test string for me by zlib deflate? 20:44 < Drainedsoul> how is the string encoded? 20:48 < tehme> hm 20:49 < tehme> show me please how you handle chunks 20:49 < tehme> Drainedsoul: ^ 20:49 < Drainedsoul> what do you mean "handle" them? 20:52 < tehme> decompress and store 20:52 < Drainedsoul> well I'm writing a server, I don't decompress chunks, I compress them 20:52 < Drainedsoul> https://github.com/RobertLeahy/MCPP/blob/master/src/world/column_container.cpp#L474 20:53 < tehme> fuck 20:53 < tehme> anyway 20:53 < tehme> where did you take lib? 20:53 < tehme> built yourself? 20:53 < Drainedsoul> hmm? 20:54 < tehme> i wanted binaries 20:54 < Drainedsoul> I had to build zlib from source because it wasn't x64 20:54 < tehme> but i cant find them on their site 20:54 < Drainedsoul> download the source and build it 20:54 < tehme> i hate it 20:55 < Drainedsoul> there are distributed binaries, but they're x86 only 20:56 < tehme> link please 20:56 < eddyb> tehme: don't use windows. problem fixed pretty much 20:57 < Drainedsoul> he's in love with MSVC++ for some reason 20:57 < Drainedsoul> there's literally a link to the zlib compiled DLL on zlib's homepage http://www.zlib.net/ 20:58 < tehme> what about header and lib? 20:58 < tehme> how sjould i use it? 20:58 < tehme> should* 20:59 < Drainedsoul> I have no idea. I don't use VS. I just /I the path to the includes and pass the DLL to the linker 20:59 < tehme> or im i fuckin blind and they are in archive? 21:00 < tehme> yep 21:00 < tehme> i am blind 21:00 < tehme> sorry 21:11 < Not-009> [mc4p] sadimusi pushed 1 commit to master [+0/-0/±8] http://git.io/jvfmug 21:11 < Not-009> [mc4p] Simon Marti 31ffd16 - Reworked protocol definitions + yggdrasil support 21:11 < tehme> if (skylight) size+=(16*16*16*16)/2; 21:11 < tehme> i love this 21:24 < eddyb> *256 would make slightly more sense 21:24 < eddyb> or, you know, constants 21:33 < tehme> TRocket 21:33 < tehme> are you here? 21:34 < tehme> oh 21:38 < Drainedsoul> how would *256 make more sense 21:39 < Drainedsoul> (16*16*16*16)/2 is 32768. But 32768 doesn't have any semantic meaning. A column is 16 chunks which are 16*16*16. Skylight is a nibble per block, so (16*16*16*16)/2 communicates something about the value 21:40 < Drainedsoul> the compiler is going to look at (16*16*16*16)/2 and just replace it with 65536 anyway 21:40 < Drainedsoul> *32768 21:45 < eddyb> Drainedsoul: 16x16x16 is a single chunk 21:46 < eddyb> Drainedsoul: a column is 16x16x256 21:46 < Drainedsoul> a column is 16x(16x16x16) 21:47 < eddyb> chunkWidth * chunkHeight * maxHeight 21:47 < eddyb> pretty sure maxHeight can vary, so it makes more sense this way 21:47 < Drainedsoul> with the current protocol max height can only vary by being decreased 21:48 < Drainedsoul> as far as I can tell 21:49 < Yoshi2> eddyb: wouldn't chunk length instead of chunk height make more sense? 21:49 < eddyb> Yoshi2: thank you, I needed that word. I've had some problems with more than two dimensions :)) 21:50 < Yoshi2> heh, you're welcome --- Day changed mer. sept. 04 2013 01:23 < tehme> shit 01:23 < tehme> dat vs 01:24 < tehme> i am trying to change file structure and now i can't compile asolution 01:30 < Drainedsoul> weird 01:31 < Drainedsoul> I don't have this issue with makefiles and GCC 01:34 < tehme> heh 01:34 < tehme> i did it 01:34 < tehme> isn't it boring to write makefiles? 01:34 < tehme> why do the work that can be done by ide? 01:35 < tehme> wasn't that you who said "let compiler do the work for you"? 01:38 < tehme> can i upload images to github ? 02:01 < Drainedsoul> yes you can 02:01 < Drainedsoul> it even has proper diff support for images, it's ridiculous 02:02 < tehme> can you help me 02:02 < tehme> ? 02:02 < tehme> i created local repo 02:02 < tehme> how should i push it to github? 02:02 < tehme> and i created github repo too 02:03 < Drainedsoul> are you just using git, or are you using a GUI front-end 02:03 < tehme> git console 02:04 < Drainedsoul> I have no idea, why are you doing that to yourself? Get something like SourceTree 02:04 < tehme> ok 02:05 < Drainedsoul> have you tried 02:05 < Drainedsoul> git help push 02:05 < Drainedsoul> ? 02:05 < tehme> i just realized i typed commands into lua interpreter console 02:06 < tehme> time to sleep or something 02:16 < tehme> wow 02:16 < tehme> nice thing 02:17 < tehme> thank you man 02:17 < tehme> it's much better 15:18 < shoghicp> Updated http://p.wiki.vg/ for the MCPE 0.7.5 release, no protocol changes 18:23 < tehme> anyone used boost iostreams zlib? 21:00 < ashka> hm, does anyone has a iptables rule to drop server list packets ? 21:07 < dx> ashka: while keeping server access? 21:07 < dx> interesting 21:07 < _68x> ashka: afaik, it's not possible without blocking the ip 21:07 < ashka> okay, it's what I thought.. I should create a proxy for it 21:07 <+sadimusi> nobody will be able to connect 21:08 < _68x> or .. you can implement a server mod that spefically does not respond to those packets 21:08 < dx> but if iptables has a module to read the first few tcp bytes... 21:08 < dx> (i can barely get a NAT working with iptables, don't ask me) 21:09 < _68x> ashka, what are you using to act as the minecraft server? 21:09 < ashka> bukkit, but I can't really do something for it but a thing as simple as iptables (live stuff, etc) 21:14 < dx> well you can use reflection from a plugin to mess with NMS and disable that part of the code :D 21:15 < _68x> ashka, then i recommend downloading bukkit's source 21:15 < _68x> or get soem one to to do this for you: 21:15 <+sadimusi> what's the goal anyway? 21:16 < _68x> get bukkit's source and make bukkit not handle the server ping packets 21:16 < _68x> of course the down side is that you have to manually do this for every bukkit build ... 21:17 < dx> send the bukkit developers a patch to include an api for this 21:17 < dx> just kidding don't waste your time 21:21 < _68x> dx, i see what you did there 21:22 < dx> :3 21:23 < _68x> i just realised that minecraft has added extra packets for mods 21:24 < dx> are you talking about plugin channels or did i miss anything? 21:25 < _68x> score board related packets 21:25 < _68x> there are some really neat applications of it 21:25 < dx> oh, that 21:25 < dx> mostly sethbling applications 21:26 < _68x> i've been on some servers that display the health bar 21:26 < _68x> i believe that they are using, Display Scoreboard (0xD0) , please correct me if i am wrong 21:30 < shoghicp> I would like that in MCPE too :( 21:31 < Yoshi2> I played around a bit with the score board packets two weeks ago and noticed at least one thing that seemed odd to me 21:31 < Yoshi2> you can't display a scoreboard without any entries 21:32 < Yoshi2> at least not as a sidebar list 21:32 < _68x> Yoshi2, it's porbably some data verification client side 21:32 < _68x> oh heya shoghicp, long time no see! 21:32 < shoghicp> hi! 21:33 < Yoshi2> if you tell the game to display a scoreboard as a sidebar and in the TAB player list, you can force the game to display the scoreboard on the side of your screen 21:33 < Yoshi2> when you press tab, the scoreboard will appear and there will be a single entry, which is your own name 21:33 < Yoshi2> very annoying, because I wanted to use the scoreboard as a message box :/ 21:34 < _68x> :/ 21:34 < _68x> does it take neline chars? 21:35 < Yoshi2> I don't think so, but I haven't tried that 21:37 < _68x> kind of sucks, but i guess they are other applications for score boards 22:12 < tehme> i just griefed huge wall of diamond blocks 22:12 < tehme> life is good 22:42 < tehme> fuck! 22:42 < tehme> i hate boost iostreams 22:55 < tehme> omfg shitfuck 22:55 < tehme> i can't decompress this shit 22:56 < tehme> and google is impressively silent 22:57 < Drainedsoul> why can't you decompress it? 22:58 <+Prf_Jakob> tehme: Please this channel is not about greifing 22:58 < tehme> Drainedsoul: tons of errors 22:58 < Drainedsoul> such as? 22:58 < tehme> cannot instattiate blah blah 22:59 < Drainedsoul> wat 22:59 < Drainedsoul> where are these errors coming from? 23:00 < tehme> from boost 23:00 < Drainedsoul> compile time errors? 23:01 < tehme> 1>c:\boost_1_53_0\boost\iostreams\copy.hpp(178): error C2338: (is_same::value) 23:01 < tehme> 1> c:\boost_1_53_0\boost\iostreams\copy.hpp(219) : see reference to function template instantiation 'std::streamsize boost::iostreams::detail::copy_impl,boost::iostreams::back_insert_device>(Source,Sink,std::streamsize)' being compiled 23:01 < tehme> yes 23:01 < Drainedsoul> what does that have to do with decompressing 23:02 < tehme> http://pastebin.com/hLbA63E4 23:04 < Drainedsoul> I don't know anything about this boost crap. Why don't you just write a nice wrapper for zlib and use that 23:04 < tehme> tons of code 23:05 < Drainedsoul> lol 23:07 < tehme> but i am close to this 23:08 < tehme> or just steal your code:D 23:13 < Drainedsoul> yeah that works 23:14 < tehme> fuck 23:15 < tehme> it's hard to understand 23:15 < Drainedsoul> what is? 23:16 < tehme> your inflate 23:30 < TkTech> Prf_Jakob: Starting to get a bit annoying. The language, one or two word sentences, and the obvious goal of using what he learns here to grief. 23:31 <+sadimusi> TkTech: agree 23:44 < Drainedsoul> what did you have in mind? 23:48 < iBotPeaches> as long as we are voicing opinions, he is very annoying, and I agree 23:49 <+Prf_Jakob> well if he is greifing then give him the boot 23:50 <+sadimusi> maybe we should add a rule about that 23:55 <+Prf_Jakob> we do 23:56 < AlphaBlend> what is the worst that could come of someone talking about griefing in here? 23:56 < dav1d> did we get a ban? 23:56 <+Prf_Jakob> actually we donät 23:56 < iBotPeaches> I don't see it on the list 23:56 < iBotPeaches> last one is about pirating 23:56 < AlphaBlend> i mean, i don't really enjoy the topic myself 23:57 < iBotPeaches> personally, I hate the constant whining and language, but that can't be a valid reason 23:57 <+Prf_Jakob> There is a section on Exploits which I guess covers griefing as well 23:57 < AlphaBlend> griefing = exploit 23:57 < AlphaBlend> wat --- Day changed jeu. sept. 05 2013 09:10 <+Prf_Jakob> What is the easiest way from the cli to get a pull request down to your local repo? 09:10 <+Prf_Jakob> TkTech: ^ 09:36 < jast> git pull 09:37 < jast> if you merge pull requests from a user repeatedly, you might wanna add a remote for the URL: git remote add foobar . makes things easier. 09:59 <+Prf_Jakob> jast: k thanks, I was hoping i could just do "git pull origin pulls/" and it would alias it correctly. 10:38 < eddyb> jast, Prf_Jakob: about that, for my forks I add a "parent" remote, so I can do git pull (--rebase if I have any local changes) parent master; git push # to bring it up to date 11:44 <+md_5> relevant to us: http://i.imgur.com/rnJHZOa.png 11:49 <+Prf_Jakob> md_5: yeupp 11:49 < winny> haha. 12:31 < tehme> sup 12:32 < tehme> well i did it 12:32 < tehme> writing directly into vector's array 12:32 < tehme> dirty dirty code 12:38 < Not-002> [fCraft] fragmer * r2202 3 files : Updated CPE netcode to latest protocol revision (3 Sep 2013) 15:20 <+clonejo> Prf_Jakob: there is some command line interface for github 15:20 <+Prf_Jakob> hub 15:20 <+Prf_Jakob> seems to be one 15:27 < iBotPeaches> a new snapshot :p its been too long 15:32 < Yoshi2> there is no UTF8 support in the snapshot, is there? 15:32 < Yoshi2> I'll just give up :P 15:38 <+pdelvo> never give up! 15:39 <+pdelvo> I got my protol version at the motd request (c->s) after I wanted it for months 15:40 <+pdelvo> the new mesa biome looks so strange 15:41 < Yoshi2> there is a mesa biome? 15:41 <+pdelvo> jeah. but its very buggy 15:42 <+pdelvo> the water does not go to the ground of the sea. there is air under it 15:42 <+sadimusi> as expected burger completely fails 15:44 < Yoshi2> sadimusi: has there been a single update which didn't cause burger to break? 15:44 <+sadimusi> sure 15:44 <+sadimusi> burger actually broke way less often than I would have expected 15:45 < shoghicp> :D 15:45 < Yoshi2> ah, good to hear 15:45 <+pdelvo> under a sea in a mesa biome: http://pdelvo.de/2013-09-05_15.42.54.png 15:45 <+sadimusi> does it fill up as soon as you update a block? 15:46 <+AndrewPH> undah da sea~ unda da sea~ 15:46 <+AndrewPH> (something something lyrics) 15:46 <+pdelvo> it does. but only the spot where I update it 15:48 <+pdelvo> I dont like that biome. looks very wrong http://pdelvo.de/2013-09-05_15.47.26.png 15:50 < shoghicp> lol xD 15:53 <+AndrewPH> looks fine to me? 15:53 < Yoshi2> is that the new flying island biome everybody has been waiting for since indev? :D 15:54 <+AndrewPH> gosh darnit Yoshi2 now I'm nostalgic for indev 15:54 <+AndrewPH> those floating islands were the bees knees 15:54 <+pdelvo> maybe :D the bad thing is that all islands are 1 block at height 15:56 < Yoshi2> AndrewPH: I'm still nostalgic for classic, it's the only reason why I started writing a smp->classic proxy on the basis of mc4p 15:56 <+AndrewPH> Yoshi2: oh boyyy 15:56 <+sadimusi> Yoshi2: did you have a look at my recent mc4p update? 15:57 <+pdelvo> I like the new particles coming out of the water. looks like there are fish swimming :) 15:57 < Yoshi2> sadimusi: nope, haven't looked at it yet 15:58 <+sadimusi> I reworked the protocol definitions quite a bit https://github.com/sadimusi/mc4p/blob/master/mc4p/messages.py#L27 16:24 < TkTech> sadimusi: Wait, what? How is ClientMessage aware of the selected protocol version? 16:24 < TkTech> What evilness have you implemented? 16:25 <+sadimusi> a few of the things I wrote probably belong to the "never ever do this" category 16:25 <+sadimusi> e.g. https://github.com/sadimusi/mc4p/blob/master/mc4p/parsing.py#L68 16:25 < TkTech> Oh sweet jesus. 16:25 <+sadimusi> but I'm willing to sacrifice my firstborn for pretty protocol definitions :P 16:25 < dav1d> lol 16:26 < TkTech> This is how you end up on the dailywtf. 16:26 < TkTech> Clever solution, but urgh. 17:01 <+pdelvo> the new version does perform a lot better for me. almost 3 times the fps I got with 1.6.2. wow 17:06 <+pdelvo> I have now >300 fps at fancy, renderdistance far, adv. opengl and full hd if I walk around and generate new chunks. If I stand still I have >400fps. in 1.6.2 I had ~130fps 17:07 < dexter0> maybe they finally merged in that new rendering engine. 17:08 <+pdelvo> the multiplayer chunk cache now has 2 values (always the same for me). Its lower then before for distance far. and the chunks need more time to load in :( 17:08 <+pdelvo> but the fps are much higher 17:12 <+pdelvo> the gpu load is lower then in 1.6.2. ~30% for me 17:12 <+pdelvo> in 1.6.2 ~40%. 17:15 < dexter0> Quick look through the jar did not turn up any shaders (which I'd expect to see in the new engine) but maybe they are just including them in the src. 17:17 <+AndrewPH> pdelvo: oh wow that's a pretty nice improvement 17:25 < Yoshi2> sadimusi: has anything else other than the protocol definition changed? 17:25 < Yoshi2> I had to dig in pretty deep into the mc4p code to bend it into doing what I want :/ 17:30 <+pdelvo> hm no improvement on my ultrabook :( 18:04 <+sadimusi> Yoshi2: no, everything else is still the same 18:05 <+sadimusi> Yoshi2: authentication changed a bit as well, it now supports yggdrasil 20:04 < tehme> this fucking minecraft eats 50% of cpu while not in game 20:04 < tehme> wtf mojang 20:06 <+pdelvo> turn on vsync 20:06 <+sadimusi> tehme: your rambling and swearing is getting a bit annoying 20:06 < tehme> ok 20:07 <+pdelvo> its not minecrafts fault that your computer always wants to do everything as fast as it can 20:08 < tehme> pdelvo: wut? 20:08 < tehme> it was in multiplayer menu 20:09 <+AndrewPH> a program doing literally nothing but 1+1 forever will eat similar amounts of cpu :) 20:09 <+pdelvo> jeah and you configured minecraft to render as much fps as it can. and because minecraft is mostly cpu limited it uses that much cpu 20:10 < tehme> pdelvo: no i did not 20:10 <+pdelvo> wow. thats nice. found a "Savanna Plateau M" biome. with a floating island at215 height 20:11 <+pdelvo> if you have vsync disabled you have 20:14 < TkTech> pdelvo: You say that, and then don't mention the seed? How cruel. 20:14 <+pdelvo> Im uploading a screenshot right now :) 20:15 < dav1d> pdelvo: what windows are you using? 20:16 <+pdelvo> windows 8. And I dont care if everyone who never used it say it sucks :) 20:16 <+pdelvo> http://pdelvo.de/2013-09-05_20.11.17.png 20:16 <+AndrewPH> pdelvo: truly this is the future 20:17 < dav1d> pdelvo: I am thinking of exactly installing that 20:17 < Yoshi2> flying islands, oh how I missed thee 20:17 < dav1d> 1.7 terrain ftw 20:17 < dav1d> (beta 1.7) 20:17 < dav1d> and alpha cobblestone 20:18 <+pdelvo> I cant find a mesa biome any more 20:54 < TkTech> AndrewPH: Technically the past. 20:54 < TkTech> Even then the old flying islands looked waaay better 21:50 * dav1d just bough windows 8 22:49 < Socolin> Hello, is someone have an example how to handle 0xFD packet on client side in C++ with Crypto++ (how to use server public key, for encrypt the token and the client private key) ? 22:50 < dav1d> thi 22:50 < dav1d> *hi 22:50 < dav1d> there should be examples on the wiki 22:50 < dav1d> on the bottom, links to pastebins 22:50 < Socolin> I have look them I don't find it 22:51 < Socolin> I have use it for server side 22:53 < dav1d> ah 22:53 < dav1d> Fador: should have some code 22:53 < dav1d> maybe just wait until he gets around 22:53 < dav1d> dx: maybe as well ^ 22:54 <+sadimusi> isn't Drainedsoul using C++ as well? 22:55 < dav1d> right 22:57 < Socolin> ok thank you, I will continue trying to make it work ;) 22:59 <+Fador> I use openssl to handle encryption in mineserver.. 23:00 < dav1d> oh 23:01 < Socolin> serverside it work ^^ 23:08 < tehme> what is code of air? 0? 23:09 < Morrolan> Item ID of air is 0, yes. 23:09 < dav1d> tehme: minecraft wiki → data values 23:28 < Drainedsoul> I have examples of how to handle that packet with C++ 23:28 < Drainedsoul> but not with Crypto++, I just use custom OpenSSL wrappers 23:32 * winny fires up the snapshot 23:33 < winny> unrelated I finally converted some wolfram alpha systems of equations stuffs to figure out where strongholds are into python :3 https://github.com/winny-/stronghold/blob/master/stronghold.py 23:40 < tehme> cheater! 23:41 < Socolin> It's ok, I just found how to do it with cryptopp, 23:44 < tehme> http://wiki.vg/SMP_Map_Format#Chunk_Column_Metadata 23:44 < tehme> what is "add array"? 23:45 <+pdelvo> it is used when you want more block type ids 23:46 < tehme> hmm 23:46 <+pdelvo> without it you have 2⁸ = 256 different blocks. with it you have 2⁸ * 2⁴ = 4096 block types 23:46 < tehme> oh 23:47 < tehme> i got it 23:47 <+pdelvo> it is only present if you set the bitmask correctly 23:47 <+pdelvo> it is not used in vanilla, but by mods 23:48 < tehme> i doubt does this have to be in block struct 23:50 <+pdelvo> what do you mean? 23:51 < tehme> http://pastebin.com/kmPjdbP3 23:51 < tehme> m_add 23:52 < Drainedsoul> if you want to store block type in memory, you should just store it as a 16-bit unsigned integer and constrain that to <4096 somehow 23:53 < Drainedsoul> it doesn't make any sense to do all sorts of bitwise shenanigans whenever you want to read the block type, just because Mojang's on wire format is stupid 23:56 < tehme> Drainedsoul: that's an idea 23:56 < tehme> but damnit 23:56 < tehme> this chunk shit is a little unclear to me 23:56 < Drainedsoul> in what way? 23:56 < tehme> so refactoring will be 23:56 < tehme> description 23:57 < tehme> i am thinking about rewriting it 23:57 < dav1d> mh 23:57 < Drainedsoul> yeah that sounds like a plan 23:57 < dav1d> why would I use partclone instead of dd? 23:58 < tehme> good question 23:59 < dav1d> well, partclone is probably faster, since it probably sees "empty" space 23:59 < dav1d> but so much probably --- Day changed ven. sept. 06 2013 00:00 < tehme> test it 00:00 < tehme> offsets or iterators? 00:03 < dav1d> depends 00:03 < dav1d> but I'd use offsets for the chunk stuff 00:03 < dav1d> actually, I am using offsets :P 00:04 < tehme> heh 00:04 < tehme> i want to try MIGHTY C++ STYLE 00:04 < tehme> this will work good with vector 00:07 < Drainedsoul> "partclone"? 00:08 < dav1d> Drainedsoul: yes 00:08 < dav1d> what clonezilla uses 00:08 < Drainedsoul> I don't follow 00:08 < Drainedsoul> uh okay 00:09 < Drainedsoul> I got confused because I thought it had some relation to the discussion about storing blocks 00:09 < Drainedsoul> sorry 00:09 < dav1d> ah no 00:09 < dav1d> my bad 00:20 < tehme> lol 00:20 < tehme> iterator version is much slower 00:24 < tehme> server kicks me before i read all chunks 00:27 * dav1d hopes for the best http://vp.dav1d.de/6mtcL 00:31 < tehme> lolololol i'm a pervert 00:31 < tehme> i made 80 threads that read chunks 00:32 < tehme> at least server doesn't kick me now 00:33 < tehme> Drainedsoul: what is the best way to store chunk columns? 00:34 < dav1d> memory 00:34 < tehme> orly 00:34 < dav1d> put your blocks into a block struct 00:34 < dav1d> store these in memory 00:34 < tehme> different containers can represent memory 00:34 < dav1d> you need 12 bit padded iirc per block 00:34 < dav1d> no container 00:34 < tehme> wut 00:35 < dav1d> Block* 00:35 < dav1d> or if you feel fancy, multi-dimensional 00:35 < tehme> what the focking hardcore? 00:35 < dav1d> what? 00:35 < tehme> how do you access this? 00:35 < dav1d> chunk[x][y][z] 00:35 < dav1d> not so bad isn't it? 00:36 < dav1d> s/n't// 00:36 < tehme> and when you move? 00:36 < dav1d> calloc it 00:36 < tehme> new chunks load 00:36 < dav1d> I free the chunk 00:36 < tehme> ols ones unload 00:36 < dav1d> calloc and free 00:36 < tehme> old* 00:36 < dav1d> and set the old chunk ptr to an empty read only chunk 00:36 < dav1d> https://github.com/Dav1dde/BraLa/blob/master/brala/dine/chunk.d 00:37 < dav1d> get_block / to_flat 00:37 < dav1d> are important 00:38 < dav1d> actually a block is 24bit 00:39 < Drainedsoul> I store blocks in columns, and I store blocks in a structure that's exactly 64 bits 00:39 < Drainedsoul> 32 bits for "flags", 16 bits for the type, 8 bits shared for skylight/metadata, and 8 bits for light 00:39 < tehme> how do you store columns? 00:39 < dav1d> Drainedsoul: 32 bit for what? 00:39 < dav1d> Drainedsoul: server I guess? 00:39 < Drainedsoul> yes 00:39 < Drainedsoul> it's a server 00:40 < dav1d> ok, then flags make sense 00:40 < tehme> i store them in this: std::map> m_columnsMap; // ZX, in chunk coordinates 00:40 < dav1d> client needs not additional state 00:40 < tehme> but i think it is bad 00:40 < dav1d> tehme: holy fucking shit 00:40 < Drainedsoul> I have a contiguous stretch of memory that will store 16*16*16*16 blocks, and then 16*16 bytes, and then 1 byte for populated/not 00:40 < Drainedsoul> use a std::unordered_map 00:40 < tehme> oh 00:40 < dav1d> tehme: calloc a bunch of memory done 00:40 < dav1d> Drainedsoul: doesn't make it a lot better 00:40 < Drainedsoul> don't calloc 00:40 < tehme> dav1d: this will lead to problems in other place 00:40 < Drainedsoul> std::unordered_map> is what I do 00:41 < dav1d> Drainedsoul: calloc and copy over the data from the chunks 00:41 < tehme> i want to keep chunk coords 00:41 < Drainedsoul> create a class 00:41 < dav1d> Drainedsoul: why the fuck would you use a hashmap for blocks 00:41 < Drainedsoul> that has arrays in it 00:41 < Drainedsoul> I don't 00:41 < Drainedsoul> I use a hashmap for columns 00:41 < Drainedsoul> ColumnID is X/Z/Dimension 00:41 < dav1d> oh the 16x16x16 chunks? 00:41 < tehme> column is what you call Chunk 00:41 < Drainedsoul> SmartPointer points to a whole column 00:41 < dav1d> ah nvm then 00:41 < Drainedsoul> I don't care about chunks 00:41 < Drainedsoul> I just store columns 00:41 < dav1d> yeah I use an AA for these as well :> 00:41 < dav1d> sorry, my bad 00:42 < tehme> and yes 00:42 < Drainedsoul> my smart pointer is a custom one, using shared_ptr is what you'd want instead 00:43 < tehme> what do i lose in unordered map? access speed? 00:43 < Drainedsoul> unordered maps don't have the same kind of ordering maps do, you shouldn't lose access speed, but iirc you sh ould gain insertion speed 00:43 < dav1d> std::map is a RBT 00:44 < dav1d> and std::unordered_map is an hash map iirc 00:44 < Drainedsoul> I don't know a lot about std::map, but std::unordered_map is a pretty vanilla hash map 00:44 < Drainedsoul> so make a ColumnID class, that holds X/Z/Dimension 00:44 < Drainedsoul> specialize std::hash for it 00:44 < dav1d> std::map is a RBT :> 00:45 < Drainedsoul> you could use tuples, but that's unspeakably ugly 00:45 < Drainedsoul> yeah I've never had a reason to use it. I just use unordered_map and unordered_set 00:45 < Drainedsoul> so I don't know a lot about what it is, or isn't 00:45 < Drainedsoul> o_O 00:45 < dav1d> RBT lookups are mostly faster 00:45 < dav1d> iirc 00:46 < dav1d> but it's too late for remembering 00:46 < tehme> Drainedsoul: what if i want array-like access? [chunkZ][chunkX] 00:46 < Drainedsoul> why in the name of God would you want that 00:46 < Drainedsoul> if that case, write a wrapper 00:46 < Drainedsoul> and use operator () so you can pass all three as a parameter 00:47 < tehme> is map of maps bad? 00:47 < Drainedsoul> it's not "bad", but you don't need it for this situation 00:47 < Drainedsoul> you're going to just incur a lot of indirections that you don't need to 00:47 < tehme> hmm 00:48 < dav1d> tehme: that only looks good, you will never actually need it 00:48 < Drainedsoul> especially since if yo'ure abstracting columns/chunks 00:49 < Drainedsoul> you shouldn't expose that abstraction 00:49 < Drainedsoul> because a block-based abstraction is more beneficial 00:49 < Drainedsoul> so only your implementation should be concerned about columns/chunks 00:49 < Drainedsoul> and defining an ID class for blocks/columns (which is what I did) allows you to expose member functions that abstract away finding which column a block is in, etc. 00:50 < Socolin> I personnaly use unordered_map with key like that: #define CHUNK_KEY(X,Z) (((((long long)X) << 32) & 0xffffffff00000000)| (((long long)Z) & 0x00000000ffffffff)) 00:50 < tehme> god 00:50 < Drainedsoul> so you use C++ and use preprocessor macros 00:50 < Drainedsoul> your opinion doesn't matter 00:50 < Socolin> chunks[CHUNK_KEY(x,z)] 00:51 < tehme> i thought about something like this 00:52 < Drainedsoul> this is a work in progress, but just look at lines 23-490 00:52 < Drainedsoul> https://github.com/RobertLeahy/MCPP/blob/master/include/world/world.hpp#L23 00:53 < tehme> i like your comments 00:53 < Drainedsoul> and if someone tells you to use a preprocessor macro, for the love of God don't listen to them 00:53 < Drainedsoul> they're doxygen comments 00:53 < Drainedsoul> doxygen scans the headers and generates documentation for all the classes I can look at in my web browser 00:57 < dav1d> Drainedsoul: lol 00:57 < Drainedsoul> hmm? 00:57 < dav1d> Drainedsoul: pbunny would disagree 00:58 < Drainedsoul> anything a macro can do, an inline function or template can do just as well, and just as fast 00:58 < Drainedsoul> and they're infinitely more maintainable since they can be namespaced etc. 01:00 < tehme> Drainedsoul: but boost is full of macros 01:00 < Drainedsoul> I don't use boost 01:02 < tehme> why> 01:02 < tehme> ? 01:02 < Drainedsoul> why would I 01:03 < tehme> there are tons of nice things 01:03 < Drainedsoul> such as? 01:03 < Socolin> lockfree queue 01:03 < tehme> made by goos specialists 01:03 < Socolin> ^^ 01:03 < tehme> good* 01:03 < tehme> so you don't have to reinvent a wheel 01:03 < tehme> and string algorithms 01:03 < Drainedsoul> you mean so when I want to distribute my application I have yet another dependency 01:04 < tehme> boost is mostly header-only 01:04 < tehme> so no 01:04 < Drainedsoul> so I have to distribute a bunch more headers with my application 01:04 < tehme> wut 01:04 < tehme> everyone have boost 01:05 < Drainedsoul> "everyone" is pretty inclusive 01:05 < tehme> i saw in your code that you don't even use std::swap 01:05 < tehme> why? 01:05 < Drainedsoul> where? 01:05 < tehme> somewhere 01:05 < tehme> i dont remember now 01:06 < Drainedsoul> I definitely use std::swap, and std::sort. 01:06 < tehme> heh 01:07 < tehme> and look at boost, you will like it:) 01:07 < Drainedsoul> I don't specialize std::swap, because this isn't C++98 anymore. std::swap can std::move my things around on its own 01:07 < tehme> there were 3 lines swap:) 01:10 < tehme> shit, it loads too slow anyway 01:11 < tehme> well, let's try macro way:D 01:12 < tehme> Drainedsoul: if i make Column ID, wouldn't it be slow access? 01:14 < Drainedsoul> why would it be slow access? 01:14 < tehme> i can't imagine how to access to column by its coordinates without linear search 01:14 < Drainedsoul> hash map... 01:15 < tehme> something like col = columns[ColumnID(1, 1)]; 01:15 < tehme> ? 01:15 < Drainedsoul> wat 01:15 < Drainedsoul> http://en.cppreference.com/w/cpp/container/unordered_map 01:16 < Drainedsoul> http://en.cppreference.com/w/cpp/utility/hash 01:16 < Drainedsoul> https://github.com/RobertLeahy/MCPP/blob/master/include/world/world.hpp#L368 here's a sample specialization of std::hash for a ColumnID class 01:17 < tehme> damn i'm a nob 01:17 < tehme> so unhashable type cannot be a key, right? 01:17 < Drainedsoul> what's an "unhashable" type 01:18 <+pdelvo> Im sure there is a way to do that if you can define a hash function for it 01:18 < tehme> type that has not hash specialization 01:18 < Drainedsoul> if you don't specialize std::hash, and there isn't a built-in std::hash, you can't use it as a key, no 01:19 < Drainedsoul> but you can just specialize std::hash. I literally linked you to a std::hash specialization you can just copy/paste 01:19 < tehme> that is what i wanted to know 01:19 < tehme> how does it work? 01:19 < Drainedsoul> it's like 30 lines of code 01:19 < tehme> will it be ok on large coordinates? 01:19 < Drainedsoul> why wouldn't it be? 01:20 < tehme> too many bytes 01:20 < tehme> collisions 01:20 < Drainedsoul> it takes the X/Z/dimension, gets their bit layouts into an unsigned type, seeds the hash with 23 01:20 < Drainedsoul> and then multiplies the hash by 31, adds the X, multiplies by 31, adds the Z, multiplies by 31, adds the dimension 01:20 < Drainedsoul> there are going to be collisions, std::unordered_map will deal with that for you 01:20 < Drainedsoul> that's why the key type has to also define operator == 01:21 < tehme> good 01:21 <+pdelvo> die hash does not have to be unique. it just has to be equal for inputs which are equal 01:21 < Drainedsoul> many different keys may map to the same hash value, but that doesn't make the keys "identical" from the PoV of the hash map. 01:21 < Drainedsoul> exactly what pdelvo said 01:22 < Drainedsoul> this is like, first-year Computer Science Data Structures & Algorithms, hash map lecture, the review 01:22 < tehme> why do you need dimension? 01:22 < Drainedsoul> because columns have dimension 01:22 < tehme> looks like i missed it 01:22 < Drainedsoul> nether, end, and overworld, at the bare minimum 01:22 < Drainedsoul> on a client you might not need that, but a server definitely does 01:22 <+pdelvo> if you want to get a hash from multiple items you can get a hash from usualy you use something like this: hash = hash(x1) ^ hash(x2) ^ hash(x3)...; 01:22 < tehme> oh 01:23 < tehme> yep 01:23 < Socolin> you can also store it in different world no ? 01:23 < tehme> ^ 01:23 < Drainedsoul> why 01:23 < Socolin> entities must be separate too 01:23 < Drainedsoul> then I have to lookup the world, and then lookup the column in that world 01:23 < Drainedsoul> rather than just looking up the column in the multi-dimensional "world" 01:25 < Socolin> when you change something in a chunk, you know the world and you have it, so you don't need to lookup the world 01:25 < Drainedsoul> pdelvo: this is what I use http://stackoverflow.com/a/892640/1007504 01:25 < Drainedsoul> which is irrelevant. If I change something in the chunk, I have the chunk, so I don't really care about anything else 01:25 < Drainedsoul> but if I want to find a chunk, you're introducing another lookup 01:38 < tehme> new knowledge comes with butthurt 01:44 < Drainedsoul> ? 01:47 < tehme> i didn't know much about maps 01:47 < tehme> and now i feel stupid because of this 01:51 < tehme> well... 01:51 < tehme> now server kicks me later 01:51 < tehme> looks like i do need a thread for sending position 01:53 < Drainedsoul> why would you waste a thread on that 01:54 < tehme> because even with starting threads for each 0x38 packet this blocks main thread for long enough for server to kick me' 01:54 < Drainedsoul> what blocks the main thread 01:54 < tehme> storing chunks 01:54 < tehme> is too long 01:55 < Drainedsoul> okay so why don't you implement a thread pool with a proper job scheduler 01:55 <+sadimusi> storing chunks takes more than 30 seconds? 01:56 < tehme> yep 01:56 < Drainedsoul> sounds like something is amiss 01:56 <+pdelvo> btw does someone other then me noticed a huge performance improvement in the snapshot? On the minecraftwiki changelist there is no hint that there was something changed 01:57 < Drainedsoul> did they fix zombie lag? 01:57 <+sadimusi> pdelvo: I tried it and the fps are about the same 01:58 <+sadimusi> (which is around 60; not sure where my pc is lacking…) 01:58 <+pdelvo> maybe you have vsync enabled n minecraft or in your driver settings? 01:59 <+sadimusi> vsync is disabled, but everything set to max 02:00 <+sadimusi> which is probably the default anyway 02:01 <+sadimusi> it uses almost no CPU, must be the graphics chip then 02:02 < tehme> damn 02:03 <+pdelvo> for me it is cpu limited. my gtx 780 is at 20% load. it doesnt get out of its power saving mode so it is downclocked 02:03 < tehme> can anyone look at my trash code and say whare am i wrong? 02:03 < tehme> where* 02:03 < Drainedsoul> wrong about what 02:03 < tehme> about chunk loading speed 02:03 < Drainedsoul> link? 02:03 < tehme> each column takes ~0.4 s 02:04 <+pdelvo> do you know how much vram you have? that could be the problem. it uses ~1,5gb of vram at render distance far 02:04 <+sadimusi> pdelvo: I'm running it on a macbook; so only geforce gt 650m… 02:05 <+pdelvo> oh okay. 02:05 < tehme> https://github.com/tehme/outlaw/blob/master/include/client/chunk.hpp 02:05 < tehme> https://github.com/tehme/outlaw/blob/master/src/client/chunk.cpp 02:20 < Drainedsoul> I don't really understand why you're doing a lot of the things that you're doing 02:21 < Drainedsoul> why does each chunk have an array for biomes? biomes are a per-column thing 02:21 < tehme> description was unclear 02:21 < tehme> i'll change it 02:22 < tehme> what's next? 02:22 < Drainedsoul> why are you using a "multi array" for the internal storage of a chunk? that's a heap allocation/indirection you don't need -- chunks are a constant size 02:22 < tehme> should i make a flat array? 02:23 < Drainedsoul> that's what I would do, then you don't have this mess of indirection 02:24 < Drainedsoul> as a note: array is part of the STL now, so you can use std::array instead of boost::array 02:24 < Drainedsoul> you should use memset for your fillChunkWithAir implementation, that's going to be as fast or (very likely) much faster than your implementation 02:25 < tehme> i don't know if visual studio 2010 version of std::array good 02:26 < tehme> memset, you say... 02:26 < tehme> well, let's try 02:27 < Drainedsoul> http://en.cppreference.com/w/cpp/string/byte/memset 02:27 < tehme> i know what it is:D 02:27 < Drainedsoul> ah okay 02:27 < Drainedsoul> people who haven't used C often aren't familiar with the functions that CPP inherited from the C standard library 02:28 < Drainedsoul> but memset is usually highly optimized. Usually it's a compiler intrinsic 02:28 < Drainedsoul> in GCC in it 02:28 < Drainedsoul> *it is 02:29 < Drainedsoul> your hash for "ChunkColumnID"s is implemented incorrectly 02:29 < tehme> why? 02:29 < Drainedsoul> multiplying and adding are different steps 02:29 < Drainedsoul> it's multiply by 31, and then add x, and then multiply by 31, and then add y 02:29 < tehme> hm 02:30 < tehme> i did like in the post on stack overflow that you linked 02:30 < Drainedsoul> and you should use the anonymous union method from my code to switch between signed and unsigned, to maintain the bit representation 02:30 < dx> i know you guys are talking about really serious stuff but i wanted to point out that at a first glance i saw a letter "t" above Drainedsoul's nick and thought he changed his nick to "trainedsoul" 02:30 < Drainedsoul> o_0 lol 02:30 < tehme> SUDDENLY 02:30 * dx vanishes 02:31 < tehme> Drainedsoul: why is it better? 02:31 < Drainedsoul> iirc, the C++ standard defines the conversion from signed to unsigned as modulo arithmetic, which is not only slow-ish, but it doesn't preserve the bit representation 02:32 < tehme> hmm 02:32 < tehme> i'll measure time 02:32 < Drainedsoul> well there's also a uniqueness concern 02:33 < tehme> oh fuck man 02:34 < tehme> holy fucking fuck 02:34 < tehme> just changing to memset reduced time per column to 0.12 s from 0.4 s 02:34 < tehme> thank you 02:34 < tehme> now it's much better 02:35 < tehme> i'll remember this lesson 02:36 < Drainedsoul> are you compiling with optimization on or off (i.e. debug or release) 02:36 < tehme> debug 02:36 < Drainedsoul> if you change your data types around a bit, you can probably (in release mode) get MSVC++ to 02:36 < Drainedsoul> vectorize the block type loading loop 02:37 < tehme> how should i? 02:37 < Drainedsoul> especially if you tell MSVC++ that it can use AVX extensions where they exist (and your processor has them) 02:38 < Drainedsoul> I'd just change it over to a flat array inside the Chunk class. That'll also cut out 02:38 < Drainedsoul> indirections and heap allocations 02:38 < Drainedsoul> and make sure you traverse your array in memory order 02:38 < Drainedsoul> to keep your cache hot 02:39 < Drainedsoul> you should go through both arrays in memory order. Make sure each iteration of the loop always reads/writes adjacent values where possible 02:39 < Drainedsoul> otherwise you'll lose spatial locality 02:40 < tehme> let's try flat array and i'll go to sleep 02:40 < tehme> damn, today i learned more than last week 02:42 < tehme> how should i make wrapper function for this array? 2 versions of getter, ref and const ref? 02:43 < Drainedsoul> I would try to avoid using a getter/setter for writing to it while you're populating it 02:43 < Drainedsoul> unless it's trivial, and is either marked inline or is in the same TU 02:43 < tehme> i don't want to make offset magic outside of chunk class 02:44 < tehme> and if you say memory order... what if i make several arrays for each type of data? then i can just memcpy 02:44 < Drainedsoul> in order to make writing the chunk data out efficient, you're going to need to understand the underlying implementation 02:44 < Drainedsoul> so abstraction doesn't really make sense 02:45 < Drainedsoul> you could do that, but then you're mostly just copying mojang's format, which doesn't make a lot of sense once it comes time to access that same data 02:45 < Drainedsoul> related data should always be kept close together, preferably so close together that it all fits on a single cache line 02:46 < tehme> a thin line between performance and comfort 02:46 < tehme> i'm really impressed how memcpy fastened everuthing 02:46 < tehme> everything* 02:47 < Drainedsoul> yeah because memcpy is probably a compiler intrinsic 02:47 < Drainedsoul> and it only reads/writes contiguous memory 02:47 < Drainedsoul> that's about as fast as you can possibly get 02:52 < tehme> BlockData& get_blockData(int _x, int _y, int _z) { return m_blocksData[_x + 16 * (_z + 16 * _y)]; } 02:52 < tehme> is it trivial enough? 02:52 < Drainedsoul> is it in the same TU as the code that's going to populate that array? 02:52 < tehme> what is TU? 02:53 < tehme> damn, i'll just overload operator[] 02:54 < Drainedsoul> Translation Unit 02:54 < tehme> or no... 02:54 < tehme> yes, it is 02:54 < Drainedsoul> I'd also mark it inline 02:55 < tehme> it's in header 02:55 < tehme> so it must already be inline 02:55 < tehme> can i overload operator[] for 3 args? 02:55 < Drainedsoul> also make sure that it'll traverse the array in the same order as the one you get from the server 02:56 < Drainedsoul> no you can't, operator [] can only be overloaded for 1 operator 02:56 < Drainedsoul> the standard mandates that commas inside operator [] are operator , not argument delimiter 02:58 < Drainedsoul> and if you're not going to actually store structures, that aggregate all the data about a block 02:58 < Drainedsoul> and you're just going to store things the way the server sends them 02:58 < Drainedsoul> definitely use memcpy 02:58 < Drainedsoul> but that's not really a good idea, imo, you should keep all information about a block close together 02:58 < Drainedsoul> for locality's sake 02:58 < tehme> i will 02:59 < tehme> is 3d array really such a problem? 02:59 < Drainedsoul> that depends how it's implemented 02:59 < Drainedsoul> if it's implemented as an array-of-arrays, it's a problem. If it's a flat array, but you're traversing it "wrong" (i.e. out of memory order), it's a problem 03:03 < tehme> YZX 03:03 < Drainedsoul> yeah, so if it's laid out that way in memory, you need to make sure that it's traversed that way 03:04 < Drainedsoul> you can't jump all over the place, just access the next element in order in memory