Weapon Additions - Updated Feb. 15th 2014 (Discontinued)
Posted: Mon Sep 23, 2013 12:51 am
- [+] Original post
- I've been working on adding the Remington 870 shotgun to Receiver, and it's all going surprisingly well. I figured I would share my progress so far with you guys, as this forum isn't very lively.
You can see the video below:
Right now I'm just working on getting it working, I would love to get some help from those who are familiar with firearms to explain how the Rem. 870 actually operates. I'm not sure if the slide needs to back/open when inserting the first round, and gets chambered when you push it forward, or if you can just fill the tube separately and cock it whenever.
Other than that, don't hesitate to make suggestions - I shoot left handed so the position and rotation the shotgun moves to while pulling the slide seem (somewhat) natural to me but probably not a right handed individual, I can easily change this position/rotation by moving an object so I'd love to hear any ideas of how it should move. How it is now you can't really see the handle move, I'm not too sure how it should be.
- [+] Update 1
- So I've gotten a lot more done today, it is pretty much working but I still need to get the rounds animated while being inserted, that should not be too difficult. I don't want to have to write everything twice, so if you want to follow the minor updates check out /r/Receiever, I will still update this post fairly frequently and also when a build is available for download. Here is an update video:
- [+] Update 2
- I re-textured the shotgun shell I made so it actually looks like the shell was fired afterwards (I know the end fold things should be open, but hey, I'm not a modeler):
Round insertion has been animated, flashlight use has been disabled while holding the shotgun, a well as a few other minor pose tweaks so that it doesn't raise to loading when the safety is on & the slide is pulled. There have been a few minor pose tweaks for the other handguns, I reduced the amount they rotate when you pull the slide, the Colt almost goes completely sideways! I always wanted to change that. I also fixed a bug in which a bullet that has been fired raycasts from the inital fired position to the current, causing a drone that flies into the any part of the trajectory to be hit with the bullet.
I've contacted Wolfire to request permission to distribute it, so now we wait. In the time they take to respond I'll be polishing what I have already, you can expect the build to be available within the next day or so depending on how quickly they reply, and if they allow it.
- [+] Update 3
- Everything is done now. The shotgun pellets to lose velocity a lot faster than bullets like they do in real life, it makes the shotgun less over-powered although it is still really strong. To make up for how good it is I've made the player walk slower and inserting rounds pretty slow as well. I think I've fixed the issue with the stock clipping through your face so you can see inside the gun, but there may be the rare occasion where the recoil moves it into such a position.
- [+] Update 4
- I made a few performance improvements after finding this thread, the robots and lights shouldn't slow the game down as much as they were, each robot was checking the entire scene for the player every frame. The lights were updating every frame, too. Now they only check once when they're created and lights update only if they're shot or animated blinking, which is a good improvement.
I also slightly reduced the amount of lights on a few parts of the map, it's barely noticeable but it should also help with performance. The shotgun pellets are a little weaker now as well, and they also spawn on the map a lot less frequently than they used to. A download should be available pretty soon.
- [+] Update 5
- I've been reading around the forums and have been trying to add a few things that people seem to want. Magazines are now a rare drop in ammo piles, and I added a weapon selection part in the options menu for when you respawn:
It saves what you pick so you will keep spawning with whatever you choose until you pick random again. I also put the Thompson model into the game, it's not operating properly yet as it fires from an open bolt but that will be much simpler to write than the pump action. I figured out how to change the slide movement speed so the fire rate is roughly the same as the actual Thompson, and I reduced the recoil so it's not crazily inaccurate like the Glock's full-auto mode. I figure since it's a two-handed weapon it would be easier to manage the recoil.
The magazine model needs to be slightly changed but that will only take a few minutes whenever I'm not lazy, it holds 20 rounds and fires .45 acp like the 1911. Whenever I can share it I'll be sure to have a few versions excluding weapons because I know some people don't think it fits. I'll be adding more handguns after this, and possibly a shooting range so you can just play around with the guns. Wolfire still hasn't responded, I guess they're pretty busy.
- [+] Update 6
- Update 6:
I made another video update just to show how things are looking, I added the Tokarev TT-33 pistol to the game as well as the shooting range I was talking about before. I haven't done any prop placement or anything yet so it's just the terrain, but I plan on making it like a little outdoor shooting range like this.
I made the 870's recoil a little more realistic now, instead of rotating a lot like the handguns it kicks upwards and slightly to a side like you see with the handguns but increased a bit. It still needs to be increased but it's better than before, you can't really see it much in the video as I'm controlling it but it's there.
I tried adding a main menu button to the options for some reason the scene just doesn't feel like restarting even after resetting all of the fading variables, I'll get it working eventually so you don't have to restart the game to go from the range to the actual game or the other way around.
- [+] Update 7
- This is a small update, no new weapons or anything. I fixed up the TT-33 model a bit and changed the 870s reload pose toggling so that it doesn't wait until it's fully raised or lowered to toggle, you can now drop flashlights and the main menu button is working. I had to remove the menu fading for now to get it to work but it's not necessary to play the game. To drop a flashlight you just need to holster your gun and press E (if you change the controls the mag release button). I also worked on the shooting range a little bit and added some targets and also a trashed van that was free on the Unity asset store. I also tweaked the recoil for the R870 and Thompson, but the default pistols have not been touched.
I tried experimenting with a camera and render texture, I plan on modeling a small TV and putting it in there so you can see the targets up close without having to walk there. There's also a fun physics glitch if you walk into the back of the camera test!
- [+] Update 8
- Update 8:
Since there's not enough room to write it out in detail (and I'm sure you don't want to read it), here's all the changes for this update:
Spoiler nesting does not work! :(
I changed around the options menu a little bit and added sliders for bullet hole and casing objects life time and robot sleep distance, I also put in a check box to show bullet trajectory.
The life time is the casing and bullet hole time before they disappear, it's in seconds, the maximum being 300 (5 minutes) or infinite. The robot sleep distance is self-explanatory, if robots are further than this distance they will pause and their rigidbodies will sleep, which is what causes them to float in place. The minimum value (20) is what Wolfire originally had the distance set to.
These 3 values only affect the objects when they are created, for example if you set the life time to 300, shoot a bullet, then switch it back to 30, that casing will still stay for 5 minutes. Robots only change their sleep distance when created, so if a new room is generated or you respawn.
I've almost finished the Thompson's action type so now it operates as it should, except for the fire selector and the ability to slowly lower the bolt with your hand to not fire doesn't chamber a round as it should. To release the bolt with your hand, hold R, pull the trigger, and then release R while holding the trigger, although it moves very fast right now. The safety/fire selection is disabled right now too. Here's a .gif to show how it works:
I scripted a bolt action weapon type so I figured I should include it even though it's a placeholder model, it was fun to play around with for a little bit. The sights aren't lined up perfectly though.
I've changed the refill loose bullets cheat to refill the magazine in your gun as well, and added a new cheat for a bottomless magazine. It's toggled by typing the keys 'I-N-F-I-N-F' in rapid succession like the other cheats, but must be disabled automatically if you remove the magazine.
This update adds 2 more guns (Mauser C96 and H&K USP) and replaces the old Thompson model with a better one, among a few other changes
- [+] changes
- -R870 can press-check to inspect chamber (T+R as usual)
-Pile of loose rounds on the range for magazine-less guns
-Fixed TT-33 magazine collider size
-Possible level tile generation optimizations (either no improvement or little, I can't tell)
-Bullet penetration on robots now takes velocity, mass & angle into account
-Bullet impact force exerted now takes mass and velocity into account
- [+] spoiler
- Hitting the battery will completely disable a robot while the motor will only disable the rotors/turret rotation
The power cable seems almost impossible to hit though..
Penetration decreases exponentially as the angle gets greater, this was just a test photo with random values
The C96 is not accurate to the real world one - As ArgenGuy has said the select fire knob indicates it's the M172 but I got lazy and decided to have the C96 use magazines rather than stripper clips, when I get to working on the bolt action rifle's code and get stripper clips working it will be changed. For now it operates similar to the 1911, though it does not have an external slide lock, it will still lock open with an empty magazine but tapping the slide forward will have it release like pulling the slide lock down (T).
The USP Compact is a DA/SA pistol so the hammer will automatically cock and release if it isn't when the trigger is fully pressed like the model 10 revolver. Thanks to Andrew1994 for the model! He never specified if it was the compact version or not, but without adjust the scale of the .45 round the magazine held 8 rounds like the compact does, it appears to be fairly small as well.
The bolt-action rifle has not been worked on at all, but the model will be replaced with a Mosin Nagant M91/30 or Kar98k eventually and then I will attempt to make stripper clips.
Download (Base files)
Download (Most recent update)
For those who are just finding this post and don't want to sift through the old stuff or learn by trial and error, here's the controls/info for everything I've added so far:
- [+] Controls
- Remington 870:
E=Toggle reload pose
R=Pull back slide
Z=Insert round when in reload pose
T+R=Press-check to inspect chamber
You can direct chamber load by inserting a round with the slide back
E=Toggle bolt rotation
R=Toggle bolt movement(forward, back)
Z=Insert round when bolt is open
Holster weapon and press E with flashlight in hand
Bottomless magazine cheat:
Toggled by pressing the keys 'I-N-F-I-N-F' in rapid succession - Currently only works with magazines. Disabled automatically if you remove the magazine.
(This does not run by itself)
Copy the contents of the base files .rar archive into the Receiver directory, overwriting all the files. Then repeat with the most recent update archive. They must be done in that order or you will end up with the first mod release from a while ago.
If you have this mod installed from the first release or any update, then you do not need to use the base files archive anymore. It just contains all the files that needed to be updated due to me using a newer version of Unity, most files can be omitted for updates to slightly reduce the download size.
If you are running on Steam, be sure to deactivate the automated update service.
(Thanks to Davidos for this info!)
If you find any bugs or have any suggestions feel free to reply to this thread or send a PM (though I cannot respond to PMs).
- [+] Known bugs
- End of game hanging:
If you collect all 11 tapes, the screen will fade to white and hang there without loading the win scene. It's not confirmed but I believe it's only happening with Steam users, it seems to load properly for me, at least in the editor.
Giant shotgun shell:
If you shoot while unholstering the 870, the shell gets scaled larger relative to how close the gun is to the unholstered rest position. If you wait until it's almost in position it will only be slightly larger than it's supposed to be. Not sure what's causing it.