00:07 < bridge> can someone review #9465 00:07 < bridge> https://github.com/ddnet/ddnet/pull/9465 00:13 < bridge> cursor moving without input feels bad, original video is better 00:14 < bridge> but then it adds new features 00:14 < bridge> like? 00:15 < bridge> i dont mind either way but idk being able to snap between a preset angle and a 45* angle sounds like bad news 00:16 < bridge> idk i prefer the first one 00:22 < bridge> its nicer but rly chotty 00:29 < bridge> Probably avoid introducing new features with that angles PR. God knows what people discovers "creative" new uses for it 00:29 < bridge> ui code is such a mess, buttons have seperate functions for game, then same thing but in editor but different params 00:29 < bridge> ui code is such a mess, buttons have seperate functions for game, then same thing in editor but different params 00:29 < bridge> so many times editor button has corners specified in flag params by mistake 00:29 < bridge> so many times editor buttons have corners specified in flag params by mistake 00:30 < bridge> Well that's what we get for not sharing codes between editor and game 00:34 < bridge> game buttons had no flags, editor have a single flag which is just hasContext 00:34 < bridge> but every single button have to specify 0 flag anyway 😆 01:24 < bridge> What does this track? 01:24 < bridge> 1. Total time spent on DDNet servers 01:24 < bridge> 2. None AFK time spent on DDNet servers 01:24 < bridge> 3. Total time spent beating maps (aka added up time of map completions) 01:24 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1344465114350223402/image.png?ex=67c10236&is=67bfb0b6&hm=f2435d07b175974da1a364ff4f0de88ef668fe356c793e3dc9bf7db7bb9332b6& 01:25 < bridge> What does this track? 01:25 < bridge> 1. Total time spent on DDNet servers 01:25 < bridge> 2. None AFK time spent on DDNet servers 01:25 < bridge> 3. Total time spent beating maps (aka sum of map completion times) 01:25 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1344465114350223402/image.png?ex=67c10236&is=67bfb0b6&hm=f2435d07b175974da1a364ff4f0de88ef668fe356c793e3dc9bf7db7bb9332b6& 01:26 < bridge> well now thats a new error ive never seen before 01:26 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1344465771165782046/image.png?ex=67c102d2&is=67bfb152&hm=a2398fb874ba614e823ab9829fc1c1a926450a880809d343c008c62abe5428f3& 01:27 < bridge> yep its consistent not just a out of memory bug 01:27 < bridge> (im fuzzing the map format( 01:27 < bridge> (im fuzzing the map format) 01:29 < bridge> yea thats more what i was exspecting. more of the most commen bug it found 01:29 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1344466343415779349/image.png?ex=67c1035b&is=67bfb1db&hm=3f220d1a619fd3fc940666563e88b5019f3ed08edf4924ad88a2c95e910442eb& 01:31 < bridge> Seems to be the latter 01:31 < bridge> https://github.com/ddnet/ddnet-scripts/blob/8cc6949be1a7d0b2780553da6afcf44074dbc8ed/servers/scripts/players.py#L110-L122 01:31 < bridge> Damn, thanks for in-depth search 01:32 < bridge> I already knew where to look, been here before :heh:, just wanted to pass you a reference cuz idk sql 01:32 < bridge> @sans._. btw. are fine with me asking you question about your skin-renderer here and there? 01:32 < bridge> sure, go for it 01:35 < bridge> @apfff I based it mostly on [this document]() by Patiga, with a few touchups here and there 01:36 < bridge> omfg thats exactly what I was looking for haah 01:36 < bridge> omfg thats exactly what I was looking for haha 01:36 < bridge> :owo: 01:37 < bridge> btw. do you know if theres an easy way to access the SVG files instead of ripping the PNGs from ddnet.org/skins? 01:37 < bridge> svg? 01:37 < bridge> from where 01:38 < bridge> Ah, those are not svg's 01:38 < bridge> ah nvm I got confused with a different project. there is no svgs xD 01:38 < bridge> yeah, they're rendered 01:38 < bridge> with canvas 01:39 < bridge> I was just wondering how they got such high quality renderings, but I guess they use the 4k versions 01:39 < bridge> Canvas? 01:39 < bridge> https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API 01:40 < bridge> crazy how opening this url made it switch to /zh-TW/ (I'm german) 01:40 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1344469197064900638/image.png?ex=67c10603&is=67bfb483&hm=7396ab3dfecb894e04e05ded69c888a0bf93ad76d31e2de3c05893f051fb3587& 01:40 < bridge> lol 01:41 < bridge> it wont even let me access the english path? 01:41 < bridge> top right 01:41 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1344469493346467860/image.png?ex=67c1064a&is=67bfb4ca&hm=21245939b7778a255853df5d455afbb70d86f3e10b15829f9d97742d3cc3ea40& 01:42 < bridge> It seems to be a Firefox thing. Works with Chrome 01:42 < bridge> That worked but manually editing the path didnt (?) 01:42 < bridge> ¯\_(ツ)_/¯ 01:43 < bridge> mdn is on some good stuff apparently 01:43 < bridge> anyways, thanks for the ressources 01:43 < bridge> np 01:43 < bridge> my lazy ass would have never done that research 01:54 < bridge> are assetsions enabled on the build on steam 01:54 < bridge> are assetsions enabled on the build on steam? 01:56 < bridge> @robyt3 01:57 < bridge> i need to know if i should report this or not 01:57 < bridge> as if the anser is no then i should report it and if the anser is yes then i shouldnt 02:08 < bridge> When you have time I wanna give a bit more details about this pls :) 02:08 < bridge> 02:08 < bridge> It randomly popped in my head again and I wanna try to find solutions 02:10 < bridge> When you have time I wanna get a bit more details about this pls :) 02:10 < bridge> 02:10 < bridge> It randomly popped in my head again and I wanna try to find solutions 02:15 < bridge> tl;dr people here probably generally don't want new & fancy chat features unless there's a good case made for them 02:15 < bridge> it's all a big scam to make you eat pig ham 02:32 < bridge> its basically this, but with anything you want 02:32 < bridge> present your data more nicely 02:33 < bridge> instead the great text wall of china™️ 02:33 < bridge> +also you get to customize stuff 02:33 < bridge> I FOUND A OOB WRITE YIPPY!!!!!! ill report it once i find the cause and mabey make a proof of consept! 02:33 < bridge> There's also functionality that can be added 02:34 < bridge> you found a what now? 02:34 < bridge> 02:34 < bridge> a oob write 02:34 < bridge> what's that 02:35 < bridge> sadly its on the heap so unlikely to be exsplotable but ill try at least 02:35 < bridge> instead of the great text wall of china™️ 02:35 < bridge> am confoos 02:43 < bridge> basicly it means that you might be able to hack someone if they join your server 02:43 < bridge> is basicly what that means 02:43 < bridge> @sans._. 02:43 < bridge> mabey 02:43 < bridge> i need to look into it more 02:44 < bridge> that's scary :heh: 02:44 < bridge> and the ddnet folder is more or less empty did someone of you killed the beta version? Cause when i check for missing files it says everything is there. 02:44 < bridge> normal version works but nightly doesnt. 02:44 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/950325874199261234/unknown.png?ex=67c0dab0&is=67bf8930&hm=4482c60fcc0fc32fc6b6f194b22b1d38f7470b0523c8d839f417cfb27b2dfaaf& 02:45 < bridge> out of bounds memory write 02:45 < bridge> yea 02:45 < bridge> in languages like cpp without intrinsic memory safety it goes uncaught 02:45 < bridge> it's the entry point for the majority of CVEs i see 02:45 < bridge> indded 02:46 < bridge> for most CVEs that result in rce espesaly 02:47 < bridge> is this relevant 02:47 < bridge> 02:50 < bridge> step 1: turn this into a OOB write primitive. so basicly contual what gets overiten and where 02:50 < bridge> well ok step 1 is to understand the cause of the bug 02:51 < bridge> ye xd 02:54 < bridge> this is exsiting! 02:54 < bridge> my first real exsplote is forming! 03:03 < bridge> wait acsualy i should reboot my pc and try agien just to be sure 03:10 < bridge> ok yep that didnt break it good its not dependent on the memory layout 03:13 < bridge> that's awesome man 03:14 < bridge> resume worthy item 03:14 < bridge> if u can fix it 😎 03:57 < bridge> i wasnt even aware that's a thing wtf 03:58 < bridge> i got no counter to that 03:58 < bridge> it's the train of thought 03:58 < bridge> it's just extra 03:58 < bridge> imo 03:58 < bridge> and i think that's probably the sentiment of others who don't want it 03:59 < bridge> i mean 03:59 < bridge> less is more 03:59 < bridge> i dont want _that_ specifically 03:59 < bridge> but external apps are a cool idea 03:59 < bridge> and very useful 04:00 < bridge> @tsk.xp LMFAO i see u 04:00 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1344504422855610468/image.png?ex=67c126d2&is=67bfd552&hm=3b6461b55c54d8d64405b77939efad23888ebfe735ddda05f364da92f56f809d& 04:01 < bridge> This is just something I whipped up out of boredom a while ago, but imagine instead of this there's literally anything, a PR, docs on something, a saved message etc. 04:01 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1344504574756524052/image.png?ex=67c126f6&is=67bfd576&hm=f066ca0c106cd9e4ba9077c183f3b819a45aa57e5e4dc7ac5980bae3bb620a2b& 04:01 < bridge> But image generation and other bs, yikes 04:01 < bridge> ~~i think they'd sooner add it to the ddnet bot~~ 04:01 < bridge> that's why bots are good 04:02 < bridge> because the server admins can opt into them 04:02 < bridge> they can't control anything about external apps 04:02 < bridge> I'm more than happy to re-write the bot in typescript but everyone is a python fanatic around here 04:02 < bridge> :heh: 04:02 < bridge> sorry but the logic isn't so unique it requires the rest of the bot to be ported 04:03 < bridge> u could do it with magick super ez 04:03 < bridge> python is weird tho 😩 04:03 < bridge> it's just an implementation detail 04:03 < bridge> no idea whats that 04:03 < bridge> imagemagick 04:03 < bridge> python lib & super duper common CLI image manipulation utility 04:04 < bridge> eh 04:04 < bridge> i used npm/sharp for image manip 04:05 < bridge> im sure u did 04:05 < bridge> u dont linux do u 04:05 < bridge> i used to, until valorant hit me like a horse 04:05 < bridge> omg 04:05 < bridge> relapsing over valorant is insane 04:05 < bridge> the good news is 04:05 < bridge> maybe i made fun of you for it already sorry 😓 04:05 < bridge> i switched to cs2 :kek: 04:05 < bridge> W 04:05 < bridge> so go back 04:06 < bridge> tell bill gates what's what 04:06 < bridge> i will, too lazy to make backups rn tho 04:06 < bridge> excuses 04:06 < bridge> i've got about 800gb of stuff i need to sort through 04:07 < bridge> ive basically just happened to buy more drives as i need them & now my pc is full of backup drives 04:07 < bridge> it's not very efficient 04:07 < bridge> wdym, that's very nice 04:07 < bridge> i wish i had more than 1 drive (aside from my boot drive) 04:07 < bridge> i wish i had more than 1 drive (excluding from my boot drive) 04:07 < bridge> i wish i had more than 1 drive (excluding my boot drive) 04:08 < bridge> i'd be able to sort stuff better 04:08 < bridge> and even dedicate a drive to windows for god knows when i might need it 04:08 < bridge> if i had thought any of this out i'd use a NAS for all but boot/root/home drives & games 04:09 < bridge> having all the devices mounted & even plugged in will have a minor effect on the rest of the system 04:09 < bridge> less is more often times 04:10 < bridge> :heh: you dont wanna know how many random tech stuff i'd buy and set up and manage just because 04:10 < bridge> if only i had the budged 04:10 < bridge> if only i had the budget 04:11 < bridge> brain happy when many seemingly complicated things work perfectly in unison, i understand what they do and how everything works, and i can manage stuff from any of the screens 04:11 < bridge> 04:13 < bridge> yea 04:14 < bridge> it’s cooler once it spreads to your LAN 04:14 < bridge> imo 04:14 < bridge> u got a whole network of cool shit 04:15 < bridge> instead of just one computer 04:15 < bridge> i used to host shit on my pc all the time & never turned it off but as i got older i started to notice the heat/fan noise/whatever 04:15 < bridge> which is why it’s cool to have smth else so you can still treat your desktop like a normal computer lol 04:15 < bridge> eh thats not too much of a bother 04:16 < bridge> what you should be crying about is the power bill :kekw: 04:16 < bridge> haha well 04:16 < bridge> that’s why i only run one pc now 04:16 < bridge> at our old place utilities were shared among all tenants 04:16 < bridge> you must've been adored by everyone 04:16 < bridge> they don’t know 04:17 < bridge> of the 200+ tenants 04:17 < bridge> they don't need to know 04:17 < bridge> 🤷‍♂️ 04:18 < bridge> anyway, back to linux vs windows 04:18 < bridge> what distro would you recommend 04:18 < bridge> aside from arch, im not touching that rabbit hole 04:18 < bridge> or anything based on it really 04:18 < bridge> depends 04:21 < bridge> i mean depends on what you mean "fix" 04:21 < bridge> if crashing it in a non-rce way counts as a "fix" then yes i could fix it 04:21 < bridge> in fact i can fix it by just making the game close imeditly. that fixes any crashes 04:22 < bridge> eliminate the potential for the oob write 04:22 < bridge> within the code 04:22 < bridge> lol 04:22 < bridge> yea thats simple enough 04:22 < bridge> ok ill make the game exit as soon as it loads is that good? 04:22 < bridge> am i misunderstanding something 04:23 < bridge> im saying ill make the game close as soon as the game loads 04:23 < bridge> basicly making it into a usless progam that does basicly nothing 04:23 < bridge> then unless theres a bug in libc or something no more oob writes 04:23 < bridge> simple 04:24 < bridge> that’s not exactly what i had in mind but you do you 04:24 < bridge> lol 04:24 < bridge> i mean it would work 04:24 < bridge> also can you exsplane the save format to me? 04:24 < bridge> this purple color on my name means fairly little 04:24 < bridge> idk anything about that 04:42 < bridge> i'm partial to nixos but i'm also probably autistic 04:43 < bridge> just get something that's easy and common enough that you won't run into weird packaging lapses & breaks that come from that 04:43 < bridge> the only thing that scary about nix is programming stuff in the lang 04:43 < bridge> might give it a shot tbh 04:43 < bridge> ~~oh no, it isn't~~ 04:44 < bridge> this aint no typescript compiler bwoiah 04:45 < bridge> in all seriousness there are some fairly hard to diagnose issues that come from basic things 04:45 < bridge> many langs looks easy until you factor in the overall development experience and then it's not so simple 04:45 < bridge> it also tends to take its time & in general it's pretty hard on your disk, i'd imagine 04:58 < bridge> 06:35 < bridge> @davidlovesmath why do you always write some English words incorrectly. Judging your overall grammar skills it kinda looks you do it on purpose. Are you some sub kind of analphabet? 06:37 < bridge> no im just very bad at spelling 06:46 < bridge> or dyslexic 06:47 < bridge> can anyone exsplane the map format to me? 07:10 < bridge> gentoo 07:11 < bridge> can you try to look up docs online a bit? some minimum effort 07:11 < bridge> wait theres docs? 07:12 < bridge> https://github.com/heinrich5991/libtw2/blob/master/doc/map.md 07:12 < bridge> thanks sorry 07:12 < bridge> https://wiki.ddnet.org/wiki/Development#External_resources 07:12 < bridge> https://ddnet.org/libtw2-doc/ 07:14 < bridge> @davidlovesmath also just in case u know, most devs are in EU and its 7 in the morning so ur lucky to get answers now xd 07:15 < bridge> just woke up 07:15 < bridge> ☕ 07:15 < bridge> ah so thats why its so inactive atm 07:15 < bridge> lol 07:15 < bridge> thanks 07:15 < bridge> where u from? 07:16 < bridge> usa 07:16 < bridge> 🇺🇸 07:16 < bridge> also is there any tools to read the datafiles easaly 07:16 < bridge> in rust yes 07:16 < bridge> twmap 07:16 < bridge> https://docs.rs/twmap/0.12.5/twmap/ 07:16 < bridge> well idk if its low level for data files 07:17 < bridge> https://docs.rs/twmap/0.12.5/twmap/datafile/index.html 07:17 < bridge> looks like its there 07:17 < bridge> do u know rust? good time to learn 07:17 < bridge> not yet but ig its a good time to learn yea lol 07:17 < bridge> otherwise u can check the tools/ in ddnet 07:18 < bridge> and see how the map related ones handle it 07:18 < bridge> in c++ 07:18 < bridge> i assume it lets me edit the fealds drectly? 07:18 < bridge> but imho twmap is clean 07:18 < bridge> "This crate provides a library for safe parsing, editing and saving " 07:18 < bridge> idk if it lets u do invalid things 07:19 < bridge> maybe with this https://docs.rs/twmap/0.12.5/twmap/datafile/struct.RawDatafile.html 07:20 < bridge> yeah that one should do the trick 07:20 < bridge> it has a load and save and all fields are public 07:20 < bridge> but idk if ur goal is to find issues with the c++ code if u will find the same with rust 07:21 < bridge> since rust is safe against lot more memory issues 07:21 < bridge> and i think this crate doesnt use unsafe 07:22 < bridge> @davidlovesmath u probs can get more done without knowing rust with this https://github.com/ddnet/ddnet/blob/master/src/tools/map_resave.cpp 07:22 < bridge> i recommend making ur own tool there 07:23 < bridge> i already found a oob write atm im trying to detemen the cause and mabey make a poc rce exsplote that opens caculator 07:24 < bridge> is the write from an invalid map? 07:24 < bridge> yea 07:24 < bridge> would be cool to try it with the rust lib 07:24 < bridge> im sure rust will shine 07:24 < bridge> send the map when u can xd 07:25 < bridge> id rather not untill i report the bug offisaly. dont want anyone stealing my bug lol 07:25 < bridge> oh ok xD 07:25 < bridge> ie on github 07:26 < bridge> also given its a oob write i might or might not disclose it privately with the staff in #✉-create-a-ticket 07:26 < bridge> https://github.com/ddnet/ddnet/security/advisories?state=Triage 07:26 < bridge> can u see this? 07:26 < bridge> as id rather not have 10 servers that hack you as soon as you join it lol 07:26 < bridge> i enabled private security reports 07:26 < bridge> so u can send it there when u find it 07:26 < bridge> ok 07:26 < bridge> well i found it im just looking for the cause 07:28 < bridge> ok, back to making my codegen intermediate layer for compilers 08:03 < bridge> i love this response tbh 08:06 < bridge> sounds cool 08:06 < bridge> how is your lang going 08:06 < bridge> either one ig lol 08:37 < bridge> this one is not a lang 08:37 < bridge> but a tool to build langs in rust easier 08:37 < bridge> like some kind of layer before llvm 08:37 < bridge> i call it IRVM 08:37 < bridge> the lang im making, im implementing enums rn 08:37 < bridge> but enums like rust 08:56 < bridge> I should get out of bed 10:21 < bridge> how to change font in text render? if possible only for one text(not for full game) 11:33 < bridge> ```rust 11:33 < bridge> let mut module = Module::new("example"); 11:33 < bridge> 11:33 < bridge> let mut func = Function::new("main", &[Parameter::new(Type::Int(32))], Type::Int(32)); 11:33 < bridge> 11:34 < bridge> let param = func.param(0)?; 11:34 < bridge> let entry_block = func.entry_block; 11:34 < bridge> 11:34 < bridge> let value = func.blocks[entry_block].instr_add(¶m, &Operand::const_i32(4))?; 11:34 < bridge> 11:34 < bridge> let then_block = func.add_block(&[]); 11:34 < bridge> let else_block = func.add_block(&[]); 11:34 < bridge> let final_block = func.add_block(&[Type::Int(32)]); 11:34 < bridge> 11:34 < bridge> let cond = func.blocks[entry_block].instr_icmp( 11:34 < bridge> IcmpCond::Eq, 11:34 < bridge> value.clone(), 11:34 < bridge> Operand::const_i32(6), 11:34 < bridge> )?; 11:34 < bridge> 11:34 < bridge> func.blocks[entry_block].instr_cond_jmp(then_block, else_block, &cond, &[], &[]); 11:34 < bridge> 11:34 < bridge> { 11:34 < bridge> let value = func.blocks[then_block].instr_add(&value, &Operand::const_i32(2))?; 11:34 < bridge> func.blocks[then_block].instr_jmp(final_block, &[value]); 11:34 < bridge> } 11:34 < bridge> 11:34 < bridge> { 11:34 < bridge> let value = func.blocks[else_block].instr_add(&value, &Operand::const_i32(6))?; 11:34 < bridge> func.blocks[else_block].instr_jmp(final_block, &[value]); 11:34 < bridge> } 11:34 < bridge> the block arguments are to handle PHI nodes in SSA automagically 11:34 < bridge> i do it internally in the lowering :poggers2: 11:35 < bridge> like MLIR 11:35 < bridge> ```rust 11:35 < bridge> let preds = ctx.func.find_preds_for(block_idx); 11:35 < bridge> let mut block_args = Vec::new(); 11:35 < bridge> 11:35 < bridge> if !preds.is_empty() { 11:35 < bridge> let operand_len = preds.first().unwrap().1.len(); 11:35 < bridge> 11:35 < bridge> for i in 0..(operand_len) { 11:35 < bridge> let phy_ty = lower_type(ctx.ctx, preds.first().unwrap().1[i].get_type()); 11:35 < bridge> let phi_node = core::LLVMBuildPhi(ctx.builder, phy_ty, c"".as_ptr()); 11:35 < bridge> let mut blocks = Vec::new(); 11:35 < bridge> let mut values = Vec::new(); 11:35 < bridge> for (pred_block_idx, operands) in &preds { 11:35 < bridge> let value = lower_operand(ctx, &operands[i]); 11:35 < bridge> let pred_ptr = ctx.blocks.get(&pred_block_idx.to_idx()).unwrap(); 11:35 < bridge> 11:35 < bridge> blocks.push(*pred_ptr); 11:35 < bridge> values.push(value); 11:35 < bridge> } 11:36 < bridge> 11:36 < bridge> assert_eq!(values.len(), values.len()); 11:36 < bridge> 11:36 < bridge> core::LLVMAddIncoming( 11:36 < bridge> phi_node, 11:36 < bridge> values.as_mut_ptr().cast(), 11:36 < bridge> blocks.as_mut_ptr().cast(), 11:36 < bridge> blocks.len() as u32, 11:36 < bridge> ); 11:36 < bridge> block_args.push(phi_node); 11:36 < bridge> } 11:36 < bridge> } 11:38 < bridge> actually found a bug the else doesnt do anything xd 11:40 < bridge> ```llvm 11:40 < bridge> ; ModuleID = 'example' 11:40 < bridge> source_filename = "example" 11:40 < bridge> 11:40 < bridge> define i32 @main(i32 %0) { 11:40 < bridge> entry: 11:40 < bridge> %1 = add i32 %0, 4 11:40 < bridge> %2 = icmp eq i32 %1, 6 11:40 < bridge> br i1 %2, label %bb0_true_1, label %bb0_false_2 11:40 < bridge> 11:40 < bridge> bb0_true_1: ; preds = %entry 11:40 < bridge> %3 = add i32 %1, 2 11:40 < bridge> br label %bbbr 11:40 < bridge> 11:40 < bridge> bb0_false_2: ; preds = %entry 11:40 < bridge> %4 = add i32 %3, 6 11:40 < bridge> br label %bbbr 11:40 < bridge> 11:40 < bridge> bbbr: ; preds = %bb0_false_2, %bb0_true_1 11:40 < bridge> %5 = phi i32 [ %3, %bb0_true_1 ], [ %3, %bb0_false_2 ] 11:40 < bridge> ret i32 %5 11:40 < bridge> ret i32 %5 11:40 < bridge> } 11:40 < bridge> ``` 11:40 < bridge> easy fix 11:40 < bridge> ```llvm 11:40 < bridge> ; ModuleID = 'example' 11:40 < bridge> source_filename = "example" 11:41 < bridge> 11:41 < bridge> define i32 @main(i32 %0) { 11:41 < bridge> entry: 11:41 < bridge> %1 = add i32 %0, 4 11:41 < bridge> %2 = icmp eq i32 %1, 6 11:41 < bridge> br i1 %2, label %bb0_true_1, label %bb0_false_2 11:41 < bridge> 11:41 < bridge> bb0_true_1: ; preds = %entry 11:41 < bridge> %3 = add i32 %1, 2 11:41 < bridge> br label %bbbr 11:41 < bridge> 11:41 < bridge> or not xD 11:41 < bridge> lovely 11:55 < bridge> `dbg_assert`s are always enabled 11:58 < bridge> epyc 13:05 < bridge> what's the difference between irvm and inkwell? 13:08 < bridge> @kollpotato inkwell api sucks and it segfaults on a invalid gep, which is why its marked unsafe 13:09 < bridge> i detach completly the ir and ir builder from llvm and provide lowering backends like llvm it 13:09 < bridge> but the lowering is like a atomic unit so its way easier to deal with ffi ownership and lifetimes 13:09 < bridge> and i can lower to other backends like qbe 13:10 < bridge> my goal is to make a rly nice api 13:31 < bridge> @jupeyy_keks if we don't know, who renders a map, why do tune layer numbers appear in the editor and not ingame (with entities enabled) (without tilebuffer)? I am wondering if this is deliberately or a bug. 13:32 < bridge> I dunno, I assume it simply never was implemented 13:36 < bridge> can I turn on the tilebuffer for ingame rendering? 13:37 < bridge> you can, there is overlay count which is set per physics layer 13:37 < bridge> and probably left out for tunes 13:38 < bridge> can you tell me how, I just want to check 🙈 13:38 < bridge> maplayers.cpp 13:38 < bridge> see how tele layer is made or smth 13:39 < bridge> yes I understand, that the tune layer is missing the overlay. I am just wondering, if I can turn on different behavior ingame. You said yesterday it was backend dependend, but not matter what backend I choose I still don't have tilebuffering enabled 13:40 < bridge> Otherwise Editor is alsways tielbuffered and ingame is not, making it possible to do options for different cases 13:40 < bridge> it's simply not implemented for tune layers 13:40 < bridge> editor is never buffered 13:44 < bridge> uh yes I mean the other way around: Ingame is always tilebuffered and editor is never, is that true? 13:44 < bridge> ingame is buffered if the backend supports it 13:44 < bridge> else it falls back to the same rendering as editor 13:45 < bridge> Back to my question, how do I disable tilebuffering ingame? 13:45 < bridge> use opengl 1 13:45 < bridge> I already did this, and the tune numbers are also not rendered, so that can't be it. Do you understand what I mean? 13:46 < bridge> I already told you tune numbers were simply never implemented xD 13:46 < bridge> they are in the editor? Whats the difference if they are rendering the same???? 13:47 < bridge> all numbers in phy layers are a extra draw call 13:47 < bridge> has nothing todo with the layer itself 14:08 < bridge> [Here]() is the only call on RenderTuneOverlay, which means, that this functions get called by the editor sperately for physics layers 14:08 < bridge> Thank you 15:37 < bridge> how to change font in text render? if possible only for one text(not for full game) 15:41 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1344680783222280304/image.png?ex=67c1cb11&is=67c07991&hm=baa29cb0dc2d35b7dd408f327174c4b315597005ff7357e6b07c1652d7a69acd& 15:41 < bridge> average cpp error 15:41 < bridge> kek 15:42 < bridge> ```cpp 15:42 < bridge> TextRender()->SetFontPreset(EFontPreset::ICON_FONT); 15:42 < bridge> // create text container, or just draw text 15:42 < bridge> TextRender()->SetFontPreset(EFontPreset::DEFAULT_FONT); 15:42 < bridge> ``` 15:48 < bridge> darn chatgpt doesnt let u make it shut up when it goes on a wrong tangent 15:48 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1344682604179361946/image.png?ex=67c1ccc3&is=67c07b43&hm=75514b25b9e1a7e81a61cb38f767bed1a8ada95687ef12717351252af87a3417& 15:48 < bridge> I assume the tune numbers are not really useful to see ingame. You'd just have a bunch of numbers everywhere for the whole tune zone without any explanation what they mean unless you look in the editor or in debug HUD to figure out the settings of each tune zone. See #6134 which is about displaying the actual tune settings for tune zones. 15:48 < bridge> https://github.com/ddnet/ddnet/issues/6134 16:07 < bridge> how can i add custom font? i added to /fonts and to index.json 16:26 < bridge> ah im not sure, if you just want to be able to change font globally tclient does that 16:26 < bridge> look for references to EFontPreset::ICON_FONT maybe you can add it there 16:58 < bridge> I see that as well and I agree, that they'd be useless 16:59 < bridge> I also have the opinion, that the switch numbers are useless 16:59 < bridge> I don't even know what they do 16:59 < bridge> (ingame) 17:01 < bridge> When i am working on the speedtile color shader, maybe we could do a tune shader as well, but not with a gradient, so that different tune zones have different colors 17:01 < bridge> but one after the other, I am already working on too many things 😄 17:09 < bridge> more like link error given it's only .o files 17:13 < bridge> @kebscs I managed to decouple text_entities for ingame and editor fully 🥳 Thank you @jupeyy_keks for leading me to the right place, the rendering logic is partly a bit tideous 17:14 < bridge> partly? it sucks xDD 17:14 < bridge> I just didn't want to shit too much on it xD 17:15 < bridge> It's a decade old spaghetti 17:15 < bridge> still better, then the old speedtile code 😠 17:16 < bridge> The old tile code in general is extremely sad 17:18 < bridge> can anyone look into #9762, i think its a bug 17:18 < bridge> https://github.com/ddnet/ddnet/issues/9762 17:29 < bridge> since I am working on activating/deactivating this for each physics type anyway, should we may add it and make it off by default? Maybe interesting for debugging mappers 17:34 < bridge> I think this is out of scope, I would have to change code I am not yet understanding, wtf is TileLayerCounter 17:35 < bridge> It counts tile layers 17:35 < bridge> hmm wait 17:41 < bridge> so for tune we would need to 17:41 < bridge> - add a new layer 17:41 < bridge> - make sure to offset the old layer by -1 17:41 < bridge> - add logic to set Index for RenderTileLayer to the tune zone ID 17:41 < bridge> - hope that render magic does it's thing 17:41 < bridge> Gotcha 17:41 < bridge> so for tune we would need to 17:41 < bridge> - add a ~~new layer~~ TileLayerCounter 17:41 < bridge> - make sure to offset the old layer by -1 17:41 < bridge> - add logic to set Index for RenderTileLayer to the tune zone ID 17:41 < bridge> - hope that render magic does it's thing 17:41 < bridge> Gotcha 18:10 < bridge> oh yeah mb 18:54 < bridge> https://en.wikipedia.org/wiki/Heisenbug 18:54 < bridge> who doesnt love these? 18:57 < bridge> https://en.wikipedia.org/wiki/Single-event_upset 18:58 < bridge> Worst thing I ever had to debug was a heisenbug occuring on different thread timings if the order of operations was a bit scuffed ... 19:20 < bridge> can sb. help me with #9767 ? 19:20 < bridge> The tune layer renders arrows, because I am probably missing a TextureSet or something similar somewhere. This works in editor, which means that the error must be somewhere here: But I don't see what's wrong. I use GetOverlayCenter like teleporters do 19:20 < bridge> https://github.com/ddnet/ddnet/pull/9767 19:22 < bridge> This adds `OVERLAYRENDERFLAG_TEXT` but it's never passed as an argument 19:23 < bridge> OVERLAYRENDERFLAG_TEXT maybe should be a bool 19:24 < bridge> I call the function with it, it's just `g_Config.m_ClTextEntitiesTune` which is either 0 or 1 19:24 < bridge> I am talking about the bottom part btw, where I use RenderTileLayer 19:42 < bridge> with opengl 1.0 this works btw 19:42 < bridge> with opengl 1.0 this works btw (like in the editor because tile buffering) 19:48 < bridge> That should at least mean you only have to look at branches where `IsTileBufferingEnabled()` return true 19:49 < bridge> Which is the branch that calls RenderTileLayer for everything 19:52 < bridge> I always get the arrows in the tune layer, no matter what I configure with ClTextEntities* 20:17 < bridge> I found out, that I can reproduce this bug only on one map, which I probably destroyed 😦 20:19 < bridge> "kein backup kein mitleid" xddd 20:19 < bridge> backups existieren 20:20 < bridge> nice 20:27 < bridge> I don't get it I completly destroyed the rendering 20:28 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1344752965373788221/screenshot_2025-02-27_20-27-41.png?ex=67c20e4b&is=67c0bccb&hm=d14762118b1bfd49ff3986257056c565f52b08440bf263132225d47ed57af736& 20:59 < bridge> asking for a review of #9763 (speedboost limiting) 20:59 < bridge> https://github.com/ddnet/ddnet/pull/9763 21:02 < bridge> Btw if you place too many old speeders they disappear 21:04 < bridge> @essigautomat this also affects the y velocity even tho that is not affected by the ramp right? 21:05 < bridge> yes 21:11 < bridge> I'm a little unconvinced this should be a tune, could you justify why you think that should be the case? 21:12 < bridge> Do you think there is some other creative use this could be used for? 21:12 < bridge> should it be possible to have only your own namepalte shown 21:12 < bridge> Do you think there is some other creative use for this tune? 21:12 < bridge> doing this is very easy with bitwise magic, not so if i have to exclude "own" 21:12 < bridge> https://cdn.discordapp.com/attachments/293493549758939136/1344764122360975442/image.png?ex=67c218af&is=67c0c72f&hm=655f50d0ad599a18b47fe76c9d63df36edd8296a1bc876ddd820c3a2e52313d8& 21:12 < bridge> ah right why should this be specific to speed boosts and not a global speed limit? 21:13 < bridge> I don't understand the question. Adding a global speed limit would be breaking probably all maps 21:13 < bridge> The tune 21:14 < bridge> I can also put these in a comment, I just asked here since you are online and there might be something I'm missing that you can clarify quickly 21:14 < bridge> because this value depends on velramp, why should this be NOT a tune? 21:14 < bridge> do you want this to be a constexpr instead? 21:16 < bridge> Well there is a single correct value for this at any given combination of velramp values. Unless you think there are other uses for it, it probably should be calculated 21:17 < bridge> This is a very good question. If you find a good form to calculate it immediately go ahead 21:17 < bridge> I would make it only active for the x velocity and make it a toggle. It should auto calculate the correct max speed 21:17 < bridge> (as you have seen on github) here is the formula https://www.wolframalpha.com/input?i=maximize+y+%3D+%281+%2F+1.4%5E%28%28x+*+50+-+550%29+%2F+2000%29%29+*+x 21:18 < bridge> where 1.4 is velramp curvature, 50 is tickspeed, 550 is velramp start and 2000 is that other velramp value 21:19 < bridge> Well it should be trivial, no? The first derivative is trivial to find roots for 21:20 < bridge> It should be x = 2000/(50 log(1.4)) 21:21 < bridge> So `x = othervelrampvalue/(tick_speed * log(curvature)) 21:21 < bridge> to be nitpicky, log2 😛 21:21 < bridge> So `x = othervelrampvalue/(tick_speed * log(curvature))` 21:21 < bridge> No, natural log, loge 21:21 < bridge> okay, I'll update the code and remove the tuning value 21:21 < bridge> to be nitpicky, ln 😛 21:22 < bridge> I think that's better if there is no use for it otherwise 21:22 < bridge> the other use for it is to turn it off 21:23 < bridge> I know it's debatable if we want that or not, since we have that functionality with the old speedtiles (unlimited uncapped) 21:23 < bridge> There is one concern I guess, you'll need to make sure you recalculate it everywhere a velramp tune change happens 21:23 < bridge> yes, you'd need to recalulate it on every tick 21:23 < bridge> yes, you'd need to recalculate it on every tick 21:23 < bridge> on every tick? really? 21:24 < bridge> othervelrampvalue, tick_speed and curvature don't change every tick, do they? 21:25 < bridge> usually not, they change when you change the tune zone or an admin enters a tune command 21:26 < bridge> you see where this is going? 21:27 < bridge> So I'd expect it to be recalculated when one of those things happen 21:28 < bridge> is that calculation really that expensive, because it's just one line. For other things we would need to add way more logic 21:29 < bridge> To be fair good point, I actually don't know, just do it every tick see if there is perceptible performance degradation 21:30 < bridge> I imagine `std::log` isn't too optimized, but we can replace that with some approximate log if needed, a taylor series approximation should be pretty accurate and cheap if needed 21:30 < bridge> We don't need it extremely precise anyway 21:31 < bridge> this can probably be branch optimized as well by the cpu, and if you compare the new speedtile code with the old one, don't complain about complexity or performance xDDD 21:31 < bridge> I'm fairly sure it's not cheap enough to do per speedtile though 21:31 < bridge> bre this is going to be called once per tick per player right? 21:32 < bridge> Compared to all the other shit in the DDNet codebase that is allowed this doesn't take any performance xdd 21:32 < bridge> Yeah, I'd imagine so, probably still fine and if it shows up in a profile an approximation is a way to optimize it out 21:32 < bridge> Have you ever looked at any of the collision functions? 21:32 < bridge> This won't even show up on any profiler... 21:33 < bridge> in python i could just add a `@cached` for lookup xD 21:33 < bridge> would still be slower, becaue python 21:33 < bridge> would still be slower, because python 21:35 < bridge> Honestly if `std::log` is more optimized than I think, a cache-miss would instantly make it slower, so caching is not the best idea 21:38 < bridge> also what do we do if we play with values and get a negative log or devide by 0? 21:39 < bridge> Can you even set the curvature negative for the velramp? 21:40 < bridge> curvature just needs to be 1, because log(1) = 0? (Can't remember if this is true for ln) 21:40 < bridge> divide by zero is only possible with the curvature at 1, but then the velramp becomes just a straight line towards infinity 21:41 < bridge> I guess then the max is indeed infinite, idk what even happens when you set these things, does the game still work? 😄 21:42 < bridge> setting curvature 1.0 would be the perfect fix for ddnet 2 21:42 < bridge> setting curvature 1.0 would be the perfect fix for ddnet 2, so we don't need to do this at all 21:42 < bridge> With curvature 1 I think there is no drag at all, you just keep going faster and faster as you rocket 😄 21:43 < bridge> Anyway, I actually don't know what to do with the degenerate cases which happen for `curvature <= 0` 21:44 < bridge> Do you think it's own tuning value is maybe a bit better in this case? 😄 21:45 < bridge> no just clamp it? xd 21:46 < bridge> curvature <= 1 actually, the values between 0 and 1 are also funky, you get exponentially faster as you go faster 21:46 < bridge> xDDD 21:46 < bridge> I think clamping is a good option 21:47 < bridge> Yeah, I'd say find a minimum that is still sane and don't allow anything below it 21:47 < bridge> like 1.1 or sth a little closer to 1 21:48 < bridge> what if tickspeed is 0? /s 21:48 < bridge> Oh I guess you could just clamp it for this calculation only, that'd only add an arbitrary limit to the speed tiles operating at extremely bizarre curvature values 21:56 < bridge> The function won't be called then. 22:27 < bridge> you don't need that, log2 is really easy to compute and then just a multiplication 22:28 < bridge> interesting that velramp start doesn't matter at all 22:29 < bridge> should be probably max( formula above, velramp_start / 50) 22:34 < bridge> @learath2 @teero777 this would be my next code for this: 22:34 < bridge> ``` 22:34 < bridge> float MaxRampSpeed = GetTuning(m_TuneZone)->m_VelrampRange/(50 * log(maximum(GetTuning(m_TuneZone)->m_VelrampCurvature, 1.01f))); 22:34 < bridge> MaxSpeed = maximum(MaxRampSpeed, GetTuning(m_TuneZone)->m_VelrampStart / 50) * MaxSpeedScale; 22:34 < bridge> ``` 22:37 < bridge> ok good that means thats safe. 22:57 < bridge> Probably, I wouldn't really assert it without benching but sounds reasonable