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 2020-04-24 00:00:00Z and 2020-04-25 00:00:00Z
Avatar
Is anyone familiar with the algorythm in gameworld.cpp? I would like to know if its possible to force a player that has the same IP as you to a specific ID, which will never change for this guy for my own map. So he is always visible in my scoreboard no matter how far away he is
02:29
I mean it should be possible, as its also possible to force the ID 15 out, the empty client that is for sending chat messages from the further away clients
02:29
but I couldnt get anything to work :/
Avatar
you want your dummy to be always visable?
08:17
These kinds of same ip queries get very expensive very quick, you might want to begin with a hashmap of ip -> client-id. After that you can force everyone in the same ip bucket as you to occupy the first couple ids
08:17
the rest you can use the distance algorithm for
08:17
I'm wondering how well the collision stuff is working with 128 players
08:18
I'd be surprised if the server didn't start slipping with that many entities close by
Avatar
e2c2b84 locations -> all-locations - def-
Avatar
I want whatever the people who came up with http basic authentication is on
11:31
If you send a 401 safari will still save the credentials that turned out to be wrong, chrome will just ignore the response and display a blank page, firefox will also happily save the wrong credentials
Avatar
isn't that more of a problem of the browsers?
11:32
but yes, the experience sucks
Avatar
Yeah I guess it's the fault of decades of backwards compatibility trying to be kept
11:33
unlike C/C++ implementation quirks, there is no reference for browser quirks, browsers don't tell you how they implement behaviour undefined by the standard
Avatar
can someone help me with how the automap data is packed into the datafile?
Avatar
I guess I wasted the time though, we really should instead let mods download demos, not th files
Avatar
its from gameitems_ex.h
11:36
its supposed to have something to do with uuids, but i dont really understand how that works
Avatar
You mean mapitems_ex?
Avatar
ouch yes
Avatar
It's a little tough, there is a translation table within the datafile that translates itemids above OFFSET_UUID
Avatar
hm so its fundamentally different to the other mapitems
11:40
that does sound a bit harsh
11:40
could you tell me how it works?
Avatar
You look for items of type ITEMTYPE_EX
11:41
These are the table entries
11:42
you extract the UUID from these (look at CItemEx::ToUuid), you match it with the uuid for "mapitemtype-automapper-config@ddnet.tw"
11:43
That items ID is the "Internal type ID" of the automapper config item
11:44
(the item that has matching uuid that is)^^
11:44
After that you can use the internal type id like any other type id
Avatar
okay, thanks for the leads :)
11:46
ill come back once im stuck again
Avatar
@heinrich5991 ^^ sounds about right, right? 😛
Avatar
yea, what you said sounds about right 🙂
Avatar
not sure if i was able to follow those instructions completely what would make sense to me:
  • each item of the type ITEMTYPE_EX defines a included ex_itemtype
  • which of the types it is, can be found out by trying to match the uuid of a known type (for example the uuid for "mapitemtype-automapper-config@ddnet.tw") with the item_data of that ex_itemtype item
  • then the matched itemtypes going are in id order 0xffff - n (n being the number of the itemtype_ex item it was defined in)
Avatar
I'm not quite sure of the very last statement
12:49
The ID is part of the datafile item, it's i->m_TypeAndID&0xffff
12:50
(which is nothing but the first 2 bytes of m_TypeAndID)
Avatar
if you want to find out the "actual type" of a type ID typeid
12:52
you look up the datafile item (0, typeid)
12:53
if you find a UUID item there, you'll have your type
Avatar
(0, typeid)?
Avatar
you find layer number 5 in (LAYERTYPE, 5)
Avatar
0 isn't ITEMTYPE_EX, is it?
12:59
I thought it was 65536 for ITEMTYPE_EX
Avatar
65535 i think ^^
Avatar
maybe
12:59
if 0 was already taken
Avatar
typeid as in the internal typeid?
Avatar
typeid as in typeid in the map on the disk
Avatar
I think this is only valid for typeid > a certain number though
Avatar
yes, halfway to max
13:00
from there
13:01
so >= 0x8000, probably
Avatar
I think you also have to iterate through the ITEMTYPE_EXs and look for the id, I don't see the index getting fixed or these items being ordered in the code
Avatar
there's a function for it though IIRC
13:03
GetItem(typeid, id) IIRC
Avatar
GetItem takes an index, FindItem is probably what you are looking for
13:05
@heinrich5991 do you remember why you didn't just subtract the offset to get to an index?
Avatar
wdym?
13:06
offset into what?
Avatar
offset into the table of itemtype_exs
13:07
no that didn't sound right
13:07
I mean something like typeid - 0x8000 to get the index of the itemtype_ex item with the uuid
13:07
that'd be better then the linear lookup into the table, no?
Avatar
hm. I don't know if anything uses the map item indices
13:08
I hope not, because then you don't have to care about how the items are laid out in the file
13:09
the linear lookup is a fault of the implementation, not the map format
Avatar
oh, the items are not in contiguous blocks?
Avatar
the items are in contiguous blocks
13:10
in my implementation, I have a hash map from (typeid, id) -> item
13:10
i.e. constant-time lookup
Avatar
in your implementation as in libtw2?
Avatar
yes
Avatar
I guess I don't really know the scope of the id, is id global in the datafile?
Avatar
(typeid, id) is globally unique
Avatar
I don't get why this is implemented like this in tw then, are items fixed size?
13:13
arent*
Avatar
because tw doesn't have hashmaps, I guess
13:13
(that's the same problem that snapshots also have)
Avatar
@heinrich5991 can index differ from id?
Avatar
index is unrelated to id
13:18
index is the index of the item in the file
Avatar
and id?
Avatar
id is something you specify while saving an item
13:19
you can specify a 16 bit item type and 16 bit item id when saving an item
13:19
they're free form, not interpreted by the map format itself
13:19
they must be unique though
Avatar
what is it used for? I don't see what they provide. (typeid, index) would already uniquely identify an item in a datafile
Avatar
index already uniquely identifes an item in a datafile
Avatar
question for the professionals here. I am having trouble opening demos. I already downloaded tw new and deleted config etc. still i cant open them. I asked other people to open them, they are able to. Do you have any idea? I am using 0.6.4 12.7.3 version
14:14
with one demo, tw crashes, and with 99% of the other demos, i just cant open them. 1% i can open
Avatar
could you try again with the newest version of ddnet?
Avatar
yes I will try
Avatar
I think we had some demo-related fixes recently
Avatar
can I open demos even if I dont have the maps downlaoded?
Avatar
i think so
Avatar
yes, you should be able to
Avatar
+can confirm that i cant open demos people send me from new ddnet without also using new ddnet
Avatar
that's expected, I think
14:19
we changed the demo format
Avatar
funny thing is, most of these demos are my own. and I never used any higher version than 12.7.3
14:19
But I will try with newest client :)
Avatar
thanks
14:20
if that doesn't work, please send me one of the demos
Avatar
works clean af, thank you @heinrich5991
Avatar
nice 👍
14:22
thank @Learath2 for that 😉
Avatar
you can also thank me for breaking it
14:23
50/50 😛
Avatar
@heinrich5991 what about the players-cache
15:15
if you wont port it to py3 i will make it work with py2
Avatar
yea yea, no need to threaten 😄
Avatar
wtf @ ddnet scripting
15:23
a grep to extract some values from our own json
Avatar
i think i got it know apart from one detail
15:27
you match it with the uuid for "mapitemtype-automapper-config@ddnet.tw"
15:28
did you mean by that that i can somehow get the relevant uuid from the string "mapitemtype-automapper-config@ddnet.tw"?
Avatar
yes
Avatar
how do i do that?
Avatar
hm would someone be mad at me if i just hardcode the number? :p
Avatar
the UUID? no
Avatar
@Patiga hardcoding the ID however, is going to break in the future
15:36
as we add more UUID map item
15:36
s
15:37
you can generate the uuid with the uuid tool in ddnet. alternatively, you can get a debug dump of uuids known to the server when you start with debug 1
Avatar
@Patiga besides, whatever highlevel language you are using probably already has a library for uuids
Avatar
isnt there just one so far?
Avatar
for map items, yes
Avatar
eh, for the sake of completeness i guess
Avatar
hm. I mean we probably are going to add more map items in the future
Avatar
do i actually need a uuid library? it seemed to me that i will just throw around 128 bit integers and md5
Avatar
don't need a UUID library if you don't want, you can hardcode the UUID
15:42
just the map item type ID shouldn't be hardcoded
15:42
UUID vs map item type ID
Avatar
hm how is hardcoding uuids going to break in the future?
Avatar
it's not
15:42
this was about hardcoding map item type IDs
15:43
then im probably going to skip that hassle
Avatar
@Patiga if you don't mind me asking: What are you making?
Avatar
im making a (hopefully sensible) map parser in rust :) (edited)
Avatar
@deen where does maps/{mapname}.msgpack come from?
Avatar
Contribute to ddnet/ddnet-django development by creating an account on GitHub.
Avatar
ty
18:11
@Learath2 do you know where I can find that map_properties tool?
18:12
which map_properties on ddnet.tw didn't find it
Avatar
@heinrich5991 django@ddnet:~$ which map_properties /home/django/bin/map_properties
Avatar
ah, it's my libtw2 tool 🙂
Avatar
yep, I just figured it out 😛
Avatar
it has a nice --help 😉
Avatar
CENSORSHIP!
Avatar
it was just flood 😛
19:41
@heinrich5991 can you also take a look at that pr?
Avatar
php 😦
19:41
yes
Avatar
(it's really hard to modify this file blind, I don't have access to the server this is hosted on so can't test it)
Avatar
wdym, blind modification
19:43
ah
19:44
without knowing the file paths
Avatar
also apparently my editor decided all the indents should be tabs
Avatar
@Learath2 if($type === "html") { ?> that works??
Avatar
wtf @ php
Avatar
why shouldn't it work?
Avatar
because stuff out of php environment didn't belong to control flow in my mind
Avatar
(this is a very ugly way to do php btw)
Avatar
yes
Avatar
usually presentation and logic is split with a template engine
Avatar
but if you do it the right way, you might as well use a saner programming
Avatar
"s/$/ language/"?
Avatar
language
Avatar
tbh, I like php
Avatar
I think it has too many footguns
Avatar
not sure if it's the nostalgia but I don't really see anything better for the web
19:52
I could see js for rest apis but that's about it
Avatar
Trafalgar Law 2020-04-24 19:52:27Z
I like too php
19:52
Php is great
Avatar
what about python? @Learath2
Avatar
After using it for a while, I don't think I like python much at all, especially the module/package system
19:54
for programming apis I think I could use something like flask or falcon, but for presentation python just doesn't integrate well into the web stack
Avatar
I also don't think it's the best (but the language is a bit old, it might be fixed eventually, there are some movements to improvements)
19:54
does php fare better in that regard?
Avatar
Php has very mature templating engines and frameworks
Avatar
@ modules I meant
19:54
but templating is also fine
19:55
python also has templating engines, did you try some?
19:55
it worked fine when I did a little django work
Avatar
eh, atleast I never quit php because I couldn't get a module included
19:55
composer usually works great
19:55
you just include vendor/autoload.php and composer sets things up
19:56
I think django is seriously a crime against humanity
19:57
I have never seen such a bloated piece of software with such horrible documentation
19:57
I worked with Jinja2 and flask, it did the job, wasn't too painful
Avatar
I worked with django for a website and flask for APIs so far
Avatar
jinja was written by the same guy who wrote twig (the template engine usually used with symfony) so atleast the template language made me feel right at home
20:00
but that's really not the point in which I think python doesn't integrate well, uwsgi itself feels like we are bolting on python to the web
Avatar
learath will never find anything he likes
20:00
he likes to be the niche type
20:01
hehe im c00l
Avatar
Not like I'm using some weird language like zig
Avatar
php is the opposite of niche
Avatar
If I was commissioned to do web work, I'd use php + symfony
Avatar
well i dont like server side rendering anyway
20:02
i always go with golang backend and react frontend separated
Avatar
If I had to use python, I'd go for flask or falcon
20:03
If I'm not doing the backend with the frontend, I'd still go for a symfony backend and a vuejs frontend
20:03
maybe u will like this
Avatar
been using pure.css a lot lately
Avatar
this is more pure
Avatar
but this also looks very interesting
Avatar
imo its the best
20:05
im only using this now
20:05
u need to know css tho
20:05
not ur wannabe css framework
Avatar
if you have something to learn web design, I'm open
20:07
I have no idea about htat
Avatar
eh, it seems this requires you to be using some packager though @Ryozuki
Avatar
only if u want to customize it
Avatar
it'd be much nicer if they used sass like every other customisable css framework
20:08
no
20:08
thats horrendous
20:08
u dont understand how this framework works
20:08
im in middle of dota ranked
20:08
cant talk much
Avatar
@heinrich5991 turns out there are no good resources out there 😦
20:09
I had to learn each piece I wanted to learn myself
Avatar
i also learn by myself
20:10
by doing
20:10
like everything
20:10
i know u like ur c books
Avatar
I rather refer to the documentation for each piece, but to each their own
Avatar
docs != book
20:13
ofc i look at mdn
Avatar
mdn felt like a good resource, yes
20:13
but it's only a doc, not for learning
Avatar
@Ryozuki doesn't this css framework compile the css file at build time? using a node script as far as I can see
Avatar
u can use a cdn
20:14
thats to customize it
20:14
i said it
Avatar
and I'm asking why is the customisation done with a custom node script instead of sass variables like every other framework?
20:15
as in what's the advantage to this approach?
Avatar
its to generate css classes
20:17
its way better than sass at creation extensions
20:17
u may have mt-2
20:17
margin top 2
20:17
u can do hover:mt-4
20:17
etc
20:17
i cant explain rn
Avatar
@heinrich5991 you should maybe migrate away from try! in libtw2 before it disappears?
Avatar
it's not going to disappear
Avatar
(idk the deprecation schedule of rust, maybe it'll stay forever)
Avatar
but yea, eventually I'll migrate it away from try!
21:33
@Learath2 but rust's deprecation schedule can be roughly summarized as: if it's not a security issue, code will continue working
Avatar
what is the "use high dpi" check for?
Avatar
if you have a hidpi display, this determines whether ddnet will run at the native resolution or not
22:55
if you have a resolution smaller than 3840x2160, you likely don't have a hidpi display
22:55
and then the option doesn't matter
Avatar
alright. so i can just uncheck it
Avatar
If you don't have a highdpi display, it won't change anything
Avatar
it doesn't matter if you check it or not
Exported 271 message(s)