IRC logs of Freenode #BZFlag for Tuesday, 2020-09-15

ZehraArena CTF released to the public: https://forums.bzflag.org/viewtopic.php?f=79&t=2045000:31
*** User49 <User49!~User49@unaffiliated/user49> has joined #bzflag00:40
*** FieldSobers <FieldSobers!~User49@unaffiliated/user49> has quit IRC (Read error: Connection reset by peer)00:41
allejoZehra: there's bzu_getTeamFromFlag from plugin_utils.h00:51
allejoand bz_eTeamType is an enum, so you can do comparisons like `cappedTeam >= eRedTeam && cappedTeam <= ePurpleTeam` iirc00:52
allejoor just use an std::map<bz_eTeamType, bool> for keeping track if flags for a team have been touched00:54
allejothen you can just do `grabStatus[eRedTeam]`00:54
ZehraThanks allejo. I noticed bzu_getTeamFromFlag, although requiring another header for a single function seemed a bit excessive.00:58
Zehra(For me.)00:59
*** spldart is now known as short_circuit00:59
*** ChanServ sets mode: -v short_circuit00:59
ZehraI also forget that bz_eTeamType is an enumeration. (And RogueTeam being at zero would have affected calculations by being off by 1.)01:00
allejoit's a header, it'd be optimized out at compile time if that's what you're worried about but whatevs01:01
ZehraThat's good, some of the earlier compilers didn't do so well and didn't properly optimize the code as expected. :)01:05
blast007like.. back in the 70's?01:06
*** _I_Died_Once <_I_Died_Once!~I_Died_On@unaffiliated/idiedonce/x-1828535> has joined #bzflag01:06
ZehraWell, comparing binary size, a megabyte in difference for a single change based on C or C++ style is a lot.01:07
ZehraOr included headers.01:08
*** I_Died_Once <I_Died_Once!~I_Died_On@unaffiliated/idiedonce/x-1828535> has quit IRC (Ping timeout: 244 seconds)01:09
blast007your plugin is larger than 1MB?01:09
Zehra18 kilobytes.01:09
blast007what are you referring to then?01:10
ZehraSame output programs, but one in C and the other in C++, binary size of compile being over a megabyte in difference.01:11
ZehraEven though the exact same thing, only difference being code style and functions used.01:11
ZehraI'm sort of getting off topic though.01:12
JeffM[m]That’s the runtime01:21
JeffM[m]And did you compare release builds or debug?01:23
ZehraI'm not sure. (In both cases.[For plugin and/or program.])01:24
allejohmm with SAMPLE_PLUGIN, including the header file makes no difference. however linking to plugin_utils is 911K. w/o linking plugin_utils 35K01:25
Zehra^01:25
JeffM[m]Does it have static runtimes?01:28
*** bertman <bertman!~bert@c-69-254-102-169.hsd1.tn.comcast.net> has joined #bzflag01:29
ZehraNo clue.01:29
ZehraAlso in reference to program or SAMPLE_PLUGIN?01:32
JeffM[m]The lib for untill01:32
JeffM[m]Utils01:32
allejohow'd you check that?01:36
JeffM[m]Linker options on the lib when it’s built01:37
allejonot seeing any flags on plugin_util's makefile other than -avoid-version01:42
JeffM[m]Then it’ll depend on what the compiler does by default, how big is the static lib?01:44
JeffM[m]My guess is the linker isn’t optimizing dead code01:44
JeffM[m]Try adding the utils cpp files to the plugin directly, it’ll then optimize the entire thing01:45
JeffM[m]There may be a “hole program optimization “ option01:45
JeffM[m]I know how to do it in Windows, not gcc01:45
allejostatic lib would be libplugin_utils.a, right? if so, 2M01:47
JeffM[m]Wow01:47
allejoI genuinely thought plugin_utils was including curl for the URL encoding/decoding functionality, however it's not being used there. so not sure where that size is coming from01:53
JeffM[m]Yeah that seem big01:55
BZNotifybzflag: allejo opened issue #263 "plugin_utils lib size seems too large" (https://git.io/JU4re)02:06
BZNotifybzflag: allejo labeled issue #263 as needs triage 02:06
BZNotifybzflag: allejo labeled issue #263 as needs more info 02:06
blast0074.6M Sep 14 21:06 libplugin_utils.a02:08
blast007(that's a release build)02:08
JeffM[m]Dammmmmmmmmmnnnnnn02:09
FusionDudeso ... static libs and shared libs are treated completely differently by the linker02:12
*** FusionDude is now known as Flash02:12
blast007the .a is an ar archive, which contains the four plugin_*.o files, which seem to not be stripped and have debug info, even though I'm not building debug02:12
Flasha static lib that is 2M might contribute a tiny 1K bit to the program02:13
Flashyes; think of a .a as like a zipped file of .o files. Only the .o files that are needed are pulled out of the library at link time02:13
Flashcompared to a shared library, where the entire library is mmap'd into memory at run time (but only 1 copy for all users of the lib)02:14
JeffM[m]Yeah it should only link in what is used02:15
blast007should those .o files be stripped?02:15
Flashthat's a good question; I don't know. I know it needs enough symbol information to resolve link dependencies at runtime, but I haven't really dealt with stripping02:16
allejoah yea, plugin_utils.o is coming in at ~752K for me which would explain the jump from 35K to 911K02:16
Flashyeah, so one symbol from that .o and you get the whole thing02:16
Flashif size is a huge concern, you can break it up into multiple compilation units02:17
blast007looks like none of our .o files are stripped02:17
FlashI thought stripping happened to executables, after linking?02:18
blast007bzflag: ELF 64-bit LSB pie executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=cccc5e925229de1eadd5221153e44ab9727bc397, with debug_info, not stripped02:18
blast007so I feel like something is just very wrong...02:19
blast007my bzflag binary is 91MB  :)02:19
Flashis that a release build?02:20
blast007all I did was ./configure, no arguments, so it *should* be02:20
Flashhmmm02:20
blast007rebuilding an older version here just for a sanity check...02:22
blast007well what the heck...02:26
*** _I_Died_Once <_I_Died_Once!~I_Died_On@unaffiliated/idiedonce/x-1828535> has quit IRC (Ping timeout: 240 seconds)02:26
allejoplease tell me that latest 2.4 *is* the "optimized" version and it was larger in an older build02:26
*** bboles <bboles!~quassel@2602:fe90:604:1b::52f2:f9b3> has quit IRC (Quit: No Ping reply in 180 seconds.)02:27
blast0072.4.12 is what I tried, and that also resulted in a non-stripped bzflag binary (weighing it at 77MB)02:27
*** bboles <bboles!~quassel@2602:fe90:604:1b::52f2:f9b3> has joined #bzflag02:29
Flashlooks to me that a straight build puts "-g -O2" in the flags02:30
FlashI have the Mac version of 2.4.20 and BZFlag is 3.7M02:32
Flashbut XCode doesn't use configure02:32
*** Zehra <Zehra!~Keiki_Han@unaffiliated/zehra> has quit IRC (Quit: Quit)02:33
JeffM[m]why didn't you go with premake again?02:33
blast007the beta version that isn't packaged in most linux distributions?02:34
JeffM[m]so?02:34
JeffM[m]include a premade preamake makefile :)02:34
allejothis is the 2.4 branch. premake is used in the 2.5-dev branch, no?02:34
blast007premake is available in the master version and used for macOS02:35
BZNotifybzflag: jwmelto commented on issue #263 "plugin_utils lib size seems too large" by allejo (https://git.io/JU4og): `.so` is fundamentally different from `.a`. It's generally not a go...03:12
FlashJeffM[m]: by the way, good to see you; you haven't been around much03:13
JeffM[m]I have had my ways of seeing what is going on03:14
Flashlol ... lurkers-r-us03:14
JeffM[m]the riot thing makes it easy03:15
BZNotifybzflag: allejo closed pull request #262 "updated readme to reflect current plugin" by Zehra (https://git.io/JUCTp)03:52
BZNotify2.4 @ bzflag: allejo pushed 2 commits (https://git.io/JU4KR):03:52
BZNotify2.4 @ bzflag: Zehra bb6b7b: updated readme to reflect current plugin (https://git.io/JU4K0)03:52
BZNotify2.4 @ bzflag: allejo ef1c75: Merge pull request #262 from Zehra/shockwave-docs (https://git.io/JU4KE)03:52
BZNotifybzflag: allejo edited pull request #262 "updated shockwaveDeath readme to remove nonexistent BZDB var" by Zehra (https://git.io/JUCTp)03:53
BulletCatcherI recommend stripping a .o file once so you learn why not to do it ever again. ;-)04:12
Flashthat sounds ominous :)04:12
BulletCatcherHint: run "nm file.o" on it before and after stripping.04:13
Flashas in, all symbols are gone and linking is impossible?04:32
BulletCatcheryup05:08
*** Sgeo_ <Sgeo_!~Sgeo@ool-18b982ad.dyn.optonline.net> has joined #bzflag05:17
*** Sgeo <Sgeo!~Sgeo@ool-18b982ad.dyn.optonline.net> has quit IRC (Ping timeout: 240 seconds)05:20
*** Sgeo_ <Sgeo_!~Sgeo@ool-18b982ad.dyn.optonline.net> has quit IRC (Read error: Connection reset by peer)07:01
*** bertman <bertman!~bert@c-69-254-102-169.hsd1.tn.comcast.net> has quit IRC (Quit: leaving)09:22
*** _I_Died_Once <_I_Died_Once!~I_Died_On@unaffiliated/idiedonce/x-1828535> has joined #bzflag09:31
*** I_Died_Once <I_Died_Once!~I_Died_On@unaffiliated/idiedonce/x-1828535> has joined #bzflag12:28
*** _I_Died_Once <_I_Died_Once!~I_Died_On@unaffiliated/idiedonce/x-1828535> has quit IRC (Ping timeout: 244 seconds)12:32
*** EvilJStoker <EvilJStoker!jstoker@unaffiliated/jstoker> has quit IRC (Ping timeout: 272 seconds)14:00
*** Sgeo <Sgeo!~Sgeo@ool-18b982ad.dyn.optonline.net> has joined #bzflag14:00
*** EvilJStoker <EvilJStoker!jstoker@unaffiliated/jstoker> has joined #bzflag14:07
macsformeI was able to fix DXJoystick on my joystick improvements branch so that it works on Windows now... still have to fix it on Linux14:42
macsformealthough I also discovered that on the Xbox One bluetooth controller (what may be the device that players are most likely to have and to use), the two triggers are actually treated as part of the Z axis, rather than as buttons... I’m not sure what to do with that14:45
macsformeit does work out of the box on other games... I wonder if they just set a certain actuation point on the axis that counts as a press... or if they use a different API entirely, that does generate button events for them14:47
*** _I_Died_Once <_I_Died_Once!~I_Died_On@unaffiliated/idiedonce/x-1828535> has joined #bzflag14:48
*** I_Died_Once <I_Died_Once!~I_Died_On@unaffiliated/idiedonce/x-1828535> has quit IRC (Ping timeout: 244 seconds)14:51
JeffM[m]Yeah the triggers are used as analog controlls for racing games, so they have to have more than "on and off".15:04
JeffM[m]XInput has a better interface to them.15:04
blast007macsforme: the Game Controller piece of SDL2 might work better for modern gamepads, since it's based around the Xbox 360 controller.15:08
blast007may still treat it the same way though.. I'd have to test15:09
JeffM[m]it probably maps to XInput on the backend too15:09
JeffM[m]I've seen a lot of APIs have seperate gamepad and joystick APIs because so many things emulate the xbox controller15:09
blast007we might not need the DXJoystick stuff anymore either.  I do have some changes somewhere that adds rumble/haptic feedback to SDLJoystick when using SDL215:10
blast007I think directional force feedback is pretty much dead these days15:10
JeffM[m]oh yeah15:11
JeffM[m]except maybe on fancy wheels15:11
JeffM[m]I still have one of those old sidewinder force feeback joysticks with directional feedback15:11
JeffM[m]has it's own power plug15:11
blast007:)15:11
JeffM[m]probably should get rid of it before I move15:12
blast007BulletCatcher: do you know if it's normal for automake/autoconf to keep debug symbols in the final .so files and executable binaries?  I do see that there's an 'install-strip' make target.15:14
BulletCatcherYes.  The point of a debug version is to have those symbols available to the debugger at runtime. :-)15:25
BulletCatcherYou can strip an executable and it will still run (but the debugger won't find any symbols).15:26
JeffM[m]would you not want to strip a release build?15:26
BulletCatcherIt depends on whether you expect end users to run a debugger on it.15:28
BulletCatcher"strip --strip-unneeded" can be used on a .so file to remove debugging symbols while preserving those needed for runtime linking.15:28
JeffM[m]I believe the previous discussion was about binary size, and thus assuming a minimal binary with no debug symbols.15:30
BulletCatcherTesting reveals that "strip --strip-unneeded" strips all symbols from BZFlag plugin .so files, so don't do that.15:45
BulletCatcherIt seems that the most reliable way to not have debug symbols in .so files is to not generate them in the first place.15:46
BulletCatcherI do that with "env ac_cv_prog_cc_g=no ac_cv_prog_cxx_g=no ./configure" to make configure think that the -g option is unsupported by the compiler.15:54
BulletCatcherOn Fedora, configuring with --enable-debug and compiling with -g adds roughly 50 megabytes of symbols to bzflag.16:07
blast007BulletCatcher: for me, it's adding -g when I *don't* have --enable-debug16:42
blast007so my release build 'bzflag' binary is like 92MB16:43
*** Agatha_ is now known as Agatha16:49
BulletCatcherMy version of gcc is 9.3.1.  What's yours?17:04
BulletCatcherNever mind.  I get a 95MB file when I use -g without --enable-debug.17:29
*** I_Died_Once <I_Died_Once!~I_Died_On@unaffiliated/idiedonce/x-1828535> has joined #bzflag17:29
*** _I_Died_Once <_I_Died_Once!~I_Died_On@unaffiliated/idiedonce/x-1828535> has quit IRC (Ping timeout: 244 seconds)17:32
blast007BulletCatcher: when you say "when I use -g", do you mean you're manually adding it?  I'm just doing ./autogen.sh && ./configure && make -j819:29
*** I_Died_Once <I_Died_Once!~I_Died_On@unaffiliated/idiedonce/x-1828535> has quit IRC (Read error: Connection reset by peer)19:34
blast007autoconf (GNU Autoconf) 2.69     automake (GNU automake) 1.15        gcc (Debian 6.3.0-18+deb9u1) 6.3.0 2017051619:39
blast007(Debian 9 system, but it was also doing the same on Debian 10)19:40
*** I_Died_Once <I_Died_Once!~I_Died_On@unaffiliated/idiedonce/x-1828535> has joined #bzflag20:36
*** _I_Died_Once <_I_Died_Once!~I_Died_On@unaffiliated/idiedonce/x-1828535> has joined #bzflag21:13
*** I_Died_Once <I_Died_Once!~I_Died_On@unaffiliated/idiedonce/x-1828535> has quit IRC (Ping timeout: 240 seconds)21:15
*** Zehra <Zehra!~Keiki_Han@unaffiliated/zehra> has joined #bzflag21:34
*** I_Died_Once <I_Died_Once!~I_Died_On@unaffiliated/idiedonce/x-1828535> has joined #bzflag21:50
*** _I_Died_Once <_I_Died_Once!~I_Died_On@unaffiliated/idiedonce/x-1828535> has quit IRC (Ping timeout: 244 seconds)21:52
*** _I_Died_Once <_I_Died_Once!~I_Died_On@unaffiliated/idiedonce/x-1828535> has joined #bzflag22:33
*** I_Died_Once <I_Died_Once!~I_Died_On@unaffiliated/idiedonce/x-1828535> has quit IRC (Ping timeout: 244 seconds)22:36
*** Juesto <Juesto!~LimeC@unaffiliated/juest> has quit IRC (Ping timeout: 264 seconds)22:36
blast007Debian 10: autoconf (GNU Autoconf) 2.69     automake (GNU automake) 1.16.1     gcc (Debian 8.3.0-6) 8.3.023:16
BulletCatcherNormally when I build BZflag I don't compile with -g (using the technique described above) and it produces about a 3 MB bzflag executable.23:30
BulletCatcherWhen I do ./autogen.sh && ./configure && make like any sensible person it gives me a 95 MB bzflag executable, roughly the same size as yours.23:32

Generated by irclog2html.py 2.17.3.dev0 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!