Search Unity

Free Live Online Training from Unity Technologies

Discussion in 'Community Learning & Teaching' started by Adam-Buckner, Oct 11, 2013.

Thread Status:
Not open for further replies.
  1. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,670
    Is there any information you can give us to help you?

    Screen shots? Screen recordings? Can you post your code? Do you have any errors? Have you run the video a second time and double checked all the steps, both code and assembling the GameObjects and Components in the Editor?
     
  2. Kiori

    Kiori

    Joined:
    Jun 25, 2014
    Posts:
    160
    Adam, could you guys please think about making an 'in-depth', fully detailed, tutorial on handling all aspects of multi-resolution support, with best practices, and hints on multi device support also?
    Coupled with a few new additions to the unity manual preferably.

    This is something that has been talked about here and there, but there is no central standard reference on how to implement it.

    I found this video for instance:



    To be terrible at best.
    We need real tutors to sit down and do the whole thing for a real project, so we have references on every case scenario.
    Also, that video is outdated with unity 5.

    Another thing is there is this whole talk of using asset bundles, but there are not cross-platform, so whats the point?
    Much better to simply use sprite sheets and forget about it, or is it?

    Thanks anyways, and good luck with the tutorials.
     
    Last edited by a moderator: Mar 16, 2015
  3. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,670
    I'm
    I'm sorry, but I'm not finding the tone of this post to be very polite.

    We have a live training session on resolution independence.
     
  4. Gumy

    Gumy

    Joined:
    Mar 16, 2015
    Posts:
    2
    Adam, thank you for great set of live training tutorials. I really learned a lot.

    Could you make a session where you show good practices in developing 2D point-and-click (or mobile "look-and-tap"?) adventure style game.
    I'm interested in how would you set up game rooms, transitions between rooms and inventory. Maybe also show combining items or using them in scene on other item.

    What I would like the most is seeing how would you combine game objects and UI objects, what and when to use which.

    Also, to spicy it up a bit, you could show JRPG style dialogue boxes (Layer with character image, textbox with name and textbox with speech).

    I still have some tutorials on site to go through, so could you point me in right direction if these are already talked about?

    Thanks again,
    Gumy
     
  5. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,670
    We could probably break this down into smaller pieces that are more suitable for 1 hour of live training: Point and Click movement (this is somewhat covered in the 2D Roguelike project).

    Out of curiosity, can you expand on a few subjects?

    What do you mean by "set up game rooms", "transitions between rooms and inventory", "combining items or using them in scene on other item", etc.

    Can you give me some examples of what you are after?
     
  6. Gumy

    Gumy

    Joined:
    Mar 16, 2015
    Posts:
    2
    Sorry I wasn't clear enough. I was thinking on something without character in scene where you just click on items (explore the scene) and you can pick them up in inventory. Later, you can combine things or use them on other objects, ex. use key from inventory on door and activate something. Think of a game like "Broken Sword" but without character movement, with similar inventory/item usage.
    By setting up rooms, I'm curious how would you build "room" (area, background) and put interactable objects in room from data structure perspective. When would you use game objects and when UI objects. Can it be that you can make that kind of a game only with UI objects now that we have new GUI?
    Also, by transitions, I was thinking how would you handle switching those rooms (areas) when you go to another room, ex. move from kitchen to living room.
    I'm more interested in seeing how would you set classes and objects to be the base of this kind of a game.
     
  7. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,670
  8. srmols

    srmols

    Joined:
    Nov 3, 2014
    Posts:
    10
    Hi, not sure if this is the place to comment about a specific session. Excuse me if that's the case.

    I've just completed the tutorial: Mobile Development. Converting Space Shooter to Mobile and I have two questions.

    1) I'm having problems with Unity Remote and multitouch. After I add the Fire Zone, it seems that it takes the second area (fire zone) as the button to fire but it also moves to the right, as if I were dragging to right. I'm not sure if it happens too in the video in 1:10:54, it's quite similar. In the other tests further in the video it doesn't happen again.

    I've tried Remote in both Android and iOS and the problem persist (except once that did work for a few seconds). It works well when I deploy a build to my Android phone, so I suppose it's a Unity Remote problem. Is could be a Unity Remote issue or am I doing anything wrong? Is there a way that works better with Remote like working with touches instead of IDragHandler?

    2) This is shorter. Is there any benefit in using a function instead of making the variable canFire public and getting it?

    Code (CSharp):
    1.     public bool CanFire (){
    2.         return canFire;
    3.     }
    Thanks.
     
    Adam-Buckner likes this.
  9. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,670
    Re: 1 - Try checking your event system and if you have both input schemes enabled, turn off the keyboard input and leave the mobile input only when testing on the remote.

    Let me know if that solves your issue.

    Re: 2 - might be style, but I'd have to look.
     
  10. srmols

    srmols

    Joined:
    Nov 3, 2014
    Posts:
    10
    Hi, thank you for the answer.

    If I disable Standalone Input Module and enable Touch Input Module in my EventSystem gameobject, Unity Remote doesn't work at all. If I enable Standalone and disable Touch, it works but the problem is still there.

    I've just copied and pasted the scripts in the tutorial page to be sure that I didn't write them wrong. Other things I've found:

    - If I shoot first and keep that finger pressed, then I can't move until I release the 'firing' finger.
    - If I'm dragging left and press fire, it goes to the right without firing.
    - If I'm moving up, down or right and I press fire, then the ship fires but moves to the right.

    Thanks!
     
  11. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,670
    No, this must be a remote issue that's failing to work with the mobile input module.

    Can you report a bug and give me the report number? This also looks like a "regression", so we'll try to track it down ASAP.
     
  12. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,670
    Two more things:

    Re: your number 2 - why a function? Don't we need a public function for the UI element? That's off the top of my head, so I may be inaccurate.

    If you were to ignore the UI RectTransform, and you wrote a script with nothing but raw touch code, and checked against a Rect with RectContains, you may get the inherent multitouch on the remote to work...

    I don't have a lot of testing time this week, but if I do, I'll give it a go.
     
  13. srmols

    srmols

    Joined:
    Nov 3, 2014
    Posts:
    10
    Sure, here it is: 682892. And thank you for the answers.
     
  14. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,670
  15. Sodrek

    Sodrek

    Joined:
    Mar 28, 2015
    Posts:
    1
    Hello, i have a question about
    Beginner Live Training Archive - Creating a Basic Platformer Game

    I did all the scripting added the Box selected the "Ground" Layer and started the game. I can see that my Hero falls until it collides with the Box, but i cant controll my Hero with the Arrow keys or the Spacebar.
    Im using Unity 5 and Windows 8.1

     
  16. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,670
  17. Crakiz

    Crakiz

    Joined:
    Jan 4, 2014
    Posts:
    1
    Hi Adam, fantastic tutorials!!, you helped me a lot.

    I have no many experience and I have a question with the Angry Birds Tutorial. I would like to know how can I create more projectiles without restart the scene.

    Thank you!!
     
  18. UndeadLich

    UndeadLich

    Joined:
    Apr 3, 2015
    Posts:
    2
    Hi there.

    I was just speaking with Mike. I am in a bit of a desperate pickle. I was working on Merry Fragmas - completed the tutorials and even created my own 3D models to beef up the game more. And then my portable hard drive went dead. Basically, I lost the unity package files. I'm sad and going a bit crazy right now. I really don't want to have to start over and re-watch the series, it's quite lengthy.

    Does anyone have the unity package files for Merry Fragmas that I can use?

    I appreciate it...

    Ta.
     
  19. Simon_says

    Simon_says

    Joined:
    Oct 19, 2013
    Posts:
    141
    @Adam Buckner Regarding the dynamic scroll list made in here
    there's heavy lag if you add over 100 items to the list, not to mention if you add 1000 items... any idea why and how can it be fixed? Even if not updating the values for each item from the script, if adding many items to the scroll lists it still lags from the visual side.
     
  20. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,670
    I'll admit that I've not tried to add that many items to a list, as it would be awfully long...

    I'll have a go and see what I can see...

    Why would you need 1000+ items to a scroll list??
     
  21. Simon_says

    Simon_says

    Joined:
    Oct 19, 2013
    Posts:
    141
    A lobby chat, it would have a lot of players online(and offline friends) where 1 player is 1 item on the list. When I made it using the list from the video, it was terribly lagging when there was more and more players on the list. If there was more than 100 items I started to experience performance issues.

    If you have a better idea on how to have a lobby chat like I have described, could you make a tutorial about it? Each of the items on the list should be interactable(click -> open context menu -> add as friend / join game / private chat). By lobby chat in here I mean just the player list, with a search option if possible(which would dynamically show matching player names).
     
  22. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,670
    A couple of notes: most lobby chats I've seen have a life time and volume limit. On an MMO I play, I checked, and the limit seems to be about 200-250 messages. Moreover, I don't believe that they are all separate items. When made a chat window in EZGui, I did a string concatenation (which it not the cheapest way of doing things, however) so that the chat was one item displaying all of the text. This doesn't solve the hyperlink issues you are speaking of. More. Research may be necessary. From looking at other solutions, these may be markup links of some sort, and I'm unclear whether the UI tools will be able to accommodate them.

    I would suggest opening a thread in the UI section of the forum, and start a discussion on the best way to make a chat window. If you do, please link the post, so we can participate.
     
  23. Simon_says

    Simon_says

    Joined:
    Oct 19, 2013
    Posts:
    141
  24. dharrison2010

    dharrison2010

    Joined:
    Apr 14, 2015
    Posts:
    3
    I believe this was recently accomplished; however, the link "Events: Creating a simple messaging system" is not a link in the archive! The words are there, but no link. Is this being updated? Thanks!
     
  25. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,670
    This was presented last night live on twitch, and should be in the archive by the end of the week. I have a few days off scheduled, so this may be the beginning of next week at the latest.
     
  26. dharrison2010

    dharrison2010

    Joined:
    Apr 14, 2015
    Posts:
    3
    Yes. I was away from home with no access to it...looking forward to watching it. Thank you!
     
  27. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,670
    Just to be clear: I need to finish some additional projects, including the new Roll-a-ball project (Updated to Unity 5) before I process this session, so it will probably be next week some time!
     
  28. Laps

    Laps

    Joined:
    Apr 22, 2015
    Posts:
    5
    Hello everyone,

    Thank you for you tutorial, they are the best, easy to understand, possible to learn new things.

    I have one question related to "catch a hat" tutorials.

    I was trying to make time incremental from gameobject collision it but still haven't got desirable results.
    I wrote short function:


    Code (CSharp):
    1. void onCollisionEnter2D (Collision2D collision) {
    2.      if (collision.gameObject.tag == "object1") {
    3.           timeLeft += Time.deltaTime*5;
    4.           UpdateText ();
    5.      }
    6. }
    I wrote function in the gameController.cs, also was trying to make separate script timer.cs but with void I wrote above, but still I got no results. Anyone got clue what I am missing? Thank you for your answers.

    Cheers!
     
  29. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,670
    Close! What you need to do is look up the "Time" class in the documentation:
    http://docs.unity3d.com/ScriptReference/Time.html

    Here you will see there are various different ways of dealing with time. You are using Time.deltaTime, and this is the time in seconds it took to complete the last frame, which is good for keeping items in your game smooth, even when the frame rate changes as the game plays. This doesn't work in your case, as the value of Time.deltaTime will be significantly less than 1/10th of a second!

    Time is a float value, where 1.0f is worth 1 second in most cases (unless you change the speed in which time operates!), so if you want to add a value to timeLeft, you can simply use:
    Code (csharp):
    1. timeLeft += 5.0f;
    ...if you want to add five seconds.
     
  30. Laps

    Laps

    Joined:
    Apr 22, 2015
    Posts:
    5
    Thank you for your quick response. I was writing mentioned function with "+= 5.0f;" into gamecontroller script where is timer and it is making no reactions ?! Also, I put the tag in the game object prefab and getting no errors. Seems that
    Code (csharp):
    1. timeLeft += 5.0f;
    part is working but somehow it refuse to react from collisions because timer is in the game controller. If I add time function in the score.cs i get no effect, if i write adding time function reacting from the tag in the game controller I also will get no effect. Maybe there any way to hook hat to game controller letting calculate score in gamecontroller.cs ?
     
  31. rakkarage

    rakkarage

    Joined:
    Feb 3, 2014
    Posts:
    683
    Oscaruzzo likes this.
  32. LastDraft

    LastDraft

    Joined:
    May 31, 2013
    Posts:
    2
    Try changing onCollisionEnter2D to OnCollisionEnter2D - the capitalisation is important.
     
  33. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,670
    Yes. I missed the typo. Spelling and capitalisation must be exact. Functions are written in what's called pascal case, where the first letter is capitalised, and the then first letter in each word is capped as well. So: OnTriggerEnter is correct.

    If you had thought it was that line of code - the add to timer line - you can test to see if it's a problem with that line of code by "commenting it out" and adding a debug log line.

    Using // will tell the compiler to ignore everything after the // on that line of code. This is meant to write comments in code. You can also use it to disable code. If you change the line to
    Code (csharp):
    1. // timeLeft += 5.0f;
    ... It will be disabled.

    If you want to check to see if a function or block of code is being called you can add a debugging line of code that will write information into your console. Write
    Code (csharp):
    1. Debug.Log("Any string value");
    ... where this string value can be a message like "OnTriggerEnter was called!"

    By trying both of these, you would have noticed that the line of code adding time made no difference, and as a matter of fact, you'd be able to show that the function was never being called. This will help you narrow down what the problem is.
     
  34. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,670
    Should be up by the end of this week. I was finishing another project and there is a technical glitch with the recording that I need to overcome.
     
    Oscaruzzo likes this.
  35. Laps

    Laps

    Joined:
    Apr 22, 2015
    Posts:
    5
    In code capitalization was all right. Thank you fro side node.
    Seems that OnCollisionEnter2D function is working only from hatcontroller.cs because there is hooked all edge colliders that are working as triggers to calculate score and time if you implement as necessary functions. Gamecontroller do not have any of the edge colliders that why is not reacting from OnCollisionEnter2D. Maybe there is any way to connect hat controller and game controller? f.e. in game controller write:

    Code (CSharp):
    1. void OnCollisionEnter2D (Collision2D collision hat) {
    2. if (hat.collision.gameobject.tag =="object1")
    3. { timeLeft += 5.0f; }}
    ?
     
  36. ryrich

    ryrich

    Joined:
    Sep 29, 2014
    Posts:
    4
    Hi Adam! Thanks for all the live training tutorials - I've been going through the archive, mainly the tips and tricks so far - lots of good stuff!

    One thing I've been working on personally is a 2D Air Hockey game, with AI (and hopefully network play with Photon PUN later down the road!)

    Sorry if this is not the place for requests, but a training session for a 2D/3D Air Hockey type of game would be invaluable. One challenge I'm trying to work out is the AI - particularly, how to intelligently calculate where the puck will be and where to hit the puck in order to best achieve a goal.

    I've tried (and will continue!) to go through Unity Answers and the forums to work on this - currently I'm able to predict the path the puck will take after an opponent hits it (using velocity/circlecasts, etc), even from wall bounces, but the puck is always moving, and I haven't yet achieved an algorithm/script to strike the puck optimally for a goal.

    Probably don't need to go into too much detail, honestly, I hope I'm on the path of thinking here -

    A lot of the training's you've conducted seemed like simple games in essence, but I learned so many things watching them ("huh, I never thought of it like that") - I'm having a great time with this game engine!

    Many thanks!

    Ryan R.
     
  37. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,670
    For ai, you can also check out aigamedev.com. It's the first place to go.
     
  38. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,670
    Any if the trigger messages need to be on one of the objects participating in the collision. I've not looked at that code in a long time, but: if you are getting a collision and you are adding points successfully, you should be able to add time in the same block. If the time variable is in a different script from the points, then have the block of code counting the points add the time by having a reference to the time variable.
     
  39. AzureXIII

    AzureXIII

    Joined:
    Nov 14, 2012
    Posts:
    1
    Can't wait, thanks for the update :)
     
    dharrison2010 likes this.
  40. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,670
    We probably won't go into the specific detail of making an air hockey game, per se, but we may cover topics that could be pertinent to an air hockey game.

    Are there any specific subject within your game that you need help with?
     
  41. ryrich

    ryrich

    Joined:
    Sep 29, 2014
    Posts:
    4
    Pretty much the one thing I'm working on right now is just having a basic AI player - I've been looking through the website you suggested (aigamedev.com) - so far, haven't found anything that I can apply to my game (yet).

    Specifically with my game, I want to split the AI behavior in three parts: offense, defense, and waiting. I feel the defense and waiting behaviors are easier to implement, so I'm currently working on offense first. Essentially, the end result I'm trying to accomplish is where the AI paddle needs to hit the puck in order to best achieve a goal.

    Since the puck is always moving, it provides some challenges... for instance, at one time slice, I could calculate where to hit the puck, but by time the AI paddle moves there, the puck has already moved to a new location! Thus, I feel the offense algorithm needs to "guess" where the puck will be, based off velocity/mass/drag/etc. and move there by time the puck will be there - even more complexity comes into play when the puck bounces off walls and things.

    So perhaps AI algorithms would be useful to discuss in future training classes - maybe how to determine future positions of objects based off physics of the environment. Or calculating where to hit an object to push/bounce it into a target location (think billiards)

    Thanks for considering this for new live training material! That would be great to watch.
     
  42. rakkarage

    rakkarage

    Joined:
    Feb 3, 2014
    Posts:
    683
  43. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,670
    There are two issues here.

    One is "how is your puck going to react?" For this, I'd suggest behaviour trees. Worth a quick google or some time on aigamedev. These will help you with the current state your ai player is in. You may be able to do this with a simple state machine, as your game is so simple.

    The second one is prediction, which will influence what state you are in, and when in a state, where to put the paddle. This is not a trivial problem. The physics of h situation is relatively simple, as the puck travels in a straight line as a set speed, so, in theory, once the puck is hit, it should be simply a question of maths to know where the puck will be at any given moment in time. The only thing that will change this is contact with another paddle.

    What's even more tricky, however, is predicting where in this path is the best intercept point for the ai's paddle, and at what vector to hit the puck for additional change in speed/direction/vector. In general, ai calculations are brute force, where that path is tested at a number of points and then compared to find the best point in the path to connect.

    Don't forget that chess computers beat humans purely by calculating all the moves possible for as many moves ahead as possible to calculate the best potential moves.
     
  44. Laps

    Laps

    Joined:
    Apr 22, 2015
    Posts:
    5
    For this I found a brittle but working solution, timer I put to the score script, and for game controller I made infinite ball spawning loop.
    Thank you for your help, all the best making those wonderfully informative tutorials.
    Until next time.
    Cheers!
     
  45. Laps

    Laps

    Joined:
    Apr 22, 2015
    Posts:
    5
    P.S. Maybe you are planing to run any tutorials for making high score system. A must thing for every game!
     
  46. ryrich

    ryrich

    Joined:
    Sep 29, 2014
    Posts:
    4
    Great stuff Adam - thanks for taking the time to provide some additional info.

    There's a lot of stuff on behavioral trees, so definitely will need to spend some time on that. As you said though, the states of my game are pretty simple, and generally not the part I'm worried with - so it may be wise to do as you said and use a state machine.

    I'm able to predict where the puck will end up using circlecasts (originally I had issues with deflections - I had to use zero friction and 1 bounciness for my puck material and give its rigidbody linear drag so deflections would line up with my circlecast predictions)

    As you said, I have enough info to estimate puck position at any time. In terms of deciding the best intercept point, maybe I could consider least distance to travel as the most favorable (either for the AI paddle or the puck), minimize number of deflections (although deflections are good strategy), or maybe a little of each. Lots to think about obviously.

    Still cruising through the tutorials and live trainings - thanks again!

    Ryan R.
     
  47. rakkarage

    rakkarage

    Joined:
    Feb 3, 2014
    Posts:
    683
  48. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,670
    Yes, you can always go straight to twitch. For our archives, I'm still fighting a technical issue.
     
  49. Adam-Buckner

    Adam-Buckner

    Joined:
    Jun 27, 2007
    Posts:
    5,670
  50. shuao23

    shuao23

    Joined:
    Dec 19, 2013
    Posts:
    31
    Is a tutorial about implementing dll's and/or threading possible?
     
    Last edited: May 4, 2015
Thread Status:
Not open for further replies.