Title: Entity flags aren't being transmitted Post by: EmeraldTiger on January 27, 2019, 06:44:51 PM Hello!
I've been hard at work on an ambitious Quake 3 mod (which is quite compatible with OA too!) lately called Uber Arena (https://www.moddb.com/mods/uber-arena). Everything is mostly going smoothly - I've got a lot of the main features / mechanics working, added some visual aids, and fixed some annoying bugs. However, there is one issue that still poses a major roadblock to some visual / audio clarity changes I'd like to make. I ran into this problem a while back, stepped away from it hoping that maybe I missed something, and returned only to have the same issues. What I want to do is very simple: use the EF_ bitflags defined in bg_public.h to transmit entity state information from the server to the client. Here is some test code to show my attempt at getting this to work: Code: #define EF_TELEPORT_BIT 0x00000004 // toggled every time the origin abruptly changes The EF_TRANSMIT is the flag I want to communicate over the server to the client. As you can see it follows the hexadecimal bitflag numbering scheme. Now I do a bitwise OR assignment / enable in the Upgrade_Weapon function: Code: void Upgrade_Weapon(int counter, gentity_t *other, int steps) { And finally a Bitwise AND / check in CG_Missile function: Code: if (cent->currentState.eFlags & EF_TRANSMIT) { So the intended outcome of this test is: 1. Upgrade any weapon into an uberweapon (either with 3x pickup, tuning device, or the /uber cmd - all call the same function Upgrade_Weapon). EF_TRANSMIT is turned on. 2. Game should print "can you read this" continuously while a missile is in the air, if the person who fired it has an uberweapon, since EF_TRANSMIT should now be on. (And I can easily revert this test code since I make regular commits to GitHub) But, just like my last attempts, nothing happens - the game still refuses to send over the information from the server to the client. Would love to know if anyone has ran into similar struggles in the past, what their solutions were, and why the problem occurs in the first place. The ability for me to send information this way is necessary for me to implement things like homing rocket tracking sounds, recoloring ion plasma gun bolts (special effects dependent on the player having an uberweapon), or adding special weapon-specific indicators around players carrying an uberweapon Here is the original thread for reference: https://www.quake3world.com/forum/viewtopic.php?f=16&t=53914. First post contains some of my initial attempts at using EF_ flags to no avail, in different contexts / with different functions. Title: Re: Entity flags aren't being transmitted Post by: Neon_Knight on January 29, 2019, 07:28:19 AM How do you do the communication between the game and cgame modules?
Title: Re: Entity flags aren't being transmitted Post by: andrewj on February 01, 2019, 06:58:13 AM According to qcommon/msg.c in the engine code, only 19 bits of eFlags are transmitted from server to client, which means anything over 0x80000 will be ignored.
You'll need to either repurpose an existing flag, or use a different mechanism. |