Unity Community


Page 1 of 3 123 LastLast
Results 1 to 20 of 48

  1. Location
    Lazio, Italy
    Posts
    678

    "Tic-Tac-Tut" Turn-Based Game Tutorial support thread.

    Hi folks,

    I've created this thread to support my "Tic-Tac-Tut" turn-based game tutorial. (Asset Store link)

    $5 gets you a complete turn-based Tic-Tac-Toe game with 40-page, illustrated PDF documentation. With diagrams!

    If you have any support queries, tutorial requests, etc. please post them here. I've set the thread to notify me automatically by email of any new posts.

    I do have a day-job, but I'll try to reply to questions and queries within 24 hours. (My job often takes me away from a decent data connection, so I'm not always online.)
    Last edited by stimarco; 06-11-2012 at 03:22 PM. Reason: Thread title change.
    Sean Baggaley

    Author of "Tic-Tac-Tut" turn-based game tutorial. Get it from the Asset Store here! (Tic-Tac-Toe game with illustrated 40-page documentation.)

    "Tic-Tac-Tut" turn-based game tutorial support thread.


  2. Location
    Gold Coast, Australia
    Posts
    3,593
    Bought it to ̶t̶r̶o̶l̶l̶ check out the documentation :P


  3. Location
    Lazio, Italy
    Posts
    678
    Quote Originally Posted by NPSF3000 View Post
    Bought it to ̶t̶r̶o̶l̶l̶ check out the documentation :P
    This is a v1.0 release, so I'm expecting some typos and the odd obsolete comment to have slipped through, so do let me know if you've spotted any.


    I'm also very new to the whole promotion and marketing thing, so... any danger of a review?
    Sean Baggaley

    Author of "Tic-Tac-Tut" turn-based game tutorial. Get it from the Asset Store here! (Tic-Tac-Toe game with illustrated 40-page documentation.)

    "Tic-Tac-Tut" turn-based game tutorial support thread.


  4. Location
    Princeton, New Jersey
    Posts
    624
    Be great if you had this sort of package for a checkers game. Would be handy...
    Asset Packages & 2D/3D gaming Development
    Unity Pro / iPhone Advanced

    http://outtoplayinc.tumblr.com/


  5. Location
    Lazio, Italy
    Posts
    678
    Quote Originally Posted by brendang View Post
    Be great if you had this sort of package for a checkers game. Would be handy...
    The Tic-Tac-Tut tutorial is primarily intended to show how to write a turn-based game, so that aspect is already covered. On the other hand, Chess is the usual choice for demonstrating how to write an AI, so checkers would at least have the benefit of being a more original choice.

    For a checkers game, I'd need to write a more substantial AI, so that would most likely be the focus of such a project. (I can reuse and modify the Tic-Tac-Tut GameBoard code, which will save a bit of time.)

    If anyone else is interested, it's certainly doable, but I'd need more than one request!

    I'm also considering a different tutorial that looks at how to compile and run C# scripts at runtime, while the game is already in play, so gamers can write their own scripts too. I think it's possible in C#, but it's very much at the R&D stage.
    Sean Baggaley

    Author of "Tic-Tac-Tut" turn-based game tutorial. Get it from the Asset Store here! (Tic-Tac-Toe game with illustrated 40-page documentation.)

    "Tic-Tac-Tut" turn-based game tutorial support thread.


  6. Location
    Münster, Germany
    Posts
    25
    Excellent Tutorial! Just bought it and I am extremely please with how you documented the code (I saw the first "free" version previously, but the extra $5.00 are well spent). What I liked is how you explained how you try to match the MVC model - among other things.

    Now working on a glowing review, then i'll be back with more requests .


  7. Location
    Lazio, Italy
    Posts
    678
    Quote Originally Posted by brendang View Post
    Be great if you had this sort of package for a checkers game. Would be handy...
    A Checkers tutorial is definitely a possibility.

    I would, however, prefer to include the (free) nGUI package too, as it'd save me having to use the Unity GUI. I've seen other tutorials that include the free version, so I'll need to contact nGUI's author to check the procedure for doing so.
    Sean Baggaley

    Author of "Tic-Tac-Tut" turn-based game tutorial. Get it from the Asset Store here! (Tic-Tac-Toe game with illustrated 40-page documentation.)

    "Tic-Tac-Tut" turn-based game tutorial support thread.


  8. Location
    Lazio, Italy
    Posts
    678
    Quote Originally Posted by AstaSyneri View Post
    Excellent Tutorial! Just bought it and I am extremely please with how you documented the code (I saw the first "free" version previously, but the extra $5.00 are well spent). What I liked is how you explained how you try to match the MVC model - among other things.

    Now working on a glowing review, then i'll be back with more requests .
    Hi AstaSyneri,

    Thanks! I could do with a review or two!
    Sean Baggaley

    Author of "Tic-Tac-Tut" turn-based game tutorial. Get it from the Asset Store here! (Tic-Tac-Toe game with illustrated 40-page documentation.)

    "Tic-Tac-Tut" turn-based game tutorial support thread.


  9. Location
    Münster, Germany
    Posts
    25
    Quote Originally Posted by stimarco View Post
    Hi AstaSyneri,

    Thanks! I could do with a review or two!
    It's already up instead of checkers I'd rather have "Mensch ärgere Dich nicht" with an irregular gameboard (or a ladder game), to show us identifying game pieces out of several choices and how to move them around on a not so easy gameboard.

    Also one very annoying topic is saving games. PlayerPrefs are extremely limited in that, and if you have ressources you don't want easily duplicated (think of Diablo-like items), XML doesn't cut it either. What is one to do when you create a random, non-limited number of items (or rather highly limited). Example: XCOM (the old one) - you'd have items on each soldier as well as a common "warehouse".


  10. Location
    Lazio, Italy
    Posts
    678
    Quote Originally Posted by AstaSyneri View Post
    It's already up instead of checkers I'd rather have "Mensch ärgere Dich nicht" with an irregular gameboard (or a ladder game), to show us identifying game pieces out of several choices and how to move them around on a not so easy gameboard.
    A cross-and-circle game? That's doable. (I'm not a fan of Checkers, so any excuse to make something else...)

    I'm not sure what the patent / trademark / copyright issues are for Ludo and Mensch ärgere Dich nicht are, but the rules aren't that far removed from Pachisi, so I can just make my own. I like Celtic art, so using a Celtic Cross as the basis for the board's layout should work.

    And this gives me an excellent testbed for learning NGUI too. (Apparently, it's fine to include the Free version for educational uses—the Asset Store is explicitly mentioned.)

    Also one very annoying topic is saving games. PlayerPrefs are extremely limited in that, and if you have ressources you don't want easily duplicated (think of Diablo-like items), XML doesn't cut it either. What is one to do when you create a random, non-limited number of items (or rather highly limited). Example: XCOM (the old one) - you'd have items on each soldier as well as a common "warehouse".
    A good question. I wonder if I could create a more complex variation of Pachisi and include an 'inventory' of some sort. There's no need to just simulate a traditional board game...

    I'll have a think and try sketching something out over the weekend.
    Sean Baggaley

    Author of "Tic-Tac-Tut" turn-based game tutorial. Get it from the Asset Store here! (Tic-Tac-Toe game with illustrated 40-page documentation.)

    "Tic-Tac-Tut" turn-based game tutorial support thread.


  11. Location
    Lazio, Italy
    Posts
    678
    A thought just occurred to me: I could create a published game based on the (above) concept, then release it on the Asset Store as a tutorial with placeholder art instead of the published art. And, of course, plenty of docs.

    I need to design the game first though.
    Sean Baggaley

    Author of "Tic-Tac-Tut" turn-based game tutorial. Get it from the Asset Store here! (Tic-Tac-Toe game with illustrated 40-page documentation.)

    "Tic-Tac-Tut" turn-based game tutorial support thread.


  12. Location
    Münster, Germany
    Posts
    25

    Questions

    Hi!

    Working through the tutorial I have a few questions.

    1. In GameController.cs why is gameStates outside the Class?

    Code:  
    1. public enum gameStates { Idling, PlayerX, PlayerO, VictoryAnimation};
    2.  
    3. public class GameController : MonoBehaviour {

    2. When I try to take the framework of MVC out of the tutorial to build my own code, I do get an error message "NullReferenceException: Object reference not set to an instance of an object
    MissionView.OnGUI () (at Assets/_Scenes/MissionView.cs:82)
    "

    There really is not much to MissionView.cs :

    Code:  
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class MissionView : MonoBehaviour {
    5.    
    6.     public MissionController controller;
    7.     public MissionMap map;
    8.     public bool playerTurn;
    9.  
    10.     void Start () {
    11.    
    12.         playerTurn = true;
    13.            
    14.     }
    15.    
    16.     void Update () {
    17.        
    18.     }
    19.    
    20.     void OnGUI()
    21.     {
    22.         if ( playerTurn ) {
    23.        
    24.             GUI.BeginGroup (new Rect (0, Screen.height / 2, 200, 200));
    25.             GUI.Box (new Rect (0,0,180,145),"");
    26.             if (GUI.Button (new Rect (50, 5, 80, 50), "Forward"))  
    27.                 Debug.Log ("Clicked Forward");
    28.             if (GUI.Button (new Rect (5, 5, 40, 135), "<-")) {
    29.                 Debug.Log ("Left Turn");   
    30.             }
    31.             if (GUI.Button (new Rect (135, 5, 40, 135), "->"))
    32.                 Debug.Log ("Right Turn");      
    33.             if (GUI.Button (new Rect (50, 60, 80, 80), "FIRE!")) {
    34.                 Debug.Log ("FIRE!");       
    35.             }
    36.            
    37.             GUI.EndGroup ();
    38.         } // end if
    39.  
    40.         Debug.Log (controller.missionState); /***********************************/
    41.  
    42.     }
    43. }

    I cleaned out a lot of comments - line 82 is the "marked" debug statement in line 40 now. Basically I am trying to access the missionState from the MissionController.cs script to find out whether it's the player's turn and then hide/show the UI.

    What am I missing? I really have trouble with dividing up the code into separate classes.

    This is MissionController.cs:

    Code:  
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public enum missionStates { alienTurn, trooperTurn, MissionOver };
    5.  
    6. public class MissionController : MonoBehaviour {
    7.    
    8.     public missionStates _missionState;
    9.    
    10.     public missionStates missionState
    11.     {
    12.         get
    13.         {
    14.             return _missionState;
    15.         }
    16.         set
    17.         {   
    18.             if (value != _missionState) // This ensures we only call GameStateHasChanged() if it's actually changed.
    19.             {
    20.                 _missionState = value;
    21.                 MissionStateHasChanged();
    22.             }
    23.         }
    24.     }
    25.    
    26.     public MissionView missionView; 
    27.     public MissionMap map;
    28.    
    29.    
    30.    
    31.     void Start () {
    32.    
    33.         missionState = missionStates.trooperTurn;
    34.        
    35.     }
    36.    
    37.    
    38.     void Update () {
    39.    
    40.     }
    41.    
    42.     public void MissionStateHasChanged ()
    43.     {
    44.         Debug.Log ("MissionStateHasChanged() has been called");
    45.     } // end method MissionStateHasChanged
    46.    
    47. } // end method MissionController


  13. Location
    Lazio, Italy
    Posts
    678
    Hi AstaSyneri,

    Just a heads-up: my laptop is broken at the moment, so I'm relying on my iPad and my memory...

    Quote Originally Posted by AstaSyneri View Post
    Hi!

    Working through the tutorial I have a few questions.

    1. In GameController.cs why is gameStates outside the Class?

    Code:  
    1. public enum gameStates { Idling, PlayerX, PlayerO, VictoryAnimation};
    2.  
    3. public class GameController : MonoBehaviour {
    By placing the enum outside the class, I don't need to qualify "gameStates" by adding the class name in front of it (e.g. "GameController.gameStates.PlayerX". It puts the enum in the global namespace, so all the scripts can see it and use it as if it were defined in their own file.

    2. When I try to take the framework of MVC out of the tutorial to build my own code, I do get an error message "NullReferenceException: Object reference not set to an instance of an object
    MissionView.OnGUI () (at Assets/_Scenes/MissionView.cs:82)
    "
    Looking at the OnGUI code, the only reason I can think of for that error is that the controller variable hasn't been assigned anything. You need to drag a MissionController script onto it in the Inspector if you don't set it up in the Start() function.

    In the tutorial, I tend to grab the relevant script links using GetComponent<COMPONENT_NAME_HERE>()

    I try not to rely on remembering to drag things into the Inspector if I can avoid it as I usually forget to do so.
    Sean Baggaley

    Author of "Tic-Tac-Tut" turn-based game tutorial. Get it from the Asset Store here! (Tic-Tac-Toe game with illustrated 40-page documentation.)

    "Tic-Tac-Tut" turn-based game tutorial support thread.


  14. Posts
    433
    hi, would this work on iOS as well and is it local or online turn based?
    thanks
    Time to make time for games and apps - UnityPro / iOS Pro


  15. Location
    Lazio, Italy
    Posts
    678
    Quote Originally Posted by ProjectOne View Post
    hi, would this work on iOS as well and is it local or online turn based?
    thanks
    Hi ProjectOne,

    If you're asking whether the 'Tic-Tac-Tut' project runs on iOS: yes, it does, but I only have an iPhone 4 and a 3rd generation iPad for testing, so I don't know how it looks on non-Retina models. In theory, it should run on Android too.

    As long as you're not using multitouch input, the usual checks for "Fire1" for clicks seems to work fine, as does the Unity GUI.

    I'm afraid there's no online turn-based support; it's local only.
    Sean Baggaley

    Author of "Tic-Tac-Tut" turn-based game tutorial. Get it from the Asset Store here! (Tic-Tac-Toe game with illustrated 40-page documentation.)

    "Tic-Tac-Tut" turn-based game tutorial support thread.


  16. Location
    Lazio, Italy
    Posts
    678
    Right, my laptop's working properly again and seems to be behaving itself. (Note to anyone who's got a Crucial M4 SSD fitted to their computer: some older versions of that drive's firmware have a very nasty bug that only kicks in after just over 5100 hours of use!)

    So... I've decided to make my next project a "turn-based board game tutorial / framework". I'm aiming for something pretty generic, so it'll come with a "race" game demo, and probably something based on the cross-and-circle board game genre (like "Ludo"). I'll throw in some computer-specific features to show how a traditional board game can be jazzed up with incidental animations and other stuff.

    One minor issue: As the new Unity GUI appears to be some way off yet—it's unlikely to make it into the 4.0 release, for example—I've decided to switch to the NGUI package for all future tutorials. (Why NGUI? There's a free version of this available which can be freely used in tutorials and frameworks.) Anyone wanting to make a full game with the end result will need to buy the full version of NGUI as this removes the DOG that appears with the free version. Or you can rip it out and replace it with your own. The principles should remain the same.

    All this will take me about a couple of weeks to write. I'm also considering using the framework for a couple of actual games to be sold in the various App Stores later on.

    I'm open to artwork contributions and suggestions for the tutorial demo projects. (Please PM me rather than posting here as I'd prefer not to clutter this thread with discussions about another tutorial.)
    Last edited by stimarco; 07-08-2012 at 02:47 PM.
    Sean Baggaley

    Author of "Tic-Tac-Tut" turn-based game tutorial. Get it from the Asset Store here! (Tic-Tac-Toe game with illustrated 40-page documentation.)

    "Tic-Tac-Tut" turn-based game tutorial support thread.


  17. Posts
    3
    Dear Sean,

    I bought your tutorial several days ago and I love it; I am curently trying to move smoothly the camera to the the clicked cell, for this I am using a coroutine called MoveObject and I update the SmoothFollow script.target with the interpolated position
    (cf my code below) but that just don''t work, it's like everything is moving (you can see the GameModel moving together with the camera) so everything looks static in the game view.

    Can you help ? Thanks

    Code:  
    1. void Update () {    
    2.  
    3.                 if (Input.GetButtonDown ("Fire1"))
    4.  
    5.                 {
    6.  
    7.                     // Construct a ray from the current mouse coordinates
    8.  
    9.                     Ray ray = Camera.main.ScreenPointToRay (Input.mousePosition);
    10.  
    11.                     RaycastHit hit;
    12.  
    13.                     if (Physics.Raycast (ray, out hit))
    14.  
    15.                         {
    16.  
    17.                            
    18.  
    19.                             BoardCellState cellScript = hit.collider.GetComponent<BoardCellState>();
    20.  
    21.                             if (cellScript)
    22.  
    23.                             {
    24.  
    25.                                 SmoothFollow script = Camera.main.GetComponent<SmoothFollow>();
    26.  
    27.                                 Vector3 startPos = new Vector3(script.target.position.x, script.target.position.y, script.target.position.z);
    28.  
    29.                            
    30.  
    31.                                
    32.  
    33.                                 Vector3 endPos = new Vector3(cellScript.transform.position.x, cellScript.transform.position.y, cellScript.transform.position.z);
    34.  
    35.                             ;
    36.  
    37.                            
    38.  
    39.                                 if (!m_Moving){
    40.  
    41.                                     StartCoroutine(MoveObject(script.target, startPos, endPos, 1.0f));
    42.  
    43.                                 }
    44.  
    45.                             }
    46.  
    47.                         }
    48.  
    49.              }
    50.  
    51.         }
    52.  
    53.         IEnumerator MoveObject (Transform thisTransform, Vector3 startPos, Vector3 endPos, float time){
    54.  
    55.             m_Moving = true;
    56.  
    57.             float i = 0;
    58.  
    59.             float rate = 1/time;
    60.  
    61.             while (i < 1)         {
    62.  
    63.                 i += Time.deltaTime * rate;
    64.  
    65.                 thisTransform.position = Vector3.Lerp(startPos, endPos, i);
    66.  
    67.                
    68.  
    69.                 yield return 0;
    70.  
    71.             }
    72.  
    73.             m_Moving = false; // MoveObject ended
    74.  
    75.         }


  18. Location
    Lazio, Italy
    Posts
    678
    Quote Originally Posted by davidoux View Post
    Dear Sean,

    I bought your tutorial several days ago and I love it; I am curently trying to move smoothly the camera to the the clicked cell, for this I am using a coroutine called MoveObject and I update the SmoothFollow script.target with the interpolated position
    (cf my code below) but that just don''t work, it's like everything is moving (you can see the GameModel moving together with the camera) so everything looks static in the game view.

    Can you help ? Thanks
    Hi Davidoux,

    I'm not sure what's happening as it's been a while since I had a chance to look at this project. (I'm a translator by day and haven't had much free time lately.)

    I'll take a look this evening and get back to you.
    Sean Baggaley

    Author of "Tic-Tac-Tut" turn-based game tutorial. Get it from the Asset Store here! (Tic-Tac-Toe game with illustrated 40-page documentation.)

    "Tic-Tac-Tut" turn-based game tutorial support thread.


  19. Posts
    4
    Just a heads-up: I've been struck by a UDN problem that's preventing me from 'claiming' my "stimarco" username. I've emailed UT support to see if this can be resolved, but I can't access any PMs sent to "stimarco" in the meantime.

    @Davidoux: I'm looking into the problem, but have had to upgrade my project to Unity 4, so it's going to take me a bit longer to investigate your issues than I hoped.


  20. Posts
    3
    Quote Originally Posted by sbaggaley View Post
    .
    @Davidoux: I'm looking into the problem, but have had to upgrade my project to Unity 4, so it's going to take me a bit longer to investigate your issues than I hoped.
    OK. Let me know when you are ready and thanks for the heads-up.

    PS : I also emailed you about your nex project "turn-based board game tutorial / framework", any heads up on this ? thanks !

Page 1 of 3 123 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •