Guild icon
DDraceNetwork
Development / developer
Development discussion. Logged to https://ddnet.org/irclogs/ Connected with DDNet's IRC channel, Matrix room and GitHub repositories — IRC: #ddnet on Quakenet | Matrix: #ddnet-developer:matrix.org GitHub: https://github.com/ddnet
Between 2024-05-13 00:00:00Z and 2024-05-14 00:00:00Z
Avatar
ws-client BOT 2024-05-13 01:03:36Z
<ChillerDragon> til there is strlcpy(3)
Avatar
morning
Avatar
morning
Avatar
Avatar
zhn
@heinrich5991 im sorry for ping, but can you review #7820 in your free time?
done
🍻 1
Avatar
Avatar
chillerdragon
Thanks good read. I rate this blog 9/10. Finally understood Nagels algorithm.
chillerdragon: thanks for the link
08:26
ChillerDragon: maybe on the weekend of june 1st/2nd
Avatar
Avatar
Avolicious
But you can still run your own Gores servers? Even ddnet has some maps on their servers
it'd be nice if the servers were open-sourced. it would allow to continue running kog after kog has died (just like with ddnet or teeworlds)
Avatar
Avatar
heinrich5991
it'd be nice if the servers were open-sourced. it would allow to continue running kog after kog has died (just like with ddnet or teeworlds)
We are not aiming to let KoG die for now. But I've already said some months ago, in case it will, we will open source some parts of it ( esp. the game-source with some minor modifications )
Avatar
Avatar
Sans
for 0.7, how exactly do I convert negative codes to hsl?
please use code blocks instead of screenshots. then we can copy-paste it. try -1802633287 & 0xffffff
Avatar
I already figured it out
Avatar
Avatar
Sans
I was able to make it work like this function HSLAfromTWcode(twCode: number, hasAlpha?: boolean): [number, number, number, number] { const hsla: [number, number, number, number] = [0, 0, 0, 255]; if (hasAlpha) { hsla[3] = (twCode >> 24) & 0xff; twCode = twCode & 0x00ffffff; } hsla[0] = ((twCode >> 16) & 0xff) * (360 / 255); hsla[1] = ((twCode >> 8) & 0xff) * (100 / 255); hsla[2] = (twCode & 0xff) * (100 / 255); hsla[3] /= 255; return hsla; }
.
08:33
something like that
Avatar
Avatar
Sans
I think I fixed the color problem
tho now Im having sizing problems
Avatar
Avatar
MilkeeyCat
yo, anyone has mafs to convert either array of little endian bytes to string or base 2 to base 10 string?
which programming language? array[0] | (array[1] << 8) | (array[2] << 16) | (array[3] << 24)
Avatar
Avatar
Avolicious
We are not aiming to let KoG die for now. But I've already said some months ago, in case it will, we will open source some parts of it ( esp. the game-source with some minor modifications )
very cool ❤️
08:44
(but no one aims to let a project die, not even teeworlds. it just happens at some point. at that point, it's usually too late to start trying to open-source it)
Avatar
Avatar
Sans
.
looks good
Avatar
Avatar
heinrich5991
(but no one aims to let a project die, not even teeworlds. it just happens at some point. at that point, it's usually too late to start trying to open-source it)
True that, but I have to remove some parts in order to make it runnable on bare-metal
Avatar
Avatar
Avolicious
We are not aiming to let KoG die for now. But I've already said some months ago, in case it will, we will open source some parts of it ( esp. the game-source with some minor modifications )
nice
Avatar
Avatar
heinrich5991
which programming language? array[0] | (array[1] << 8) | (array[2] << 16) | (array[3] << 24)
It works ye, but what if the number is very big, bigger than 128 bits
Avatar
which programming language? that works indefinitely in python
Avatar
Rust 😬
Avatar
print the last byte in binary, padding it to 8 characters using zeros
09:10
then print the second to last one, … and finally print the first one
09:11
printing it in base 10 requires big int arithmetic AFAICT
09:11
oh
09:11
base 2 to base 10 requires big int arithmetic
09:11
for large numbers
Avatar
I suggest using something like this: https://docs.rs/byteorder/latest/byteorder/
This crate provides convenience methods for encoding and decoding numbers in either big-endian or little-endian order.
Avatar
Crates for da weak
Avatar
Avatar
MilkeeyCat
Crates for da weak
XD true
Avatar
Hacking own crapy solution > already made crate
Avatar
Hacking your hacked solution > RCE
Avatar
Avatar
AssassinTee
I suggest using something like this: https://docs.rs/byteorder/latest/byteorder/
doesn't help for printing converting a base 2 number into a base 10 number
Avatar
Avatar
MilkeeyCat
Hacking own crapy solution > already made crate
you're going to need to implement big integers then
Avatar
Multiplying by 2 and adding 1 will be enough ig
Avatar
you also need modulo 10
09:15
unless of course, you store the number as decimal 🤔
Avatar
fn main() { let num: [u8; 4] = 42u32.to_le_bytes(); //how to convert these bytes into a number string, how to get "42" } here's what i have, and what i need to get xd
Avatar
and you need it to work for arbitrary amounts of bytes?
Avatar
Yep
Avatar
you could store your number as a vector of u8
09:28
the digits of your number in base 10
09:28
then you can implement * 2 and + 1 on that
09:28
and convert your base 2 number into base 10 like that
Avatar
Ye, that's the only solution i could find
Avatar
(usually you'd just use a big integer library though)
09:30
(that can do arbitrary arithmetics on integers. like normal python integers)
Avatar
Sooner or later ill need to write it myself, so it decided to write myself from start 😄
Avatar
why do you need to write it yourself?
09:31
sooner or later
Avatar
U will see :p if i don't give up on the project
Avatar
Avatar
MilkeeyCat
fn main() { let num: [u8; 4] = 42u32.to_le_bytes(); //how to convert these bytes into a number string, how to get "42" } here's what i have, and what i need to get xd
What does *2 and + 1 have to do with printing an integer?
Avatar
Avatar
Learath2
What does *2 and + 1 have to do with printing an integer?
char s[] = "01001011"; int value = 0; for (int i=0; i< strlen(s); i++) // for every character in the string strlen(s) returns the length of a char array { value *= 2; // double the result so far if (s[i] == '1') value++; //add 1 if needed } Serial.println(value); I yonked this code from some forum but i can this mafs on string and get what i need.
10:18
Doesn't it work?
Avatar
Oh, you are going from base 2 string to native byte order integer, yeah that's fine
10:30
Though it feels to me as if it has nothing to do with your original question 😄
10:31
(also doesn't work on arbitrary lengths of s)
10:33
(also unless the compiler is smart it keeps calling strlen which gives you a nice nasty O(n^2) algorithm)
Avatar
Avatar
Learath2
Though it feels to me as if it has nothing to do with your original question 😄
fn mul2(s: &str) -> String { todo!(); } fn inc1(s: &str) -> String { todo!(); } fn the_function(bytes: &[u8]) -> String { let mut res = String::new(); for byte in bytes { for i in 0..8 { let bit = (byte >> i) & 1; res = mul2(&res); if bit == 1 { res = inc1(&res); } } } res } fn main() { let num: [u8; 4] = 0x45u32.to_be_bytes(); let num_str = the_function(&num); } i plan to do smth like this
Avatar
Do you want a base 2 output?
Avatar
base 10
Avatar
This is very wrong then
10:40
Even ignoring the fact that you are trying to abuse a string as an arbitrary precision integer
10:41
What does it even mean to mul2 a string?
Avatar
mul2("22" ) -> "44"
Avatar
Yeah but how would you do that operation?
10:41
You'd have to go back to an int
10:43
I'm having trouble telling you which part is wrong because too much of it is wrong. I urge you to go back to the drawing board
10:44
Like this method will kind of sort of work for building a base2 string, but then mul2("1") == "10"
Avatar
it will be passing already base 10 string ._.
Avatar
Then mul2 is wrong, what does 2 have to do with 10?
Avatar
that's the magic, i guess justatest
Avatar
Unless I hit my head harder than I thought this morning this is the wrong magic 😄
Avatar
ill try to make it the way i think it will work and if it wont ill come back 😄
Avatar
You want mul10 and add not inc
10:49
Actually there is no way this works without an accumulator, you need 4 bits to get one digit of base10, and you'll need to handle a remainder. It's just far too much work for an algorithm worse than the naive one. Just build your integer from LSB to MSB and reverse it at the end like a normal person? 😄
10:51
(or pre-overallocate and write from right to left, there is no sane/cheap way to go the other way around due to how the mafs mafs)
Avatar
@Learath2 as I wrote above, it should work if you build up your integer as a Vec<u8> base 10 repr
11:45
you'll have the digits of your base-10 integer in the array
11:45
then implement mul2 and add1 like long addition/long multiplication on paper
11:45
this way, you can convert a base-2 integer repr to a base-10 integer repr
11:46
a normal person would just use a bigint library, but @MilkeeyCat prefers not to
Avatar
Ohhh, I see what you are trying to do now, this is still a little insane to me tbh, why go bit by bit?
11:49
This algorithm I guess has the benefit of being very easy to read? Other than that it's probably worse both in memory usage and performance
Avatar
the algorithm has the benefit of being easy to write
11:50
since @MilkeeyCat doesn't want to use a library ^^
Avatar
I guess this is the best you can do without having to think of carries
Avatar
mul2 and add1 already need carries (edited)
Avatar
mh, the inc1 will never result in a carry, since it's preceded by a mul2
11:55
the mul2 itself can create new digits, but that's not really an issue since you are building the integer MSB to LSB
Avatar
Avatar
Learath2
mh, the inc1 will never result in a carry, since it's preceded by a mul2
amazing, I didn't notice 😄
Avatar
Avatar
Learath2
the mul2 itself can create new digits, but that's not really an issue since you are building the integer MSB to LSB
you still need carry. e.g. 18 * 2 is 36 not 26
Avatar
Avatar
heinrich5991
you still need carry. e.g. 18 * 2 is 36 not 26
Ah true, that's where the carry goes, nicely abstracted away
Avatar
Seemed that all KoG CHN servers shutdown.
Avatar
The cursor on android version still have problems now (I know this is not important)
Avatar
im advancing, im learning qutebrowser now
15:05
browser with vim like motions lets go (edited)
15:33
Avatar
ывроплыврпролыдволдр 2024-05-13 15:47:44Z
hello, i have problem
Avatar
did you properly install all dependencies listed here?: https://github.com/ddnet/ddnet?tab=readme-ov-file#dependencies-on-linux--macos
DDraceNetwork, a free cooperative platformer game. Contribute to ddnet/ddnet development by creating an account on GitHub.
Avatar
ывроплыврпролыдволдр 2024-05-13 15:49:49Z
not, im on ubuntu and downloading here https://ddnet.org/downloads/
15:50
ah
Avatar
Avatar
ывроплыврпролыдволдр
not, im on ubuntu and downloading here https://ddnet.org/downloads/
which ubuntu version do you use
Avatar
ывроплыврпролыдволдр 2024-05-13 15:51:38Z
last 24.04 LTS
Avatar
but yeah installing the dependencies might help. apparently some ffmpeg stuff is not static linked
Avatar
Install the dependencies and Hit it with a sudo APT Update && sudo APT upgrade and Check again i guess
Avatar
Avatar
Jupstar ✪
but yeah installing the dependencies might help. apparently some ffmpeg stuff is not static linked
ывроплыврпролыдволдр 2024-05-13 15:52:18Z
ok im try
15:52
give me some time
Avatar
good luck, try
Avatar
ывроплыврпролыдволдр 2024-05-13 15:54:22Z
dont helped
15:54
Avatar
sudo apt install libmfx1
❤️ 1
Avatar
libmfx1-dev maybe
Avatar
ывроплыврпролыдволдр 2024-05-13 15:56:50Z
thx, helped
Avatar
libmfx-dev
Avatar
Avatar
Headshot
sudo apt install libmfx1
ывроплыврпролыдволдр 2024-05-13 15:57:03Z
this is helped
feelsamazingman 1
Avatar
wsp gang
15:59
how do I open the game im on phone 🔥
🙀 1
Avatar
Avatar
l.jul1a
how do I open the game im on phone 🔥
#questions but i can tell you, there is no current version for android
16:03
only ddnet 9.x
16:03
and also only android
Avatar
im on iphone
Avatar
then u cant open ddnet there
Avatar
Avatar
Ryozuki
libmfx1-dev maybe
no
Avatar
why does ddnet even depend on that lib
16:05
sounds like it's not even directly related to ffmpeg
Avatar
Avatar
meloƞ
did you properly install all dependencies listed here?: https://github.com/ddnet/ddnet?tab=readme-ov-file#dependencies-on-linux--macos
the dependencies should not be needed for regular playing, only for development
Avatar
Avatar
Ryozuki
libmfx-dev
-dev is never needed to run a program
16:50
hmm. it seems their system was a bit broken. we don't depend on libmfx.so.1: $ objdump -p DDNet | grep NEEDED NEEDED libfreetype.so.6 NEEDED libSDL2-2.0.so.0 NEEDED libdl.so.2 NEEDED libvulkan.so.1 NEEDED libGL.so.1 NEEDED libnotify.so.4 NEEDED libgdk_pixbuf-2.0.so.0 NEEDED libgio-2.0.so.0 NEEDED libgobject-2.0.so.0 NEEDED libglib-2.0.so.0 NEEDED libcurl.so.4 NEEDED librt.so.1 NEEDED libm.so.6 NEEDED libpthread.so.0 NEEDED libc.so.6 NEEDED ld-linux-x86-64.so.2
16:50
so it must be pulled in by the system libraries
16:50
which shouldn't have these dependency problems
Avatar
Avatar
Ryozuki
libmfx-dev
(-dev contains headers etc.)
Avatar
ah
🧑‍🚀 1
CLOWNamused 1
Avatar
okay who packaged ddnet on flathub kek
Avatar
only 4*??
17:01
xd
Avatar
The map editor is actually thinking it is saving the map files in the correct $HOME/.teeworlds/maps folder: This is actually not true. The editor saves the file inside the /home/miguel/.var/app/tw....
Avatar
Avatar
meloƞ
okay who packaged ddnet on flathub kek
xdd
17:02
he clearly played it before packaging xD
Avatar
Unfortunately, at the moment I do not have enough time to support this package, and very soon I will have to give up everything for a long time. Is someone willing to take over maintaining tw.ddnet...
Avatar
a93ad48 add cl_show_chat_team to only show team members' messages - yrrrmmbl 3889bf8 Merge pull request #8344 from yrrrmmbl/master - heinrich5991
Avatar
https://github.com/MilkeeyCat/milklang/blob/main/src/parser/expr/int_repr.rs that's what i ended up with(if you write in Rust, you may have a heart attack justatest )
Avatar
Translate the Android back-button to the escape-key, so it can be used to navigate back in menus, open/close the ingame menu, close the editor etc. Trap the Android back button by setting the SDL_ANDROID_TRAP_BACK_BUTTON hint, so it can be handled in our code reliably instead of letting the system handle it. Interpret fast repeated presses of the back-button (5 times within 1 second) as a quit-event, so the app can be quit cleanly and quickly without using the UI. The client settings ...
Avatar
Avatar
MilkeeyCat
https://github.com/MilkeeyCat/milklang/blob/main/src/parser/expr/int_repr.rs that's what i ended up with(if you write in Rust, you may have a heart attack justatest )
this is reportable
22:54
4f62980 Fix off-by-one error in map_create_pixelart - Patiga 03b13cb Merge pull request #8355 from Patiga/fix-pixelart - heinrich5991
Avatar
Is there a way to get access to players stats the way DDstats and ddnet.org do? and ¿can i do it? (edited)
23:55
<ChillerDragon> wait do you mean ranks or master server?
23:57
<ChillerDragon> The first link I sent you is the ranks database and this is where you see all currently playing players https://master2.ddnet.org/ddnet/15/servers.json
23:57
<ChillerDragon> @EpicBanana20
Avatar
Ah i think its rank
23:58
unsure what is master server tbh
Exported 160 message(s)