Search Unity

FPS Tutorial update

Discussion in 'Editor & General Support' started by Jeff Aydelotte, Jun 10, 2009.

  1. saverio4pc

    saverio4pc

    Joined:
    Jul 15, 2009
    Posts:
    1
    For some reason I couldn't get anything to work in the tutorial part one, however part two was going great until I hit a snag with the rocket explosion. I can't get it to collide with other meshes with colliders, do I need to edit the script? I am using newest unity and OSX.
    thanks
     
  2. grfxman

    grfxman

    Joined:
    May 28, 2009
    Posts:
    309
    I think it might be better all around to have the waypoints actually have a variable to assign the next waypoint. IE.. a waypoint target. Also Having a variable that allows you to assign a monster / NPC to the path.

    I'm considering rewriting the waypoint. In theory you would have a "Waypoint Starting Post" that held the monster/NPC then have a simpler script for the individual posts that made up the rest of the path. And each one would have a variable slot for the next post. This would probably use less memory and also the interface would be much less cluttered. Also you could incorporate respawning upon NPC death and the Waypoint Starting Post would be a good place to put that code. If you wanted to be slick you could also add a variable to assign the color of the line between waypoints. Thus helping organisation of large groups.

    As I said earlier I combined this demo with the island demo. And Having too many waypoints actually killed it at compile time. but a bigger issue was waypoint lines going everywhere. Even to clusters I did not want on the other side of the island. Which made organization an issue.

    I'm looking for a job this week but next week if I have time I'll post a test. :)
     
  3. Seth1984

    Seth1984

    Joined:
    May 5, 2009
    Posts:
    19
    @grfxman: Great idea!! An optimal thing would be in my opinion the definition of several (not just 3) points in the 3d space (let say and array of points to be reached, or having several empty objects placed into the scene to have it visually) and as you suggest an assigned npc that will go from the first to the next following a imaginary straight line...
    So, an npc, a bunch of points (placed smartly [no pathfinding requested] in order to allow the npc to follow a linear path which also can have different y values ) and a really "forget about the rest" logic which just processes two points each time and loops till the assigned npc is "alive"....

    @aebrahimi: I think that the collisions for the level mesh are not properly working... There are places (i.e inside the main room of the building) where the grenades and rockets does not collide, falling down, remaining alive without obviously triggering the explosion code... However, the player does not fall anywhere...
     
  4. grfxman

    grfxman

    Joined:
    May 28, 2009
    Posts:
    309
    Thnxs for the comments :) This tutorial really got me to love Unity's Abilities. I was dreading having to learn yet another scripting language after spending 5 months learning Real Crafter's language. But since my end goal is an MMORPG this tutorial got me excited about this engine.

    As far as the lack of explosions in certain rooms, That is something I encountered as well. It has more to do with the rigid body solver then any code. In any animation package if an object is passing through a really low resolution mesh at too high of a speed, its possible for it to pass thru a barrier before the solver can detect any collision.

    Your options to fix this usually are

    _1 Increase the density of the mesh.

    _2 Slow down the rate of speed/velocity of the projectile.

    _3 increase the number of times the rigid body solver calculates for object collision per second.

    You can get these same errors in any 3D package that runs physics simulations. And its always a trade off on accuracy versus speed. I fairly new at this app so I'm not sure how you would increse the solver's samples per second. But I'm sure it is in the manual somewhere. :)
     
  5. Seth1984

    Seth1984

    Joined:
    May 5, 2009
    Posts:
    19
    @grfxman: I think you're right, but i0ll understand your analysis for what concerns rockets, but for grenades (which travel not so fast) i was expecting something different... for improving the physical computation one should modify the Fixed Timestamp value (in the first pdf of the tutorial, pag. 16), but probably also the mesh of the tutorial is not properly dense as you suggest.. Obviously for my future projects i'll keep this considerations in my mind...

    However, i'm really interested in the waypoint idea you're proposing.. will you be so kind to let me know if you do progresses with it or also if you need help implementing this functionality?
    Thanks...
     
  6. shader

    shader

    Joined:
    Apr 4, 2009
    Posts:
    253
    Hi

    This thread has gone a little quiet recently ... is the FPS demo completely finished now or are we awaiting further developments ?

    I check everyday :)

    Thanks
     
  7. antenna-tree

    antenna-tree

    Joined:
    Oct 30, 2005
    Posts:
    5,324
    The update on the original post in this thread should work for most everyone now. However we found one more bug which has stopped us from officially releasing it on the site.
     
  8. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,552
    Could somebody please post up the Ai, Ai Animations and Waypoint scripts?

    Edit: nevermind :)

    I'm on dialup for a few days and downloading the lot while take ages. The scripts seem to have been removed from the third pdf.

    Cheers
    AaronC
     
  9. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,552
    I tried attaching this but the forum wont let me.

    Its the defined waypoints approach where one waypoint references the next. Inspiration Courtesy DaveyJJ, and the origional scripts of course.

    http://rapidshare.com/files/258822810/DirectionalWaypointExample.zip.html

    Only 10 downloads available so if someone feels like adding it here for others that could be handy.

    Cheers
    AaronC
     
  10. sport20

    sport20

    Joined:
    Jun 14, 2009
    Posts:
    39
    Quick question about the FPS tutorial.

    Do you have to create a new scene when you start each part?

    I tried following from part 1 and continuing to part 2 with the rocket launcher but I've ended up with some errors.


     
  11. tholland

    tholland

    Joined:
    May 28, 2009
    Posts:
    129
    I've worked my way through the three parts of the tutorial and have problems with the final one:

    - the sounds for the rocket and the machine gun don't work. I can play the machine gun ok in Windows Media Player, but the rocket makes it crash!

    - killing the robot generates the rag doll although sometimes it takes off into the sky, rather than lying dead on the ground.

    Any ideas about what I'm doing wrong?
     
  12. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,552
    @tHolland, when I first did these tutorials quite some time ago, I did it three times over, until I got comfortable with it. Well a little more comfortable.

    If firing the rocket is causing a crash on windows it sounds like a null reference exception: The code is seeking something thats not there so doesnt know what to do. Is everything assigned in the inspector? Does the rocket prefab have the audio and explosion prefab assigned?

    @Others (lol non-Dharma Initiative)
    My defined waypoints project is now on my website for D/L
    click the www button below and its under the "Stuff" tab.

    It enables your AI to travel along a definite route, rather than semi-randomly-and hard to control, like the fps tutorial.

    Enjoy your work
    AC
     
  13. amirebrahimi

    amirebrahimi

    Joined:
    Jan 27, 2008
    Posts:
    171
    So, I replaced the Unity package with a project folder for all the people who were having crashes on Windows when importing. I have fixed this crash bug in 2.6. See the OP for download links. We'll push all of this to the website soon.
     
  14. amirebrahimi

    amirebrahimi

    Joined:
    Jan 27, 2008
    Posts:
    171
  15. grfxman

    grfxman

    Joined:
    May 28, 2009
    Posts:
    309
    Thanks ! Downloading it now :)
     
  16. grfxman

    grfxman

    Joined:
    May 28, 2009
    Posts:
    309
    Ok so I downloaded th new files and there are a few issues:

    _1 First upon loading the completed tut file it asked me to save to update the files. Which I found odd since this is supposed to be a new version.

    _2 once the scene was loaded and I hit play I got these errors:

    NullReferenceException: The prefab you want to instantiate is null.
    UnityEngine.Object.Instantiate (UnityEngine.Object original, Vector3 position, Quaternion rotation)

    (at C:\builds\unity-trunk\unity\Runtime\Export\Generated\BaseClass.cs:51)
    RocketLauncher.Fire () (at Assets\WeaponScripts\RocketLauncher.js:11)
    UnityEngine.Component:BroadcastMessage(String, Object, SendMessageOptions)
    UnityEngine.Component:BroadcastMessage(String, Object, SendMessageOptions)
    UnityEngine.Component:BroadcastMessage(String) (at C:\builds\unity-trunk\unity\Runtime\Export\Generated\BaseClass.cs:532)
    PlayerWeapons:Update() (at Assets\WeaponScripts\PlayerWeapons.js:10)

    _3 I went ahead and built it anyway. These were the major errors during game play

    Rocket Launcher does not work

    Barrels don't explode

    Enemies don't fire anything
     
  17. amirebrahimi

    amirebrahimi

    Joined:
    Jan 27, 2008
    Posts:
    171
    Is this the completed project you downloaded or the assets folder for starting out the tutorial?
     
  18. grfxman

    grfxman

    Joined:
    May 28, 2009
    Posts:
    309
    Its the completed project. Thought I would test it first.

    The starter projects doesn't contain a scenes folder. The only error I'm Getting on the Starter Projects is :

    There are inconsistent line endings in the 'Assets/WeaponScripts/Explosion-Simple.js' script. Some are Mac OS X (UNIX) and some are Windows.
    This might lead to incorrect line numbers in stacktraces and compiler errors. Unitron and other text editors can fix this using Convert Line Endings menu commands.
     
  19. amirebrahimi

    amirebrahimi

    Joined:
    Jan 27, 2008
    Posts:
    171
    Somehow an older version of the completed project got published. I'm updating the site right now with the newer version. I'll post again when it is done.
     
  20. grfxman

    grfxman

    Joined:
    May 28, 2009
    Posts:
    309
    Thanxs :)
     
  21. amirebrahimi

    amirebrahimi

    Joined:
    Jan 27, 2008
    Posts:
    171
    The completed project folder has been updated.
     
  22. shader

    shader

    Joined:
    Apr 4, 2009
    Posts:
    253
    :(
    Rocket launcher doesn't work for me (v2.51, Vista)
     
  23. Armagon

    Armagon

    Joined:
    May 29, 2009
    Posts:
    246
    I'm really sad to know that the updated FPS Tutorial does not have any new features, after so much was requested by the community. As it is, just a couple of bug fixes that most Unity developers had fixed themselves, and updated documents. :cry:
     
  24. amirebrahimi

    amirebrahimi

    Joined:
    Jan 27, 2008
    Posts:
    171
    @Armagon: The point of this update was to fix the tutorial documentation and completed project, so it would work outright in v2.5.1. This is step one of a two part process, which was to simply maintain old content that once worked. Step two will be to produce a wholly new FPS tutorial, based partly on the feedback of our community.
     
  25. outtoplay

    outtoplay

    Joined:
    Apr 29, 2009
    Posts:
    741
    Well, I'm glad you went to the trouble of updating the FPS. I think it's a great learning tool and having it jive with the latest version of the software is damn helpful.

    I also wanna shout out to Jeff for his very cool, video tutorial breakdown of the Occlusion Culling project for iPhone. Five minute in and out, and his cadence and speaking style were exactly right. THIS is exactly what the hordes are looking for... A quick, to the point single topic vid. Bravo! and look forward to as many as you guys can pump out.

    Props to the Unity Demo Team. The goods are coming and the promise of the best documentation in the industry is well underway.

    B. 8)
     
  26. grfxman

    grfxman

    Joined:
    May 28, 2009
    Posts:
    309
    I have to agree. I know this tut has run into some problems for a time, But it is a step in the right direction for anyone who is building an MMORPG or FPS.

    Thanks for all the work that you guys put into it!!! :)
     
  27. CrystalVisions

    CrystalVisions

    Joined:
    Sep 11, 2007
    Posts:
    61
    The Completed tutorial is still the old one.
    I downloaded the one above it and did not get the updating message.

    However, I still cannot open the tutorial or any
    project or unitypackage that contains an .mb file. The asset importer becomes non-responsive. Anyone have any suggestions?
     
  28. shader

    shader

    Joined:
    Apr 4, 2009
    Posts:
    253
    Hi

    Could someone respond to CrystalVisions post please, I can't see any difference either.

    Thanks
     
  29. HiggyB

    HiggyB

    Unity Product Evangelist

    Joined:
    Dec 8, 2006
    Posts:
    6,183
    Dude, relax and wait for it. :) It's barely 9:30am here in San Francisco where the demo team is primarily based so they're not likely on the forums just yet. :)
     
  30. amirebrahimi

    amirebrahimi

    Joined:
    Jan 27, 2008
    Posts:
    171
    What do you mean by updating message?

    There is only a project folder, no unitypackage. The .mb file is there only to give additional source material if you own Maya. We provide an FBX file for the purpose of the tutorial, which does import regardless of whether you have Maya installed or not.
     
  31. shader

    shader

    Joined:
    Apr 4, 2009
    Posts:
    253
    @HiggyB

    Did I state or imply a time restriction on the response ?
     
  32. amirebrahimi

    amirebrahimi

    Joined:
    Jan 27, 2008
    Posts:
    171
    Apparently, there is now an issue with the update making it through our CDN (content delivery network). I'm looking into it now.
     
  33. CrystalVisions

    CrystalVisions

    Joined:
    Sep 11, 2007
    Posts:
    61
    grfxman had said earlier: "First upon loading the completed tut file it asked me to save to update the files. Which I found odd since this is supposed to be a new version. "

    That is what I mean by the "updating message" which still appeared on the completed tutorial but not on the fps tutorial at the link above it.

    As far as the mb files: It is not a problem if there is an fbx file as well, and it is a project so that I can remove the mb file before opening it. But if the project only contains the mb for example the Locomotion project with the coyote model, there lies the problem.

    Every time I try to open a unitypackage file OR a project that contains an mb file it freezes the asset importer. I have the learning edition of Maya installed. Where should I be posting this, in a bug
    report?
     
  34. amirebrahimi

    amirebrahimi

    Joined:
    Jan 27, 2008
    Posts:
    171
    I'm not sure if Maya PLE allows exporting to FBX. Can you check whether that is an option? Currently, we only support automatic importing of maya files into Unity with registered, full versions of Maya and Max. To prevent Unity from freezing you'll need to disassociate .mb/.ma files with Maya as this is what we use to automatically import the files.
     
  35. amirebrahimi

    amirebrahimi

    Joined:
    Jan 27, 2008
    Posts:
    171
    Okay, so I’ve just renamed the file altogether to get around the delay in this getting propagated through our CDN. If the file on the fps tutorial page does not say “FPS_Tutorial_Completed.zip”, then you need to refresh your page.
     
  36. CrystalVisions

    CrystalVisions

    Joined:
    Sep 11, 2007
    Posts:
    61
    Thank you thank you thank you thank you. Much.
     
  37. shader

    shader

    Joined:
    Apr 4, 2009
    Posts:
    253
    Great it's working !

    The rocket launcher is very scary, I can't wait to let it loose on those pesky herons on the island

    BTW: I extracted the completed.zip file and ran inside Unity. Can I assume that the other first 4 files in the list are the latest ? I am sure they are but I'd just like confirmation please.

    Thanks :)
     
  38. grfxman

    grfxman

    Joined:
    May 28, 2009
    Posts:
    309
    Hee Hee I have the old FPS tut working on the island demo already and people love shooting the Herons. :) LOL

    But I'm looking forward to comparing this version with the old one.

    Quick Question: Were there any changes made on the waypoints on this version? The old ones were memory hogs and would kill the build if you added to many.
     
  39. Armagon

    Armagon

    Joined:
    May 29, 2009
    Posts:
    246
    grfxman, i compared the "updated" FPS tutorial with my version of the old FPS tutorial and i saw absolutely no significant changes, specially to the culling or waypoint scripts. So, no performance or other improvements at all. :(
     
  40. grfxman

    grfxman

    Joined:
    May 28, 2009
    Posts:
    309
    Well That's OK if it's just a maintenance update. There is a large and very helpful group of talented people on the forum and wiki. So I'm sure we will be able to add some fun touches. The main thing is that the FPS really is a good foundation for learning the Unity3D app.

    I am in the middle of making a bunch of VTM's for my site and it looks like I will be working with the guys at unitytutorials.com as well. It's my intention that all of the tuts I make are geared towards making MMO's and MMORPG's. And since I found this tut so useful I have already made plans to expand on it.

    I'll make a separate post in about a week with the details and I'll also try to add some additional tools for this tut specifically. I'm just waiting for a few questions to be answered by Unity and then I'll wrap the first VTM and do the final edit and post the NFO. :)
     
  41. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,552
  42. grfxman

    grfxman

    Joined:
    May 28, 2009
    Posts:
    309
    Those are pretty cool !!! Thxs for the link :)
     
  43. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,552
  44. ddesmond

    ddesmond

    Joined:
    Feb 9, 2010
    Posts:
    163
    Hello,

    I am unable to get the fps tutorial to go past the first step of using the mainlevelmesh. I don't see textures. When I run the application, I don't see anything either. Is there a recent download for the fps tutorial?
     
  45. andeeeee

    andeeeee

    Joined:
    Jul 19, 2005
    Posts:
    8,768
    Hello and welcome to the forum!

    Is this with the complete version of the tutorial (ie, the downloaded one)?
     
  46. ddesmond

    ddesmond

    Joined:
    Feb 9, 2010
    Posts:
    163
    Yes, it is with the complete template, I realized that I made a mistake. I tried to import new assets, I tried copying the project folder and it seemed to work. It was complaining about the may .mb file, so I removed it. The fbx file is grey, doesn't seem to be showing textures.