RE: [hlcoders] Client entindices

2002-01-23 Thread James Williams

> Logic would dictate that the entity numbers *should* be the same on
> client and server; I don't see how the two can remain synchronized
> otherwise.

They are the same client and server, but that's not what I'm concerned
about. I'm trying to read the entity lump in the map and match up those
entities to entindices. Is that even possible?

-James "Corvidae" Williams ([EMAIL PROTECTED])
Administrator, Wavelength Forums (http://www.planethalflife.com/wavelength)
Co-Leader / Coder, Underhive (http://www.underhive.com)

___
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders




RE: [hlcoders] Client entindices

2002-01-22 Thread James Williams

> I don't think you have a hope of matching up indexes in the BSP file with
> anything that exists while the game is running.

Eep.


Can anyone think of a way I could keep a key/value pair read from the map
and an entindex (from wherever, probably a message from the server)
associated with each other? Actually, if entities aren't reordered when the
map is loaded (they all spawn in the same order they are in the map)
couldn't I search for the ents server-side, send all the entindices over in
a large message on player connect, and then loop through the map on the
client and match up keyvalues to the entindices in the same order as the
message?

-James "Corvidae" Williams ([EMAIL PROTECTED])
Administrator, Wavelength Forums (http://www.planethalflife.com/wavelength)
Co-Leader / Coder, Underhive (http://www.underhive.com)

___
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders




Re: [hlcoders] Client entindices

2002-01-22 Thread botman

> How are entindices ordered on the client? I know entindex 0 is worldspawn,
> then comes 1-32 for players, but what comes after that? Are the rest of
the
> ents grouped by classname, by position, by order in the BSP, or some other
> way I haven't come up with yet?
>
> I'm currently parsing the BSP myself on the client so I can pull keyvalues
> straight from the map without a message. I'm looping through all the
> entities in the ent lump and storing off the index of each if it's an
entity
> I want to look at, but GetEntityByIndex() called with that index isn't
> returning the correct entity so I can poll its origin and angles. Anyone
> have any tips on why this doesn't appear to be working correctly?

Leon or someone else from Valve can correct me if I'm wrong, but I believe
that the entities are stored in-game using a linked list that the engine
keeps internally.  When you look through the entities (using
UTIL_FindEntityInSphere, etc.), the engine interates through this linked
list.

When an entity gets removed (UTIL_Remove), the engine simply unlinks that
entity from the linked list and frees the memory associated with that
entity.

My quess is that the entities are originally spawned in the same order that
they appear in the BSP file, but since some entities spawn other entities
when they are created, the index in the BSP file would not match the index
of the entities that were created in-game (especially the ones toward the
end of the list), of course as the game progresses, old entities are removed
and new entities are created, grabbing whatever index is free in the
existing list.

I don't think you have a hope of matching up indexes in the BSP file with
anything that exists while the game is running.

Jeffrey "botman" Broome

___
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders