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 2020-07-13 00:00:00Z and 2020-07-14 00:00:00Z
Avatar
@nexusrf can you try the build in #2502?
Avatar
Fix a use-after-free when there are no new snapshots for the cl_dummy tee after the switch: #2499 . When one of the tees is hooked, cycling through them will no longer show phantom hook for the oth...
Avatar
@heinrich5991 can we add to the tail of netobjects without breakage or do we need to add a new object and backwards compatibility code?
Avatar
@Learath2 i never used this channel, where is #2502
Avatar
Fix a use-after-free when there are no new snapshots for the cl_dummy tee after the switch: #2499 . When one of the tees is hooked, cycling through them will no longer show phantom hook for the oth...
Avatar
The bot even links it for you 😄
09:15
Go to the checks tab, there is artifacts towards top right, you can download from there
09:16
Avatar
@Learath2 this is only for authorized users
Avatar
sure? I thought they changed that
Avatar
i dont see a difference either
09:30
wel
Avatar
neither one takes effect in my game
09:31
i did download the file, do i have to do some sort of preparation first? maybe download a further build or something
09:32
i mean an earlier build
Avatar
Nope, if that artifact doesn't change your dummy gameplay that's fine
Avatar
85a2268 Show "Free View" for Sixup - Learath2 37a906d Merge #2501 - bors[bot]
10:01
As reported by Clavata on Discord. @Zwelf ?
Avatar
neither one takes effect in my game
@nexusrf here's what I meant by phantom hook: https://youtu.be/mxVT4pdyGnU.
Avatar
xd, never did see it
Avatar
@Learath2 not really, not without extra checks
10:32
the trouble is that the unpacking fails if the object is too small
Avatar
@heinrich5991 so if I were to introduce a new field to player@netobj.ddnet.tw I'd need to instead add a new netobj called player2 AND keep the code for the old netobj too?
Avatar
short of improving the general problem, yes
10:36
the only problematic combination is new client <-> old server
10:36
i.e. we can fix it
Avatar
Uf, I hadn't noticed this rather problematic limitation of the protocol yet
10:40
@heinrich5991 could we even improve the general problem now?
Avatar
yes
10:41
since the only problem is new client <-> old server: the new client expects the netobj to be longer
10:41
so we can make the new client add default values for short netobjs
Avatar
something similar to your get or default thing on vanilla?
Avatar
don't remember what you're referring to, possibly
Avatar
You made it to fix the race record thing iirc
Avatar
ah yea
10:43
something similar to that, just for netobjs
Avatar
Problem is that netobjs aren't "unpacked"
Avatar
hm yes
10:46
can add that ofc
Avatar
Yeah, there is no good way to handle this problem
10:47
We only have a Size, no way to figure out how many fields are missing
10:47
honestly, just that cast even if it has the correct size is unsafe
Avatar
yes @ unsafe
10:47
why not? we know the size, we should be good
Avatar
Ah but everything is ints
10:48
and we already assume sizeof(int) == 4
10:49
maybe a "default" instance of each netobj that we can chop up and append to the end of the small one?
Avatar
if you are talking about anything with 0.7: I will just break compability since there arent any ddnet7 servers anymore and i will just replace my player object with the current one
Avatar
I'm more concerned about the new field we want to add causing some ugly compatibility code
Avatar
you could make the snap code support not only invalidating objs but also replacing them
10:51
in a different buffer maybe
Avatar
can you elaborate further?
Avatar
in addition to the other functions like SnapInvalidateItem(int SnapID, int Index), the client interface gets a new function SnapReplaceItem(int SnapID, int Index, void *pItem, int ItemSize);. in the snap sanity check loop, this function is called at the appropriate places when a old netobj is detected
10:55
this requires support code in datasrc/{network,datatypes}.py
Avatar
That'd imply we need to keep all the older versions in the code still, no?
Avatar
we only need to add a default value to new fields in datasrc/network.py
Avatar
I'm not sure ItemSize > ObjSize is a good enough way to detect an old message though
Avatar
why not? we theoretically have unique IDs (edited)
Avatar
I guess it is as long as we only append at the tail
10:58
This sounds like a good plan
11:00
@heinrich5991 or maybe keep all this transparent to the client?
Avatar
cannot do that
11:01
the old server is the problem
Avatar
I meant as in CClient, I was thinking of fixing it while validating, but noticed that'd be quite ugly now that I checked how we store the snaps
11:02
so yeah, SnapReplaceItem sounds about right
11:04
@heim
11:04
@heinrich5991 doesn't look trivial to replace it either actually
Avatar
yep, needs a side buffer
Avatar
I guess the cache is efficient enough at shifting data over unless the snap is larger than the cache line
Avatar
ehm what?
11:05
I wouldn't try to modify a snap in place
Avatar
Rebuild it?
Avatar
no, keep a side buffer with all the replaced objects
Avatar
And when the client tries to reference them, redirect it?
Avatar
yes
11:07
if we had actual data structures, this wouldn't pose such a problem.. :/
Avatar
which data structure would you use to solve this problem?
Avatar
I would have the snap as a key-value mapping, probably a hashmap
11:08
they support modifying items
11:08
(in fact that's how I implemented it in libtw2)
Avatar
Hashmaps have good theoretical performance, but I wonder how they'd compare to the array of ints approach right now?
11:09
Arrays have great cache behaviour and they play really well with prefetching
Avatar
our array of ints approach has a linear search for ddnet and a binary search for teeworlds 0.7
Avatar
Do we lookup enough for the O(1) lookup to be a good optimization?
Avatar
dunno, typical snap size?
Avatar
Don't we traverse snaps more often?
Avatar
let's say 128 items
11:11
so finding the entry in the hash map must not be 64 times slower than the comparison we do for our linear search
11:12
in order for the hash map to be more effective
Avatar
and we'd have to be doing the lookup often enough for it to be worth it, just traversing through an array has much better performance than traversing through a hashmap
11:17
Traversing a hashmap has the overhead of going through the empty buckets and worse cache performance
11:18
I think the unordered_map in c++ even uses linked lists, which are even worse
Avatar
yes. rust hashmaps are fine
11:20
unordered_map has to have bad performance according to the standard
Avatar
@heinrich5991 do they use open addressing?
Avatar
it changed a couple of times
11:21
the algorithm used
Avatar
Well even with open addressing, you have a layer of indirection and a prefetch unfriendly data structure
Avatar
The hash table implementation is a Rust port of Google's SwissTable. The original C++ version of SwissTable can be found here, and this CppCon talk gives an overview of how the algorithm works.
11:23
Avatar
I've been watching a couple different talks on data structures and performance, I've been very surprised at some of the benchmarks I've seen
Avatar
so no indirection if I see this blog post correctly
Avatar
Well with a catch, if you don't have indirection, you can only store one type of thing (or a union) and the buckets then get rather large
11:26
We generally recommend that you use absl::flat_hash_map<K, std::unique_ptr<V>> instead of absl::node_hash_map<K, V>.
11:26
Ah, that's not saying what I thought it's saying
11:27
That's rather odd, I'd have thought the library would be smarter than the programmer at handling the indirection
Avatar
we want fixed size buckets here, though
Avatar
Do we? Items have varying size
Avatar
pointer, len
11:27
(like we currently have with the array btw)
Avatar
whats this hash map talk about?
11:28
related to ddnet
Avatar
yes, kinda
Avatar
Considering whether a hash map would be a good choice to store snaps as
Avatar
I was lamenting the fact that we don't have data structures
Avatar
instead of a large rather flat array of ints
Avatar
do we iterate snaps a lot?
11:29
well i dont know much :)
Avatar
Once every time we receive a snapshot
Avatar
whats the advantage of the hash map then?
Avatar
Then once more for the events
Avatar
and in the game code as well
Avatar
@Ryozuki we do linear lookups for specific times
11:30
s/times/types/
11:31
maybe we can index by type or smth
11:31
if i got this right
Avatar
We traverse it as many times as we do a linear lookup
11:33
Ah I see what you mean @heinrich5991 you want the snaps themselves to stay as is, but we reference into it using a hashmap?
Avatar
I want the snap data to be stored in an array
11:33
but I want an index
11:34
so yes
Avatar
That would probably have better performance
11:35
With a flat hashmap, the next item would probably fit into the cache rather nicely
Avatar
by snap types u mean CNetObjs?
Avatar
not very prefetch friendly but it happens
11:35
Well types of netobjs
Avatar
anymore
11:39
they made discord not gamer
11:39
justatest
Avatar
What does "invite-only place" mean? I always see invites on public websites, like on DDNet.tw
Avatar
that you get to decide who joins I guess
Avatar
There are also communities that don't create permanent invites posted publicly - instead they create expiring ones or even one-use-only
14:20
let's say community of specific paid course
Avatar
pls fix this no sound hook
15:22
some players have it, i will add an example in a bit
15:25
sound is on, everyone's hook is normal except for his. his hook has no sound
Avatar
was the double hook sound in 0.7 just fixed
Avatar
and if he hits an unhookable tile you still hear the usual sound
Avatar
Cellegen | HU 2020-07-13 15:33:10Z
@noby so you did make a 0.6 - 0.7 compatible server right? Can we make a window compile out of it?
Avatar
i didnt make it, i applied the fixes timakro made to https://github.com/unique-clan/unique-race this server
Avatar
Cellegen | HU 2020-07-13 15:35:15Z
but can i compile it to windows? since according to the instruction, not even git bash can recognize "cmake" or "make" commands (edited)
15:35
is it linux related?
Avatar
that server should work on windows but i dont know / dont have windows to test it on
15:36
u probably have to install cmake
Avatar
Cellegen | HU 2020-07-13 15:36:13Z
right
Avatar
actually no
15:36
use the instructions here
Avatar
Cellegen | HU 2020-07-13 16:09:40Z
the fuck?
16:10
im not sure if this is intended xd
16:14
maybe programming isn't for me lol
Avatar
im always using cmake gui before start compiling huh
Avatar
Cellegen | HU 2020-07-13 16:15:12Z
cmake gui generation cannot detect visual studio on my computer
16:15
so i tried visual studio itself kek (edited)
16:18
reinstall/check your VS Installer
Avatar
@Learath2 sorry but i dont see any difference at all with that build and my current ddnet version
Avatar
That's great
17:55
I was worried it'd break something like the dummy triple fly u do
Avatar
u mean this thing?
17:56
i didnt try playing with it yet
17:56
i will do some 3flies with dummy and see
18:02
i dont see any major difference @Learath2 my triplefly has not been cucked
👍 1
Avatar
Perfect
Avatar
ᶰ°Konͧsti 2020-07-13 18:13:20Z
Cucked
Avatar
does hook have a hitbox or is it just a straight line
Avatar
Is it possible I can add the AntiBot in my own mod @Learath2 ?
18:46
Its a library, right?
18:46
not open source but free to use?
Avatar
It's not my library to share
18:47
You should ask @noby he wrote it
Avatar
DDNet has it, is it possible to have it for local testing?
18:47
Or isnt it public?
Avatar
It isnt public
Avatar
Oh, ok
Avatar
If it was really public people can reverse engineer it
Avatar
True
18:48
thanks
Avatar
Example: https://youtu.be/ZKXxNgFj-HA.
  • Some players will not make hook sounds when hooking other players
  • Wall hooking sounds are fine
  • It seems that everyone will be missing hook sounds coming from that player (confirmed by asking another person who was there if they hear anything)
  • If you record a demo, hook sounds will be missing from that demo too
  • Rejoining the server doesn't fix the problem (if you're not the player that doesn't make sounds)
  • It's possible that changing t...
Avatar
sound is on, everyone's hook is normal except for his. his hook has no sound
@nexusrf I've encountered this too! I've created an issue (see above)
Avatar
does ddnet not use cl_isddnet anymore?
20:33
instead NETMSG_CLIENTVER now?
20:40
oh, it is sending both
Avatar
yes
Avatar
Provides a fix for #2507 on the server side. The client shows no hook, as it sends the server to release the hook (Input.m_Hook = 0). Made a demo how it currently looks: !client_demo Looks a bit ugly in the client :/ (sorry for the gif, experimented a bit with video recording and editing)
21:42
4d34dd3 Limit zooming out further (fixes #2497) - def- 3ff0a7f Merge #2498 - bors[bot]
Avatar
f10 (screenshot) doesn't work when holding alt, ctrl etc.
22:09
it did work before
22:10
because alt is "show chat" for me and I wanted to screenshot it
😮 2
Exported 204 message(s)