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 2021-02-16 00:00:00Z and 2021-02-17 00:00:00Z
Avatar
@Deleted User i am getting this "not dividable by 4" warning on 6 skins, how can i remove the warning without removing the skins?
Avatar
fix the skins
07:58
and maybe also tell whoever uploaded these skins to fix them too, so they wont be used
Avatar
Avatar
Ryozuki
Click to see attachment 🖼️
i got neovim to show me this directly in the editor monkalaugh
08:05
vim master race
Avatar
@Deleted User if i knew who did it xD
08:05
random skins
08:06
i collected them
Avatar
@fokkonaut use convert maybe
08:06
monkalaugh
Avatar
xd ye
08:06
Does anyone have an idea for rewriting the draggers in a less ressource eating way?
Avatar
hm we have to be careful with changing these things
08:08
physics stuff
Avatar
it wont be hard redo the behaviour
08:08
i think
Avatar
placing one single dragger tile from editor, will create MAX_CLIENTS new draggers
08:08
lol
08:08
xd
Avatar
yea, for every team one
08:08
and in one CDragger there is an array for all solo players in one team
08:08
xD
08:08
its hilarious i think
Avatar
i guess there is ways to improve this
08:09
but i never touched that code
Avatar
definetely, i checked with vs, even if i add a return to the snap function of CDragger, it still eats up 5% of the CPU
08:09
with > 100 tees
08:10
i dont have insanely many draggers
08:10
because in my case it creates 128 draggers per dragger
08:10
xd
08:12
monkaS
Avatar
i dont even know what to say
08:14
i tried kind of a rework yesterday but i really gave up, ok it was evening and i already was up the whole day
08:14
but still, it gave me a lot of cancer
08:14
its a relatively small class tho
Avatar
u can see this is old code
08:14
it doesnt even comform to naming standards
08:14
xd
08:15
check CGameController::OnEntity
08:15
it creates a new CDraggerTeam
08:15
which will create max_clients new CDraggers, for each team one xD
Avatar
u mean IGameController
Avatar
yes, of course
08:16
sorry
Avatar
for each door it also creates 8 CDoor s
08:17
xd
08:17
2 CDoors
08:17
for a double door
Avatar
i know what you thought tho
Avatar
CDraggerTeam has 64 CDraggers
08:19
i see
Avatar
@heinrich5991 i am unable to fix this, even if i ignore the error
Avatar
Avatar
Ryozuki
CDraggerTeam has 64 CDraggers
at least their functions are returned if the team is not active, but the calls are expensive still
08:21
u can see
08:21
the dragger has a target
08:21
if there are multiple teams
Avatar
the target has a very weird handling
Avatar
it has to handle more than 1 target
Avatar
yes, thats the soloents
08:21
in general, in Team X there can only be one target
08:21
thats m_Target
Avatar
i guess soloents is when in the same team a tee is in solo
Avatar
but to have it working for everyone separated, there is m_asoloents
08:22
yes
Avatar
used to handle more than 1
Avatar
but see how weird m_Target is handled xD
Avatar
ye i agree this is not good
Avatar
if there is no target, it chooses one of the soloents as target
08:22
xD
08:22
to have the checks still be valid
Avatar
i think it takes the closest entity as target then
08:23
it looks like the old CDragger just got extended by m_soloents
08:23
and by CDraggerTeam
08:27
it looks like the entities in ddrace are just hacked together xD
Avatar
do you think you can get something for the draggers? they are really the worst (edited)
Avatar
buy better VPS xd
Avatar
any raspberry 4 is better xd
Avatar
well you can also crash ddnet servers if you place a few more draggers
08:30
i think
08:31
maybe not crash
Avatar
is a std::vector inefficient?
Avatar
for what
09:02
accessing and iterating should be fast
Avatar
std::vector should be nearly equal to an array
10:30
113f35b Add kintaro_2, redrawn by mind - Jupeyy 0613338 Merge pull request #19 from Jupeyy/pr_add_kintaro_2_by_mind - Jupeyy
10:35
26815a5 Add greensward, redrawn by mind - Jupeyy 27640ee Merge pull request #20 from Jupeyy/pr_add_greensward_by_mind - Jupeyy
Avatar
An std::vector has the same performance as an array if you don't use the bound checking accessors
10:54
Oh and you also pre reserve the space. Growing is obv overhead
11:50
af02f71 Add --fix option to meta script (closed #17) - ChillerDragon
Avatar
As reported by "think twice" on Discord. Confirmed by Im 'corneum.
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 if it works standalone, system.c especially
  • [ ] 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-addresssanitizer--u...
Avatar
@timakro I think the sentence in the book is correct. is it still a question?
15:16
(btw) lifetimes exist separately from variables and scopes, when you mention a lifetime it doesn't have to refer to a lifetime of a specific variable or scope
Avatar
@heinrich5991 Yes, I still don't get it. So my understanding of what they're saying is: It compiles iff there is any lifetime 'a that satisfies those criteria:
The function signature now tells Rust that for some lifetime 'a, the function takes two parameters, both of which are string slices that live at least as long as lifetime 'a. The function signature also tells Rust that the string slice returned from the function will live at least as long as lifetime 'a.
So it's like you say in this case 'a doesn't refer to the lifetime of any specific variable or scope. It's just that if the compiler can fill any lifetime for 'a which satisfies the criteria, then it compiles. Further context:
Remember, when we specify the lifetime parameters in this function signature, we’re not changing the lifetimes of any values passed in or returned. Rather, we’re specifying that the borrow checker should reject any values that don’t adhere to these constraints. Note that the longest function doesn’t need to know exactly how long x and y will live, only that some scope can be substituted for 'a that will satisfy this signature.
15:51
Am I making sense up till this point?
Avatar
yes
15:54
that sounds correct @timakro
Avatar
So my problem is with those criteria which 'a has to satisfy from the sentence in question. If those were the only criteria it's trivial to find a valid lifetime to substitute for 'a, you could do it even in cases where it's obvious that it doesn't compile. Because the criteria are 1. the parameter string slices live at least as long as 'a 2. the returned string slice lives at least as long as 'a. So 'a could be tiny, like imagine 'a starting just before the function call and ending right after the function call. fn main() { let in1 = String::from("foo"); // lifetime of in1 starts here let in2 = String::from("bar"); // lifetime of in2 starts here let out = longest(&in1, &in2); // 'a starts and ends here (just this line), lifetime of out starts here drop(in1); // lifetime of in1 ends here drop(in2); // lifetime of in2 ends here println!("{}", out); } // lifetime of out ends here (edited)
16:14
@heinrich5991
Avatar
ah, I see
16:15
let me think
16:18
I think the interesting point is that caller and callee have different constraints on the return value
16:18
the callee (the function) has to guarantee that the return value will live at least as long as 'a
Avatar
Omg why is everything saying this, I'm so confused xD
Avatar
but the caller (your main) may only, as a result of that, assume that the return value will live for 'a (at most)
Avatar
everyone
Avatar
sorry, what's the word I shouldn't say? ^^
Avatar
urn value will live at least as long
16:19
at least as long as anything
16:19
No!
16:19
Nobody cares if the return value dies
16:20
It can die instantly after the function returns
Avatar
you do, you want to use the return value in the println later on
Avatar
Nobody cares
16:20
Ah ok
Avatar
if you wouldn't use the value, it would be okay to use that very short lifetime you specified
16:21
(and the compiler actually does that to fix some otherwise annoying problems, "non-lexical lifetimes")
Avatar
On another note what I also think is not clear from the explanation in the book or what confuses me: It seems to me it is very important to distinguish when we talk about "the lifetime of the parameter" we really mean the lifetime of the thing the reference is referring to, not the lifetime of the reference. But when we talk about "the lifetime of the return value" we mean the lifetime of the returned reference, not the lifetime of the thing the reference is referring to
16:25
The book just says "the lifetime of the parameter" and "the lifetime of the return value". I assume it means by that what I just said
Avatar
I think the lifetime (on a reference) always talks about the pointed-to value
Avatar
But as parameter and returned value point to the same thing it wouldn't make sense to compare them, would it?
16:27
(They'd have the same lifetime)
Avatar
yes, in this case they have to adhere to the same restriction, live longer than 'a
16:28
but the following function also satisfies this
16:33
fn max<'a>(x: &'a str, y: &'a str) -> &'a str { if x > y { x } else { "abc" } }
16:33
sorry, got distracted
16:34
here, you can see that it makes sense that the return value only has to live "at least as long" as the parameter 'a
16:34
the else branch has a string that lives for 'static, the longest possible lifetime
Avatar
Okay, I see what you mean and how this works when you assume
I think the lifetime (on a reference) always talks about the pointed-to value
16:37
But I'm not sure if that's really what lifetime means because of this from later in the same chapter of book: { let x = 5; // ----------+-- 'b // | let r = &x; // --+-- 'a | // | | println!("r: {}", r); // | | // --+ | } // ----------+ (edited)
16:38
hm to be fair it's quite similar (edited)
16:39
both lifetimes
16:39
they could mean the same
16:39
We all agree on how it works, I think it's actually very intuitive. The "explanation" paragraph from the book should just be removed in my opinion ^^
Avatar
ah ^^
Avatar
Enhances situation in #3528

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 if it works standalone, system.c especially
  • [ ] Considered possible null pointers and out of bounds array indexing
  • [x] Changed no physics that affect existing maps
  • [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet...
Avatar
Small cleanup

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 if it works standalone, system.c especially
  • [ ] 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
@Learath2 found ur alt monkalaugh
Avatar
hahahahaha
19:13
🥴
Avatar
how did you???
19:16
remove this
Avatar
I was told that the collision code does not perform too well with many tees. Since I am a big fan of many tees I tried to improve it a bit. The main idea is reducing loop iterations. Current code iterates over all tees and for all of them iterates over all tees again to check collision with every tee. This is a somewhat redundant check. Because tee a checks if it collides with tee b and then tee b checks if it collides with tee a. So my idea was to apply collision to tee a and b at the s...
Avatar
[quakenet] ChillerDragon BOT 2021-02-16 19:26:07Z
classic love those prs
19:26
UwU
19:26
starts twerking killed me _D
Avatar
nice meme steal ryozuki
Avatar
Avatar
Im 'corneum
nice meme steal ryozuki
i just stole from someone who probs stole it too
20:23
thats t he internet for u
20:23
monkalaugh
Avatar
As reported by texnonik on Discord

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 if it works standalone, system.c especially
  • [ ] 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/...
Avatar
@Learath2 i tried something with the draggers, to handle the teams inside of one dragger, not one dragger per team. if one player is in a team and another one isnt the pull strength seems to be different somehow, any ideas? https://github.com/fokkonaut/F-DDrace/commit/1c19aad782946c06b5610e2904ec4ac025525864?w=1
Avatar
ah okay no, it was like that before too
22:04
nice, then i did not break anything
22:47
c59c41b Inform player while loading when save exists, but they don't belong to the team - Zwelf 62efdf9 Merge #3625 - bors[bot]
Avatar
9daf127 Rename save/load to conform to the code style - Zwelf 1ac07fe Merge #3626 - bors[bot]
Exported 173 message(s)