Guild icon
DDraceNetwork
Development / developer
Development discussion. Logged to https://ddnet.tw/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 2023-01-15 00:00:00Z and 2023-01-16 00:00:00Z
Avatar
Can anyone give me some thought on how to find out what is in the camera so visible to the player with the zoom level. Would then use the information to compare to a rect and the camera automatically has that field or rect in the center.
Avatar
@Daniel wdym
01:28
DDraceNetwork, a free cooperative platformer game. Contribute to ddnet/ddnet development by creating an account on GitHub.
Avatar
i want to calculate the view of the camera like im on camera position 10 10 and the zoom level is 12 then i want 2x vec2 to get the rectangle of view
01:33
example image for better understanding.. hard to explain for me
01:34
I can calculate the green box but not the red box of the current camera view
Avatar
do you have the current position of the tee? or let me rephrase. is the tee in the center of that red box? (edited)
Avatar
Avatar
Ravie
@Jupstar ✪ here's an idea with a scrollbar, we could also do something about the spectator box below to have more space for players
so like, will it be like you have to hold tab and use the scroll wheel?
Avatar
Avatar
default
do you have the current position of the tee? or let me rephrase. is the tee in the center of that red box? (edited)
no the tee is not at the center
Avatar
the input parameters and specified output would help :)
Avatar
丿丨v丨丿 2023-01-15 01:48:38Z
how to fix itoop
monkalaugh 1
Avatar
Avatar
Daniel
no the tee is not at the center
just tried to find x/y position using CE and the hud. they seem to hide it. can't help then. sorry. not interested to unrandomize the values at 02:50 in the night. (edited)
Avatar
Avatar
Voxel
so like, will it be like you have to hold tab and use the scroll wheel?
either wheel or drag the scrollbar with the cursor like normally
Avatar
Avatar
Ravie
either wheel or drag the scrollbar with the cursor like normally
i think its better to use scroll wheel, unless you want a seperate cursor just for that menu
01:49
like in emotes
01:50
even then you can still look around holding tab
Avatar
cursor is more intuitive for new people who don't know the shortcuts
justatest 1
Avatar
i use cursor for zoozing
Avatar
i think float ScreenX0, ScreenY0, ScreenX1, ScreenY1; Graphics()->GetScreen(&ScreenX0, &ScreenY0, &ScreenX1, &ScreenY1); i think this is my solution
Avatar
418af5c M Quantum, A FarLands - ddnet-maps
Avatar
Avatar
Jupstar ✪
do you still need it?
nice. would be nice to fix this error, though it could be tricky if this undefined behavior has always been part of the shapshot compression.
Avatar
Avatar
Robyt3
nice. would be nice to fix this error, though it could be tricky if this undefined behavior has always been part of the shapshot compression.
i named myself ᴷᵉᵏᶳ over a bind then in F1 typed player_name nae as soon as the server confirmed the name change it happened
Avatar
Avatar
Jupstar ✪
i named myself ᴷᵉᵏᶳ over a bind then in F1 typed player_name nae as soon as the server confirmed the name change it happened
doesn't seem to work for me locally :/
Avatar
u need the client version that still prints the errors
10:44
or add it back, i tested it on multiple ddnet servers
Avatar
I'm on current master with the errors enabled again
Avatar
mhh let me test
10:48
for me it still happens: 37.230.210.231:8344 even renaming to keks
10:52
well weird it behaves different between us i use clang 16 on debian linux i dunno if this could be simly because the compiler compiles it differently but i am sure it also happened on gcc so maybe bcs my pc runs faster, or bcs linux/windows difference
10:53
or network/ping
10:54
btw in_range<long> is that even a safe template parameter? can't long be 32-bit on a 32-bit computer? (edited)
Avatar
ah, should probably use int64_t
Avatar
if there is smth that helps you understanding the problem just ping me, i can reprod it even in debug build
Avatar
debug: sizeof(int)=4 sizeof(long)=4 sizeof(int64_t)=8
10:59
yeah, I guess the check never worked on my Windows system
Avatar
oh ok 😄
Avatar
now I get the error immediately when renaming
Avatar
As the integer overflow/underflow in UndiffItem can happen during normal gameplay, we should in this case neither ignore the snapshot delta nor show an error message. Instead of depending on the particular compiler doing integer wrapping, when integer overflows or underflows occur, we make it part of the design, by implementing integer wrapping with add_int_wrap.

Checklist

  • [X] Tested the change ingame
  • [ ] Provided screenshots if it is a visual change
  • [ ] Tested in comb...
Avatar
Uf, is that really the prettiest way to write add_int_wrap? I'm really not a huge fan of the random 64 assumption in there
Avatar
Our assumption that int's are 4 bytes also annoys me 😛
16:56
But I guess that one is deeply rooted
Avatar
Is there a smarter way then doing a memcpy to convert between type and unsigned type? template<typename T, typename U> constexpr inline T bit_cast(U u) { static_assert(sizeof(T) == sizeof(U) && std::is_trivially_copyable_v<T> && std::is_trivially_copyable_v<U>); T t; std::memcpy(&t, &u, sizeof(T)); return t; } template<typename T> constexpr inline T add_wrap(T a, T b) { typedef typename std::make_unsigned<T>::type unsigned_type; return bit_cast<T>(bit_cast<unsigned_type>(a) + bit_cast<unsigned_type>(b)); } When I use reinterpret_cast I get error: invalid cast from type 'int' to type 'unsigned_type' {aka 'unsigned int'} 148 | return reinterpret_cast<T>(reinterpret_cast<unsigned_type>(a) + reinterpret_cast<unsigned_type>(b));
Avatar
reinterpret_cast takes pointer
17:25
use *reinterpret_cast<unsigned int*>(&a)
Avatar
I see, thanks
Avatar
I actually wonder if that reinterpret cast is actually legal. Though not enough to dig out the standard 😄
18:00
Mh, the bit_cast one is definitely legal. reinterpret_cast might not be, I don't really remember now
Avatar
With gcc -O2 both implementations have the same assembly https://godbolt.org/z/McW3EWaqE
Avatar
bit_cast - the code is practically the same as in their possible implementation segment. They also note reinterpret_cast (or equivalent explicit cast) between pointer or reference types shall not be used to reinterpret object representation in most cases because of the type aliasing rule. https://stackoverflow.com/questions/98650/what-is-the-strict-aliasing-rule https://stackoverflow.com/questions/14623266/why-cant-i-reinterpret-cast-uint-to-int (edited)
When asking about common undefined behavior in C, people sometimes refer to the strict aliasing rule. What are they talking about?
Here's what I want to do: const int64_t randomIntNumber = reinterpret_cast<int64_t> (randomUintNumber); Where randomUintNumber is of type uint64_t. The error is (MSVC 2010): error C244...
Avatar
Maybe do the bit_cast just in case. We had issues with strict aliasing once and its really no fun to debug
Avatar
Avatar
Learath2
I actually wonder if that reinterpret cast is actually legal. Though not enough to dig out the standard 😄
you can safely reinterpret_cast between types of same size
Avatar
discord troll admins
18:48
fat fingers
18:48
woden hands
18:49
i mean its not only #developer
18:49
even showroom
Avatar
wtf, someone reordered channels order?
Avatar
discord really needs a layout lock xD
Avatar
Avatar
Chairn
you can safely reinterpret_cast between types of same size
Actually even the size doesn't seem to matter 😄 C++11 5.2.10p7 allows converting any object pointer to an object pointer of different type
19:00
Let me see if you are allowed to actually access it without invoking UB though
Avatar
probably not
19:00
move #developer back
19:00
under #general
19:01
@Learath2 this is a matter of life and death
Avatar
I think that was intentional we've been moved down 😦
Avatar
nonono
19:01
this cant be done
19:01
move it back
19:01
@Discord Mod
19:02
who did this
19:02
Avatar
Avatar
Learath2
I think that was intentional we've been moved down 😦
move it back while we figure it out
19:03
cammostripes
Avatar
Avatar
Ryozuki
@Discord Mod
deen
Avatar
i'd need 5 years to get used to this game breaking change
Avatar
@deen pls
Avatar
before developers goes here #off-topic can go here lmao
Avatar
ChillerDragon BOT 2023-01-15 19:14:08Z
yo joptster im thinking about stealing your laser_text.cpp is it free to use? who even made it? fstd? https://github.com/Jupeyy/teeworlds-fng2-mod/blob/07ac6046c37eba552d5d0b59bcc7bf35904b3e4f/src/game/server/laser_text.cpp
FNG mod for teeworlds, that advances the original FNG idea by golden spikes and other features - teeworlds-fng2-mod/laser_text.cpp at 07ac6046c37eba552d5d0b59bcc7bf35904b3e4f · Jupeyy/teeworlds-fng...
Avatar
ZombieToad BOT 2023-01-15 19:16:02Z
hello @Learath2 @deen @snail @murpi Some moderator has just global banned me for 1day for racism? i have not said anything remotely racist so can you investigate the moderators for abusing rcon and kindly unban me?
troll 1
Avatar
Glad guys u moved this channel down, thanks 🙏
Avatar
chillerdragon: yeah u can use it for free af
Avatar
Knowing you, I bet you said something especially vile. I've never seen you not be racist
f3 1
Avatar
ChillerDragon BOT 2023-01-15 19:17:11Z
who made it?
Avatar
ZombieToad BOT 2023-01-15 19:18:31Z
I am sorry you think that way of me but i can assure you that i did not. if you believe that i did could you provide the logs to me? (@Learath2)
Knowing you, I bet you said something especially vile. I&#x27;ve never seen you not be racist
troll 1
Avatar
I shall inquire with the appropriate mod and get back to you kind sir
Avatar
ZombieToad BOT 2023-01-15 19:19:18Z
Thank you very much
Avatar
Avatar
Ryozuki
this cant be done
i knew u would be the main one crying
19:22
u such a old man
Avatar
Avatar
snail
u such a old man
ssh
19:23
ofc
19:23
developers should be the second channel
19:23
its a rule
Avatar
for 95% players this channel is irrelevant
Avatar
1. we encourage ppl to look here more, its the most interesting discussion 2. ppl learn
Avatar
its more logic to have it below
19:23
with questions/bugs
Avatar
how is it less interesting than #off-topic tho
Avatar
even tho its obviously disturbing since we arent used to it
19:24
its not about interesting its about relevancy
Avatar
its the most relevant channel?
19:24
literally lol
Avatar
for devs yes
19:24
not for most ppl
Avatar
for the game
Avatar
i think second most relevant
Avatar
for ppl
19:24
#bugs should be at top
Avatar
it has most messages
Avatar
ChillerDragon BOT 2023-01-15 19:24:49Z
what are u talkin about
Avatar
they moved the channel down
19:24
like its trash
19:25
this is my rust dump
19:25
it must be up
Avatar
ChillerDragon BOT 2023-01-15 19:25:24Z
i mean the learto sp racism logs thingy
Avatar
who cares
Avatar
ChillerDragon BOT 2023-01-15 19:25:37Z
i do
19:25
who cared about discord
Avatar
ChillerDragon BOT 2023-01-15 19:25:51Z
axaxax
19:26
jopstar
19:26
did u steal laser text too or write it ur self?
19:26
i feel like this has been around forever maybe fstd made it idk
19:26
oh wow he is even still on this irc
19:27
helo if u got the ping
Avatar
i stole the idea
19:27
but i wrote myself iirc
Avatar
ChillerDragon BOT 2023-01-15 19:27:32Z
but ur code?
19:27
cool stuff
Avatar
i guess so, the old version didnt connect the laser dots
Avatar
ChillerDragon BOT 2023-01-15 19:27:49Z
wait but wasnt there fstd's openfng when u started?
Avatar
i wanted it connected
Avatar
ChillerDragon BOT 2023-01-15 19:28:01Z
so you made it tighther?
Avatar
i made it so it looks more like text
Avatar
ChillerDragon BOT 2023-01-15 19:28:22Z
idk how it looked before
19:28
was there space between?
Avatar
order looks good now, regarding relevance (edited)
Avatar
The original idea with laser text was indeed fstd's, but people have improved upon it since then
Avatar
ChillerDragon BOT 2023-01-15 19:29:01Z
wait it was fstds idea?
19:29
i thought that idea was even older
19:29
and he only made the open src port
Avatar
Avatar
ReD
order looks good now, regarding relevance (edited)
Yes, I just moved the rest around a bit too, should be good now
Avatar
i mean where the fuck is the idea behind it xD
19:29
its text made of laser dots
Avatar
ChillerDragon BOT 2023-01-15 19:29:34Z
fakof
19:29
its genious
19:29
and culture
Avatar
do u fear copyright or what is ur problem xd
19:29
just use it
Avatar
ChillerDragon BOT 2023-01-15 19:29:54Z
no im just curious
Avatar
be criminal
Avatar
ChillerDragon BOT 2023-01-15 19:30:06Z
and if i steal it into my mod i would at least like to properly credit
Avatar
Hm, first I saw loltext was in openfng or ddwar, not sure which, but I'm not sure if he took it from another mod
Avatar
then give it to fstd
19:30
i dont want credits for anything
Avatar
ChillerDragon BOT 2023-01-15 19:30:31Z
if i manage to understand the code i might make a yt video on it explaining it seems like a fun copy paste for new devs
19:31
send screenshot
19:31
of discord channels
Avatar
ChillerDragon BOT 2023-01-15 19:32:13Z
ty babe
19:32
lmao all muted
19:32
@zwelf when bridge all those?
Avatar
Closes #5620.

Checklist

  • [X] Tested the change ingame
  • [ ] Provided screenshots if it is a visual change
  • [ ] Tested in combination with possibly related configuration options
  • [ ] Written a unit test (especially base/) or added coverage to integration test
  • [ ] Considered possible null pointers and out of bounds array indexing
  • [ ] Changed no physics that affect existing maps
  • [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/...
Avatar
he can bridge it as soon as he has own bridge that doesnt create 2000 seconds delay xdd
Avatar
a127890 Clear editor file browser search term when entering folder - Robyt3 d34819a Merge #6285 - bors[bot]
Avatar
When hovering the demo seekbar, show a tooltip with the time at the hovered position. !screenshot

Checklist

  • [X] Tested the change ingame
  • [X] Provided screenshots if it is a visual change
  • [ ] Tested in combination with possibly related configuration options
  • [ ] Written a unit test (especially base/) or added coverage to integration test
  • [ ] Considered possible null...
Avatar
315e52f Refactor demo seekbar width calculation - Robyt3 d662c7e Add tooltip to demo seekbar showing the currently hovered time - Robyt3 4c639a5 Merge #6286 - bors[bot]
Exported 172 message(s)