Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

Realistic FPS Prefab [RELEASED]

Discussion in 'Assets and Asset Store' started by Azuline-Studios, Apr 5, 2013.

  1. TheNorthridge

    TheNorthridge

    Joined:
    Jan 4, 2012
    Posts:
    193
    I agree with Tony on all fronts. We must have friendly NPC AI, would really help! Then we can build towns, villages, Whore Houses! :D (jk)
     
  2. Azuline-Studios

    Azuline-Studios

    Joined:
    Apr 5, 2013
    Posts:
    203
    No problem, Dari. For the complete leaning feature, there will need to be some additional checks to prevent the camera from clipping into walls and to determine how the AI will react to the player when they are leaning/peeking around a corner. We’re still working on this, which is why we can’t give you a full example yet. Hope the wait won’t be an inconvenience.

    And about enabling and disabling the crosshair, are you using version 1.18? In version 1.17, we saw the problem with the Crosshair Enabled option, but it seems to be working now in our project using version 1.18. Again, thank you very much for pointing this out.


    Hi Shkarface Noori, great news on your game! The same change can be applied to the 1.16 version of FPSRigidBodyWalker.cs. The cancel sprint condition check is slightly different in 1.16, but here’s the change around line 244 you can make to prevent backwards sprinting:

    Code (csharp):
    1.             //cancel a sprint in certain situations
    2.             if((sprintActive  Input.GetKey (FPSPlayerComponent.fire))
    3.             ||(sprintActive  Input.GetKey (FPSPlayerComponent.reload))
    4.             ||(sprintActive  Input.GetKey (FPSPlayerComponent.zoom))//cancel sprint if zoom button is pressed
    5.             ||(FPSPlayerComponent.zoomed  Input.GetKey (FPSPlayerComponent.fire))
    6.             ||inputY < 0.0f//prevent player from sprinting backwards
    7.             ||climbing){
    8.                 cancelSprint = true;
    9.             }
    You can do a search for "cancel a sprint" in FPSRigidBodyWalker.cs and your scripting editor should bring you to the above condition check. Then you just have to add the line "||inputY < 0.0f" without quotes as shown above. Hope that helps.


    Hi Mister D, sorry to hear you've encountered an issue with the water plane. May I ask a few questions to get a better idea of what might be going on? First of all, are there any errors displayed in the console when running the scene in the editor? And when you mention your screen freezes, does Unity crash/lock up, or does it appear to be a graphics rendering hiccup of some kind?

    I just tested the Water Zone prefab by dragging it into a new scene and it worked in our project, but one thing you can try is changing the water plane material to use a basic diffuse shader, then deactivating the Water Simple script component to rule out the shader/material as the problem. If you still are experiencing this, could you please post a screenshot or some more specifics? Thanks for your patience.


    Hey guys, friendly NPCs will be available soon. TonyLi, the method you described is probably the best way to access the behavior of the current AI scripts (reducing the attack range).

    What needs to happen to make better friendly NPCs, is to handle the target acquisition of the NPCs based on a friendly or hostile var. This would mean that the NPCs will need to be able to acquire multiple targets, but react to them differently, instead of just the single “attack target” that they currently use.

    So the player might still be identified as a target, but if the NPC is friendly, this reference would only be used for following the player or orienting the NPC to face the player while conversing. At the same time, the AI script should also allow the NPC to acquire hostile/non-player targets and perform the normal attack actions on those targets. I’m not sure of how interested you are in making these changes yourself, but we can provide some guidance if you would like to implement these improvements sooner.

    As for a kill counter, there currently isn’t one in the recent version’s scripts, but it would be fairly simple to add. You could create an integer var in FPSPlayer.cs and then in the Die() function of CharacterDamage.cs, you could create a reference to the kill count var of FPSPlayer.cs and increment it when an NPC dies.

    We really like the work you’ve done with the dialogue system and the Realistic FPS Prefab! If you have any specific requests for the types of public variables that you want to access for the behavior of the upcoming friendly NPCs, please let us know. Right now, it looks like there would be these vars added to the AI script:

    isFriendly : true if NPC should not attack the player
    attackNPCs : true if NPC should attack NPCs hostile to the player
    followPlayer : to make the friendly NPC start following if the player enters their attack range

    And also a killCount var in FPSPlayer.cs.
     
    Last edited: Nov 7, 2013
  3. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,868
    How about categorizing NPCs into factions, rather than a friend/enemy Boolean? That way, for example, robots could be aggressive against players and zombies but friendly to aliens.

    My only work with the Realistic FPS Prefab is to provide integration support for customers of the Dialogue System, so I'm not going to edit any Realistic FPS Prefab scripts. Presumably customers will be using the vanilla distribution.

    Could you send more messages to game objects instead, like an OnDie() message? The PickUpItem() message that gets sent to pickups is very useful. It enables me to provide a script that customers can attach to pickups that does some extra Dialogue System-related stuff when the object is picked up.
     
  4. TheNorthridge

    TheNorthridge

    Joined:
    Jan 4, 2012
    Posts:
    193
    I like Tonys idea of a category system.
    What would be really useful, is if you attack a friendly NPC they turn hostile to the player. No one likes to get shot :p

    Friendly NPC will be very useful for my project :)

    Any news from the next update will have the Bioshock like powers?
     
  5. Mister-D

    Mister-D

    Joined:
    Dec 6, 2011
    Posts:
    1,545
    hi azuline,
    the graphics freeze when trying to climb a ladder in the game im making if i have added a plane with a water shader in my scene, the log doesnt show any errors. the ladder is climbable and the screen dont freeze if i disable the waterplane. i have no idea whats happening.
     
  6. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,868
    My current kill count solution (since I don't want to edit Realistic FPS Prefab scripts) is to attach a simple script to the NPC that handles OnDestroy(). When the NPC game object is destroyed, this script updates a counter in the Dialogue System. Do you see any problems with this? I don't want to distribute anything to customers that might cause problems with your framework.
     
  7. Dari

    Dari

    Joined:
    Mar 25, 2013
    Posts:
    130
    Thanks a lot Azuline! I didn't had the new version :)
     
  8. snowboardkid

    snowboardkid

    Joined:
    Jun 16, 2013
    Posts:
    17
    Is anyone else having issues with the CharacterDamage script? I used this on an older version, and it was easy to make any object destroyable, but now I can't get it to work. The Glass object doesn't work for me either (it doesn't shatter anymore). Anyone know what's going on?
     
  9. rcgmhds

    rcgmhds

    Joined:
    Feb 2, 2013
    Posts:
    21
    Hey Azuline! I'm incredibly impressed by the amount of work that has gone into this prefab with it's current price point; it's definitely a required buy for any person wanting to develop an FPS. It is looking utterly fantastic, and I'm speaking primarily for the water hit markers and the ability to swim!

    That being said, could you possibly add the change list from 1.16 to 1.17 to 1.18 as well as update the "upcoming" changes? That would be great! Thanks again. :)
     
  10. Azuline-Studios

    Azuline-Studios

    Joined:
    Apr 5, 2013
    Posts:
    203
    That sounds good ToniLi. A faction system and some public functions like “changeAlliance(allianceID)” or “pauseAttack()” would be useful additions to our asset that the Dialogue System could access.

    The kill counter method you described is a nice and simple way to track the NPCs too. Keep up the great work!


    Having the option to make friendly NPCs turn hostile if attacked is a good idea, TheNorthridge. As far as spells and powers, a secondary/alternate fire system is on the list for a future update, which could be used for spells. You might want to watch this video by TheOneShotGG too.


    One thing you can try is re-downloading the asset from the Asset Store and importing it into a new, blank project, Mister D, as sometimes those processes can be interrupted and cause problems. When you say the graphics freeze, does Unity itself seem to freeze or just the graphics rendering? And if you wait for a while, does an error eventually show up? One of the prefabs (either the ladder, player, or water prefab) might also be misconfigured somehow. Please keep us updated on the situation and thanks again for your patience.


    No problem Dari, glad that solved the issue


    Hi snowboardkid, the way damage is applied to objects was changed in version 1.18, which means that objects will need to be assigned either to layer 19, the Interactive Objs layer, layer 9, the Ragdolls/Pickups layer, or layer 13, the NPCs layer. When this change was made, we missed the step of applying the changes in the demo scene to the Glass prefab in the project library (it still is set to layer 10, World Collision, instead of layer 19). So to have the glass take damage again, you’ll need to set it to layer 19, the Interactive Objs layer at the top right of the inspector and click the Apply button to apply the changes to the Glass prefab object and it should be breakable again. Very sorry we missed that. We’ll be uploading a fixed version to the Asset Store soon.

    As far as using the CharacterDamage.cs script to make objects breakable, this now will only work if the object the script is attached to is set to layer 13, the NPCs layer. We suggest using the BreakableObject.cs script for this, though, and setting the object to layer 19, the Interactive Objs layer, so the WeaponBehavior.cs script will call the damage function of the attached BreakableObject.cs component and damage/break the object.

    One thing to note, is that the current version of the BreakableObject.cs script will cause null reference errors if there isn’t an audio source or particle emitter attached to the object. We’ve just updated this script so these components won’t be required. To fix these issues, you can download this .unitypackage file and import it into your project, which will update the Glass prefab and the BreakableObject.cs script so it can be used to make any game object breakable. Thank you for pointing this out.


    Also, there is another known issue with the asset when trying to do a build for the Windows 8 Store. Some code involving the way coroutines return values and are terminated will cause build errors for this platform. This issue will also be fixed in the next version shortly, but if you need the updated scripts now, please send a PM and we'll give you a link to a .unitypackage file that you can import into your project.


    Thanks, rcgmhds! The changes from version 1.16 to 1.17 should be in the Version Notes section in the documentation under the 1.17 header, if that was what you were asking? The upcoming features list will be updated soon too. Thanks for the feedback!
     
  11. rcgmhds

    rcgmhds

    Joined:
    Feb 2, 2013
    Posts:
    21
    I was referring to this topic, but the upcoming features list is primarily what I was referring to; good to know that it'll be updated soon. :)
     
  12. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,868
    The only snag is that OnDestroy() also gets called when you reload a level -- for example, when the player dies and respawns. If you wouldn't mind changing this line in CharacterDamage.cs:
    Code (csharp):
    1. if (hitPoints <= 0.0f) Die();
    to
    Code (csharp):
    1. if (hitPoints <= 0.0f) SendMessage("Die");
    it would really help us tie in more cleanly.
     
  13. rcgmhds

    rcgmhds

    Joined:
    Feb 2, 2013
    Posts:
    21
    Are there any plans to give the FPSPlayer prefab a model in the future? Heck, I'd be more than willing to pay extra for it to have a model that can cast and receive shadows; it would definitely give me a head start in writing this multiplayer game.

    Also, I'm having an issue with the ranged hit detection and returning the name of a sphere collider that I've placed on the rigging of my models. I converted the WeaponBehavior.cs script months ago to do this by using hit.collider.gameObject.name == "Head" (for example), but now it seems to only recognize the top element, e.g. zombie_1 which would be the name of the prefab.

    Is there anything that was changed that would limit my ability to add a collider to specific body parts and use them to amplify or decrease damage dealt through WeaponBehavior? Thanks in advance.

    PS. I've tried hit.collider.name, hit.collider.gameObject.name, hit.transform.collider.name, etc. Everything returns "zombie_1" when it should be returning "Head" or "Hips".

    Edit: Found the solution. Since Head and Hips didn't have a CharacterDamage script attached to them the if statements would have never found the object I was looking for. I moved the code above the first if statement (checking if the object has a CharacterDamage component) and it works flawlessly.

    Code (csharp):
    1.  
    2. switch(hit.collider.gameObject.layer){
    3.             case 13://hit object is an NPC
    4.                 Debug.Log (hit.collider.name);
    5.  
    The next problem I have is with this:
    Code (csharp):
    1.  
    2. hit.collider.gameObject.GetComponent<CharacterDamage>().ApplyDamage(damage, direction, mainCamTransform.position);
    3.  
    It's throwing a null reference exception. Since the joints don't have a CharacterDamage script attached to them how can I send a message to the parent object? I tried hit.collider.transform.parent.gameObject.GetComponent<CharacterDamage>, but I'm assuming I would have to go farther up the hierarchy to find the base object. Is there an easier way? Thanks again in advance.

    Edit: Found it. Boy, did that take some digging. Now individual body parts work seamlessly with the prefab. :)

    Code (csharp):
    1.  
    2. hit.collider.transform.root.GetComponent<CharacterDamage>().ApplyDamage (damage * 10, direction, mainCamTransform.position);
    3.  
     
    Last edited: Nov 12, 2013
  14. raymondle

    raymondle

    Joined:
    Sep 14, 2013
    Posts:
    2
    Hi, I'm using newest version 1.18, and i'm trying to Build this project to Windows Store Project but have an error at AI.cs, so can you help me ? I see function must return DataType IEnumerator, but this function return bool.

     
  15. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,868
    Just want to let Dialogue System customers know that the Dialogue System for Unity version 1.1.0 is now available on the Pixel Crushers website. It usually takes about 7 days for the Unity folks to get it onto the Asset Store. If you've bought the Dialogue System and don't have access to the customer download page, please PM me. Also, if you plan to buy Chat Mapper (not required, but a really nice tool), PM me for the 10% discount code we arranged with Urban Brain Studios for Dialogue System customers.

    1.1.0 substantially improves integration with the Realistic FPS Prefab:
    • More robustly synchronizes hit points, hunger points, thirst points, ammo, and weapons.
    • Supports kill counts*.
    • Example scene updated with an additional conversation that tests giving and taking items, and a kill quest.
    * The kill count currently listens for OnDestroy() on enemies, which requires a little extra work when you reload a level. If the Realistic FPS Prefab introduces another way to register kills, I'll update the Dialogue System to work with it.

    More info: http://www.pixelcrushers.com/dialogue_system/manual/html/release_notes.html

    If you have any requests for additional features to work with the Realistic FPS Prefab, please let me know!
     
  16. dreamlarp

    dreamlarp

    Joined:
    Apr 22, 2011
    Posts:
    854
    I am very pleased with what is being done between the dialog system and this kit. I love the faction idea. It will help me game. But how will this all work with PVP games? I would love to break the arenas into factions. And how would we use players being killed to this?
     
  17. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,868
    In PVP, each player has his own instance of the Dialogue System, including his own Lua environment where the Lua variable Actor["Player"] refers to that player. You could add each human opponent to the Actor[] table on the fly, and even add fields such as Actor["SomeOpponent"].Faction.

    I assume when a player is killed his Realistic FPS Prefab objects are destroyed, and a new set is instantiated. In concept, you could add the LuaOnDestroy script to each player. Let's say you've defined two variables in your dialogue database: Human_Kills and AI_Kills. Then on the players you can set the LuaOnDestroy line to: Variable["Human_Kills"] = Variable["Human_Kills"] + 1.

    But the snag with using OnDestroy is that we don't know who destroyed the object (i.e, who killed it). In a single-player game it's obvious that it's the player. But for a multiplayer game you'll need something a little more sophisticated. If Azuline adds a different way to handle kill counts, we can change the Dialogue System script to work with it.
     
  18. Azuline-Studios

    Azuline-Studios

    Joined:
    Apr 5, 2013
    Posts:
    203
    Sure, the next version will have this change, which calls the Die() function in any script attached to the NPC. So OnDestroy() won’t be needed for kill counts.

    In the current version of the asset, the player object isn’t destroyed when the player dies, the level just restarts. We can make the same SendMessage() change as was done for the CharacterDamage.cs script to call the Die() function in any scripts attached to the FPS Player object if that would help. The SendMessage() call of the Die() function could be modified to send an attacker ID as well.

    For a multiplayer environment, either the player object(s) could be destroyed and re-instantiated on player death, or the player object could be deactivated, then moved back to the spawn point, and re-initialized and reactivated. This would probably be faster, since that’s how object pooling optimizes the handling of game objects. Keep up the great work!


    Nice job solving the hit detection issue, rcgmhds! The reason version 1.18 affected your previous hit detection method is that the SendMessage() calls for the ApplyDamage() functions were changed to direct ApplyDamage() calls. This was done to allow different types of objects to have their own damage parameter/info sets, for efficiency, and more clarity of where and how damage is applied to specific object types.

    As far as having a character model for the player, this is on the list for a future update as part of a third person mode. TheOneshotGG has already implemented this feature in a project. What’s needed is a toggle-able external camera and animation handling for the character model. Here’s a post where we described how to make a very simple third person mode for testing.


    Hi raymondle, sorry to hear you’ve encountered errors when trying to build for the Windows 8 Store. This is a known issue with version 1.18 and is related to return values and termination of coroutines. I will send you a PM with a link to a .unitypackage file that you can import into your project to fix the problem. This will be addressed in a mini-update shortly that will also fix the glass prefab not being set to the correct layer and taking damage. Thanks for your patience.
     
  19. dreamlarp

    dreamlarp

    Joined:
    Apr 22, 2011
    Posts:
    854
    I do not see any doc's posted on this asset. Can you point me to any that you may have please.

    Thank you.
     
  20. Azuline-Studios

    Azuline-Studios

    Joined:
    Apr 5, 2013
    Posts:
    203
    Hi dreamlarp, here is the documentation. Please let us know if you have any more questions.
     
  21. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,868
    Sending the Die() message with an attacker ID for AI and players would be ideal. With that, there's no need to destroy any objects, since nothing would depend on receiving OnDestroy() messages. Thanks!
     
  22. CactiiPie

    CactiiPie

    Joined:
    Jan 1, 2013
    Posts:
    12
    Hey Azuline, how would I make it where once I use an object like a door (Kinda like when you pick up a gun or something) it switches scenes for interiors or whatever. Thanks!
     
  23. TonyLi

    TonyLi

    Joined:
    Apr 10, 2012
    Posts:
    9,868
    The Azuline folks may have a better suggestion, but you could make the door a "pickup" and add a script with a PickUpItem() method. This method gets called whenever the player "picks up" the item. A simple example would be:

    Code (csharp):
    1. public class Door : MonoBehaviour {
    2.  
    3.     public string newScene;
    4.  
    5.     public void PickUpItem() {
    6.         Application.LoadLevel(newScene);
    7.     }
    8.  
    9. }
    10.  
    Warning: Untested code. I'm not near Unity right now. Also, you might want to get a little more sophisticated than this -- perhaps playing a door-open animation, or using LoadLevelAsync if you have Pro, etc.
     
  24. Azuline-Studios

    Azuline-Studios

    Joined:
    Apr 5, 2013
    Posts:
    203
    Hey guys, TonyLi has the right idea. You could also name the function ActivateObject() since this message is sent as well as PickUpItem().


    In other news, version 1.19 has been submitted to the Asset Store and will be going through the review process. This is a mini-update that includes some small fixes and prevents the build errors for the Windows 8 Store platform. Upgrading isn’t too important, unless you’re experiencing any of the issues listed below or want the improved sprinting feature. Here’s a list of the changes:

    • Fixed AI search range not increasing after being attacked by player.
    • Updated coroutine return and break statements to prevent errors when building for Windows 8 Store.
    • Applied layer changes to the Glass prefab to allow it to take damage after being placed from the Project Library.
    • Added cameraIdleBob and cameraSwimBob vars to Ironsights.cs to allow customization of vertical bobbing of view while idle or swimming.
    • Added staminaDepleted var to FPSRigidBodyWalker.cs to disable sprinting if stamina is fully depleted and sprintRegenWait is true. This is done to prevent the player from sprinting for short times if stamina is low.
     
  25. NessimOnair

    NessimOnair

    Joined:
    Jul 19, 2013
    Posts:
    22
    Hello Azuline I do not understand how to add Skins Gui interface kit? Mistletoe Text to change with my own GUI directory you can do a tutorial I try with my codes its me errors / /
     
  26. Andy Charlie

    Andy Charlie

    Joined:
    May 31, 2013
    Posts:
    31
    Hello Azuline Studios, the new update is great because it fixes more errors that only the ones in the description, little issues whit the zombies triggers and the mp5, but now i have a question, how to implement a spawn system and a player select camera in 1.18? I make a system that simple start the game with a camera that can select multiple players and just instantiate the selected player prefab, but when the game starts it freezes and shows a lot of errors, all about null references by the NPC AI enemies and objects like pick up weapons. I think the problem is in the fact that these scripts need a player that can use, and they dont have any one in that moment.

    Greetings
     
    Last edited: Nov 21, 2013
  27. Devision4

    Devision4

    Joined:
    Jan 12, 2013
    Posts:
    1,329
    Hi, does the OCULUS RIFT Tutorial for 1.6 still work on latest version? I need to implement that quickly. Thanks
     
  28. Azuline-Studios

    Azuline-Studios

    Joined:
    Apr 5, 2013
    Posts:
    203
    Hi NessimOnair, we’ll be looking into implementing a basic GUI soon, so that will be a good example. In the meantime, you should be able to implement any GUI system you’d like by accessing and displaying script variables like “hitPoints” or “ammo”. The GUI elements should also be rendered by the weapon camera, since it has a higher depth than the main camera. The wiki and reference pages might also be good places to start. Does that answer your question?


    Glad you’re enjoying the update Andy Charlie! The issue you mentioned with making a camera that can select multiple players probably has to do with the way that most of the scripts locate prefab objects starting with a “Camera.main” reference to the camera with the “MainCamera” tag. You’re right that many of the game objects in the asset need a reference to the player object. So if the main camera is separate from a player prefab for a time, other scripts in the player prefab(s), NPCs, and pickups will likely encounter null reference errors because they won’t be able to locate the player prefab objects.

    A solution might be to change the Camera.main references in the scripts to a direct player object reference that doesn’t depend on a camera with the MainCamera tag, or to delay the initialization of the scripts until the main camera has selected a player and become part of the player prefab’s hierarchy like it is by default. This a technical improvement we could make to the scripts in a future update that would allow more flexibility and control over the camera. Thank you for bringing this to our attention.


    Hi Devision4, the Oculus Rift tutorial should still work for version 1.19, but only if the Remove Prefab Root box is unchecked on the World Recenter component of the FPS Player object. It’s suggested to leave this box checked though, which will make the setup of the prefab slightly different than how it is described in the tutorial.

    With the Remove Prefab Root box checked, the main parent object of the prefab objects (FPS Player, FPS Weapons, FPS Camera, FPS Effects) will be deleted on starting the scene. We will update the Oculus Rift tutorial to reflect these changes, but you still might be able to figure it out. We will also be updating the guide that covers NPC and player damage soon to reflect the changes introduced in version 1.18. Sorry for the inconvenience, but please let us know if you have any questions.
     
  29. dreamlarp

    dreamlarp

    Joined:
    Apr 22, 2011
    Posts:
    854
    Has anyone tried this on mobile yet? I would like to know how well this does with mobile and multiplayer.
     
  30. sistematix

    sistematix

    Joined:
    Dec 26, 2012
    Posts:
    9
    there's a bug when NPC robots were underwater, they can still shoot the player, but player can't shoot NPCs while underwater, The NPC should avoid the water zone when chasing the player
     
  31. Andy Charlie

    Andy Charlie

    Joined:
    May 31, 2013
    Posts:
    31
    Hi Azuline Studios, me again, the solution works! i will be glad to post soon the scripts i made to share to you and everyone this mod, just need to fix some issues. But im here with other question. I try to make a GUItexture, just by selecting "Gameobject" - "create other" - GUItexture, and then just add the texture.That works fine always in unity, and other projects. But when i start the game the texture not shown, it looks fine in the "game" tab, when the game is stop, but i just press play, the game starts and the texture is gone. Please help
     
  32. GageLucasDev2

    GageLucasDev2

    Joined:
    Jul 24, 2013
    Posts:
    77
    Hi. Just a quick recommendation for the Kit.

    I think itd be nice to have a stock feature for enemy respawning over time, such as enemy will respawn if not dead every 5 minutes.

    If this is a feature already in or easy to implement please point this out. Thanks
     
  33. GageLucasDev2

    GageLucasDev2

    Joined:
    Jul 24, 2013
    Posts:
    77
    Am i to assume this product is dead?
     
  34. Azuline-Studios

    Azuline-Studios

    Joined:
    Apr 5, 2013
    Posts:
    203
    Hi dreamlarp, we’ve built the project for Android and have been in communication with users who have built the project for other platforms, so the asset should work with mobile. If you run into any problems with this process please let us know so we can work with you to resolve the issue. What is lacking in the current version for mobile is on-screen/touch virtual joysticks. In an upcoming version we will be improving the input method by moving all the input calls to one script, which should allow easier modification. Here is a blog post that might help as well.

    Currently multiplayer has not been tested with the asset, but a few users have reported some initial success implementing their own multiplayer modes. The “Remove Prefab Root” var of the WorldRecenter.cs script was added as a result of such a discussion, because the multiplayer feature a user was implementing required that all the player objects be included under one parent object, instead of being located under the scene hierarchy root (which is more ideal for a SP environment with larger scenes). We’re planning on implementing multiplayer in the future, but there are some other gameplay, input, and AI improvements that we’d like to make first. If you have any more questions about this, please feel free to contact us again.


    Thanks for pointing this out, sistematix. We know about this behavior of the NPCs not avoiding water zones. One thing you can do as a work-around is to create about a waist-high collider around the water which is flagged in the Layer Collision Matrix of the Physics Manager to only collide with layer 13, the NPC layer. A better solution to this will be introduced when the AI pathfinding gets an upgrade, which will result in the AI truly avoiding movement into areas and pathing around obstacles.

    As far as having the player fire underwater, each weapon object has a Fireable Underwater box on their WeaponBehavior.cs component which determines if that weapon can be fired underwater. Not all weapons have this attribute set to true by default, but you could change this if you’d like.


    Good to hear it worked, Andy Charlie. Nice job! For the GUITexture issue, did you set the layer of the new object to layer 14, the GUICamera layer? This is the layer used by all the GUI elements in the scene and prevents them from being repositioned by the WorldRecenter.cs script. This script moves all scene objects towards the origin for floating point precision purposes. If your GUITexture object is not set to layer 14, WorldRecenter.cs will change the original position coordinates of that object which are needed for correct alignment on the screen. If this doesn’t solve the issue, please let us know.


    Hi DevGuy, wave spawning or other more advanced spawning of enemies is something we definitely will be looking into for future versions. In the current version, you might want to take a look at the MonsterTrigger.cs and MonsterItemTrap.cs scripts, which spawn, or more accurately, control activation and deactivation of existing NPC objects, when the player moves into a trigger area or picks up a trapped item. These scripts might be a good start for implementing a basic version of the feature like the one you mentioned, but a better way to do this would be to implement an NPC instantiation or object pooling method which has the ability to spawn/place NPC objects infinitely and more dynamically in the scene. If you need any help or information on how to implement a feature like this in the meantime, please let us know.
     
  35. shkar-noori

    shkar-noori

    Joined:
    Jun 10, 2013
    Posts:
    833
    can you point the multiplayer projects?? i mean who made them?
     
  36. Andy Charlie

    Andy Charlie

    Joined:
    May 31, 2013
    Posts:
    31
    ¡It worked! this was to make my HUD, i think this is the best way to make your game HUD, just make the art in photoshop, export to unity in png. make a GUITexture, adjust the positions of the texture and guitext and woala, a perfect and easy GUI where only you imagination is the limit.
     
    Last edited: Nov 29, 2013
  37. sistematix

    sistematix

    Joined:
    Dec 26, 2012
    Posts:
    9
    thx azuline cant wait for the next version, so here's my experiment i've add some few codes and change the Zombie NPC, i want to create a basic night scene mode, set the ambient light to dark, remove the directional light but the terrain still look like a daylight mode :( any solution?
    $zombie project.jpg
     
  38. shkar-noori

    shkar-noori

    Joined:
    Jun 10, 2013
    Posts:
    833
    great job you done there.... maybe u should try to disable lightmapps, and where did u get that zombie model in the right? (Not Mixamo's zombie).. can you provide a link to it?
     
  39. sistematix

    sistematix

    Joined:
    Dec 26, 2012
    Posts:
    9
  40. rcgmhds

    rcgmhds

    Joined:
    Feb 2, 2013
    Posts:
    21
    Hey Azuline. I have a few issues I'm wondering if you can help me solve. They may or may not be affecting everyone else.

    1. Noticed an issue with being unable to select or use weapons, even after dropping them, if you hold (press and hold Z) a usable object (canteen or apple) then use it by pressing E.

    2. The Table and Shelf will not render in the Game view; it will, however, render in the scene. This also applies to the ladder prefab.

    3. The FPS prefab (arms and active weapons) will not receive shadows. This is rather odd considering the 1.16 prefab worked very well with shadows.

    4. The M1911, MP5, and Shotgun pickup objects will not receive shadows either.

    5. The camera is about half a meter higher than any other object (character models) in the asset store. Can you please explain how to lower it?

    6. Once a "Zombie" attacks the attack animation infinitely loops regardless of the distance between the player and the npc. This happens on occasion and I haven't figured out why it happens quite yet.

    7. NPC's (Zombie's in particular) are raised about a third of a meter off of the ground. I've tried adjusting the character controller center, but it seems like it wants to raise itself regardless.

    I believe #5 and #7 are a consequence of the same thing, but I haven't quite figured it out yet. Do you have any plans for supporting Unity 4.x animation methods? It's getting harder and harder to find legacy supported animations.
     
    Last edited: Dec 1, 2013
  41. sam07

    sam07

    Joined:
    Dec 1, 2013
    Posts:
    1
    Hello Azuline. :D

    How to remove Hunger and Thirst ? I don't need this ...
     
  42. bobbylee

    bobbylee

    Joined:
    Aug 15, 2013
    Posts:
    42
    Hello,

    I am looking hard at buying this asset, I do have one question, how hard would it be to integrate Daikon Forge GUI with this currently?
    I read your list of planned updates, so I am happy with that part, it looks like this can be the best FPS out there soon.

    Thank you.
     
  43. jessica1986

    jessica1986

    Joined:
    Feb 7, 2012
    Posts:
    622
    IS it android, ios ready ?
     
  44. Andy Charlie

    Andy Charlie

    Joined:
    May 31, 2013
    Posts:
    31
    In the player.cs you can toggle that functions
     
  45. Andy Charlie

    Andy Charlie

    Joined:
    May 31, 2013
    Posts:
    31
    I think that would be easy, just make sure that all your GUI prefabs or objects are in the GUICamera layer
     
  46. Andy Charlie

    Andy Charlie

    Joined:
    May 31, 2013
    Posts:
    31
    AFAIK is not made to compile directly to android or ios, but you could make or buy a touch screen fps controls, then in the RFPS prefab configure the controls (they are to easy to edit) to work whit that touch screen buttons, then just download the android or IOS SDK to complete the tools for export the game, but that is just a idea.

    And wow, a girl in this forums.
     
  47. shkar-noori

    shkar-noori

    Joined:
    Jun 10, 2013
    Posts:
    833
    Hi....i have made a pause system and I get this error when i unpause the game...

    $error.png

    any idea how to fix it...as i said i have a full game coming with this package....and i have done A.I and GUI and Main-menu and tweaked most of this packages into my needs...as you see here:

    http://kitn.net/wp-content/uploads/2013/10/١.jpg

    so i need some other guns....how can i do that with your package?? can i send you a weapon model and you make it work with this package. i just cant get everything done when it comes to design and positioning... can you help me?
     
  48. Azuline-Studios

    Azuline-Studios

    Joined:
    Apr 5, 2013
    Posts:
    203
    The multiplayer project I mentioned was a personal project that a user was working on. They mentioned that they were using Photon Cloud. I don’t have a link or any more information on this, other than there is still some work that needs to be done for compatibility with the Realistic FPS Prefab out of the box. With some research into both projects and Unity itself, it should be possible.


    Great Job, Andy Charlie. GUITextures are very flexible and there is definitely a lot of potential with what you can do with them :)


    No problem, sistematix. As Shkarface Noori mentioned, you probably need to remove the lightmaps for the demo scene. You can do this by going to the Window->Lightmapping menu, then clicking on the Clear button. It should be noted that you will have to re-bake the lightmaps again if you want the original lighting of the demo scene, which can take some time.


    Hi rcgmhds, I’ll answer your questions as you’ve listed them:

    1. Just tested this and can confirm that this is a bug. Not sure why this happens yet, but possibly has something to do with the DragRigidbody.cs script causing the pickup object to be removed before the WeaponPickup.cs (or other script) can execute all of its pickup code. It’s interesting that the pickup sound is played and the item is removed, but the player’s inventory is not updated. Until we find the cause of this, a simple work-around would be to not allow the player to pick up items that they are dragging. This can be done by adding a line of code to this condition check around line 494 of FPSPlayer.cs:

    Code (csharp):
    1.         //Pick up items        
    2.         RaycastHit hit;
    3.         if(!IronsightsComponent.reloading//no item pickup when reloading
    4.          !WeaponBehaviorComponent.lastReload//no item pickup when when reloading last round in non magazine reload
    5.          !PlayerWeaponsComponent.switching//no item pickup when switching weapons
    6.          !FPSWalkerComponent.holdingObject//don't pick up objects if player is dragging them -ADD THIS LINE-
    7.          (!FPSWalkerComponent.canRun || FPSWalkerComponent.inputY == 0)//no item pickup when sprinting
    8.             //there is a small delay between the end of canRun and the start of sprintSwitching (in PlayerWeapons script),
    9.             //so track actual time that sprinting stopped to avoid the small time gap where the pickup hand shows briefly
    10.          ((FPSWalkerComponent.sprintStopTime + 0.4f) < Time.time)){
    2. Do you know which platform are you building for? That might make a difference in the way that the textures and meshes are compressed. The table, shelf, and ladder seem to be working in the scene and game views on our end. You also might want to try re-downloading the asset in case the package was corrupted. It seems odd that other models would render correctly, but those three would have the rendering issue.

    3 4. We developed the asset without real-time shadows, so there may be some inconsistencies in the object prefab’s Cast Shadow and Receive Shadow flags. I can confirm that the shotgun, MP5, M1911 pickup models, and the view weapon and arm models do not have their Cast Shadows and Receive Shadows boxes checked on their Mesh Renderer components. Checking these boxes will allow them to cast and receive shadows, though for the view weapon and arm models to receive shadows from level geometry, the weapon camera will need to be deactivated and the gun layer will need to be added to the Main Camera’s culling mask to allow it to render the gun elements.

    5. You can set the Player Height Mod value of the FPSRigidBodyWalker.cs component attached to the FPS Player object to -0.5 to decrease the player’s height by 0.5 units. We haven’t tested this variable with negative values much yet, and it appears that sometimes the player will get stuck in the ground when un-crouching. We will be looking into how to fix this for the next version.

    6. The zombie attack anim looping issue is one that we’ve yet to encounter. Have you experienced this in the unchanged/unedited demo scene? Also, when you notice this happening, are there any errors displayed in the console?

    7. For the levitating zombies, you can try increasing the default character controller center Y value of the zombie NPCs from 1.1 to 1.3. This seems to bring the zombie’s feet closer to the ground. Although the height of the capsule might need to be decreased to better fit the size of the zombie model. We’ll also be tweaking this for the next version.

    You make a good point about the animation methods. We’re still looking into this and whether or not it still makes sense to support the legacy animation methods as newer versions of Unity are released. Thank you very much for pointing out the above issues. We will be looking into making improvements in these areas for the next version.


    Hi sam07, Andy Charlie is correct that you can uncheck the Use Player Hunger and Use Player Thirst boxes of the FPSPlayer.cs component attached to the FPS Player object. Doing this will deactivate the hunger and thirst features and prevent those attributes from being drawn on the screen. Hope that helps.


    Thanks bobbylee, integrating the Daikon Forge GUI should just be a matter of following the standard method the authors suggest. The main thing to keep in mind about the Realistic FPS Prefab, is that it uses a system of two cameras, the main camera for drawing the scene, and a weapon camera for drawing the view weapon models and the GUI elements. If you’re drawing GUI elements, they should be assigned to layer 14, the GUICamera layer, which will draw the GUI elements with the weapon camera, which has a higher depth than the main camera. Hope that helps.


    Hi jessica1986, we’ve tested the project so that it can be built for the Android platform successfully. As Andy Charlie said, what’s currently missing is virtual/on-screen joysticks for mobile. We’re modifying our input methods to make this process more straightforward, but it still could be done for the current version with some research and testing. Here is a blog post we wrote on the subject. Please let us know if you have any more questions.


    Nice work Shkarface Noori! The error in your console screenshot is probably happening on the first frame after un-pausing, or setting Time.timeScale back to a positive value from zero, when Time.deltaTime isn’t a usable value yet. There is a known inconsistency in the WeaponBehavior.cs script around line 698 which looks like this:

    Code (csharp):
    1. if(Time.deltaTime > 0.0f  !unarmed){
    and it should be this:

    Code (csharp):
    1. if(Time.smoothDeltaTime > 0.0f  !unarmed){
    That may or may not be causing the errors, but it looks to be related to the same issue. As far as adding new weapons, have you seen this video? We’re also planning on making another video tutorial which covers the process of adding new weapons that use the default hand models and animations. This is done by duplicating the existing weapon objects, deactivating the existing mesh objects that you want to replace, and making the new weapon model object a child of the original weapon model in the hierarchy. If you have any specific questions or need more help, feel free to send us an email or PM.
     
  49. rcgmhds

    rcgmhds

    Joined:
    Feb 2, 2013
    Posts:
    21
    1. Thanks for the work around!

    2. I'm building for Windows/Linux/Mac, but I figured out what was happening. If Batching Static is enabled on an object it will not render in the Game view, but it will render in the scene view. I'm not to familiar with it, but disabling this fixed it right up. As a side note, I had entire houses, walls, and a few other things have this behavior as well.

    3 4: The information you gave regarding the pickups helped considerably. Thank you! As far as working with the weapon camera and altering it to cast/receive shadows, I can't seem to get it working as you described. Hopefully you can give me further instruction at a later time as this is more of a "final polish" scenario and isn't immediately important.

    5. I messed around with this value and found that -0.35 is the lowest I can go without offsetting the height of the player too much and it being shorter than other common objects (stove, counters, tables, etc). I messed around with the Crouch Height Percentage as well; like you said, it gets "stuck" in a crouch position when I set it to 0.35 (for prone).

    6. I haven't been able to reproduce this issue for a while. It may have been caused by me not setting a transform or an incompatible animation.

    7. Yes, I set the character controller for another model that I have to 1.1, height to 1.85, and made sure that the models feet were touching the ground. This seems to have fixed it up quite nicely. I haven't really messed with the model/prefab that came with the FPS package.

    I really didn't like to point out the lack of support by animators for legacy because your system works fantastically in regards to transitioning. All I had to do to have an entirely different animation set from what came with the package was to plug-in and go; this really made my day and the only grievances I really have are already stated.

    The only other thing that I can think of that this package is lacking is pathfinding using NavMesh (Pro features). It's so hard to find a working solution that you can plug into your scene and go like this one. I've said it before and I'll say it again; I would not mind at all to have to pay more for an upgrade that included pathfinding and more diverse npc features (dynamic wandering at the very least).

    PS. Here are two screenshots that show the difference between crouching (crouch height percentage: 65) and standing (Height Mod: 0) in relation to other assets.

    Crouching: https://www.dropbox.com/s/xmt5r55qgdc5gdo/Screenshot 2013-12-02 14.56.19.png
    Standing: https://www.dropbox.com/s/f6er1ia89g0a7nt/Screenshot 2013-12-02 14.57.03.png

    I could always adjust the scale of my npc's, but when I did earlier during a test run they didn't seem to trigger hits on the player.
     
    Last edited: Dec 2, 2013
  50. GageLucasDev2

    GageLucasDev2

    Joined:
    Jul 24, 2013
    Posts:
    77
    i do need assistance on how to spawn enemies in an area over time when they die.

    also, how may i go about moving the hunger and thrist around and is it possible to apply the numerical value to a texture that can be subtracted? same with health.

    regarding the ammo notifier, i just need to know how to change the font, color, etc.

    Thanks
     
    Last edited: Dec 6, 2013