Guild icon
Teeworlds
discord.gg/teeworlds / development
For discussions around the development of the official Teeworlds
Between 2018-12-18 00:00:00Z and 2018-12-19 00:00:00Z
Avatar
Question about codestyle: Name for one-dimensional array: CMyClass aMyArray[x]; Name for one-dimensional array of pointers: CMyClass* apMyArray[x] But what about multi-dimensional arrays of pointers? Name for three-dimensional array of pointers: CMyClass* aaapMyArray[x][y][z] That looks ridiculous, doesn't it?
Avatar
I think tw doesnt use multi dimensional arrays
10:12
You can use a simple array and access it like arr[y * width + x]
10:12
Iirc i think tw does that where 2d arrays are needed
10:12
Or maybe it was ddnet code idk
Avatar
Would there be any real benefit? Or is it to overcome this naming convention? 😄
10:14
Looks super cool, though.
Avatar
Its simpler to allocate i guess but idk
Avatar
hmm, k ty
Avatar
@Slayer *gV* src/game/client/components/binds.h 55: char m_aaaKeyBindings[KEY_LAST][MODIFIER_COUNT][128];
11:12
so you'd call it aaapMyArray I guess
11:13
note that the * goes next to the variable name, not next to the type
Avatar
@Ryozuki it does, there are three-dimensional arrays there :D
Avatar
Ty @heinrich5991 . Looks very weird, though.
Avatar
I wrote that, it did feel weird
Avatar
Another question: Is it possible to send localized messages from server to the clients? I guess not, at least I couldn't find any usage in the server-side source.
Avatar
not for mods
Avatar
I can not introduce new localized strings server-sided to the client. But it would be so cool to at least reuse existing localizations... 😦
Avatar
yep, not currently possible unfortunately
Avatar
It would always be very limited though
13:23
imo server messages should never be attempted to be translated
13:24
there are no server messages anymore by default, it's all generated by the client
Avatar
But there is no other way for server mods.
Avatar
so if there is a server message, it's a mod or an admin => no reason to believe we would be able to translate it adequately with client strings
Avatar
F. e. I want to send statistics about the current capture spots. Spot 1 -> Red Team Spot 2 -> Blue Team ... At least "Red Team" and "Blue Team" are localized and could be reused.
Avatar
unless the server provides translations, client shouldn't attempt to localize server messages
Avatar
This is probably a very limited usecase. Would be just nice to have for this particular case 😄
Avatar
otherwise you'll end up with a mash of localized strings and english strings, that's meh, better be all english imo
Avatar
For complete sentences I do agree.
Avatar
as long as you don't have ONLY extremely basic messages you don't want translations
13:26
mixing up languages is not good
Avatar
See, "Red Team" is very basic 😛
Avatar
Yes, but that's not the only message you have
Avatar
Whatever. Was just curious if there is a way (: Ty!
Avatar
I do think that having translatable messages would be cool 🙂
Avatar
But Dune is certainly right, that the server should be able to share localization information then, too. What might be quite some work to implement.
Avatar
Client could send
13:43
"language" to server on connection
13:44
so, then server could generate message based on that variable
13:44
server already have Client name and Clan name, so it could have a Language as well.
13:46
I think, there's also possible to geolocalize players, but not everyone likes to have messages in their mother language. Or they are just in a foreign country for vacations.
Avatar
I'm still not sure if it's on bam's side or on the Teeworlds configuration side: ``` [1/3] [3] copy datasrc/ui/gametypes/ictf).png -> build/x86_64/debug/data/ui/gametypes/ictf).png [2/3] [1] copy datasrc/ui/gametypes/idm).png -> build/x86_64/debug/data/ui/gametypes/idm).png [3/3] [6] copy datasrc/ui/gametypes/itdm).png -> build/x86_64/debug/data/ui/gametypes/itdm).png sh: 1: sh: 1: Syntax error: ")" unexpectedSyntax error: ")" unexpected sh: 1: Syntax error: ")" unexpected bam: 'copy...
Avatar
ChillerDragon 2018-12-18 16:23:52Z
Haha why would someone use fake multi dimensional arrays in C++ xd I used them in my bash game i think.
Avatar
What's the problem with multi dimensional arrays? They represent certain structures of data well :)
Avatar
ChillerDragon 2018-12-18 16:37:22Z
ye i like multidimensional arrays my brains understands them better than the weird y * x + x thingy or how ever it was
Avatar
they are used a lot
16:40
atleast i remember
16:40
i dont know where tho
16:40
but its more common than you think xd (and its y * width + x) (edited)
Avatar
ah, you asked why someone would not use them? when they have dynamic size, probably
Avatar
ChillerDragon 2018-12-18 16:53:57Z
what is the difference between width and x lol
Avatar
x is a position, width is a size
Avatar
ChillerDragon 2018-12-18 16:57:23Z
so what is the amount of dimensions?
16:57
oh lol none of these? I am confused xxd
16:57
see thats why i prefer multiple []
16:59
9099a69 fixed empty vote when joining a server. closes ... - oy
Avatar
We have up to 64 slots now - far enough to make disappear the need to kick afkers.
Avatar
About race mod. Im curious, if we can send motd to player? on command, with custom text
23:41
so, top races, could be displayed in motd, instead of chat.
Avatar
yeah, it could afaik
Avatar
that would be better, I guess
23:42
more space
23:42
no spam on chat
Avatar
gonna try that 😮
Avatar
you are faster than me :D. I just started to make racemod, just for fun
23:43
but, if you just ported
23:43
maybe i will contribute
Avatar
I did too :D
Avatar
to your
23:43
hahaha
Avatar
seems like everyone is :)
23:44
but, I just started to make Database interface, to work with multiple base types
Avatar
already ported the race mod from 0.4 to 0.5 and 0.6 😄
Avatar
but it doesn't matter now
23:44
:DD!
23:44
I have few ideas, like a possibility to turn on spectator mod, without killing character
23:44
on longer maps, it will help
23:44
to understand map D:
Avatar
yea could be useful
Avatar
so like pause?
Avatar
kind of
Avatar
right now i'm implementing all the race features from 0.6
Avatar
github repo?
Avatar
could try some new thing later
23:47
didn't push it yet
Avatar
the teerace features are tough to port
Avatar
teerace can wait at least
Avatar
i still need to implement the teleport layer and finish my sqlite backend
Avatar
and I think alot of stuff redix wants to reimplement
Avatar
cause might as well
23:48
since starting fresh
Avatar
I wanted to ask, if you reimplement everything from scratch
Avatar
I did the telelayer but the chat stuff is broken :p
Avatar
lord had an idea how to implement the telelayer without a custom layer 👍
Avatar
2 named layers
Avatar
will there be speed tiles support too?
Avatar
same for the speedup
Avatar
what about grenade teleport :^)
23:49
jk
Avatar
does not make a difference
Avatar
what about the teleport kills ;D
Avatar
teleport kills?
Avatar
what, like, kill tiles with hitbox of tele?
Avatar
what about movable platforsm! ?
23:51
hahaha
Avatar
there used to be a feature that if you teleport on a tee, you kill it :p
Avatar
oh that would be cool
Avatar
cl_teleport_kill or so
23:51
it's in 0.6
Avatar
in ddrace?
Avatar
moving platforms not a fan cause it adds lag and prediction
Avatar
and have to deal with cycles and stuff
23:51
just annoying
Avatar
ehm, because they are hackyu on 0.6
Avatar
they'll be just as hacky on 0.7 (edited)
Avatar
I know that, but 0.8
23:52
haha
Avatar
need to make race the most compatible with vanilla client
Avatar
to answer the question: i copied a lot of things... but i'm reimplementing some others like the scoring stuff and the custom layers
Avatar
add a message for when someone else starts the race ty ;)
Avatar
☝ that's only useful for ghosts ^^
Avatar
only useful for a feature Im doing in 0.6 xd
Avatar
gonna do vanilla compatible things first
Avatar
0.6 maps will be compatible with 0.7?
Avatar
right now most race servers are bork if you join with vanilla I think
23:55
except tileset I think they are fine?
Avatar
since most maps are broken anyway i'll write an update tool
23:55
so like mapping old tileset pos to new tileset ones?
Avatar
as i said... i'll prefer to implement the tele layer in a way that the vanilla client can handle
23:56
so i have to convert the old ones
23:57
oy already did something like this. but didn't work for all tilesets for me =\
Exported 148 message(s)