Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

GTGD's Unity Multiplayer Tutorials

Discussion in 'Community Learning & Teaching' started by GTGD, Feb 7, 2012.

?

Please select each option you agree with (you can select multiple options)

Poll closed Dec 22, 2015.
  1. I like that the videos are covering a complete project.

    230 vote(s)
    88.1%
  2. I find the videos are detailed enough for me to understand and follow.

    197 vote(s)
    75.5%
  3. I find the video quality is clear enough.

    186 vote(s)
    71.3%
  4. I find the audio quality is clear enough.

    180 vote(s)
    69.0%
  5. The narrator doesn't send me to sleep.

    143 vote(s)
    54.8%
  6. In general the topics covered are interesting.

    170 vote(s)
    65.1%
  7. I find the website useful.

    130 vote(s)
    49.8%
  8. The Gamer To Game Developer logo looks good.

    119 vote(s)
    45.6%
  9. I would like to suggest topics that GTGD should cover in the future.

    103 vote(s)
    39.5%
Multiple votes are allowed.
  1. im

    im

    Joined:
    Jan 17, 2013
    Posts:
    1,408
    oh once thing i just finished video 32 which is basically the end and one gaping hole ive jsut noticed is nothing on sound (music, sfx, ect) so would be nice if there was some video that was added that covered basic sound (music, sfx) like when the player clicks on a menu item or when they fire the blaster or teleport, etc.

    found a little issue with S2 video 3

    i notice u have a coroutine and u have a wait based on ping which may actually not be enough time

    i found alternative which would always work is to requets host list

    and the do something like

    Code (csharp):
    1.  
    2.  
    3.     void OnMasterServerEvent(MasterServerEvent msevent)
    4.     {
    5.         if (msevent == MasterServerEvent.HostListReceived)
    6.         {
    7.             hostList = MasterServer.PollHostList();
    8.  
    9. // put ping thing here i u like
    10. refreshing = false;
    11.                 }
    12.         }
    13.  
    the above always works. then u can check for refreshing in doing gui and if so give message... also u can have refresh button that ignores them if in middle of existing refesh. ect... its check for false set to true when u call

    Code (csharp):
    1.            
    2. if(!refreshing)
    3. {
    4.     refreshing = true;
    5.  
    6.     MasterServer.ClearHostList();
    7.  
    8.     MasterServer.RequestHostList(GameInfo.Type);
    9. }
    10.  


    also this

    Code (csharp):
    1.  
    2. if(serverPingList[i].time <= 0)
    3.  
    should be this

    Code (csharp):
    1.  
    2. if(serverPingList[i].time < 0)
    3.  
    actually 0 is ok its normally like your local server on same box or in lan without latency to speak of so there is no need to say n/a for 0, just for negative. negative is like cant get ping at all so i normally turn that to 9999 so it sorts correctly

    so basically if u sort by ping u get local servers, lan servers, then internet servers and then u get those who u cant get a ping for...
    just trying to help out :)
     
    Last edited: Jan 26, 2014
  2. GTGD

    GTGD

    Joined:
    Feb 7, 2012
    Posts:
    436
    @FAR

    1. I haven't tried using more than one camera but perhaps you could just parent them like you're suggesting. I'm guessing that you're trying to have all those views display at the same time.
    2. If you don't have too many player types then building different player types and turning them into prefabs is certainly something you could do. You could write yourself a checklist to make sure that you attach all the necessary components to the gameobject as you build it.



    @MithosKuu

    Text issues:
    Putting a character limit on the player name is a good idea and I should have put a character limit on the input side of the communication log. The length of the communication and combat log is not really that important because it's a tiny amount of data and the game is going to end eventually.

    Server Security:
    You could write a bit of code so that the server checks what damage is applied and if it's beyond what it should be the player gets banned (the game action is not slowed down that way). I feel that a voting system is a pretty good way to get rid of cheaters from a game as well. I think an authoritative setup is a bit slow for an FPS game. You can see in S1 that I'm already struggling to have acceptable gameplay with a non authoritative setup.

    Expandability:
    Yes this is something that I was intending for Series 2. I'm currently working away figuring out how to get S1 onto Steam. After that then I think I had better turn my attention back to Series 2 to fulfill my promise in video 34 I think it was.

    Thanks!

    @im

    Thanks for finding the bug! I'll have to look into it once I sort out getting S1 onto Steam!

     
  3. GTGD

    GTGD

    Joined:
    Feb 7, 2012
    Posts:
    436
    @GregMeach

    Thanks!

    The kickstarter though isn't mine. It belongs to someone by the name of Jordan Lee Jones. He really needs to take S1 way futher before trying to call for funding because S1 is just a learning project.

    @radaro89
    No S1 was made in Unity 3.4 so there will be a number of warning messages. I don't remember there being red errors when bringing it to Unity 4. You can watch video 2 of series 2 to see what I altered to have the project fully functioning in Unity 4. The main problem was the communication log not working.

    For the drop down box options what were you getting and what was I getting in the video?


    @im

    Yes I didn't implement sound in the project but it isn't that hard either. There's also a really excellent plug-in on the asset store called Master Audio for controlling sound and that's what I was using for my current project (a sailing ship game where you blow up priates!).

    Thanks for sharing your code for requesting the host list! I wasn't entirely happy with my implementation so I'll give yours a go and definitely implement it once I get it working.

     
  4. catbert90

    catbert90

    Joined:
    Jan 26, 2014
    Posts:
    7
    Really great tutorials its much appreciated,,, I dont suppose some one can help me though ive been stuck on it ages... As im trying to make a 3rd person shooter so im having a really hard time trying to put a new camera script in with networking for a third person view :( Can any one help me please?
     
  5. kool

    kool

    Joined:
    Jan 26, 2014
    Posts:
    2
    can any one make fps constructor tutorial it need to configure
     
  6. radar089

    radar089

    Joined:
    Jan 2, 2014
    Posts:
    216
    i will let you know what my resuts are when i check out theseries 2 video 2, i must have missed that lol.
     
  7. radar089

    radar089

    Joined:
    Jan 2, 2014
    Posts:
    216
    @GTGD

    Dude how do you feel about his kickstarter? it looks like a straight copy of the world u builtand all, i guess if you dont mind its no big deal. did he even give u cred? i could have at least made a new gui and world scene...

    have a good day and thanks for your hard work on the tutorials you gave out for free, your amazing.
     
  8. im

    im

    Joined:
    Jan 17, 2013
    Posts:
    1,408
    hi again

    let us know when it goes live on steam

    and we'll give it a nice review!

    :)
     
  9. GTGD

    GTGD

    Joined:
    Feb 7, 2012
    Posts:
    436
    @catbert90, The main thing that you need to understand is to make sure that you control what is sending the RPC across the network for controlling a camera or any other gameobject for that matter. Once you've grasped that I believe you should be able to apply that concept to a third person camera no problem.

    @kool, you might want to elaborate because I don't think you've said enough for most of us to fully understand the question.

    @radaro89, I think you've already had a look at my reply to GregMeach above. I really don't mind if someone uses my project however they want, so long as it isn't for a nefarious purpose somehow. Really the project belongs to everyone who follows the tutorials or purchases the project folders, and I've really just provided a foundation project. Someone explained to me, with an example, that what I've done is to prepare a pizza base and it's up to each person to turn it into the pizza that they want. They have to make their own sauce, put their own toppings and then bake it how they want.

    Thank you for your concern though. I do appreciate it.

    @im,

    Awesome! God Willing, when GTGD S1 is successfully setup for steam I'll be sending you a Steam key (I think that's what its called) pronto. Of course I'll be getting in touch with all of my customers who bought any of my products so that I can give them a Steam copy as well. Btw, I've successfully built an application in Adobe Director (I've lost track of how many software I trialed for building an application) for playing the videos and I have to do a bit of testing but it looks like its working well and it's fast and responsive.

    Only downside is that the scaling in my application is poor and anyone with a resolution of 1366x768 and below will have a somewhat unclear viewing experience. Fortunately all of the videos will be available in a Data folder, in.MOV format, so everyone can in fact bypass the .exe application and still play the videos in whatever video player they are comfortable with (or even copy them to a smart phone or tablet). I'll be making sure to state this in the requirements section of my store page so that people are aware and don't send me too many unhappy messages :(. I haven't entirely given up yet and I'm still trying out stuff to see if I can overcome this situation :).

     
  10. catbert90

    catbert90

    Joined:
    Jan 26, 2014
    Posts:
    7
    So if I was to create a single player third person camera it should be quite easy to adapt it to multiplayer? Im struggling so much in this aspect...

    Thanks for your reply
     
    Last edited: Feb 3, 2014
  11. cod3r

    cod3r

    Joined:
    Sep 19, 2012
    Posts:
    91

    Typically networking needs to be involved from the get-go. While I don't have specific experience with this particular tutorial, if I was you I'd include networking at the very beginning.

    It's not that it can't be retrofitted, but you will have a harder time doing that than just adding it at the beginning.
     
  12. GTGD

    GTGD

    Joined:
    Feb 7, 2012
    Posts:
    436
    I'm mostly just replying to myself here, but I just wanted to note down that I've mostly solved the resolution issue for my Adobe Director application for GTGD S1, and anyone with a 1366x768 resolution will get video playback just a bit less than 720p due to some scaling. I think I was just a bit dumb in making optimal use of window space. Resolutions lower than that work as well but the video playback resolution falls closer to something resembling 480p.

    Today I checked the Steam software and hardware survey stats, and from all the users who participated 24% of them had a primary screen resolution of 1366x768 (laptops probably)! So yes, when building any application or game it is critical to make sure that it works well at this resolution.

     
  13. im

    im

    Joined:
    Jan 17, 2013
    Posts:
    1,408
    hi so r we there yet... ;)

    ?1366x768 ?

    do 1024 x 768 instead

    oh u need conversion software? there r nice free ones

    handbreak
    http://handbrake.fr/

    here more
    https://en.wikipedia.org/wiki/Comparison_of_video_converters

    also check out

    http://www.videohelp.com/


    good luck

    also what r rules for using your framework that people type in as they go through the tutorials. i mean i did all the videos and i followed along and typed it all in and made a growing number of fixes, changes and added features, removed features, ect... so how can i use it. can i use it in a game... i mean not your basic game of cource. i have my own game, but can i use the source code that ive done so far from it in my own game so long as the source code is not released and only the game unity build stuff is released... hey perhaps oneday i'll have my game on steam greenlight. and perhaps oneday it would get greenlite like your software... ;)


    also i need to replace the movement rpc stuff with state synchronization i figure... and some how get animations involved. perhaps pass some int representing the animation to play. also ill have to add prediction, dead reckoning or interpolation/extrapolation.. so would be nice to see some video or find some other good tutorial on all that...

    http://docs.unity3d.com/Documentation/Components/net-StateSynchronization.html
     
    Last edited: Feb 4, 2014
  14. GTGD

    GTGD

    Joined:
    Feb 7, 2012
    Posts:
    436
    For building the Adobe Director application (.exe needed for Steam) yes I think I've gotten there as per my reply to myself above :D. Next step is to learn how to get what I've built into Steam using the Steamworks SDK. Ok so I have no idea what I'm doing at the moment, but once I study the Steamworks documentation thoroughly I should figure stuff out and get this ball really rolling.

    Thanks for those links and your time. I've never known about that last site till now.

     
    Last edited: Feb 4, 2014
  15. im

    im

    Joined:
    Jan 17, 2013
    Posts:
    1,408
  16. GTGD

    GTGD

    Joined:
    Feb 7, 2012
    Posts:
    436
    I saw your message yesterday but I couldn't reply because I'm running the Steamworks sdk to upload GTGD S1. I couldn't reply because there is no ability to type in the console window (a DOS like window). The normal steam client can't run alongside it. It also showed your username as some bunch of numbers so I couldn't tell who wrote to me.

    Anyway as for rules on using the framwork, well I guess there are no rules so go and do whatever you want and then one day get your game onto Steam :).

    I'd recommend mecanim for animation and just syncing the input data across the network (watch Unity's tutorial on mecanim and you'll understand how mecanim works). I didn't base my scripts on the no longer available Unity multiplayer example project so I don't remember how networking was done in it and how they synced the old style animation across the network.

     
  17. im

    im

    Joined:
    Jan 17, 2013
    Posts:
    1,408
    re: saw your message yesterday but I couldn't reply because I'm running the Steamworks sdk to upload GTGD S1

    its not a problem


    re: Anyway as for rules on using the framwork, well I guess there are no rules so go and do whatever you want and then one day get your game onto Steam .

    well thanks you but, u might still want to consider copyrighting your work. not just the videos, but the source code as well. i dont think you want people to jut to take your source code and start selling it or start selling a build of it... they should have to make significant changes to it and make some other different game... you dont want someone selling it as a complete project for example with or without value. it should most likely be limited to reference use. im not lawyer, but i think you understand you've created this body of work at great cost to you in many ways, time, lost opportunity, ect... and some people out there are not very nice... i on other hand if you took a look at it you would recognize less and less with each pass i make to the code..

    here for example is what is left to your respawn window

    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4.  
    5. public class RespawnWindow : BaseWindow
    6. {
    7.     private const string ManagersGameObject= "Managers";
    8.  
    9.     private const string WindowTitle = "Respawn"; // i still have to do localization but i move as many constants out as i could
    10.  
    11.     private const string RespawnButton = "Respawn"; // i still have to do localization but i move as many constants out as i could
    12.  
    13.     private SpawnManager spawnManager;
    14.  
    15.     override void WindowStart ()
    16.     {
    17.         SetWindowTitle(WindowTitle);
    18.        
    19.         GameObject gobject = GameObject.Find(ManagersGameObject);
    20.         spawnManager = gobject.GetComponent<SpawnManager>();
    21.     }
    22.  
    23.     void RespawnPlayer()
    24.     {
    25.         HideWindow ();
    26.        
    27.         spawnManager.RespawnPlayer(Network.player);
    28.     }
    29.    
    30.     override void WindowMain()
    31.     {
    32.         if(GUILayout.Button(RespawnButton, GUILayout.Height(ButtonHeight)))
    33.         {
    34.             RespawnPlayer();
    35.  
    36.             return;
    37.         }
    38.     }
    39. }
    40.  
    and i still have to do all my gui styles and graphics. just pure functionality

    im not going to post your source code but u can see what i did is as i went through videos i wrote it my own way... and i still have to do things like localization and move constants, ect to config files....

    all my windows basically extend abstract class BaseWindow and have their own api to replace unity it handles most of the work and i just do things unique to the window in the specific window scripts.
     
    Last edited: Feb 6, 2014
  18. GTGD

    GTGD

    Joined:
    Feb 7, 2012
    Posts:
    436
    Well here you go. Here's the EULA that will be going with GTGD S1. The last line allows for derivative works.

    Btw, I've successfully uploaded the application to Steamworks and then downloaded and tested it successfully. Valve has a really impressive system. I've also finished setting up the store page. I'm hoping that GTGD S1 will be live on Steam by the end of next week or the week after. Valve needs a bit of time to carry out a review before it can go public.

    Please read the following terms and conditions carefully before using this SOFTWARE PRODUCT. Your use of this copy of "GTGD S1" indicates your acceptance of this License.

    SOFTWARE PRODUCT here means Software, videos, and all accompanying files received with your order of "GTGD S1".

    If you do not agree to any of the terms of this License, then do not install, or use the SOFTWARE PRODUCT.

    This SOFTWARE PRODUCT, all accompanying files, data and materials, are distributed "AS IS" and with no warranties of any kind, whether express or implied. The user must assume all risk of using the program. This disclaimer of warranty constitutes an essential part of the agreement.

    This SOFTWARE PRODUCT and all services provided may be used for lawful purposes only. Transmission, storage, or presentation of any information, data or material in violation of any Australian law is strictly prohibited. This includes, but is not limited to: copyrighted material, or material we judge to be threatening or obscene. You agree to indemnify and hold GTGD harmless from any claims resulting from the use of this SOFTWARE PRODUCT, which may damage any other party.

    You are allowed to create derivatives of the project source code for commercial purposes so long as they are for lawful purposes only.


     
    Last edited: Feb 9, 2014
  19. GTGD

    GTGD

    Joined:
    Feb 7, 2012
    Posts:
    436
    Valve was super fast with my reviewing my store page! GTGD S1 will be coming to Steam on the 13th of February 0900 PST time.
     
  20. Twinny

    Twinny

    Joined:
    Apr 30, 2013
    Posts:
    13
    I have a question. I recently upgraded to Windows 8 and somehow lost most of the project files in the process. I looked at your site but you only have downloads available for scripts and other miscellaneous items. Would i have to buy the $30 package in order to get access to the completed Unity project?
     
  21. GTGD

    GTGD

    Joined:
    Feb 7, 2012
    Posts:
    436
    GTGD S1 is coming to Steam at a price of 25 USD and it will be 22.50 USD for the first week. It should be released late this week. I've removed the $30 package from my store page. Yes you'll need to purchase the package to get the completed Unity project folder. It's not just a project folder, I'm also offering project folders for each video and also all of the videos themselves including the two S2 videos I stopped at.

     
  22. leekinon

    leekinon

    Joined:
    Dec 4, 2013
    Posts:
    21
    I have a question. How can we save the HP and energy after respawn?
     
  23. GTGD

    GTGD

    Joined:
    Feb 7, 2012
    Posts:
    436
    I'm already using playerprefs to save those values and then restore them when the player is respawning. The player stats window will have those saved values showing. You could have some more code that does a similar thing after the player has respawned.

     
  24. im

    im

    Joined:
    Jan 17, 2013
    Posts:
    1,408
    thanks for the eula :)

    congrats on your steam release and best of luck :)
     
  25. leekinon

    leekinon

    Joined:
    Dec 4, 2013
    Posts:
    21
    Is it work about save the player name after respawn by using player stats ?
     
  26. RetroGear

    RetroGear

    Joined:
    Feb 14, 2014
    Posts:
    3
    Hi GTGD

    I'm completely new to Unity (although I've done some c# coding using the XNA framework some time back). Purchased your tutorial series through steam – congratulations on a first class set of tutorials, . I've found these to be immensely informative and exceptionally well presented.

    I've worked my way through the first 10 episodes and all has been fine. Started on 11 (Crouching) and have hit a problem right at the start;

    private CharacterMotor motorScript;

    Hovering over “CharacterMotor” I get the message “The name 'CharacterMotor' does not exist in the current context”. I've searched through the forums etc but have not been able to find a solution to this problem (I apologise if I've missed the solution somewhere).

    The CharacterMotor script is present in my project (I modified it as instructed in tutorial 5), I've tried re-importing the Character Controller assets but I'm still unable to get the 'Crouching' script to recognise the CharacterMotor script.

    Any help you can give would be greatly appreciated

    regards
     
  27. GTGD

    GTGD

    Joined:
    Feb 7, 2012
    Posts:
    436
    This might be a very silly suggestion, but double check where you've attached the Crouching script to and check the line of code in the start function that sets up a reference to the CharacterMotor. The problem shouldn't be present with the completed project folder I provide so you could check that as well.

     
  28. RetroGear

    RetroGear

    Joined:
    Feb 14, 2014
    Posts:
    3
    GTGD – thank you for the reply. I haven't attached the Crouching script to anything yet – I only got as far as typing the first line in (private CharacterMotor motorScript; ) when it became apparent that there was a problem.

    I copied and pasted the “Crouching” script from your download into my project and the same thing happened - all references to 'CharacterMotor' show up in red in the script (indicating a problem) with “The name 'CharacterMotor' does not exist in the current context” appearing when I hover over the script.

    I have uninstalled and reinstalled Unity but the problem remains. I tried creating a new project, imported the Character Controller assets and created a single script containing the private CharacterMotor motorScript; line and the same problem occurs. Am I missing something – e.g. should I be attaching the 'CharacterMotor script' to an empty GameObject and referencing it that way?

    I am using Unity Version 4.3.4. I tried to install and run Version 3.4.0 but this simply crashes on start up (I have Win7 64bit OS).

    So it looks like I'm missing something or perhaps that reference to CharacterMotor using 4.3.4 for some strange reason just does not work.

    I propose to “go around the problem” for now and not include the Crouching script in the project as I would like to press on with the remaining tutorials. Is this likely to have any impact on the remainder of the project?

    I've probably made some sort of stupid mistake but I've been following the tutorials carefully and am just a bit confused as to what is going on.

    Anyway – thank you for your help.
     
  29. catbert90

    catbert90

    Joined:
    Jan 26, 2014
    Posts:
    7
    Hey GTGD glad to see your on steam now congrats!

    Im just wondering if you ever fixed the player name changing on re spawn bug? If so could you point me into the direction of how to fix it please?

    Thanks for all your tutorials they have been truly amazing in me learning unity and C#

    Thanks,

    Rob.
     
  30. GTGD

    GTGD

    Joined:
    Feb 7, 2012
    Posts:
    436
    @catbert90, that's not a bug, I explain in the video why that is happening and it's because one set of player prefs is being read and written to on the same computer.


    @RetroGear, if you happen to be using Windows 8 then check that you have the .net framework 3.5 installed.

     
  31. RetroGear

    RetroGear

    Joined:
    Feb 14, 2014
    Posts:
    3
    GTGD Hi

    RE: "CharacterMotor does not exist in the current context"

    Thank you for your reply. I am using Windows 7 and have .NET.Framework 4.5.1 – could this be causing my problems?

    I was at the point of giving up on this problem but I noticed that I could not access any of the .js scripts (in the Standard Assets folder) from any of my c# scripts. I managed to find this thread

    http://answers.unity3d.com/questions/163644/script-from-js-to-c.html

    which led me to

    https://gist.github.com/zephjc/5641540

    This was a CharacterMotor script in c# on GitHub. This had been converted from the .js script. I copied this into a c# script within a new project as a test and I could access the components of the CharacterMotor script without any problem.

    So my question is have I missed something out in setting up the Unity environment that is preventing me from accessing .js script components from my c# scripts? I feel I have must have messed up somewhere as I assume other people are not having this problem.

    I am using Windows 7 64bit and Unity 4.3.4

    I'm going to start from scratch with a new project and rebuild the Prototype Game project from your tutorials. Does it matter where the c# version of CharacterMotor resides i.e. Standard Assets Folder or Scripts folder within my project assets?

    Sorry to be pestering you with this but it may be relevant to others having similar problems. Thanks again for your help.
     
  32. GTGD

    GTGD

    Joined:
    Feb 7, 2012
    Posts:
    436
    Double check if the older framework is installed as well. If not then it would be a good idea to install it so that MonoDevelop recognizes generics which you'll come across shortly.

    The C# version of the CharacterMotor script can probably be put anywhere, but I think the original one had to be in the Standard Assets folder. I could be wrong though because I've never tested taking it out of the folder.
     
  33. morvi

    morvi

    Joined:
    Feb 8, 2014
    Posts:
    10
    Hi GTGD,

    first, I have to say "THANK YOU" for your great work on the tutorials, they really helped me dealing with unity, 3D-Game Development and so on.

    I just have a little question to video S1.7. I searched for it in the forum and in unity documentation, but I didn't find an answer: Why is the grey color of the box behind the health bar darker than the color of the bigger box around it - since you didn't mention any background-color in the code?

    Sorry, if I missed the question anywhere ....

    Is it true, that there's going to be a new series 2 soon?

    I'm really looking forward to it.

    morvi
     
  34. GTGD

    GTGD

    Joined:
    Feb 7, 2012
    Posts:
    436
    I'm just drawing an empty box behind the health bar and the colour is grey because that's the default Unity GUI skin colour.

    I'm working on Series 2 right now! I'm not yet sure how long it's going to take, but I can confirm the following topics as a minimum for series 2:

    1. Deploying your own unity master server at no cost so you can move away from relying on Unity's testing master server. More importantly your users can host public servers and players can see and join those servers because of your master server. No need for expensive third party networking plugins.
    2. Mecanim animation across the network running, strafing, jumping, and perhaps crouching.
    3. Simple and effective combined first and third person camera for networking or single player.

    At this stage I'm not sure if I'll be bringing in health, weapons and all that stuff because it's covered in series 1 and I'm aiming to keep series 2 focused and much shorter than series 1.


     
  35. NikoBusiness

    NikoBusiness

    Joined:
    May 6, 2013
    Posts:
    289
    hello friend you are the best !!! thank you for the tutorials , im in the 5 part of your video at the end but i have an unusual problem i cant understand how is it possible when i start 2 .exe instance and chose 1 red 1 blue it works fine but when i switch with alt + tab to the other instance sudenly 1 of the instance is behaving wrong what it does is when i press move it moves only the other player not the one it should :/ and when i press shoot the other player shoots not the actual player HOW IS IT POSSIBLE to 1 instance work corect and the other not work correct?
     
  36. GTGD

    GTGD

    Joined:
    Feb 7, 2012
    Posts:
    436
    Hello,
    It's possible that you haven't edited all the player related scripts as required. Also double check that you have enabled Run In Background.

    o CharacterMotor scirpt
    o FPSInputController script
    o MouseLook script
    o FireBlaster script
    o CameraScript

     
  37. morvi

    morvi

    Joined:
    Feb 8, 2014
    Posts:
    10
    Excuse me, I think I explained too bad what I was wondering about.

    You actually draw to GUI.Box's in S1.7 for the HUD, a big one as a kind of frame for other HUD-Components to come in the next videos I guess and a small one as a Background for the green health bar.
    Now when I play the game and watch the green bar shrink, because of resuced health, I can see the colour of the small Background box and then I see that the colours of this small Background box and the colour of the bigger "frame"-box are different, although you didn't change the color between drawing these boxes. That seemed strange to me.

    The topics for series 2 sound very good. Beside working on your tutorials I have a closer look on photon since I want to make a board game on PC with multiplayer off course, and for some reason hamachi doesn't work anymore on my pc - the ping to my friends PC failed - I reinstalled the whole PC but that didn't help. After googling and watching youtube videos with this topic for hours and hours I gave up. But then I have to have a dedicated server and that's why I came to photon.
    But maybe your solution with unity master server is the better one

    As I said, I'm looking forward to it
    morvi
     
  38. Regretfulone

    Regretfulone

    Joined:
    Nov 20, 2013
    Posts:
    1
    (Sorry to sound like many of the others who have posted so far), Thank you so much for putting out these videos! I have learned so much and I am only just starting on video 7. Unlike some tutorials that I have looked through before, your tutorial is so comprehensive and you really make sure to be clear and simple with your explanations. I am not new to Unity or to coding, I have used both for a while now, and I wanted to let you know that I still feel like I have learned so much from these tutorials. I never would have just dove into trying the network code by myself because I would have had no idea where to begin, and I really feel like I am getting a better understanding from your videos. I can not wait to finish the project and start changing it in my own way to make it a bit more 'my' project :] (would of course credit you in the credits and link back to your website).

    I am really interested in making different game modes and possibly tweaking the HUD/menus to make a lobby of sorts for before and after a match. Possibly even letting people vote on the game mode for the next round, but I am getting ahead of myself out of excitement! I can't wait to check out series 2!

    Again thank you so much for all your time put into this!,
    Sam
     
  39. Forgon

    Forgon

    Joined:
    Mar 19, 2013
    Posts:
    8
    First of all thanks for the awesome tutorials!

    I have an issue in the part 10.

    Everything works fine untill the part RestartMatch coroutine. And then it just hangs there as "Red/Blue team has won".

    Code (csharp):
    1.  
    2.             if (BlueTeamHasWon)
    3.             {
    4.                 GUI.Box(new Rect(0,0,Screen.width,Screen.height),"" );
    5.                 GUI.Box(new Rect(0,0,Screen.width,Screen.height),"Blue team has won the match!",_winStyle );
    6.                 if (Network.isServer)
    7.                 {
    8.                     GUI.Label(new Rect(0,0,100,20),"I am a server!" );
    9.                     StartCoroutine(RestartMatch());
    10.                 }
    11.                 else
    12.                 {
    13.                     GUI.Label(new Rect(0, 0, 100, 20), "I am a client!");
    14.                 }
    15.             }
    16.             if (RedTeamHasWon)
    17.             {
    18.                 GUI.Box(new Rect(0, 0, Screen.width, Screen.height), "");
    19.                 GUI.Box(new Rect(0, 0, Screen.width, Screen.height), "Red team has won the match!", _winStyle);
    20.                 if (Network.isServer)
    21.                 {
    22.                     GUI.Label(new Rect(0, 0, 100, 20), "I am a server!");
    23.                     StartCoroutine(RestartMatch());
    24.                 }
    25.                 else
    26.                 {
    27.                     GUI.Label(new Rect(0, 0, 100, 20), "I am a client!");
    28.                 }
    29.             }
    Since the level was not restarting properly I added a little test GUI code if Network.isServer part is actually working. It works fine in clients but in the server nothing happens, not even the GUI code (or any code in that part) runs. I am not sure what's the problem here because in any other script Network.isServer actually ran correctly, but not on this script.
     
  40. Forgon

    Forgon

    Joined:
    Mar 19, 2013
    Posts:
    8
    Ok nevermind, apperantly I forgot to update the winning score when decreasing the score :), now it works perfectly.
     
  41. GTGD

    GTGD

    Joined:
    Feb 7, 2012
    Posts:
    436
    @morvi. The colour difference is just because the boxes are by default a bit transparent so of course when two transparent objects are overlapping the colour will appear darker over the area that they are overlapping.


    @Regretfulone. Actually a ready room where the map can be selected and players can chat is something that I will look into for series 2, and it is a popular request. I might look into a voting system like you mentioned or I might just let the first player who joined the server select the map. I haven't added it to the list yet for series 2 because I haven't coded it just yet.

    Btw, I can confirm that the combined first and third person camera is working nicely and has the following features:
    • 1st person and 3rd person views with smooth zoom transition. Zooms out as far as you allow.
    • Orbit so that you can rotate the camera around your player with a smooth return on releasing orbit.
    • Collision avoidance that automatically zooms in the camera and zooms it out when there is no longer an obstruction.
    • Simple over the shoulder option for when in a 3rd person view.
    • Player model head tilts with camera and it's easy to get any model head to tilt.
    • Works in multiplayer or single player straight away.
    My unity master server has been running for a while now without dropping out at all so I feel pretty happy about it's reliability. When I make another video to give an update on where I'm at my intention is to give out the IP address and Port number for my master server, for a limited time of course, so that all of you can use my master server for testing instead of Unity's test master server and also confirm for yourself that it really does work.

     
  42. DyEliot

    DyEliot

    Joined:
    Jul 2, 2013
    Posts:
    1
    I wanted to know once I learn this development can I make it so it can go into third person? I want to make a game that people shoot things in but can also build "premade" stuff once they have the materials for those things. How would I do that if I used this example that you gave in the video? Sorry I am sure this sounds weird, but I was just wondering is all.
     
  43. TiagoCarvalho

    TiagoCarvalho

    Joined:
    Apr 9, 2013
    Posts:
    49
    Awesome tutorials.. Thanks to GTGD I learned everything I needed to know to create my first FPS Online game which i called "Combat Company".

    I leave here a link to the topic where I presented Combat Company.
    http://forum.unity3d.com/threads/223192-Online-FPS-game-project-quot-Combat-Company-quot

    (I know that probably shouldnt post here links to other topics, but i really wanted to show to all FPS game lovers my project. :D)

    And again, I'm truly grateful to GTGD by his detailed tutorials which allowed me to make my own project :)
     
  44. newfinalflashers

    newfinalflashers

    Joined:
    Mar 1, 2014
    Posts:
    27
    Thank you for all of your tutorials they are really helpful!
    I would like to know how to make a change weapon script where instead of pressing one button to "cycle" through weapons you press one button for each specific weapon, and this button for this weapon,and so on and so on... instead of just cycling. Thanks
     
    Last edited: Mar 4, 2014
  45. GTGD

    GTGD

    Joined:
    Feb 7, 2012
    Posts:
    436
    @DyEliot
    Yes the camera script I've developed will allow you to go into third person. Sometime in the future I'll make a video showing the upcoming content for series 2. I won't be covering object placement in series 2 or being able to build things, but basically you need to develop some sort of simple inventory system and when you have enough materials a build option becomes available to the player. How you do that is whatever you are imagining. My advice is that you plan out your systems on paper and then work away bit by bit to turn it into reality.

    @TiagoCarvalho
    Your project is looking pretty awesome! It's really come a long way, keep it up!

    Btw, since S1 I've learnt that to get perfectly smooth camera viewing, parent the camera to the player CameraHead. Don't forget to unparent it when destroying the player!

    Code (csharp):
    1.  
    2. pseudo code
    3. myCamera.transform.position = cameraHeadTransform.position;
    4. myCamera.transform.parent = cameraHeadTransform;
    Also for the movement update script I've learnt that instead of just assigning the updated position I can Vector3.Lerp the player to the updated position. This makes the motion quite a bit smoother, though some thought has to be put in for applying the correct speed.

    @newfinalflashers
    You could make a bunch of inputs for each of those weapons and then when a weapon button is pressed the current weapon state is changed to that weapon. Shouldn't be difficult, plan out how you're going to do it and it will start to become clearer to you.

     
  46. newfinalflashers

    newfinalflashers

    Joined:
    Mar 1, 2014
    Posts:
    27
    Thanks I'll do that!
     
  47. Addyarb

    Addyarb

    Joined:
    Mar 2, 2014
    Posts:
    42
    GTGD,

    I'm having problems at the very end of 1.5 (Spawn System). I added all of the network views and movement updates, and for some reason I can't move at all (rotation/WASD/FireBlaster etc.) when I build the game. I'm simply frozen in place. Any help would be greatly appreciated, as I went to your downloads and imported the scripts just as you wrote them.

    Thank you!
     
  48. GTGD

    GTGD

    Joined:
    Feb 7, 2012
    Posts:
    436
    Maybe it has something to do with the cursor lock in the CursorControl script. If the cursor is not locked the player will not be able to move.

    Maybe you haven't edited enough of the scripts as per my advice to Nitza above because I don't recall including Unity made scripts in the scripts package.

     
  49. newfinalflashers

    newfinalflashers

    Joined:
    Mar 1, 2014
    Posts:
    27
    Is there anyway you can make a patching tutorial for your game and maybe even show us how it works?

    Thanks,
     
  50. GTGD

    GTGD

    Joined:
    Feb 7, 2012
    Posts:
    436
    You might want to have a look at the Crafty Patching System on the asset store. Proper patching is complex stuff.