Guild icon
Teeworlds
IRC / bridge
One-way IRC channel bridge. If you want to be able to send messages to IRC, contact @Dune or @heinrich5991. https://www.teeworlds.com/?page=docs&wiki=rules/irc_rules
Between 2020-03-19 00:00:00Z and 2020-03-20 00:00:00Z
Avatar
[quakenet] Learath2 BOT 2020-03-19 11:32:19Z
Hello people of #teeworlds, I'm here to bless you with technology from the future, libcurl. However it'd be best if we could get the engine jobs revamp along with it. Thus it is time I inquire once more about allowing a little more C++11 in our codebase
11:32
shared_ptr's are perfect for this and they can't be zero overhead without language support, ofc we can refcount on our own, but not reinventing the wheel and all
Avatar
i agree that the engine jobs should get reworked, but what about just using the non-blocking libcurl api?
Avatar
C++11 WOHOOOOOOO
12:17
!!!!
12:17
send code
Avatar
[quakenet] Dune BOT 2020-03-19 12:32:17Z
Learath2: you want to add a libcurl dependency in Teeworlds?
Avatar
[quakenet] minus BOT 2020-03-19 12:49:22Z
refcounting doesn't sound like a huge deal to implement
Avatar
minus: in the face of threads?
12:55
we need c++11 support for proper atomics though to implement them
12:56
@redix truly nonblocking libcurl isn't reliably available due to dns lookups
Avatar
[quakenet] Learath2 BOT 2020-03-19 13:03:05Z
minus: Sure but why bother when it's already a language feature? I'm sure the people who implement the standard for compilers have a better testing suite and code review standards then us
Avatar
open a c++11 proposal issue, stop starting an obsolete conversation again like last time 😄
Avatar
[quakenet] Learath2 BOT 2020-03-19 13:04:05Z
You really are a buzzkill
Avatar
the arguments are the same, each time
13:04
and nothing seems to move forward
Avatar
[quakenet] Learath2 BOT 2020-03-19 13:04:59Z
Maybe we should port teeworlds to x86 assembly, you know these newfangled languages are too much
Avatar
even dune seemed to agree at some point that c++11 is fine. who else needs to be convinced?
13:05
oy?
Avatar
oy
Avatar
open an issue 😄
Avatar
[quakenet] Dune BOT 2020-03-19 13:06:26Z
@jxsl13 I don't think moving Teeworlds to C++11 is a good idea
13:06
I recognize it is a controversial topic with many valid arguments on both sides, but I don't remember saying that it is "fine"
13:07
I personally think it will do more harm than good
Avatar
._. I'm not gonna look through the logs for that.
13:08
Dune needs to be convinced again, attacc!
13:08
(or open an issue)
Avatar
[quakenet] Dune BOT 2020-03-19 13:11:23Z
iirc sharedptr is like 10 lines to implement. heinrich5991 seems to say there is some overhead without c++11 features though :)
Avatar
correctly implementing shared_ptr is hard
13:16
it's a synchronization feature
13:16
Dune: was it just auto you were worried about?
13:17
what if I find a way to lint against auto so that people adding auto to the codebase get a failed build?
Avatar
[quakenet] Dune BOT 2020-03-19 13:19:28Z
lambdas etc. c++11 seems to push people to introduce unnecessary levels of abstraction. I agree that it would be fine if we had strict code guidelines, and it is only in the absence thereof that I personally prefer c++03
13:19
it would be silly to have a bot just for my personal likings though ;)
Avatar
lambdas make code faster, but we can lint against them, too
Avatar
[quakenet] Dune BOT 2020-03-19 13:20:28Z
well-used lambdas are good yeah. kinda like gotos, yet we don't allow gotos
Avatar
comparing lambdas to gotos is… every modern language has lambdas, but I don't think I know any that has gotos
13:21
this is a false comparison IMO
Avatar
[quakenet] Learath2 BOT 2020-03-19 13:21:23Z
Which I think is equally unwise, but that's another discussion
Avatar
[quakenet] Dune BOT 2020-03-19 13:21:26Z
I'm not hardcore against it though, if everyone else is for it, I'll just go with it :) I was only answering because jxsl13 seemed to implied I was for it
13:21
Learath2: I liked your goto, yeah
13:22
I like that Teeworlds uses abstractions very sparingly and I think it has deserved it a lot
13:22
served* (?)
Avatar
[quakenet] Learath2 BOT 2020-03-19 13:31:36Z
served in what way? It's not terribly easy to read the teeworlds code, nor is teeworlds very performant
Avatar
[quakenet] Dune BOT 2020-03-19 13:32:25Z
code simplicity and readability. You feel like the code is complex/hard to read?
13:33
(of course, I'm biased because I'm familiar with it)
Avatar
[quakenet] Learath2 BOT 2020-03-19 13:33:44Z
I don't but I've been looking at it for 10 years, it's trivial to navigate around for me, a lot of people start out, implement a chat command or two, see the rest of the code with 0 documentation and bail
Avatar
[quakenet] Dune BOT 2020-03-19 13:34:11Z
The lack of documentation is an issue but unrelated to the code, right?
Avatar
[quakenet] Learath2 BOT 2020-03-19 13:34:40Z
The lack of documentation wouldn't be much of an issue if the code was really readable though
Avatar
xD I feel the code complexity
13:35
it has gotten way better in 0.7
Avatar
[quakenet] Learath2 BOT 2020-03-19 13:35:42Z
Start from where you get the input in CControl and try to follow it through to CCharacter on the server, it's not trivial to read any of that code
Avatar
I have been looking at the code for 12 years and have started to touch it rather recently.
13:36
rubs hands, as Dune slowly changed his view
Avatar
[quakenet] Learath2 BOT 2020-03-19 13:38:35Z
Or having to implement a linked list whenever you want one, don't get me wrong, my language of choice is C and I'm very well acquainted with implementing linked lists but many new programmers don't learn how to even work without these abstractions that hide away the details
Avatar
[quakenet] rand BOT 2020-03-19 13:38:48Z
I had some hard time going from src/game to src/engine then back to src/game, then looking for a definition to finally get that it was a generated file…
13:40
then, controls, snap, DirectInput, PredictedInput
Avatar
[quakenet] Learath2 BOT 2020-03-19 13:41:43Z
Then one asks the question what is predicted input what is direct input, which sounds like a simple question but how would the server know what was predicted what was direct input
13:42
Anyways, tw code isn't very unreadable, but it's not self-documenting either
Avatar
[quakenet] Learath2 BOT 2020-03-19 14:12:24Z
There is something wrong with gfx resolution, if you set it and restart it will just not respect it and set it to the desktop size
Avatar
[quakenet] Dune BOT 2020-03-19 14:15:14Z
never had that issue Learath2, OS?
14:15
OSX?
Avatar
[quakenet] Learath2 BOT 2020-03-19 14:15:21Z
macOS yep
14:15
in windowed mode
14:19
backend_sdl.cpp:L701 is responsible for it
Avatar
[quakenet] Dune BOT 2020-03-19 14:20:20Z
I realized the game looks pretty pixalated so i went to the graphics settings and i wonderd why the resoltion is so low. Then I tried to increase it. But after restart the same option was selected ...
Avatar
[quakenet] Learath2 BOT 2020-03-19 14:26:44Z
I don't think you need to force the desktop resolution when rendering windowed
14:29
changing gfx_fullscreen also kills the game on macOS :P
Avatar
[quakenet] Dune BOT 2020-03-19 14:31:36Z
can't really try any fixes without a mac :/
Avatar
[quakenet] Learath2 BOT 2020-03-19 14:45:29Z
if only I could link to the version of sdl I built myself
Avatar
[quakenet] Learath2 BOT 2020-03-19 15:48:51Z
it's an SDL bug with OpenGL being deprecated on macOS
15:48
brilliant
Avatar
[quakenet] Learath2 BOT 2020-03-19 17:33:46Z
Okay I managed to diagnose the problem and I'm kinda stuck, only the main thread seems to be allowed to call [NSOpenGLContext update] which needs to be called whenever the window moves, [NSOpenGLContext update] is only ever called when an update is scheduled through [SDLOpenGLContext scheduleUpdate] which happens when we are setting the current window or when the window moves/gets resized/etc.
17:33
However when we now swap after the window moves we cause an [SDLOpenGLContext updateIfNeeded] which causes a [NSOpenGLContext update] outside of the main thread
17:33
Which is not allowed
Avatar
[quakenet] Dune BOT 2020-03-19 18:00:20Z
so this is an SDL issue
18:00
it is calling [NSOpenGLContext update] outside of the main thread, and there is nothing we can do about that?
Avatar
[quakenet] Learath2 BOT 2020-03-19 18:11:33Z
Dune: Apparently we should be rendering on the thread that we create the window and context on, that's what SDL says it supports, but I don't quite see how that helps, given [NSOpenGLContext update] uses pthread_main_np
Avatar
I don't know what pthread_main_np does
Avatar
[quakenet] Learath2 BOT 2020-03-19 18:17:15Z
returns 1 if the calling thread is the initial thread
18:18
huh, who wrote the code to make gfx threaded anyway? everyone and their mothers seem to warn about creating the context and window on different threads being illegal
Avatar
@heinrich5991 true, forgot about the dns thing =\
Avatar
[quakenet] Learath2 BOT 2020-03-19 21:17:01Z
After extensive digging I have concluded that calling SDL_GL_SwapWindow outside the main thread is not legal on OSX. You can do all the GL you want on a separate thread but SDL doesn't seem to like being split off to other threads
Avatar
SDL_GL_SwapWindow is the main reason why the rendering was moved to another thread at all. In the main thread it causes input latency, since the call blocks when vsync is enabled.
Avatar
[quakenet] Dune BOT 2020-03-19 21:28:28Z
so we need communication between the threads or?
Avatar
[quakenet] Learath2 BOT 2020-03-19 21:57:56Z
Well OSX doesn't allow it, however I noticed prebuilt ddnet binaries worked fine for me, after further digging I found a weird symbol called sNSOpenGLContextSuppressThreadAssertionsComputedValue which skips the main thread check on those binaries
21:58
no idea what it's computed off of yet as reading objective c disassembly is a tedious process
Avatar
[quakenet] Dune BOT 2020-03-19 22:04:23Z
this looks painful
Avatar
[quakenet] Learath2 BOT 2020-03-19 22:10:28Z
osx either works very easily, or never works
Avatar
[quakenet] Learath2 BOT 2020-03-19 22:21:09Z
okay, if you link on an old enough version of osx it'll work
Exported 93 message(s)