FPS question

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Robomaniac
Posts: 602
Joined: Sat Aug 23, 2003 2:03 am
Location: Pottstown, PA
Contact:

Post 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.
The Robomaniac
Project Head / Lead Programmer
Centaur Force
Coolkat
Posts: 25
Joined: Sun Mar 28, 2004 1:44 am
Location: U.S.A.

FPS question

Post 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?
IcePump Gaming
under construction
saigumi
Posts: 921
Joined: Fri Aug 22, 2003 11:31 am
Location: St. Louis, MO USA
Contact:

Post 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.
Crud, how do I do this again?
Coolkat
Posts: 25
Joined: Sun Mar 28, 2004 1:44 am
Location: U.S.A.

Post 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.
IcePump Gaming
under construction
bappy
Posts: 63
Joined: Fri Dec 12, 2003 10:49 am
Location: france
Contact:

Post 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...
-----------------------------
Sans danger, pas de gloire...
http;//bappy.free.fr
-----------------------------
Hazel
Posts: 5
Joined: Mon Mar 29, 2004 7:34 pm

Post 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).
Post Reply