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-05-16 00:00:00Z and 2022-05-17 00:00:00Z
06:36
Teeworlds written in C++?
Avatar
ye sadly
Avatar
[quakenet] ChillerDragon BOT 2022-05-16 07:22:03Z
Teeworlds vanilla is written in a more C style and ddnet is slowly drifting to more and more modern C++
Avatar
Avatar
Ryozuki
ye sadly
💀
Avatar
progress in ryolang parsing
08:38
PepeA
08:39
fn myfunc(a, b) { return a * b; }
Avatar
Avatar
Ryozuki
progress in ryolang parsing
AST looks good. But as proverb says: create games, not engine. You are going with brand new language 😅
08:50
i dont want to create a game or engine
08:50
Don't Reinvent The Wheel, Unless You Plan on Learning More About Wheels
08:50
The introduction to Head First Design Patterns exhorts us not to reinvent the wheel: You're not alone. At any given moment, somewhere in the world someone struggles with the same software design problems you have. You know you don't want to reinvent the wheel (or worse, a flat tire), so
Avatar
[quakenet] ChillerDragon BOT 2022-05-16 10:15:59Z
Aaa did i brick my system? Or did ddnet link times just increase by a factor of 100
10:21
Hmm yea older commits link way faster. What changed :(
10:23
The main motivation is to reduce the size of binaries for release build (following #5074). The feature is not enabled by default because it increases the build time and the effect should be valued ...
10:26
Ah okay I see one just has to use debug builds for faster linking. I guess thats fair
Avatar
imho its not a worth change
10:51
i prefer faster linking
10:51
i dont test stuff on debug mode
Avatar
@Ryozuki you could PR disabling the slower linking for -DDEV=ON, if you want
Avatar
Avatar
Ryozuki
i prefer faster linking
Even if all the developers preferred faster linking we'd be in the minority, smaller executable is better for more people 😄
Avatar
Avatar
Learath2
Even if all the developers preferred faster linking we'd be in the minority, smaller executable is better for more people 😄
it literally isnt smaller
11:32
only the tools
11:33
and its just a few kb
11:33
its rly worthless
Avatar
[quakenet] ChillerDragon BOT 2022-05-16 11:36:15Z
smol ryo trying to argue that size doesn matter hrhrhrhr
11:37
I also usually dont test stuff in debug mode but just because im to lazy to type -DCMAKE_BUILD_TYPE=Debug maybe we can make that a default and then build times are fast by default
Avatar
it rly doesnt
11:38
not when talking about less then some mbs
11:39
the difference from debug to o1 is usually rly big
11:39
so i prefer testing in release
Avatar
I see 1.5 MB in total savings, if I count it correctly
Avatar
so nothing basicallu
Avatar
you don't like the solution with -DDEV=ON?
Avatar
imho it should be an opt in thing
11:41
always disabled otherwise
Avatar
the normal cmake build is intended for people packaging the stuff
Avatar
actually u shouldnt even need a custom option for it
Avatar
-DDEV=ON is when you're developing
Avatar
ye i use ddev
Avatar
we could disable that linking for -DDEV=ON
11:41
the slow one
Avatar
the correct way is to make -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON work
11:42
and not rely on custom options
11:42
its better for maintainers and custom makepkgs
Avatar
is that actually the intended way?
Avatar
Windows
>
Windows build time changed from 3:10 to 5:05
11:43
this is insane for a 1.5mb saving
11:43
xd
Avatar
no, not if you build once and distribute it to thousands of people
Avatar
Avatar
heinrich5991
is that actually the intended way?
im sure it is
Avatar
can you tell me why you think it is the way?
11:46
I could also imagine it being a way to override options if the project didn't care about them, e.g.
11:46
e.g. we add a lot of compiler warning options even though you could also pass them via CFLAGS=…
Avatar
well warnings usually are meant for developers, LTO, optimizations, IPO which can considerably increase built times i think they make more sense as env vars or explicit
Avatar
so your belief comes from your other belief that stuff that increases build times should be passed in via CMAKE_* variables
Avatar
ye i guess its personal taste
Avatar
ba8b833 Some ddnet-setup changes - def- a50ff01 Fix build-and-deploy macos steam dir - def-
Avatar
I have added -DDEV=ON disabling IPO in https://github.com/ddnet/ddnet/pull/5133 If this is not enough, we can always disable IPO by default and I only enable it for official builds, but my motivation was to not have so many magic settings that I set only for official release.
@Kaffeine Windows x86-64 with MinGW worked, previously: -rwxr-xr-x 1 deen deen 755K May 15 11:38 config_retrieve.exe* -rwxr-xr-x 1 deen deen 756K May 15 11:38 config_store.exe* -rwxr-xr-x 1 deen de...
Avatar
Thats fine
Avatar
7eb3a78 Add HTTP masterserver registering and HTTP masterserver - heinrich5991 41f9818 mastersrv: Add 0.7 support and other stuff - heinrich5991 b03a8ae x - heinrich5991 7f80dbd Fix memleak of multiply chained console commands - heinrich5991 9ce1a20 bb - heinrich5991 fb0f051 Cut some dependencies - heinrich5991 82afa0d among others: make info serial a number - heinrich5991 28083d1 more - heinrich5991 01f57df more - heinrich5991 e46a5d4 fix ipv6 - heinrich5991 5678d32 kill the whole process if a task fails - heinrich5991 d7d50c4 send non-info fields via http headers - heinrich5991 a73ef22 Make dbg_curl 1 use the normal logging - heinrich5991 297d0cc Don't resend server info the masterserver already knows - heinrich5991 319ce10 Make server info buffer size large enough - heinrich5991 5e85926 Make mastersrv restartable without losing a lot of data - heinrich5991 5549ccc Separate challenge token, add register extra fields again and handle Content-Type - heinrich5991 222fe1d Remove backward compatibility in mastersrv - heinrich5991 c082a84 Add crude port forward error message in the style of the old one - heinrich5991
poggers 1
Avatar
Other opinions to my physics changes in https://github.com/ddnet/ddnet/pull/5063 ? (edited)
Fixes #3622, #4723 #4798 and #5054 Here you can find a comparison video with 16.0.3: https://youtu.be/bYwLB1cEMI8 This now also includes the changes from #4980 So please also see my monologue here:...
Avatar
I updated the twmap tools and wan't to get the discordbot up to date again especially to have the 2 new ddnet-specific checks:
  • Checking tiles for tile ids that are unused/not defined yet (already has the weapon shields as valid)
  • Checking teleporters for ones that use the number 0
Note:
14:51
70083ee Update twmap tools - Patiga c947152 Merge pull request #30 from Patiga/update-twmap-tools - def-
15:23
Why I no longer recommend Julia
Avatar
part 7 weapon finals pretty sure this is a bug. (edited)
Avatar
seems intended
16:55
its on all edges
Avatar
Avatar
c0d3d3v
seems intended
come on again
16:56
its stuck
Avatar
intended code-wise, not map-wise
16:56
maybe easiest to fix the map
Avatar
no I mean the map xD
Avatar
just put a tele in that spot?
Avatar
Avatar
deen
just put a tele in that spot?
just change direction of the arrow
Avatar
I think @Chrona placed it there to make the part harder (edited)
Avatar
@Chrona can you maybe change the direction of all arrows? hes on a magical edge stuck
16:58
hes not bein pushed into the tp (edited)
Avatar
Avatar
c0d3d3v
I think @Chrona placed it there to make the part harder (edited)
I was wrong xD It should make the part easier... Starkiller showed me the bug xD
17:04
normaly you would be moved by the arrow to the tele
17:04
but somehow there is a sweet spot so that you do not get moved
17:06
ah it is the corner bug
17:06
you get stuck in the corner... Chrona should probably invert the arrow directions
👍 2
Avatar
@deen continuing the templates topic. Now we have a lot of snapping done like: CNetObj_GameInfo *pGameInfoObj = (CNetObj_GameInfo *)Server()->SnapNewItem(NETOBJTYPE_GAMEINFO, 0, sizeof(CNetObj_GameInfo)); But it makes no sense to repeat CNetObj_GameInfo three times and use the only correct NETOBJTYPE. With one line for codegen and for lines for engine/server.h: --- datasrc/datatypes.py +++ datasrc/datatypes.py @@ -218,6 +218,7 @@ class NetObject: . . . lines = ["struct %s : public %s"%(self.struct_name,self.base_struct_name), "{"] . . else: . . . lines = ["struct %s"%self.struct_name, "{"] +. . lines += ["\tstatic const int ObjectType = %s;" % self.enum_name] . . for v in self.variables: . . . lines += ["\t"+line for line in v.emit_declaration()] . . lines += ["};"] --- src/engine/server.h +++ src/engine/server.h @@ -279,6 +279,13 @@ public: . virtual void SnapFreeID(int ID) = 0; . virtual void *SnapNewItem(int Type, int ID, int Size) = 0; +. template <typename T> +. T *SnapNewItem(int ID) +. { +. . int Type = T::ObjectType; +. . (T *)SnapNewItem(Type, ID, sizeof(T)); +. } we can turn messes into a nice and clear code: CNetObj_Character *pCharacter = static_cast<CNetObj_Character *>(Server()->SnapNewItem(NETOBJTYPE_CHARACTER, ID, sizeof(CNetObj_Character))); CNetObj_Character *pCharacter = Server()->SnapNewItem<CNetObj_Character>(ID); // or even auto *pCharacter = Server()->SnapNewItem<CNetObj_Character>(ID); Deal? 😄 If yes, then I'll try to come up with a PR when I'll have time. (edited)
Avatar
static const int maybe a constexpr just to make sure ?
17:20
Overall I like the idea, but @heinrich5991 doesn't like metaprogramming in c++, sooo you'll just have to PR and see who wins 😄
Avatar
looks okay to me, no metaprogramming involved (edited)
Avatar
Avatar
Learath2
static const int maybe a constexpr just to make sure ?
Yeah, better yet. And I see that we'll need at least one more line for protocol7 but it's not a big deal.
Avatar
maybe don't overload the function name
Avatar
protocol7 objects are tagged if you need to know whether something is for sixup
Avatar
Avatar
heinrich5991
looks okay to me, no metaprogramming involved (edited)
I also do not like complex templates but those are small and easy to read.
17:23
Ok then! 👍 . I'll do PR eventually. And I'm fine with any name for that method (maybe SnapNewObject() or something like that; it will be easy to rename during CR).
Avatar
i like auto *pCharacter = Server()->SnapNewItem<CNetObj_Character>(ID);
17:27
looks clean
17:27
as c++ can get
17:27
xd
17:27
CNetObj_Character *pCharacter = Server()->SnapNewItem(ID);
17:27
is this possible btw?
17:27
can it infer the type
17:27
like rust?
17:27
xd
Avatar
Not the return type methinks
Avatar
I also would like to hear @Robyt3#2709 opinion from the teeworlds refactoring perspective. Would that interfere with your changes or maybe I should send PR to teeworlds first?
Avatar
@Robyt3
Avatar
imho it would be even better if int ID was a new type
17:33
and not just int
17:33
and u can somehow know it is a NETOBJTYPE_ enum
17:34
since netobjtype is not a enum used as a flag i think its fairly trivial
17:34
just make it non anonymous
Avatar
that somehow goes against the design though, engine shouldn't know anything about game
17:36
one could reexport the engine functions in game code with the correct type though
Avatar
I would love to have named enum classes here but it is too big change for the project. 🙂 Also you're messing up ID and Type. Type is a value from NETOBJTYPE_ anonymous enum. ID is an integer with this_type instance number. E.g. for CNetObj_Laser valid IDs in the mod I'm maintaining can reach hundreds.
Avatar
(assuming you refer to int Type)
Avatar
ah i guess i mixed them ye
Avatar
int Type is now hidden / not needed for this SnapNewObject().
Avatar
Avatar
Kaffeine
@deen continuing the templates topic. Now we have a lot of snapping done like: CNetObj_GameInfo *pGameInfoObj = (CNetObj_GameInfo *)Server()->SnapNewItem(NETOBJTYPE_GAMEINFO, 0, sizeof(CNetObj_GameInfo)); But it makes no sense to repeat CNetObj_GameInfo three times and use the only correct NETOBJTYPE. With one line for codegen and for lines for engine/server.h: --- datasrc/datatypes.py +++ datasrc/datatypes.py @@ -218,6 +218,7 @@ class NetObject: . . . lines = ["struct %s : public %s"%(self.struct_name,self.base_struct_name), "{"] . . else: . . . lines = ["struct %s"%self.struct_name, "{"] +. . lines += ["\tstatic const int ObjectType = %s;" % self.enum_name] . . for v in self.variables: . . . lines += ["\t"+line for line in v.emit_declaration()] . . lines += ["};"] --- src/engine/server.h +++ src/engine/server.h @@ -279,6 +279,13 @@ public: . virtual void SnapFreeID(int ID) = 0; . virtual void *SnapNewItem(int Type, int ID, int Size) = 0; +. template <typename T> +. T *SnapNewItem(int ID) +. { +. . int Type = T::ObjectType; +. . (T *)SnapNewItem(Type, ID, sizeof(T)); +. } we can turn messes into a nice and clear code: CNetObj_Character *pCharacter = static_cast<CNetObj_Character *>(Server()->SnapNewItem(NETOBJTYPE_CHARACTER, ID, sizeof(CNetObj_Character))); CNetObj_Character *pCharacter = Server()->SnapNewItem<CNetObj_Character>(ID); // or even auto *pCharacter = Server()->SnapNewItem<CNetObj_Character>(ID); Deal? 😄 If yes, then I'll try to come up with a PR when I'll have time. (edited)
I like it, although auto is C++11 so it can't be used on vanilla yet. I don't have any major changes that this would interfere with.
Avatar
vanilla is not c++11 yet?
17:38
monkaS
Avatar
I actually built https masters on top of ddnet instead of teeworlds because of this
17:39
c++98 was too annoying to work with to port https client code from ddnet to teeworlds
17:40
c++11 is now older than c++98 was when teeworlds was started
Avatar
Avatar
heinrich5991
that somehow goes against the design though, engine shouldn't know anything about game
protocol is a part of the game or engine? Engine message.h includes protocol.h which includes mapitems_ex.h which makes the engine depending on mapitems_ex.cpp which is a part of game. This ruined my attempt to clearly split engine and game libraries. 😕
Avatar
protocol is game
17:43
ah well. src/engine/protocol.h is engine, build/src/game/generated/protocol.h is game (edited)
Avatar
Thanks, I'll try to sort it out using this information. (edited)
Avatar
vanilla already mixes up game and engine in IMap, as this depends on the mapitems
Avatar
due to my misguided attempt at compressing tile data?
Avatar
yeah, it's that transparency layer in IMap that does the uncompression
Avatar
maybe that could be dropped for 0.8 again? and use proper compression like zstd or so
Avatar
or the map interface has to be moved to the game
17:48
I like the IMap because all the validation can be centralised there
17:49
but switching to json map format with compressed and base64 encoded layers would make a lot of validation easier
17:49
how much more would size increase with json
17:49
or maybe bson?
17:49
or msgpack
Avatar
I would switch to .zip if I were to design a new format tbh
Avatar
i wonder if this exists in c++ https://github.com/bincode-org/bincode
Avatar
maybe json for some metadata
Avatar
yeah, zip with a manifest.json or something
Avatar
real zip, not gzip yeah
17:51
well i guess its the most portable one
17:52
it would be cool to have a new format that is properly documented and makes creating external tools easy
17:52
idk
Avatar
most importantly to me: a format that can be adjusted more easily later on
Avatar
yes, zip is really widely supported
Avatar
easily extended you mean?
Avatar
and you can open it with standard tools
17:54
widely supported
Avatar
being mod friendly would be nice
Avatar
and there's precedent: docx, odt, jar are all zips 😉
Avatar
it could be cool to discuss a format someday
Avatar
yeah, adding a new field to CTile would be easy with json but very hard with a binary format
Avatar
Avatar
heinrich5991
and there's precedent: docx, odt, jar are all zips 😉
really useful to extract all images from docx files
Avatar
or from a map file 😉
Avatar
does zip use only 1 compression algorithm?
17:56
or u can choose
17:56
neverrly looked at it
17:56
i like this one tho https://www.7-zip.org/7z.html
Avatar
zip can only use our current compression algorithm, I think
17:57
unfortunately
Avatar
Avatar
Ryozuki
imho it would be even better if int ID was a new type
ID is a 16bit integer to be precise
Avatar
Avatar
heinrich5991
c++11 is now older than c++98 was when teeworlds was started
wait isn't vanilla C++03?
Avatar
ah, don't know the difference between '03 and '98
Avatar
Run scripts/fix_style.py --dry-run src/game/client/gameclient.cpp:725:86: error: code should be clang-formatted [-Wclang-format-violations] m_multiplierMultiView = MapValue(maxCameraDist, minCameraDist, maxVel, minVel, tmp); ^ Error: Process completed with exit code 1. Someone knows what the f problem is here? apart from naming conventions (edited)
Avatar
don't dry run and see how it modifies it
🧠 1
19:03
so, what was it?
Avatar
idk the pipeline did the check so i have to see first how i start this python thing on my system, didnt do anything in python yet x)
Avatar
just run python3 scripts/fix_style
Avatar
yea but it says "Found no clang-format 10" so i have to tell it somehow that the clang format is in another dir
19:07
or just move it, lets try that
Avatar
hum, add it to the PATH variable
19:07
or you can PATH=/path/to/clang/format/10 python3 scripts/fix_style.py
19:13
the suspense is killing me now 😄
19:13
becuase i don't see what's wrong with your formatting
Avatar
i am trying!! xd
19:13
i will drop the answer here when i got it (edited)
Avatar
are you on windows?
Avatar
ah that's why
19:15
i've never run it on windows
19:17
im not sure you can
19:17
you would need to install the full llvm suite i guess, but that's quite big
19:18
https://github.com/llvm/llvm-project/releases/tag/llvmorg-14.0.0 and i can't find clang-tools for windows there
Avatar
you also need clang-format 10 specifically, it doesn't work with newer versions
Avatar
maybe you can try this: https://prereleases.llvm.org/win-snapshots/LLVM-12.0.0-6923b0a7-win64.exe, it includes clang-format, not sure which version
19:19
it dates from august 2020
Avatar
i can try
19:20
wait
19:20
last page says visual studio supports clang-format
19:20
do you use visual studio as compiler?
Avatar
just ping me and i can clang-format the code, no need to worry about setting it up on windows
19:34
Thanks i almost slam my desk because the plugin chairn send only works until vs 2019 and i have 2022
Avatar
i think he meant clang-format on a PR
Avatar
@Vy0x2 I think deen is saying you can just PR it like that and he'll fix it up
Avatar
too slow heinrich 🙂
Avatar
oooh sry missunderstood that
Avatar
i got a new job
19:41
i think now ill be even less active here feelsbadman
Avatar
is it blockchain though 😛 (edited)
Avatar
not rust related
Avatar
what is it?
Avatar
its about PKI stuff tho
19:43
a legal certificate issuer in spain i think
Avatar
oh
19:43
what are you going to do there? 🙂
Avatar
develop apis and stuff
19:44
xD
19:44
mostly python
Avatar
py3? ^^
Avatar
yeah xD
19:45
python 2 justatest
Avatar
idk, if it's some gov agency ^^
Avatar
here usually the gov doesnt hire devs directly
19:45
they just hire private companies
19:46
atleast usually
Avatar
can you work for the federal government if you support catalonia independence?
Avatar
there is no federal goverment here
Avatar
@Discord Mod ^
Avatar
but yes
19:47
you can work for the local autonomy goverment
Avatar
isn't spain a federation?
Avatar
no lol
19:48
i wish
Avatar
but local region have great autonomy though
19:50
i wish
Avatar
would be great if we would not only predicate the air-jump event but send the actual event from the server to the client, like the ground jump only with particles.
Avatar
they are slowly killing the catalan language
19:50
well i dont want to talk about politics rn
Avatar
Chairn i am about to delete my messages 😐
19:52
feelsbadman
19:52
i have auto trim whitespace on save on all editors
Avatar
i got it working on my linux laptop in 2min
Avatar
linux master race
brownbear 1
19:55
don't forget to change visual studio option for this 😄
Avatar
oh there is one? i like that being told NOW
Avatar
that's a classic one
19:57
editor.trimAutoWhitespace (edited)
Avatar
clang-format is successful 😍 I will check it out, i always was busy finding those white spaces
19:58
clicking in every line to see if there is something monkalaugh
Avatar
ouch
Avatar
you also have files.trimTrailingWhitespace
❤️ 1
19:59
or with sed: s/\s*$//g
20:00
damn, faster than light heinrich
Avatar
it was me even after this embarrassment :D
Avatar
there's a bot invasion or?
Avatar
on matrix
Avatar
i don't even have time to read them
Avatar
nooo my ez $70000
20:03
they're gone
Avatar
Avatar
Vy0x2
Chairn i am about to delete my messages 😐
that variable naming looks wrong
Avatar
yea sorry pepeH
Avatar
This article aims to introduce you into DDNet development, since it's an open-source game, it relies on random people kind enough to contribute to it on their free time.
Avatar
which one are you gonna be :D?
Avatar
i made it some time ago
Avatar
Thanks i already said here that the naming convention is off, so i already know but i am too lazy to fix it because i dont want to contribute it either
Avatar
Avatar
Chairn
which one are you gonna be :D?
xD
Avatar
This is to keep the reports channel clean and have a report example as first message, since people have a hard time reading channel headers and pins. Not sure if this will have the desired affect, only time will tell. Logs deleted/edited messages in reports to a seperate channel for easier lookups & Auto-remove reports when:
  • checkmark is added
  • certain period has passed to keep the channel clean
  • message doesn't contain a @Moderator (User gets notified via DM)
Avatar
i like how based is international
20:37
"basé"
20:37
in catalan i have seen it too
20:37
"basat"
20:37
xdd
Avatar
well, latin roots
Avatar
i was surprised to see belgium/french comics used in memes recently
22:39
755c260 Add HUD Sprites, LoadHudSkin() and HUD Assets Tab - C0D3D3V 53e1218 Return the quad offset of the first added quad, when adding new quads - Jupeyy a0164df Small cleanup of HUD + comment on distance calculation at sound - C0D3D3V b23811b show local available and used jumps, in spec only available jumps - C0D3D3V 7abeaf0 Preparations for the new HUD - C0D3D3V 5ac46f9 Many new indicators have been added to the HUD - C0D3D3V 320e9e0 Rename Read() function to avoid equal naming - C0D3D3V 3957a74 move m_Ninja in Character Core - C0D3D3V de750e8 display ninja Bar - C0D3D3V b942b7a Show weapon no hit only if the tee got the weapon - C0D3D3V 63d4591 Make Ninja Bar Smooth - C0D3D3V 78a0a3d add deep and live frozen display - C0D3D3V b403f47 Add Freeze Bar - C0D3D3V e71578e Add DDNetCharacterDisplayInfo NetObj - C0D3D3V 09bd106 increase height of freeze bar - C0D3D3V a4b6558 load CNetObj_DDNetCharacterDisplayInfo into CCharacter - C0D3D3V 670da66 add vertical ninja bar - C0D3D3V 6159b18 use QuadsSetSubsetFree also for freeze bar - C0D3D3V ef468e8 remove constant scaling factors and constant y offset - C0D3D3V 940047f Add Practice Mode Symbol next to the timer - C0D3D3V be75b80 Render Dummy Actions on the right side of the screen - C0D3D3V a9c8b34 Player position, speed and angle can now be displayed in the HUD. - C0D3D3V 9dc2141 remove shadow variables - C0D3D3V 0c4dfb6 Add Options for new HUD - C0D3D3V fa2ac1b Merge branch 'master' into New_HUD - C0D3D3V 796b2ad Fix Weapon Shields rendering and Clean up Sprite Offsets in items.cpp - C0D3D3V d6833b6 fix jump display - C0D3D3V 47874fb Merge #5085 - bors[bot]
Exported 290 message(s)