Guild icon
Teeworlds
discord.gg/teeworlds / development
For discussions around the development of the official Teeworlds
Between 2018-12-19 00:00:00Z and 2018-12-20 00:00:00Z
Avatar
I introduced Teeworlds to two friends of mine. We enjoyed playing Instagib for the beginning very much. They struggled enough with the very unique movement of Teeworlds. Just shooting the laser with insta kill gave them a fun time, while improving their movement. On the other hand, they didn't enjoy Vanilla at all. Learning the movement AND all the weapons was too much at once. They ended getting killed all the time, with no chance on their own. Imo, we should consider to add Instagib ...
Avatar
@The Pro '' Iirc one strong argument was that race benefits from some client modifications alot, while providing a very unique gameplay. https://github.com/teeworlds/teeworlds/issues/33
YES! We will have it. No player collision or weapons. Must be time limited. ~10 minutes should be good. During the time, players race to get the fastest time. Players can reset at anytime using a b...
Avatar
Question: How would I send server-sided a global sound to all clients?
Avatar
CGameContext::CreateSound at each player's position with a proper mask
Avatar
Thx. I am very unfamiliar with this mask thing. Could you please elaborate on this?
Avatar
GameContext.h has "Cmask*" functions. I think, you can try to use one of them
14:41
inline int64 CmaskAll() { return -1; } inline int64 CmaskOne(int ClientID) { return 1<<ClientID; } inline int64 CmaskAllExceptOne(int ClientID) { return CmaskAll()^CmaskOne(ClientID); } inline bool CmaskIsSet(int64 Mask, int ClientID) { return (Mask&CmaskOne(ClientID)) != 0; } (edited)
14:42
with GameServer()->CreateSound(vec2 pos, int soundId, int64 mask); (edited)
Avatar
how did you enable syntax highlighting @Savander ?
Avatar
add language after "` "
14:43
ugh
Avatar
yeah after the thing
Avatar
for example cpp
Avatar
int test = 0xb00b; (edited)
Avatar
i mean, tripple
14:44
`
14:44
3x`cpp
Avatar
hmm
14:44
:)_
Avatar
imo it's a cool idea with potential to add movement abillity, here my suggestion
  • like in InstaShield (0.7 Instagib) explosion is triggered when laser is fired very close to the ground
  • laser explosion inflicts more overall damage than a usual granade explosion
  • due to more damage the resulting jump should of course be a little bit stronger
  • explosion cancels the bounce off the wall impotant!
so you can't jump and wall bou...
Avatar
they have to be in the same line
14:45
without space
Avatar
ah got it
Avatar
$cool = "Its super cool"
Avatar
Ok, cool. But what exactly is the cmask for and how to use it?
Avatar
I don't know if i understand it correctly, but you can try to mask everyone, except one
Avatar
In computer science, a mask is data that is used for bitwise operations, particularly in abit field. Using a mask, multiple bits in a byte,nibble, word etc. can be set either on, off or inverted from on to off (or vice versa) in a single bitwise o...
Avatar
CmaskAllExceptOne
14:47
in for loop, and send sound to each player
14:47
at their positions.
Avatar
I think you mean the other one, CmaskOne
Avatar
hm, maybe.
Avatar
Thanks for the link, but I still don't understand how they affect the sound.
Avatar
The mask, indicates which player will "hear" the sound? Right?
Avatar
CreateSound generates sound packets for clients, it'S a multicast operation the mask tells the function which clients to send packets to
Avatar
the mask tells who to send the sound to
Avatar
Ok. CMaskAll sends the packets to all clients then.
Avatar
oh, right. Now i understand how it works.
Avatar
Further then, most clients won't output the sound, as it is too quiet?
Avatar
CMaksOne, set a bit "on", for a clientId position
14:53
CmaskOne(3) => 1000 & 1111 = 1000 (edited)
Avatar
Isn't this CMaskOne(8)?
Avatar
no, because you are working on bits
14:57
it's 3 position
14:58
not 3 like a 11 in bit representation (edited)
15:00
What happens when using CMaskAll then?
Avatar
I think, it will send to everyone (edited)
Avatar
every bit is set to 1
Avatar
that one is weird for me, because it returns -1 (edited)
Avatar
yeah 0xffffffffffff
15:02
or whatver the f count is
15:03
all you want to do @Slayer *gV*
15:03
for(player) createsound(.... cmaskone(playerid))
Avatar
It looks like, -1 = 0b11111110 (edited)
15:04
and -0 = 0b11111111 o.O
Avatar
But what should be the position then?
Avatar
nvm, it's in some kind of "Ones' complement"
Avatar
Most clients won't output the sound then for being too far away (if i choose a random pos), will they?
15:05
So, I also have to set the m_Pos to the clients pos?
Avatar
@Savander -1 = ffff = 1111111
Avatar
in Two's complement it's '-1 = 0b1111111`
Avatar
well there are more 1's but thats it
Avatar
In computing, signed number representations are required to encode negative numbers in binary number systems. In mathematics, negative numbers in any base are represented by prefixing them with a minus ("−") sign. However, in computer hardware, numbers are represented only ...
15:05
0 is 0000
15:05
-1 ffff
Avatar
And didn't scrolled lower ;D
Avatar
-2 fffe
15:06
and so
Avatar
@Slayer *gV* that is why I originally answered send the sound at the player's position
Avatar
great, thanks 😃
15:06
Now it's clear to me
Avatar
I am fairly new to C programming, and I encountered bit masking. Can someone explain to me the general concept and function of bit masking? Examples are much appreciated.
Avatar
crisp clear
15:07
😄
Avatar
lol, bitmasking xd
Avatar
@LordSk 🦋 Yeah right. Was just hoping for a one-liner. Thank you!
15:08
😃
Avatar
Now I need my very own method "SendGlobalSound", to reimplement functionally that teeworlds 0.5.2 had :/
15:11
how Flag capture sound is handled
15:11
check it out
15:11
it's global
Avatar
GameServer()->SendGameMsg(GAMEMSG_CTF_CAPTURE, fi, F->GetCarrier()->GetPlayer()->GetCID(), Server()->Tick()-F->GetGrabTick(), -1); (edited)
15:15
Actually, I really want to send the capture event sound
Avatar
I see, it's handled client-side
15:15
:/
Avatar
But I am not sure if I could reuse this.
Avatar
You can try :o. I always trying 😄
15:17
okay, that SendGameMsg
15:17
will print chat message on chat, with name and time.
15:18
case GAMEMSG_CTF_CAPTURE: m_pSounds->Enqueue(CSounds::CHN_GLOBAL, SOUND_CTF_CAPTURE); int ClientID = clamp(aParaI[1], 0, MAX_CLIENTS - 1); if(aParaI[2] <= 60*Client()->GameTickSpeed()) str_format(aBuf, sizeof(aBuf), Localize("The %s was captured by '%2d: %s' (%.2f seconds)"), aParaI[0] ? Localize("blue flag") : Localize("red flag"), ClientID, g_Config.m_ClShowsocial ? m_aClients[ClientID].m_aName : "", aParaI[2]/(float)Client()->GameTickSpeed()); else str_format(aBuf, sizeof(aBuf), Localize("The %s was captured by '%2d: %s'"), aParaI[0] ? Localize("blue flag") : Localize("red flag"), ClientID, g_Config.m_ClShowsocial ? m_aClients[ClientID].m_aName : ""); m_pChat->AddLine(-1, 0, aBuf);
15:18
I think, you have to make your own function, to send sound to each player on your own
15:19
9bd444a Always use colorful gametype and level icons in... - Dune-jr 157c2d1 Merge pull request #1904 from Dune-jr/feature-c... - oy
Avatar
I don't know if its a bug or intended. But killing spree messages don't appear anymore. I think they should be shwon in chat like in 0.6. It just feels good to see how you are owning and to know that other people see it to. Now you sometimes don't even notice who is playing rly good. With the message you can instantly see who is owning up the server. And if its you its a great feeling!
Avatar
0.7 uses raw input for receiving mouse delta data directly. while prior versions manually warped the mouse cursor back to the middle of screen and calculated the delta. Raw inputs are not influenced by the mouse settings of the OS like mouse acceleration. It would be nice to have an option to use the old relative mouse mode approach (see https://wiki.libsdl.org/SDL_HINT_MOUSE_RELATIVE_MODE_WARP).
Exported 103 message(s)