Guild icon
Teeworlds
discord.gg/teeworlds / development
For discussions around the development of the official Teeworlds
Between 2020-09-09 00:00:00Z and 2020-09-10 00:00:00Z
Avatar
Wow, fokkonaut opened exactly my issue. I've tried to mitigate it with a start delay but it still doesn't help all the time and sometimes teeworlds is restarted without econ making my econ-consuming chatbot bridge fail. (edited)
07:06
I am fighting with it for 2 months already. Would be so nice if someone will fix it. Applies to both teeworlds and ddnet codebase.
Avatar
@Dune I did a PR für GH-Actions, but I think you used the implementation from sb. else ( @Learath2 ??). Do you need help?
07:20
no it was axblk
Avatar
why does discord auto change less than 3 to a emoji
Avatar
You can disable that
Avatar
found it
10:47
thanks
Avatar
The first release of actions/checkout@v2 did not support submodules. Today it does.
18:33
This adds an option (disabled by default) to predict the projectile position. It is not a physically correct prediction, so it does not simulate explosions and the projectiles might even fly through walls. The main benefit is that all moving objects are in sync when player and projectile prediction is enabled.
Avatar
This fixes two issues:
  • #2650 is using the actual position of a player as the hook destination. If the character is not visible, this leads to hooks to random coordinates.
  • The hook rendering code mixes predicted and unpredicted values. This causes the hook to not always be at the center of the hooked tee. According to the unpredicted pPlayerChar->m_HookedPlayer the hook is still flying, so it uses Player.m_HookX and Player.m_HookY. These values are predicted, so the hook might al...
Avatar
Why is this beautiful branch stalled in 2012 and never got merged to tw? does anybody knows it? https://github.com/matricks/teeworlds/compare/master...ressys (edited)
A retro multiplayer shooter. Contribute to matricks/teeworlds development by creating an account on GitHub.
Avatar
probably because matricks disappeared
21:39
When teeworlds needed him most, he vanished
Avatar
is it a bad idea to create arrays every frame?
Avatar
and we will wait 100 years for him to return?
21:42
in an iceberg?
Avatar
@TsFreddie wihtout initializing, arrays cost almost nothing
Avatar
i mean the tl ones
Avatar
Those are alway heap allocated, you can presize them to avoid extra allocations
21:48
I put an array in CTextCursor to store the quads, which sounds like a bad idea tbh.
Avatar
matricks has 7 repositories available. Follow their code on GitHub.
21:48
that's nice
Avatar
Uf, not sure
Avatar
Do you think his account is hacked? (edited)
Avatar
@TsFreddie Do you need to create them every frame? Maybe you could cache a bit
21:49
@Deleted User doubt it
Avatar
yeah, i think i should cache it.
21:50
I'm trying to move everything like alignment and auto fontsize (used in broadcast) in TextRender. and make all text deferred by default
Avatar
Truncation and a BoundingBox() would also be great to have while you are at it btw
21:52
i'm using boundingbox and linewidth array to make alignment when drawing
21:52
the quads are only store in TopLeft alignment
Avatar
So nice that you are working on this, it's been kind of a mess for so long
Avatar
it actually started when I really want to write a unified CLineInput
21:55
then the TextRender is just not up to the task..
21:56
currently my API for textrender looks like this:
21:56
c++ virtual void SetCursor(CTextCursor *pCursor, float x, float y, int Flags = 0) = 0; inline void SetCursor(CTextCursor *pCursor, int Flags = 0) { SetCursor(pCursor, 0, 0, Flags); } // virtual void MoveCursor(CTextCursor *pCursor, float x, float y) = 0; virtual void TextDeferred(CTextCursor *pCursor, const char *pText, int Length) = 0; virtual void TextOutlined(CTextCursor *pCursor, const char *pText, int Length) = 0; virtual void TextShadowed(CTextCursor *pCursor, const char *pText, int Length, vec2 ShadowOffset) = 0; inline void TextColor(const vec4 &Color) { TextColor(Color.r, Color.g, Color.b, Color.a); } inline void TextSecondaryColor(const vec4 &Color) { TextSecondaryColor(Color.r, Color.g, Color.b, Color.a); } // These should be only called after TextDeferred, TextOutlined or TextShadowed // TODO: need better names virtual void RedrawTextOutlined(CTextCursor *pCursor) = 0; virtual void RedrawTextShadowed(CTextCursor *pCursor, vec2 ShadowOffset) = 0; (edited)
21:59
So TextDeferred calculates the quads and render the glyphs if needed. You can get the boundingbox without actually drawing it. When you're ready to draw you just call RedrawTextOutlined
22:00
Then you can probably cache the CTextCursor and set a flag to skip quads calculation for the following frames as well. but the idea is not fully fleshed out yet.
Avatar
DDNet has some deferred text you can take a look at, I think Jupeyy ended up giving out an index to an array of quads
Avatar
yeah i saw that
Avatar
I think text containers he called them
Avatar
i might cache the array and give out indices too.
Avatar
but it's hardly used anywhere in ddnet =\
22:02
only the chat as far as i remember
Avatar
namesplates
22:03
they used it for nameplates as well
Avatar
that hardly makes sense since they move all the time =\
Avatar
I'm trying to do a "drop-in" replacement. but I still need to rewrite all the rendering. but i wish i can just set a flag and skip quads for the following frames.
22:04
quads can move too. doesn't cost that much
Avatar
The general idea is called a quad container in the ddnet code I think
22:05
Once you have a block of text rendered into a quad, you can just render the quad
Avatar
quite a bit cheaper than re-rendering the text iirc
Avatar
vanilla already has this for shadowed text
Avatar
I tried to introduce a kind of text cache. It basically records all the text draw calls, batches them together, uploads the vertices to the gpu and reuses them for the next frames.
22:06
If something changed, only the modified ranges are updated. That works for the whole game with only changing some lines outside the text renderer
Avatar
Eh, it's rather finnicky to reuse things with the way teeworlds is set up
Avatar
yeah. especially if i want to move more features to the textrender
22:08
like auto ellipsis, and proper centered multilines.
Avatar
If somebody is interested: https://github.com/axblk/teeworlds/tree/text_opt_vbo pretty stable, only the cache allocation isn't optimal (edited)
A retro multiplayer shooter. Contribute to axblk/teeworlds development by creating an account on GitHub.
Avatar
Are vertex buffers even legal in tw code? 😄
22:10
immediate mode gang
Avatar
This is also a cool idea, a text cache does indeed allow minimal modification to code outside the text renderer
22:13
@redix how did you end up looking for things in the cache? a hashmap?
Avatar
i just about to ask does that means you need to do string cmp for every frame?
Avatar
Many string cmps for every frame I'd guess
Avatar
maybe introduce a static flag and skip checking changes as well for ui's and such.
Avatar
It's just a list of the draw commands. It saves all text in one component to one big vbo. If the order changed it has to recreate the vbo or at least update everything after the change. Still way cheaper than generating all data each frame (edited)
Avatar
but how do you know if the text changed and you need to upload a new vbo?
Avatar
^^ I guess we think alike 😄
Avatar
compare text and cursor 😄
Avatar
So you compare all text on screen, every frame to the cached version and it's still performing better then the immediate mode text we do?
Avatar
way better
Avatar
That speaks to how awful immediate mode has gotten
Avatar
basically halves my cpu usage
22:19
or increases fps by 80% on my gpu
Avatar
maybe we can combine both? i do plan to rewrite the textrendering since the old one does a lot of back and forth to find words and new line.
22:19
i can probably do it in two passes. (edited)
Avatar
that's my plan 😄 finish your stuff then i'll try to adapt my approach
Avatar
How many vertex buffers can we have?
Avatar
and use a static flag on the cursor. if the text are expected not to change we use vbo.
Avatar
can vbo move position? like you cached a line of chat now it need to move up a line
Avatar
the backend has a limit. I used same as for textures
22:21
in chat i would rather re-render it
22:22
but for scrollregions and such stuff i'm using opengl matrices to move stuff
Avatar
Why? We could translate it up
Avatar
right now i'm batching the whole chat to one draw call
Avatar
you can only change position and stuff for one call
Avatar
Oh, let's generate an index of every localized string in tw, that would be even cheaper
Avatar
probably not those with variables
22:26
but if we can reuse the quads by just setting a flag i guess theres no need to specifically do anything about the localized strings.
Avatar
Anyway, I require sleep. Have fun optimizing 👋
Avatar
ghosty happy dreaming
Exported 103 message(s)