how does one arrange the weapons for an ego shooter, especially for a multiplayer shooter, the best way?
in the ego shooter I am currently working on I used an overlay scene and different cameras for each weapon. by switching weapon (mouse wheel) you actually switch the active camera. this way, creating the weapon switching system is quite easy, but then the problem is that the weapons are not effected by the light in the actual game scene, which will not necessarily be noticed by the player in regular lighting conditions, but looks very unrealistic when you go into a dark room and the weapon stays bright.
but when I put the weapons in the actual game scene in front of the camera, in a multiplayer game the other players would also see the weapons in front of your game character.
In a multiplayer game, you would have to send the weapon across the internet to all players for the correct weapon to be seen, right? When you send the data across the internet, omit the weapon data, and when you display the other people on your screen, just use a multiplayer character that doesn’t have a weapon. Or, make it invisible.
i thought about this to. there are two things to note:
firstly, mainstream games, such as Call of Duty, send data of gun type, but you’ll notice if your playing split screen that the character will look like its scratching its head whilst not on the persons screen.
Second, multiplayer games are best when there is the same copy per person, an it gets data to drive it:
i am going to have the same “client” copy for each distribution, which will connect to the server blend file. It will have an empty containing one property for each connected player. It will set the property depending on order of connection: eg first player = p1, second = p2 and so on. it will then name the player objects in accordance with the names, so that you can have a dynamic number of players. in the python modules i will use try: except: to see if a Nth player exists, use this player object, else endObject. For weapon switching you can have them parented to players back, then make them parent to an empty on players hands. and the player pulls them off his back. i have a python system whereby it gets the gun by a property called “gun” on the player, which contains the name of the current gun : “OBump45” note the OB,as i am using 2.49b and the python uses the string to find that object. sorry for the long reply, it’s a tricky subject, and i have spent some time thinking about methods i will use.
The main idea is make a self-replicatable player object, then an empty with a property list of connected players. set Nplayer pos and rot and gun…
My point is that you would just have a separate ‘local machine’ player character (the character I’m playing with - which has the weapon onscreen) from the ‘online machine’ objects (all clones of a single other character, which has whatever weapons you want him to have). The player object doesn’t seem like it would work well with having part of his code work for the local machine, and a separate section of code for the online players. The rest of your idea seems like it’d work fine.
thanks for your replies.
but I will come to multiplayer later, first im gonna make a coop game (with having the 2nd player play with a gamepad/joystick and two camera viewports, so no need of network support).
do I have to place all weapons which one can have in front of the camera, and then make all weapons except of the active weapon invisible? then all weapons would be in the game at once, because like I said for future games i dont want to use an overlay scene for the weapons.
I would use one weapon mesh in the actual scene, and then use replace mesh (personally I’d use the python function but the logic brick would work too)
that way you can add and remove weapons from the game rather easily, without having to make changes to the character.
if I use replace mesh, how do I ensure that the mesh appears at the right position/with the right coordinates and in the right angle? of course the new weapon should have the same angle as the previous weapon had.