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 2022-07-18 00:00:00Z and 2022-07-19 00:00:00Z
Avatar
its not lost, its just hidden
00:39
in general, its hidden in the == operator
Avatar
return !(a == a)
Avatar
newer languages?
01:31
javascript has xor
Avatar
6532954 A Campotle 4, A Campotle 5 - ddnet-maps
Avatar
Is there a way to do this in c++, where the metaphorical list is a list of the 4 cl laser color channels? so i don't have to a long if else chain?
05:20
i did this in ms paint because it was the fastest way i could get the idea out of my head
Avatar
not sure what ur asking but maybe switch statements could help
Avatar
is there a switch in c++? i dont remember
05:56
o ya
Avatar
[quakenet] ChillerDragon BOT 2022-07-18 06:48:30Z
stemyes
06:48
a
06:48
yes tere is switch
Avatar
Is PROJECTILE things like non-spinning / spinning laser?
07:00
also what is ENTITIYCLASS_LIGHT
Avatar
???? visual studio is yelling at me for the variable being uninitialized, but isnt it literally initialized at the top of this segment?
07:23
also update on the laser renderer:
Avatar
which variable
Avatar
int ColorMode;
07:30
does it compile?
Avatar
It compiles, but if I join a server with lasers, the switch function just outputs default: and if I join something like fng, that's when it yells at me.
Avatar
oh visual studio is complaining because you give it a value inside an if block so it may not have a value always
07:32
which would make it random memory I think
Avatar
That's weird.
Avatar
yeah c++
Avatar
so i would have to put it all the way up here?
07:33
I'll try that
Avatar
just do int ColorMode = 0;
Avatar
That fixed it!
07:39
Now I just need to figure out how to handle the switch function. All inputs are correct numbers, but it doesn't recognize any.
Avatar
Never really coded in c++ but since color mode is an int shouldn’t it be case 1 Instead of case ‘1’
Avatar
i'll try that
Avatar
oh yeah lol
Avatar
I thought it might be some c++ thing I didn’t know haha
Avatar
oh my god. oh my god this is beautiful
Avatar
Nice!
Avatar
i'll send over a demo
07:52
Shotgun was rendered as 2 in game, but for some reason, probably goes to default
07:53
@Souly
Avatar
Avatar
Voxel
Click to see attachment 🖼️
That looks great and honestly I think it’d help, I’ve mistaken those a few times at least
Avatar
why now i can't use "pgdn" to hides the background layer
08:04
before , in some dark maps use "pgdn" to hides the background layer.You can see maps more clearly.but now i can't do it.
Avatar
You can rebind it by typing in f1 bind pgdown cl_showquads
Avatar
oh
08:08
thanks
Avatar
yea it got renamed to prevent any accidental clicks from new players
Avatar
Avatar
Voxel
You can rebind it by typing in f1 bind pgdown cl_showquads
hm.not pgdown , i try some word, it is pagedown.
Avatar
yea maybe
Avatar
how can i setting swtich it?
Avatar
that? i do not know
Avatar
(on key to switch)
08:11
okay
08:12
i'm going to try
08:14
hm
08:14
bind pagedown +toggle cl_showquads 0 1
Avatar
yea, just replace the old show quads thing with new
Avatar
Press and hold it to display, but release will become as is
08:16
It can also be used
Avatar
Avatar
RemakePower
bind pagedown +toggle cl_showquads 0 1
use toggle instead of +toggle if you don't want to hold the key
Avatar
there is a kog map that has it written. maybe pillars. it says this map has high res quads. press pgdown to disable
Avatar
Avatar
Voxel
Shotgun was rendered as 2 in game, but for some reason, probably goes to default
Nice! Btw, if you need help you can also dm me :)
Avatar
Hi! I hosted a server with maps from ddnet-maps repo, but when i select it in list, it just passes and doing nothing. When doing exec storage.cfg manually, it says that add_path is unknown command
Avatar
Avatar
cauldron
there is a kog map that has it written. maybe pillars. it says this map has high res quads. press pgdown to disable
which is now broken i guess
Avatar
@Jupstar ✪ how much should I care about what I put into which group/binding in shaders?
10:04
like, if I nearly always have the camera buffer bound, should it always be in the same slot, and if a few shaders don't use the camera should I leave that slot unused?
10:07
or is that super irrelevant? I remember reading that the lower bindings are supposed to be used for things that change least frequently (or the other way around, not sure anymore)
Avatar
1347860 Adapt upstreams CButtonContainer - ChillerDragon 650800e Merge #5633 - bors[bot]
Avatar
As cheeser0613 suggested, veto could start earlier and be harder. We could only pass vote when everyone with veto pressed yes.
14:50
0d4f388 Fix clang tidy accessing data pointer - ChillerDragon a9bc4ae Merge #5634 - bors[bot]
Avatar
[quakenet] ChillerDragon BOT 2022-07-18 15:15:25Z
@cauldron inputs are solid: rcon, chat, local, console, team chat supporting tab completion for names and commands and keyboard shortcuts for navigation and history search
15:15
there is a verrrrry cursed ascii world renderer
15:15
scoreboard works most of the time
15:16
serverbrowser is okay unless some utf8 chinese characters mess up indentation
15:16
oh and its linux only and probably will stay so
15:17
15:17
me search for "chill" in "internet" tab
15:18
downloading a map:
15:18
15:19
the spawn of multimap using the crappy renderer: xd
15:19
Avatar
Avatar
Patiga
like, if I nearly always have the camera buffer bound, should it always be in the same slot, and if a few shaders don't use the camera should I leave that slot unused?
camera sounds like a push constant to me, is more efficient, but dunno if wgpu has that
15:20
generally, minimize state changes always 😄
Avatar
[quakenet] ChillerDragon BOT 2022-07-18 15:21:09Z
typing in "fire" in local console then "tab" to iterate all search mates like in the gui client
15:21
15:21
player scoreboard:
15:21
15:22
help page and thats about it:
15:22
15:28
@cauldron you can build this boi https://github.com/chillerbot/chillerbot-ux/ using cmake .. -DHEADLESS_CLIENT=ON -DCURSES_CLIENT=ON to run it your self :)
chillerbot-ux UserExperience based on DDraceNetwork, a mod of Teeworlds - GitHub - chillerbot/chillerbot-ux: chillerbot-ux UserExperience based on DDraceNetwork, a mod of Teeworlds
Avatar
@Jupstar ✪ @heinrich5991 I think I'll give up on the reuse-optimization for now, tried to get the performance of having to just render 1 line of vertical line of pixels each frame, but it still got less fps than the original https://gitlab.com/Patiga/twgpu/-/tree/tilemap-reuse-optimization
16:15
(it doesn't render properly yet, but I think the performance should be representative)
16:15
@Jupstar ✪ maybe a simple good optimization could be just calculating the bounding box of the tilemap?
16:16
-> and then adjust the clipping
16:16
heh, that could actually result in higher fps on zooming out
Avatar
dont u already have the boundingbox
Avatar
not yet, no
Avatar
i mean the tilemap itself is a bounding box
Avatar
well the edges extend outwards, and so far I handle air mostly the same as any other tile
16:17
the bounding box should ignore air
Avatar
i think my understanding of a bounding box is smth different than yours xD
Avatar
hm my understanding of a bounding box is an estimation of the real size of a thing
Avatar
but what does it help here?
Avatar
like if you have a model, you could put a box around it to have simpler calculations for some stuff
16:20
here my bounding box could be the smallest rectangle (still aligned with bothes axis) in which all tiles of the tilemap are
16:20
the bounding box can extend into infinity in a direction by having a tile on the outer edge of the tilemap
16:21
I could then see how much of the bounding box actually overlaps with the camera view
16:21
and calculate how much of the screen I can clip off
16:21
clip/scissor
16:22
maybe I'm misusing the word 'bounding box', unsure about that ^^
Avatar
Avatar
Patiga
here my bounding box could be the smallest rectangle (still aligned with bothes axis) in which all tiles of the tilemap are
yeah but how often does it happen that the tilemap size is not equal to the tiles used
16:23
i mean sure some mappers just make width & height too big, but i assume its not too often
Avatar
hm good question
16:24
I guess I could write a python script to figure out if that is the case
16:24
but clipping/scissoring more should improve the performance, no? that should be a cheap operation
Avatar
u know what could work? render the first 8 layers at once
16:26
u have 16 texture units garantueed in the fragment shader, and the first layer knows the background layer(the clear color)
Avatar
what are texture units?
Avatar
texture slots
16:27
samplers
Avatar
ah, the bindings?
Avatar
yeah sampler binding
Avatar
oh so you are proposing creating a shader that renders multiple layers at once?
Avatar
would at least lower the amount of calls to the webgl API
16:28
bcs that is still insane xD
Avatar
hm, I guess I could also try understand the webgl api and improve the wgpu webgl-backend code ^^
16:29
are you sure that that many calls are actually a problem? shouldn't they mostly be cpu-based calls?
Avatar
well they just spam out all state changes, i dunno how well the webgl "drivers" are
16:30
but assuming they are rather bad, that sounds like some overhead
16:30
a well written opengl driver might check all states before trying to apply them
16:31
tho that ofc can come with overhead in case the dev writes well written backends 😄
16:31
vulkan is just better xD then its ur fault if it sucks
Avatar
btw @Patiga sadly i cannot test ddnet rendering on webgl without vsync. dunno why, but seems SDL hasnt implemented it yet and is always default on
16:33
:/
Avatar
ah darn
Avatar
@Patiga does wgpu generally have no geometry/tesselation shader? or just the webgl backend not
Avatar
not at all as of yet
Avatar
too bad
16:49
bcs then u could move bit of your fragment code to the geometry shader stage already
16:49
but probably when zooming out far enough it doesnt matter anymore anyway, bcs then 1 pixel = 1 tile
16:50
so RIP
Avatar
I think their current goal is putting out like a MVP version
16:50
until they get version 1 out I doubt they will add more shader stages as I understand it
19:43
e3c4461 Wawka no longer mod - murpii fdb8112 Merge pull request #206 from murpii/patch-12 - def-
Avatar

Checklist

  • [ ] 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/#using-addres...
Avatar
u know when u start reading wikipedia and get deeper and deeper, today i found this experience on stack overflow
20:04
there is one guy that posts a lot in x86
20:05
he knows way too much stuff
20:05
i cant remember the name rn
20:06
found it
20:06
Stack Overflow | The World’s Largest Online Community for Developers
20:06
I wrote these two solutions for Project Euler Q14, in assembly and in C++. They implement identical brute force approach for testing the Collatz conjecture. The assembly solution was assembled with...
20:06
example casual answer from him
20:06
insane xD
20:06
pog
Avatar
Now do such detailed answers for GPUs thx xd
Avatar
people learning assembly and that dont know these details?
Avatar
why not? 🙂
Avatar
if i knew nothing about cycles etc i would use div too
20:35
its the most logical thing
20:35
use the div mnemonic to divide
Avatar
obviously, but the guy looked more advanced than beginners
Avatar
Avatar
heinrich5991
why not? 🙂
its highly inefficient
20:35
check the answer
20:36
for a detailed explanation
20:36
xdd
20:36
On Intel Haswell, div r64 is 36 uops, with a latency of 32-96 cycles, and a throughput of one per 21-74 cycles. (Plus the 2 uops to set up RBX and zero RDX, but out-of-order execution can run those early). High-uop-count instructions like DIV are microcoded, which can also cause front-end bottlenecks. In this case, latency is the most relevant factor because it's part of a loop-carried dependency chain.
>
shr rax, 1 does the same unsigned division: It's 1 uop, with 1c latency, and can run 2 per clock cycle.
Avatar
I misunderstood the conversation, didn't read enough messages
Avatar
he also has a rly in depth explanation about why zeroing with xor is the best option
20:36
i gotta find it
Avatar
because it's hardcoded into the processor
20:37
as a free operation, even
20:37
only limited by instruction decoding
Avatar
All the following instructions do the same thing: set %eax to zero. Which way is optimal (requiring fewest machine cycles)? xorl %eax, %eax mov $0, %eax andl $0, %eax
20:38
here
Avatar
you can execute as many xor R, R as you want per cycle 😛
Avatar
TL;DR summary: xor same, same is the best choice for all CPUs. No other method has any advantage over it, and it has at least some advantage over any other method. It's officially recommended by Intel and AMD, and what compilers do. In 64-bit mode, still use xor r32, r32, because writing a 32-bit reg zeros the upper 32. xor r64, r64 is a waste of a byte, because it needs a REX prefix.
>
Even worse than that, Silvermont only recognizes xor r32,r32 as dep-breaking, not 64-bit operand-size. Thus even when a REX prefix is still required because you're zeroing r8..r15, use xor r10d,r10d, not xor r10,r10.
20:39
@heinrich5991 but he mentions that the only useful case is when u dont want to alter flags
20:39
iirc
20:39
i read it this morning xd
20:39
the only useful case to not use xor*
20:40
20:40
xd
Avatar
boo images
Avatar
i felt it would spam irc too much :c
20:41
he knows so much, always mentioning this x cpu family does this and that other that
20:41
truly years of knowledge
Avatar
guy just memorized all intel documentation 😄
Avatar
is it possible that compiler may choose a value for enumeration?
Avatar
okay, i got a really weird bug
22:22
i have an assertion to test if memory has been zeroed, it fails on clang, but not on gcc
22:22
but when i look up the memory with gdb, it is 0
Avatar
smells like UB
Avatar
687fd91 Rename variable m_aEntries to m_vEntries - Robyt3 c6cf000 Fix names of static variables in settings menus - Robyt3 5daa0f9 Merge #5638 - bors[bot]
Avatar
(gdb) p *pCursor $9 = {m_Flags = 0, m_LineCount = 0, m_GlyphCount = 0, m_CharCount = 0, m_MaxLines = 0, m_StartX = 0, m_StartY = 0, m_LineWidth = 0, m_X = 0, m_Y = 0, m_MaxCharacterHeight = 0, m_LongestLineWidth = 0, m_pFont = 0x0, m_FontSize = 0, m_AlignedFontSize = 0, m_CalculateSelectionMode = TEXT_CURSOR_SELECTION_MODE_NONE, m_PressMouseX = 0, m_PressMouseY = 0, m_ReleaseMouseX = 0, m_ReleaseMouseY = 0, m_SelectionStart = 0, m_SelectionEnd = 0, m_CursorMode = TEXT_CURSOR_CURSOR_MODE_NONE, m_CursorCharacter = 0} (gdb) x/26wx pCursor 0x7fffffff4ee0: 0x00000000 0x00000000 0x00000000 0x00000000 0x7fffffff4ef0: 0x00000000 0x00000000 0x00000000 0x00000000 0x7fffffff4f00: 0x00000000 0x00000000 0x00000000 0x00000000 0x7fffffff4f10: 0x00000000 0x00000000 0x00000000 0x00000000 0x7fffffff4f20: 0x00000000 0x00000000 0x00000000 0x00000000 0x7fffffff4f30: 0x00000000 0x00000000 0x00000000 0x00000000 0x7fffffff4f40: 0x00000000 0x04007fff this is beyond me
Avatar
sizeof(*pCursor)?
22:43
which is actually weird given that i count 100 manually
Avatar
then there's probably padding?
Avatar
so i'd guess there's some extra data
Avatar
the last four bytes
22:43
is there a int64_t in there?
Avatar
there's a pointer in the middle
Avatar
ah yea
22:44
so the structure is padded to a multiple of 8 bytes
22:44
104 is divisible by 8
22:46
@Chairn do you understand the problem now?
22:47
looks like standard doesn't require padding to be initialized to 0
Avatar
no, padding is indeterminate
22:47
and can change at any time
Avatar
ptype /o var shows padding in gdb
Avatar
If T is an non-union class type:
>
all padding bits are initialized to zero bits,
23:08
hmm, clang not compliant with standard?
Avatar
Avatar
Voxel
Click to see attachment 🖼️
HUGE Update to this project! Fokkonaut cleaned up and polished the laser code so now that (with anti-ping off only right now), the lasers are differentiated by weapon and type! Huge shoutout to him! If we were to mainstream this into the actual game, it would require an update to the server to send over weapon/laser types. It's not perfect right now, but it's a very solid concept build. https://github.com/VoxelDoesCode/ddnet/tree/multicolored-lasers (edited)
DDraceNetwork, a cooperative racing mod of Teeworlds, now with experimental features - GitHub - VoxelDoesCode/ddnet at multicolored-lasers
Avatar
Little correction: On an up-to-date server it works without antiping, but older servers fall back to the rifle laser color. If you use antiping on an older server it also shows the correct color :)
23:12
Maybe nuborn can do something, that it predicts the laser color correctly when holding shotgun, we'll see
Avatar
ᴿᵉˣᵉᴺ 2022-07-18 23:13:17Z
Hello, can anyone talk to me about Client ID?
Avatar
Hello, yes
Avatar
Avatar
Voxel
HUGE Update to this project! Fokkonaut cleaned up and polished the laser code so now that (with anti-ping off only right now), the lasers are differentiated by weapon and type! Huge shoutout to him! If we were to mainstream this into the actual game, it would require an update to the server to send over weapon/laser types. It's not perfect right now, but it's a very solid concept build. https://github.com/VoxelDoesCode/ddnet/tree/multicolored-lasers (edited)
why don't you PR it? It would be easier to discuss it there
Avatar
Avatar
Chairn
why don't you PR it? It would be easier to discuss it there
Pull Request to the main ddnet repo?
23:23
You can add commits later on, after the pull request is made already
Avatar
@fokkonaut can't wait for colored laser drawings on your server justatest
23:24
Thought about that too already, but I can only let people choose color 1-4, cuz everyone can set their own colora
Avatar
Let me just finalize the menu first, and then I'll PR
23:27
(after supper)
Exported 244 message(s)