Hello there, I am in need of some feedback when it comes to a weapon creation/changing system for my FPS. In short, the player will be allowed 3 weapons; a Primary, a Secondary, and a Melee weapon. The weapons are spawned on the map and the players get to customize their abilities before the game starts. Think like Halo:Reach but more in depth. Now, when the player is spawned each player is given the basic setup of the 5 starter options (based on the players class type). But they are allowed to pickup other weapons which have spawned on the map. So here is the question which I am asking...
Would it be better to create the weapons by...
1. Preloading every available weapon before the game starts then just setting the weapons invisible flag on/off if its selected or not.
2. Creating a dummy entity then changing it with ent_morph if a player picks up another weapon. (System im using now)
3. Calling an ent_remove to remove the weapon pointer, then recreate it with the new weapon model.
Im not sure which way would be the best. Currently, I have 3 dummy entities set up (primary, secondary, melee) then I just change them with ent_morph when a player picks up a new weapon. But that creates a tiny bit of lag/freeze so the weapon can load. Are there any other ways to do it that I am missing? Any kind of advice would be EXTREMELY helpful. Keep in mind, this is an online FPS.
Re: Advice for weapon changing system
[Re: exile]
#365768 03/29/1106:5903/29/1106:59
you can use also option 2, but doing ent_morph for all possible weapons with a wait(1) between them in the beginning of the action. This way all entities are already preloaded and there won't be lag when they appear.
3D Gamestudio A8 Pro AMD FX 8350 4.00 Ghz 16GB RAM Gigabyte GeForce GTX 960 4GB
Re: Advice for weapon changing system
[Re: painkiller]
#365937 03/30/1114:3703/30/1114:37
Hmmm, I see. Well the problem I am facing is the weapons have at least 100 frames of animation minimum. Not only that but their respective textures are a pretty good size too. So the problem I am having with preloading the models is it takes FOREVER to load. Well, at least a full 30-45 second pause.
Re: Advice for weapon changing system
[Re: exile]
#365940 03/30/1114:4303/30/1114:43
Try 30-45MB!!! There are 16 of them The largest texture is 1024x512 and the average texture size is 512x512. Not only that, but the models have 2 skins, one for the hands and one for the weapon. I was considering making the hands completely separate from the weapon models, animating them with EVERY weapon animation, then just place the weapon at the proper bone positions. Not sure what I should do anymore The thing that makes the model sizes so big are the animations.
Re: Advice for weapon changing system
[Re: exile]
#365947 03/30/1115:5503/30/1115:55
Save skins in .DDS, that will reduce size extremely I hope you use bones for animations, cause vertex is big.. I'm using models with size around 10-15MB, with few skins. I make function which creates all of them right before I launch the level And deletes them all after creation, works good and fast