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-04-18 00:00:00Z and 2021-04-19 00:00:00Z
00:15
não tem nenhum br não
00:16
tee_thinking
Avatar
4c3782a A DoomWorld II, R Exanimus - ddnet-maps
Avatar
ᶰ°Konͧsti 2021-04-18 04:35:18Z
Where to find the .teeworlds thing on windows
Avatar
go windows search bottom left
04:57
type in %appdata%
04:57
then Teeworlds
Avatar
The TARGET_OS variable wasn't set to "haiku", which caused issues.

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
  • [x] 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...
Avatar
yay haiku support
Avatar
6058019 Fixed library dependencies for the Haiku operating system - panos 180ae57 Merge #3782 - bors[bot]
Avatar
[freenode] chillerdragon[m] BOT 2021-04-18 11:22:27Z
i wish there was a more obvious word to describe the .teeworlds thing :D
Avatar
Config directory
Avatar
I was feeling particularly nostalgic for the days of Geocities and floppy disks, so my new homepage is all the best bits of that idealized past.
12:11
holy shit
Avatar
  • Haiku is Unix-like, but it still doesn't use libnotify.
  • Haiku comes with its own sets of definitions for certain long variables. There's still a problem revolving around the variables, but I removed a duplicate, conflicting definition on the Haiku platform.
  • Changed some definition-related logic in detect.h, because the gcc compiler in Haiku (version 8.3.0) complained about duplicate definitions. I chose to use 'unknown' rather than an empty string.
I think that I'm very close.
Avatar
[freenode] AlwaysLivid BOT 2021-04-18 12:24:29Z
I was on here around October the 3rd, according to my logs. The Haiku port is very close to being complete, but I literally have no idea how to resolve the last (hopefully) outstanding issue.
Avatar
what is it?
Avatar
[freenode] AlwaysLivid BOT 2021-04-18 13:38:55Z
Dunno, some lvalue/rvalue thing, seems to be a bug on the operating system-level.
Avatar
sounds like a debugger might help
Avatar
[freenode] AlwaysLivid BOT 2021-04-18 13:41:00Z
I just got word that it builds...
13:46
It may be building on 32-bit and working, but it doesn't on 64-bit because of a for i loop utilizing a long long variable under src/game/client/components/chat.cpp
Avatar
[freenode] AlwaysLivid BOT 2021-04-18 14:02:04Z
Teeworlds builds successfully on Haiku (although it shows a black screen right now, which is being discussed as we speak), but I'm not sure what's happening here.
Avatar
maybe just make it an int64 or something like that
Avatar
[freenode] AlwaysLivid BOT 2021-04-18 14:12:06Z
That should probably work. Should I make it an int64 on Haiku only, or should that affect all platforms?
Avatar
all platforms
14:12
the fewer #ifdef HAIKU the better
Avatar
[freenode] AlwaysLivid BOT 2021-04-18 14:12:40Z
seems fair!
14:12
Thanks for that.
14:14
Oh, I see why the variable is long long.
14:14
m_aLastSoundPlayed[CHAT_NUM] is defined as int64.
Avatar
f14401d Add points video by Eki - def-
Avatar
[freenode] chillerdragon[m] BOT 2021-04-18 15:24:21Z
@Deleted User yea true that term is there but it doesnt seem well established i feel like the average tw player does not know what a Config Directory is even tho he knows %APPDATA%\Teeworlds
Avatar
Of course our diskcache on ddnet.tw is pickled with python2
16:24
because for once if something worked on the first try we'd have to deal with the 4 horseman of the apocalypse
16:29
and ofc there is no asyncpg for python2.7
16:30
@jao please tell me how you got this thing to work with a cache with entries pickled in py2?
16:31
I'll patch diskcache to load with a different encoding...
Avatar
maybe i used py2 😄
16:39
don’t remember
Avatar
there is no asyncpg for py3, how would you even use it
16:40
man why did we use python for implementing anything 😦 I wish we did the infrastructure for ddnet in nim or sth else that is not python
Avatar
does the file have asyncpg?
16:41
the file that doesnt work is separate from the normal bot
Avatar
ah, you changed it so you insert it to the db somewhere else I guess
16:46
man I wasted 4 days on this and I still didn't even reproduce the damn bug
16:46
I'm just hitting python with a hammer until it works
Avatar
did i try the file i sent u?
16:49
its not the one on github
Avatar
yeah, I'm using that, with python2 it loads the cache just fine but I get a TypeError: 'Player' object is not iterable
16:56
Finally...
16:56
god
16:56
now it won't happen on my computer because I have 32g of ram
16:57
as expected works perfectly fine on my computer...
Avatar
okay I can get it to run out of memory with ulimit -Sv 200000 I think we should just run this on a server with more memory, but I'll try to see what can be done
17:06
can't even debug it with a ulimit that low because python2 is as production ready as my toy language
17:10
@jao okay, try json.dump(out, f) instead of f.write(json.dumps(out))
17:10
that lets me execute this with 250M of memory
Avatar
[freenode] AlwaysLivid BOT 2021-04-18 17:52:46Z
Question: Does m_LastChatSend (in chat.cpp) stand for Unix time?
Avatar
ticks since map load
Avatar
[freenode] AlwaysLivid BOT 2021-04-18 17:56:41Z
... Hm. I get that I'll sound stingy, but could 32 bits work rather than 64?
Avatar
@Learath2 it works poggers
Avatar
@jao I can give you one more optimization that would cut another 200M
17:59
just so we have some more headroom
Avatar
use a chunked download for the cache file into a file https://gist.github.com/Learath2/4093e09d079210b8f677e41ace8a5659
GitHub Gist: instantly share code, notes, and snippets.
18:00
that instead of just doing resp = requests.get
Avatar
jao's hairy kebab 2021-04-18 18:01:33Z
does "download skins" work for skins i manually add to folder outside from database ?
Avatar
there is a lot more that can be done btw, I just hope this is enough, but we can also delete data early (I think a gc.collect() is needed afterwards)
18:01
@jao's hairy kebab no, download skins only gets skins from the database
18:03
oh btw I made cute graphs
18:03
This was the initial memory usage
18:04
this is after chunked downloads
18:04
this is with streaming the json dump
18:04
and this is a failed attempt at early del, I think this didn't work because I didn't gc.collect()
Avatar
i tried that too
Avatar
you delete way too late though we are technically done with data after the first loop
18:06
then you can iterate out['players'].keys() instead
18:08
In hindsight I should have fixed the y axis of these plots so the reduction was more obvious...
18:08
you live and you learn
18:09
maybe plot them all on the same graph even...
Avatar
fwiw with both files predownloaded I could run it within 250M, this plot is with unlimited memory so aggressive GC never really kicked in
18:20
@deen btw if you weren't going to cache them at all, why did you download skins into config_directory? We could have downloaded them to some temporary storage
Avatar
[freenode] chillerdragon[m] BOT 2021-04-18 18:24:58Z
AlwaysLivid: so you want to run ddnet on a system without 64 bit variables? I assume the chat thing will be your least problematic code. int64 is all over the place. I think the team masks depend on 64 bits for 64 players. But there are also win32 builds arent there? So it should work somehow but idk
Avatar
[freenode] AlwaysLivid BOT 2021-04-18 18:25:20Z
no, the system has full support for 64 bit variables.
18:25
it's unix-like, even supertuxkart can run on it for example
18:26
it's the "storing 32-bit integers in 64-bit variables because this is an array" thing that I'm worried about considering that long long seems to be out of the question for the time being, so I'm cutting edges.
18:28
nobody has any idea why the operating system's definitions that ddnet manually defines for two variables aren't, like, working as it should, and i can't seem to be able to easily reproduce this in order to file a bug report on the system and leave the codebase here unaffected
Avatar
isnt it just bcs int64 can e.g. be defined as signed long, while long long is a complete different type
18:36
imo chat.cpp should just be updated to use "auto" or int64 directly
18:36
(even if both are 64bit)
Avatar
also ddnet should get away from system.h as much as possible and use c standard really
Avatar
[freenode] AlwaysLivid BOT 2021-04-18 19:27:20Z
ddnet is fine for using long long
Avatar
it's just that one of the systems that i'm trying to get ddnet to work on seem to not deal with it very nicely (which is weird, because i can name other examples where it does)
Avatar
well thought bcs u said lvalue and rvalue
19:33
sounded like bcs of type mismatch
19:33
i still think it shouldnt use int64, since that define exists in some header
Avatar
if it works fine on other systems and it doesn't on haiku
19:33
then it's likely on haiku
19:33
but the weird thing is that the exact opposite scenario could also apply
19:34
if long long has worked with other ported software but it hasn't with haiku, it could be because of ddnet
Avatar
I prefer int64 as it's more human readable if stdint is included ^^
Avatar
int64_t
19:42
is just as good imo xd
Avatar
yeah, i meant int64_t
19:43
i always use stdint in all my code file so that i never do stupid mistakes with wrongly sized integers
Avatar
yeah i prefer it too 😄
19:56
it's actually not best practice to use fixed-width integers if you don't need them
Avatar
its the most defined behaviour so why not
Avatar
i don't get why? The size is given by the programmer for a specific purpose, so it better not be smaller than expected
Avatar
Avatar
Deleted User
its the most defined behaviour so why not
he is a c programmer he loves undefined behaviour
20:27
PES_SusThink
Avatar
i mean for like simple returns or stuff it really doesnt matter
20:30
but for memory layout i prefer defined behaviour
Avatar
The compiler knows better, just chose a type with bounds guarantees that suits your needs
Avatar
@Learath2 i found something u will love, if u havent seen it yet https://suckless.org/sucks/systemd/
Avatar
If you actually want more arguments about it ask on ##C in freenode
Avatar
lol im never gonna ask smth there
20:34
idk why i get a feeling if u ask anything there a bunch of elitists will crucify u
Avatar
Avatar
Ryozuki
@Learath2 i found something u will love, if u havent seen it yet https://suckless.org/sucks/systemd/
Yeah I know this
20:35
If you want a decent read about systemd https://blog.darknedgy.net/technology/2020/05/02/0/ is very nice
Avatar
darknedgy
20:35
monkalaugh
Avatar
very well researched
Avatar
@Learath2 I think for software correctness, it's best to choose fixed-size types
Avatar
depends on your goals
20:54
if you need it to be a certain size, sure
20:54
but usually you care about the bounds of an integer
Avatar
do we agree that C's int/long/short are the worst of all worlds?
20:58
useless type width bounds that aren't actually used as such in practice
Avatar
for OS stuff, i guess C's default types are better, for all other stuff, intx_t seems better
Avatar
how do C types help for OS stuff?
21:29
int isn't the architecture's native type. you'd probably want a register sized int for that
Avatar
isn't int in general the same size as a pointer?
Avatar
No. See for example 64bit Windows.
Avatar
Avatar
Learath2
RayB was only testing his and his testing teams maps
😂👍
22:29
The prodigal son
Avatar
Huh, RayBan still alive?
Avatar
Avatar
Learath2
The prodigal son
was kinda shocked to see my name in 2021, hope you can still move forward lol
Exported 148 message(s)