02:04 < bridge_> [ddnet] https://www.theverge.com/2021/4/8/22373290/intel-bleep-ai-powered-abuse-toxicity-gaming-filters 02:23 < bridge_> [ddnet] pretty cool 02:24 < bridge_> [ddnet] this screams latency though 05:42 < bridge_> [ddnet] Knuckles cracked 05:42 < bridge_> [ddnet] n-word cranked up to 11 05:42 < bridge_> [ddnet] yup. its gaming time 05:42 < bridge_> [ddnet] what were they thinking 09:29 < bridge_> [ddnet] i have question 09:29 < bridge_> [ddnet] if im on platform and i press d i will reach speed 10 in 5sec, then i continue running with d but i fall of platform 09:29 < bridge_> [ddnet] do i : 09:29 < bridge_> [ddnet] 1) keep my 10 speed 09:29 < bridge_> [ddnet] 2) speed is set immediately to 5 09:29 < bridge_> [ddnet] 3) speed decrease from 10 to 5 with rate of x (x = ?) 09:35 < bridge_> [ddnet] 1) 10:29 < bridge_> [ddnet] @devs pls add units in ctrl+shift+d 10:29 < bridge_> [ddnet] ;-; 10:39 < bridge_> [ddnet] u 10:39 < bridge_> [ddnet] u 11:02 < bridge_> [ddnet] lets add feet and yards and stones, the american way 11:02 < bridge_> [ddnet] :BASED: 11:07 < bridge_> [ddnet] lets add pixels 11:22 < bridge_> [ddnet] no guys in sub-tiles/tick 11:22 < bridge_> [ddnet] bcs its the smallest units of the game 11:22 < bridge_> [ddnet] st/t 11:22 < bridge_> [ddnet] u cant get half a sub-tile or half a tick 14:01 < bridge_> [ddnet] would `if (false)` be stupid? 14:01 < bridge_> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/836210437803606036/unknown.png 14:03 < bridge_> [ddnet] :kek: 14:03 < bridge_> [ddnet] Eeeeeeh, there must be a better way to do this 😄 14:03 < bridge_> [ddnet] ikr 14:05 < bridge_> [ddnet] but i can't think of any on the spot rn 14:05 < bridge_> [ddnet] I can only think of uglier ones, maybe this is as good as it gets 14:06 < bridge_> [ddnet] i can just get rid of `else` and let it compare all the way through, but i don't really want to. 14:06 < bridge_> [ddnet] Uhm, wait why do you need this to be dynamic? 14:06 < bridge_> [ddnet] idk. feel like it. 14:07 < bridge_> [ddnet] `gamemodes.h` for reference 14:07 < bridge_> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/836211872969261066/unknown.png 14:07 < bridge_> [ddnet] oh, if you are wondering why I'm comparing. i'm making chat command `/room 1 ctf` 14:09 < bridge_> [ddnet] 2 questions, First: Why do you need `AddGameType` when is this called? Second: Would you ever want to register the same gamecontroller with 2 different names? 14:09 < bridge_> [ddnet] AddGameType is for enabling gamemodes 14:09 < bridge_> [ddnet] like you put `add_gametype dm;add_gametype ctf` in config, then the rooms can only be dm or ctf, can't be anything else. 14:10 < bridge_> [ddnet] Ah okay 14:10 < bridge_> [ddnet] then 2 different name is for `add_gametype 1v1dm dm sv_player_slots 2` 14:10 < bridge_> [ddnet] then `/room 1 1v1dm` and `/room 1 dm` are both dm types but with different settings. 14:11 < bridge_> [ddnet] So how about you build an array of all valid gametypes using the preprocessor, then do one single check? 14:11 < bridge_> [ddnet] maybe scorelimits are different and stuff 14:11 < bridge_> [ddnet] bravo, i'll try to do that rn. 14:12 < bridge_> [ddnet] but wait 14:12 < bridge_> [ddnet] i can't put constructors in array. 14:12 < bridge_> [ddnet] can i 14:13 < bridge_> [ddnet] Well the part of the code I see is just using TYPE, that's why I suggested that 😛 14:13 < bridge_> [ddnet] yeah, i had this already 14:13 < bridge_> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/836213383954825257/unknown.png 14:14 < bridge_> [ddnet] The usual solution is to have a factory function, though I guess that's starting to make it ugly 14:14 < bridge_> [ddnet] (since you can't take the pointer to a constructor) 14:15 < bridge_> [ddnet] right, i'm making this ugly rn, just so i can register more gamtypes with two lines in `gamemodes.h` 14:15 < bridge_> [ddnet] instead of poking into factories and stuff 14:15 < bridge_> [ddnet] I think this is fine btw, if(false) looks odd but I think it's much better than the alternatives 14:17 < bridge_> [ddnet] I wish C++ had first class classes 🙂 14:18 < bridge_> [ddnet] Would make stuff like this much prettier 14:20 < bridge_> [ddnet] @TsFreddie I have a solution for you that is not as pretty and will make all the CS people hate you but get rid of the `if(false)` 14:20 < bridge_> [ddnet] 👀 let's hear it 14:21 < bridge_> [ddnet] I even know a convoluted way to make it palatable to CS people (but they are insane so who cares) 14:21 < bridge_> [ddnet] Just use a goto 😛 14:21 < bridge_> [ddnet] (or if you are scared of our theory overlords put it in a `do { ... } while(false)` and break out of it 14:21 < bridge_> [ddnet] ) 14:22 < bridge_> [ddnet] `do {} while(false)` seems like it is in the same ballpark as `if (false)` 14:23 < bridge_> [ddnet] goto tho.. i don't know.. 14:23 < bridge_> [ddnet] Which is why I suggested it in parenthesis, if I was doing it I'd either keep the if(false) or use the goto 14:23 < bridge_> [ddnet] I might use the goto just to annoy people 14:24 < bridge_> [ddnet] i'm more scared of goto than annoyed. cuz multiple people taught me to never use it lol 14:25 < bridge_> [ddnet] multiple people who've read just the title of one letter by djikstra 14:25 < bridge_> [ddnet] just thought more about goto.. i don't know how would it work tbh. 14:25 < bridge_> [ddnet] I can't take `CLASS` out with the goto i don't think 14:26 < bridge_> [ddnet] Well you'd just remove the `else` and goto a label after the `#undef` 14:27 < bridge_> [ddnet] As said, just keep the if(false) it doesn't look too bad anyway 14:29 < bridge_> [ddnet] yeah, i'll keep `if (false)` 14:29 < bridge_> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/836217328374120548/unknown.png 14:29 < bridge_> [ddnet] i don't even know if this is legal 14:30 < bridge_> [ddnet] that looks completely insane 14:30 < bridge_> [ddnet] You just needed a single goto, not two 14:32 < bridge_> [ddnet] oh right. i don't know what i was thinking 14:32 < bridge_> [ddnet] :justatest: 14:35 < bridge_> [ddnet] there are some very cute goto patterns we can't use anymore because some people take things so damn literally, they really think things like `do { ... } while(false);` is better, but it only makes your code more cryptic 14:35 < bridge_> [ddnet] I've also seen `for(int i = 0; i == 0; i ++)` 14:36 < bridge_> [ddnet] :nouis: 14:36 < bridge_> [ddnet] is `for(;;break)` valid? 14:37 < bridge_> [ddnet] nope. tried it 14:38 < bridge_> [ddnet] https://github.com/Learath2/libpbo/blob/master/libpbo/pbo.c#L233 here is a pattern I use a lot 14:39 < bridge_> [ddnet] Though this is not the best example, I don't think I have any better ones public 14:40 < bridge_> [ddnet] Another perfectly valid use is breaking out of nested loops, some people will tell you to make these into one-off functions. To those people I say no 14:40 < bridge_> [ddnet] :justatest: 14:42 < bridge_> [ddnet] (fwiw these are only necessary because C just lacks the tools to do this in a clean manner) 14:42 < bridge_> [ddnet] C++ has exceptions and RAII that can handle the first usecase for you. Some languages have `break ;` pattern that will break out of n blocks 14:44 < bridge_> [ddnet] and if you want more examples of decent uses of goto and have a thing for "appeal to authority" arguments Knuth has a great paper on this 14:44 < bridge_> [ddnet] iirc called "Structured programming with go to statements" 14:45 < bridge_> [ddnet] i'd like a `break ` very much ngl 14:48 < bridge_> [ddnet] Yeah, I think rust had a proposal for one 14:55 < bridge_> [ddnet] Also I was genuinely hoping `for(;;break)` was a thing. 15:08 < bridge_> [ddnet] why? 15:40 < bridge_> [ddnet] idk, it looks funny 15:51 < bridge_> [ddnet] rust has them already since long https://doc.rust-lang.org/rust-by-example/flow_control/loop/nested.html 15:52 < bridge_> [ddnet] ah, this is also acceptable 15:52 < bridge_> [ddnet] I meant a proper arbitrary break though, like out of any block not just loops 15:52 < bridge_> [ddnet] and more readable than n blocks 15:53 < bridge_> [ddnet] @Learath2 how would this work outside of loops? 15:53 < bridge_> [ddnet] isnt that a goto 15:53 < bridge_> [ddnet] well a very limited goto that would just go to outside the block 15:53 < bridge_> [ddnet] https://doc.rust-lang.org/rust-by-example/flow_control/loop/return.html 15:54 < bridge_> [ddnet] https://github.com/rust-lang/rfcs/blob/master/text/2046-label-break-value.md 15:54 < bridge_> [ddnet] oh 15:54 < bridge_> [ddnet] well atleast u can expect to maybe have this in rust i wonder how long it would take for the grandpas in the c++ standard to add this 15:54 < bridge_> [ddnet] :monkalaugh: 15:54 < bridge_> [ddnet] never lol 16:16 < bridge_> [ddnet] pvp scoreboard with teams looks pretty goofy 16:16 < bridge_> [ddnet] https://cdn.discordapp.com/attachments/293493549758939136/836244250634223696/unknown.png 16:40 < bridge_> [ddnet] could it be a thing that you can filter maps by date in the editor when you try to load them ? and not only by name 16:58 < bridge_> [ddnet] what the difference between 16:58 < bridge_> [ddnet] `vec2 m_MousePos[NUM_DUMMIES]` 16:58 < bridge_> [ddnet] and 16:58 < bridge_> [ddnet] `vec2 m_TargetPos[NUM_DUMMIES]` 16:58 < bridge_> [ddnet] `m_MousePos` changes mouse position, but i dont see any `m_TargetPos` changes, even as another player 16:58 < bridge_> [ddnet] (client side) 18:43 < bridge_> [ddnet] mousepos is screenspace, targetpos is worldspace iirc 20:46 < bridge_> [ddnet] Apparently if you change from a non-team game to a team game while snapping gameinfo. There's a high chance that your character's color won't get updated to team color. 20:48 < bridge_> [ddnet] And..... apparently you can just resend map info to force client to refresh it's state. (For 0.6) 20:48 < bridge_> [ddnet] map info is treated as a map change 20:49 < bridge_> [ddnet] so the client re-enters the game 20:49 < bridge_> [ddnet] Ye, but it happens super fast if the server keeps snapping everything. 20:50 < bridge_> [ddnet] The connecting screen only flashes by for 1 or 2 frames on my MacBook. Haven't tested with high ping tho. 20:51 < bridge_> [ddnet] For 0.7 you just send team change message to spectators and back then it'll update. 20:51 < bridge_> [ddnet] 💯 20:53 < bridge_> [ddnet] And it sounds like a non-red/blue team game is possible for 0.7 :kek: