This is a difficult question to answer, there are several ways.
1) have a flag in your player entity class, which says "This is the player, don't draw its model!"
2) just draw the model, but set it to invisible
either way, you would only need to set this on the client side, but that can be handled w/ your networking code, determining each entity to create.
FPS question
-
- Posts: 602
- Joined: Sat Aug 23, 2003 2:03 am
- Location: Pottstown, PA
- Contact:
FPS question
hey.. im making an FPS game.. i can make it all fine and dandy and have it all work.. except i want to add a multiplayer aspect to the game. if two or more people are heading around the "world" or "level".. would the other players just see floating guns as the other players? how would you get it so the other people see a player model.. while you only see your weapon?
would it work if you attached the player model to the camera like you would the weapon model?
would it work if you attached the player model to the camera like you would the weapon model?
IcePump Gaming
under construction
under construction
Are you planning on making this networked or splitscreen?
If it's networked, you would have the clients simply create, update, and remove the model representing the other player.
Sort of like
Client1 -> Log In
Server starts tracking Client1.
Client2 -> Log In
Server starts tracking Client2.
Server tells Client2 about Client1.
Server tells Client1 about Client2.
...
and so on.
The graphics on one client have absolutely nothing to do with the visibilty of that client on another PC, only the network information that you pass around does.
If it's networked, you would have the clients simply create, update, and remove the model representing the other player.
Sort of like
Client1 -> Log In
Server starts tracking Client1.
Client2 -> Log In
Server starts tracking Client2.
Server tells Client2 about Client1.
Server tells Client1 about Client2.
...
and so on.
The graphics on one client have absolutely nothing to do with the visibilty of that client on another PC, only the network information that you pass around does.
Crud, how do I do this again?
well, i m making a fps to..
i have resolved the problem of is player, is ennemy must i draw a model etc... by this architecture:
class entity
{
position;
virtual init(int first,...)=0;
virtual update(float time)=0;
virtual close()=0;
}
class animatable: public entity
{
// a meshnode that have or not animation
}
class collision:public animatable
{
// a colision mesh, or use the meshnode boundingbox
// a physique pointer etc;
}
after, there is two big base class wich other object derive: character and item:
class character::public collision
{
// armor, life etc
// add possibility of mouvement , jump etc in virtual method
}
class ennemy::public character
{
//base class for different ennemy behaviour...
}
class player:: public character
{
//load model node, set it invisible, add camera class.
}
so when you have multiplayer, a player for one client is an ennemy for an other client, and vice versa, so in the other client , your player will be created as an ennemy, which is drawn... and if you want a more specific thing for multiplayer (like npc etc) just derive character class...
i have resolved the problem of is player, is ennemy must i draw a model etc... by this architecture:
class entity
{
position;
virtual init(int first,...)=0;
virtual update(float time)=0;
virtual close()=0;
}
class animatable: public entity
{
// a meshnode that have or not animation
}
class collision:public animatable
{
// a colision mesh, or use the meshnode boundingbox
// a physique pointer etc;
}
after, there is two big base class wich other object derive: character and item:
class character::public collision
{
// armor, life etc
// add possibility of mouvement , jump etc in virtual method
}
class ennemy::public character
{
//base class for different ennemy behaviour...
}
class player:: public character
{
//load model node, set it invisible, add camera class.
}
so when you have multiplayer, a player for one client is an ennemy for an other client, and vice versa, so in the other client , your player will be created as an ennemy, which is drawn... and if you want a more specific thing for multiplayer (like npc etc) just derive character class...
-----------------------------
Sans danger, pas de gloire...
http;//bappy.free.fr
-----------------------------
Sans danger, pas de gloire...
http;//bappy.free.fr
-----------------------------