Page 1 of 1

Posted: Tue Mar 30, 2004 12:03 am
by Robomaniac
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

Posted: Tue Mar 30, 2004 12:03 am
by Coolkat
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?

Posted: Tue Mar 30, 2004 1:38 am
by saigumi
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.

Posted: Tue Mar 30, 2004 2:32 am
by Coolkat
yeah i am making this networked. not split screen.. thanks.. that helps a lot.. so just draw all the models but your own basically.. i can do that :P

thanks all.. i really like this Engine and it'll be great for my project.

Posted: Tue Mar 30, 2004 7:48 am
by bappy
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...

Posted: Tue Mar 30, 2004 8:16 am
by Hazel
I would not use inheritance but composition: A player HAS/POSSESSES a player model. And if it is your player... just don't add the player model to your scene manager and everything is fine. Just draw the 'view' weapon model(the one you see your player holding in his hands).