11:08 <+bridge> [ddnet] cool read https://eb2.co/blog/2014/04/c--14-and-sdl2-managing-resources/ 12:50 <+bridge> [ddnet] interesting read, ty 👍 12:52 <+bridge> [ddnet] unique_ptrs are great 12:52 <+bridge> [ddnet] IMHO they don't need the extra layer of abstraction though 13:28 <+bridge> [ddnet] @heinrich5991 Hey, where to I get client version from as a 0.7 server? I wnat to do what you discourage here https://github.com/teeworlds/teeworlds/pull/2430#issuecomment-578539436 ^^ 13:28 <+bridge> [ddnet] @heinrich5991 Hey, where do I get client version from as a 0.7 server? I wnat to do what you discourage here https://github.com/teeworlds/teeworlds/pull/2430#issuecomment-578539436 ^^ 13:34 <+bridge> [ddnet] @Learath2 the article or `unique_ptr`? 13:35 <+bridge> [ddnet] well the article adds a layer of abstraction to unique_ptrs, which I don't think they need 13:36 <+bridge> [ddnet] @timakro ah, slightly misunderstood the protocol change 13:36 <+bridge> [ddnet] yeah i guess, but i dont see how to get client version in 0.7 13:36 <+bridge> [ddnet] you can, but don't 13:37 <+bridge> [ddnet] maybe you could adjust the protocol so it uses an extra bool instead of another enum variable 13:38 <+bridge> [ddnet] @timakro what are you trying to do anyway? compatibility hack? 13:38 <+bridge> [ddnet] he's trying to make a race server that sends the correct message to <0.7.4 and >=0.7.5 13:39 <+bridge> [ddnet] the problem is that I slightly misunderstood the protocol change in that pull request 13:39 <+bridge> [ddnet] adding another bool is smart 13:39 <+bridge> [ddnet] 0.7.6 is not yet released, right 13:39 <+bridge> [ddnet] 0.7.5 13:39 <+bridge> [ddnet] right 13:39 <+bridge> [ddnet] so better make that PR soon 😛 13:39 <+bridge> [ddnet] what is the extra bool for anyway? 13:40 <+bridge> [ddnet] it indicates whether it was not only personal best but also global best 13:40 <+bridge> [ddnet] I see 13:41 <+bridge> [ddnet] Do you think the SDL people would accept a patch with a new event type that'd only be used on macOS? 13:41 <+bridge> [ddnet] I'd guess so 13:41 <+bridge> [ddnet] can't you map it to an existing one? 13:42 <+bridge> [ddnet] the accent menu doesnt give any indication that it's started nor does it give an indication that it's ended, so I can't make it into a SDL_TEXTEDITING event without hooking into some internal stuff, which I think they'd hate more 13:43 <+bridge> [ddnet] I could maybe add a new field to SDL_TEXTINPUT 13:43 <+bridge> [ddnet] I mean the best way forward would be to have some sort of communication channel to them 13:43 <+bridge> [ddnet] do you have something like that? 13:44 <+bridge> [ddnet] I guess I could file a bug report for discussion on the subject 13:45 <+bridge> [ddnet] do you know their response times to issues? ^^ 13:45 <+bridge> [ddnet] freenode has a #sdl i think 13:45 <+bridge> [ddnet] https://discordapp.com/invite/F6mPUgc 13:45 <+bridge> [ddnet] SDL Enthusiasts sounds a bit inofficial 13:45 <+bridge> [ddnet] do you know whether it is official? 13:46 <+bridge> [ddnet] i dont think its official but maybe someone important is there 13:46 <+bridge> [ddnet] there is always the freenode #sdl 13:46 <+bridge> [ddnet] There is a guy who answers blazing fast to bugs, but he is the only one that quick 13:46 <+bridge> [ddnet] could that guy be https://twitter.com/icculus 13:46 <+bridge> [ddnet] ? 13:46 <+bridge> [ddnet] freenode #SDL doesn't have any of the people familiar with macOS internals 13:47 <+bridge> [ddnet] yeah icculus is the macOS guy 13:47 <+bridge> [ddnet] my last patch is still awaiting his feedback 13:47 <+bridge> [ddnet] icculus is like the lead dev i think 13:48 <+bridge> [ddnet] https://www.youtube.com/watch?v=MeMPCSqQ-34 :) 13:49 <+bridge> [ddnet] https://xkcd.com/1782 13:51 <+bridge> [ddnet] Why does it always end like this? I start out fixing a teeworlds bug, due to some mess macOS created I start fixing an SDL bug which inevitably leads to disassembling AppKit with it's 100 years worth of compatibility hacks 13:52 <+bridge> [ddnet] @Learath2 its cuz i care to much about macOS :D 13:52 <+bridge> [ddnet] you** 13:52 <+bridge> [ddnet] well it's the only machine I have access to right now 13:52 <+bridge> [ddnet] cant u just install linux there 13:52 <+bridge> [ddnet] don't have the storage for it 13:53 <+bridge> [ddnet] i mean, remove completly macos 13:53 <+bridge> [ddnet] I do have a small virtual machine for compiling though 13:53 <+bridge> [ddnet] :P 13:53 <+bridge> [ddnet] I need macOS to write iOS apps 13:53 <+bridge> [ddnet] do it through a vm then 13:53 <+bridge> [ddnet] how often do u write ios apps 13:53 <+bridge> [ddnet] whats tw sever tickspeed? 60 hz? 13:53 <+bridge> [ddnet] 50 13:53 <+bridge> [ddnet] 50 13:53 <+bridge> [ddnet] iirc 13:54 <+bridge> [ddnet] @Ryozuki not much anymore tbh 13:54 <+bridge> [ddnet] 🤠 🔫 13:54 <+bridge> [ddnet] xd 13:54 <+bridge> [ddnet] whats this 13:54 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/695602096325787668/unknown.png 13:55 <+bridge> [ddnet] it's a watergun because american people think emojis dictate societal rules 13:55 <+bridge> [ddnet] anybody knows how float precision works? big can the number go until i loose 0.001 precision? 13:55 <+bridge> [ddnet] xddd 13:55 <+bridge> [ddnet] anybody knows how float precision works? how big can the number go until i loose 0.001 precision? 13:56 <+bridge> [ddnet] @timakro floats are more precise the closer you are to 0 13:56 <+bridge> [ddnet] i know that much xD 13:56 <+bridge> [ddnet] i mean how big does it have to be when the 3rd decimal becomes inaccurate 13:57 <+bridge> [ddnet] and can i reach that with tickspeed 13:57 <+bridge> [ddnet] of teeworlds 13:58 <+bridge> [ddnet] wait are they? floats always confuse me 13:59 <+bridge> [ddnet] The number of places of precision for float is the same no matter what the size of the number. Data type float can represent numbers as big as about 3.4E+38. But the precision of these large numbers will also be about 7 decimal digits. 14:00 <+bridge> [ddnet] As numbers get larger and larger you'll use less and less of the mantissa for precision 14:01 <+bridge> [ddnet] i dont think thats how floats work 14:01 <+bridge> [ddnet] well I don't see any other way of them working 14:01 <+bridge> [ddnet] for a 32 bit float you have a sign bit, 8 bits for exponent, that leaves 23 bits for the mantissa 14:02 <+bridge> [ddnet] the larger the exponent, the less of the mantissa will be after the decimal point, hence smaller the precision 14:05 <+bridge> [ddnet] from the wikipedia article it seems you are right 14:05 <+bridge> [ddnet] Problem with calculating 0.001 precision is that the number is stored in base2 not 10 14:06 <+bridge> [ddnet] i dont need to know exactly 14:06 <+bridge> [ddnet] just if its possible to reach that point or not 14:06 <+bridge> [ddnet] with 50hz 14:06 <+bridge> [ddnet] like in a month or so idk 14:06 <+bridge> [ddnet] or a year 14:07 <+bridge> [ddnet] and where does this 7 decimal places come from you can find everywhere 14:07 <+bridge> [ddnet] 8 bits exponent, 27 bits significant 14:07 <+bridge> [ddnet] Think it might be something like 0.001 x 2^23 14:11 <+bridge> [ddnet] 7 digits is easy 14:11 <+bridge> [ddnet] The number of digits of precision a floating point variable has depends on both the size (floats have less precision than doubles) and the particular value being stored (some values have more precision than others). Float values have between 6 and 9 digits of precision, with most float values having at least 7 significant digits. 14:11 <+bridge> [ddnet] 10^7 ~ 2^23, you have 23 bits for the mantissa 14:12 <+bridge> [ddnet] to lose 10^-3 ~ 2^-10 of precision you need to lose about 10 bits 14:12 <+bridge> [ddnet] so for exponents < -10 you won't have 0.001 of precision 14:13 <+bridge> [ddnet] exponents < -10 would be a small number? 14:14 <+bridge> [ddnet] that doesn't sound right, I mean you need 10 bits to be after the "binary point" so 23 - 10 = 13, so numbers smaller then 2^-13 14:14 <+bridge> [ddnet] pretty small number 14:15 <+bridge> [ddnet] Sorry, I haven't worked with float internals for like 2-3 years now 14:17 <+bridge> [ddnet] If you use 13 bits before the point, you'll have 10 left for after the point and that's still enough for 0.001 precision, 14 bits and you no longer have enough 14:18 <+bridge> [ddnet] but that would be 2^14 = 16384, you are saying for numbers >16384 you dont have 0.001 precision? 14:19 <+bridge> [ddnet] sounds way off 14:20 <+bridge> [ddnet] messed a bit around in https://www.h-schmidt.net/FloatConverter/IEEE754.html 14:20 <+bridge> [ddnet] @heinrich5991 adding a bool for the race thing might indeed be better 14:20 <+bridge> [ddnet] However the client would drop packets which are missing the new bool. The client needs some backward compatibility for the protocol first, e.g. using a default value if a field is missing 14:20 <+bridge> [ddnet] got 16383 14:21 <+bridge> [ddnet] exponent > 140 cant represent accurately enough 14:22 <+bridge> [ddnet] take exponent 140 and tick all the boxes in the mantissa 14:22 <+bridge> [ddnet] (for 16383) 14:23 <+bridge> [ddnet] wow this actually seems true 14:24 <+bridge> [ddnet] and i saved the player start time in ticks as a float on my race server 😩 14:25 <+bridge> [ddnet] yep any bigger then 2^13 and you lose the 0.001 14:25 <+bridge> [ddnet] i dont wanna know when i loose 0.01 14:26 <+bridge> [ddnet] o.o 5:27 until you lose that precision 14:26 <+bridge> [ddnet] (0.001) 14:26 <+bridge> [ddnet] yeah not race time, server run time 14:26 <+bridge> [ddnet] ouch 14:27 <+bridge> [ddnet] you lose 0.001 ~= 2^-6.6 at ~2^17 I think 14:27 <+bridge> [ddnet] 0.01* 14:28 <+bridge> [ddnet] that's quite a bit more 14:28 <+bridge> [ddnet] thats 45 minutes xD 14:28 <+bridge> [ddnet] looks like 131071 14:29 <+bridge> [ddnet] use a double? 14:29 <+bridge> [ddnet] that gives a lot more 14:29 <+bridge> [ddnet] maybe the error cancels out with short race times xD 14:29 <+bridge> [ddnet] tbh i might just store ticks*10 in an integer 14:29 <+bridge> [ddnet] what about just using integer milliseconds? 14:30 <+bridge> [ddnet] yep that 14:30 <+bridge> [ddnet] ticks*20 i guess 14:30 <+bridge> [ddnet] why not just ticks? 14:31 <+bridge> [ddnet] well the plan was to have more precision 14:31 <+bridge> [ddnet] but i messed that up 14:31 <+bridge> [ddnet] ah 14:41 <+bridge> [ddnet] @heinrich5991 @redix is right, when we just add a bool new clients won't be compatible with old servers. So tell me the secret to get client version :D can't find it in the protocol. my server code is beyond hacky anyways 14:42 <+bridge> [ddnet] i think right now there is no server which supports new map records anyway 14:43 <+bridge> [ddnet] for now just use the new personal record value 14:44 <+bridge> [ddnet] why this client addition if you cant use it ... 14:44 <+bridge> [ddnet] and my sever does 14:44 <+bridge> [ddnet] i just tried to implement it 14:45 <+bridge> [ddnet] There are high precision timers in most OSs maybe just sample that instead of ticks 14:45 <+bridge> [ddnet] for the next version 😄 when the protocol gets backward compatibility, we could use a new bool, so the protocol might change before a new version 14:45 <+bridge> [ddnet] oh please god stop hammering out new versions 14:46 <+bridge> [ddnet] i just made a server that supports 0.6 and 0.7 clients 14:46 <+bridge> [ddnet] well tw release cycle is already slow 14:46 <+bridge> [ddnet] if only we can get some extensible protocol into teeworlds that'd be the last major update requiring this much work 14:46 <+bridge> [ddnet] yea you can wait another 10 years :D 14:47 <+bridge> [ddnet] but in general... it would be better to rely on a stable version. i think there are already incompatibilities with the chat commands because people use the dev version =\ 14:48 <+bridge> [ddnet] people as in fokkonaut 😛 14:48 <+bridge> [ddnet] so tell me how to detect client version already xD 14:49 <+bridge> [ddnet] is this black magic or am i just missing a field in the protocol? 14:49 <+bridge> [ddnet] well it was only an example 😄 demos were also broken in some clients 14:50 <+bridge> [ddnet] @timakro `Server()->GetClientVersion(ID)` 14:50 <+bridge> [ddnet] @timakro the client sends it in NETMSG_INFO 14:50 <+bridge> [ddnet] thx 14:51 <+bridge> [ddnet] The 0.7 client sends it there 14:51 <+bridge> [ddnet] what about 0.6? 14:51 <+bridge> [ddnet] i couldnt find it there 14:52 <+bridge> [ddnet] 0.6 vanilla clients don't send version 14:52 <+bridge> [ddnet] ddnet uses NETMSGTYPE_CL_ISDDNET 14:52 <+bridge> [ddnet] And ddnet clients only send it in cl_isddnet? 14:52 <+bridge> [ddnet] yea 14:52 <+bridge> [ddnet] that 14:54 <+bridge> [ddnet] I need a way to keep track of whether we are inputting text at a global scale 14:55 <+bridge> [ddnet] I'm having trouble imagining how 14:56 <+bridge> [ddnet] (rendering happens after input update and because of imgui it's information that doesn't exist before rendering) 14:56 <+bridge> [ddnet] @heinrich5991 this sounds like some CS problem you might have seen before 😛 15:04 <+bridge> [ddnet] @timakro the pull request you mentioned was not included in 0.7.4. The latest dev version still uses `0x0704` as client version, so right now the client version does not tell you whether a client supports it or not =\ 15:10 <+bridge> [ddnet] @timakro you can detect my F-Client, which is afaik the only client that uses the new chat system 15:11 <+bridge> [ddnet] its version is `0"0f2030` 15:11 <+bridge> [ddnet] its version is `0x0f2030` 15:14 <+bridge> [ddnet] @timakro you can set the timer precisiom serverside 15:14 <+bridge> [ddnet] if you send GAMEFLAG_RACE 15:14 <+bridge> [ddnet] Gamecontroller has a snap object, GameDataRace 15:15 <+bridge> [ddnet] https://github.com/ddnet/ddnet7/blob/a6f5861d9ab396aae0df40435a2bf120ba9f9c8f/src/game/server/gamecontroller.cpp#L400 15:17 <+bridge> [ddnet] (if that was what you were looking for earlier) 15:41 <+bridge> [ddnet] @timakro why won't it work with old server new client? 15:41 <+bridge> [ddnet] okay, I'm going to write the PR I guess 15:42 <+bridge> [ddnet] client will drop the packets because of a missing field 15:42 <+bridge> [ddnet] okay, need a default value if the field isn't present 15:42 <+bridge> [ddnet] @timakro please don't do version detection, it's evil 😦 15:43 <+bridge> [ddnet] @heinrich5991 old server will send 1 byte, new client will try to unpack 2 byte 15:43 <+bridge> [ddnet] yes, I'll do the PR with the forward and backward-compatible message 15:43 <+bridge> [ddnet] nice :) 15:44 <+bridge> [ddnet] @timakro you can use -1 as score. sorting in the scoreboard works then 🙂 15:45 <+bridge> [ddnet] what where 15:45 <+bridge> [ddnet] 0.7 can display score as time. right now you use 0 if someone did not finish yet 15:46 <+bridge> [ddnet] ok, thx 15:46 <+bridge> [ddnet] if you use -1 they will be at the bottom and the client will not display a time at all 16:19 <+bridge> [ddnet] @timakro @redix https://github.com/teeworlds/teeworlds/pull/2536 16:24 <+bridge> [ddnet] looks good 17:18 <+bridge> [ddnet] That's a nice fix, how about you help me come up with a nice fix for my problem aswell so we can have good IME in teeworlds for once? 😛 18:58 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/695678706408226906/unknown.png 18:59 <+bridge> [ddnet] the gun damage indicator is not perfect :D. this is a straight up shot, and its not centered correctly :p 19:00 <+bridge> [ddnet] It looks like even the space between stars isn't same 19:00 <+bridge> [ddnet] maybe that, or the screenshot was just not nice enough 19:00 <+bridge> [ddnet] I don't think they are even supposed to be lined up properly 19:00 <+bridge> [ddnet] you can see though, the right side doesnt touch the block, the left side is on it a bit 19:00 <+bridge> [ddnet] there is randomness to it 19:00 <+bridge> [ddnet] @Learath2 i think it was ment to be lined up 19:01 <+bridge> [ddnet] are u sure there is randomness? 19:01 <+bridge> [ddnet] well i don't remember, take a look at the code, someone would have to mess up really bad for this to be this bad 19:02 <+bridge> [ddnet] doesnt look like its random 19:02 <+bridge> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/695679531650121838/unknown.png 19:02 <+bridge> [ddnet] these are multiple shots now 19:02 <+bridge> [ddnet] (i just shot like 5 time in a row or so) 19:03 <+bridge> [ddnet] i guess its because the amount is 10, and thats even. 19:03 <+bridge> [ddnet] looks like adding an 11th star on the right would balance it out again 19:04 <+bridge> [ddnet] i remember, i had this issue for my spread gun, when it was even i needed to shift all projectile directions, so its center 19:04 <+bridge> [ddnet] centered again* 19:11 <+bridge> [ddnet] weird, the server sends the angle but the client seems to ignore it, how does the client decide what side the stars should be displayed on? 19:13 <+bridge> [ddnet] doesnt the server send the stars too 19:32 <+bridge> [ddnet] help posting in the ddnet forum doesnt work 19:32 <+bridge> [ddnet] gives http error 500 19:35 <+bridge> [ddnet] what r u doing? applying for mod? 20:13 <+bridge> [ddnet] @Learath2 the server sends 10 objects 20:13 <+bridge> [ddnet] 10 stars 20:13 <+bridge> [ddnet] in 0.7 its different, but for 0.6 20:13 <+bridge> [ddnet] oh one per location 20:13 <+bridge> [ddnet] in 0.7 the angle is ignored 20:14 <+bridge> [ddnet] wait 0.7 still sends all the stars one by one? 20:14 <+bridge> [ddnet] no 20:14 <+bridge> [ddnet] in 0.7 this is not possible anymore 20:14 <+bridge> [ddnet] thats why i only send 1 star for ddnet7 20:14 <+bridge> [ddnet] and how does the client know which way the stars go? 20:15 <+bridge> [ddnet] it calculates based on whether there is another one next to it i guess, because if i keep shooting, it will perform a circle 20:15 <+bridge> [ddnet] but thats not the problem right now :D 20:15 <+bridge> [ddnet] we are still here for the 0.6 thing 20:15 <+bridge> [ddnet] NETEVENTTYPE_DAMAGEIND 20:15 <+bridge> [ddnet] in 0.6 each star is added to the snapshot with this type 20:16 <+bridge> [ddnet] in 0.6 the server loops through the amount of stars we want, does its math and then sends the angle with the object to the client 20:53 <+bridge> [ddnet] @heinrich5991 What do i need to send now after your fix? 20:55 <+bridge> [ddnet] Hmm the new clients will accept both msgs with 2 booleans and with 1 bool 20:55 <+bridge> [ddnet] right? 20:57 <+bridge> [ddnet] If I send just the short one I can't get the map record message. If I send just the long one old clients don't get the message. If I send both new clients get two messages. 20:58 <+bridge> [ddnet] @timakro old clients will just ignore the extra bool 21:02 <+bridge> [ddnet] old clients cant be changed 21:02 <+bridge> [ddnet] oh they will right now 21:04 <+bridge> [ddnet] yep