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

[RELEASED] PUN Rally

Discussion in 'Assets and Asset Store' started by perick, Dec 1, 2015.

  1. perick

    perick

    Joined:
    Jun 20, 2008
    Posts:
    235
    Andreas, I didn't plan to include all feature requests in this project, but I'll do some of them in a fair pace. PUN Rally is intended as a racing game tutorial that teaches you some challenges of this type of game only. Ideally, developers can learn and start to develop their own ideas.

    It's impossible to meet all demands, because they'll be completely out of scope sometimes. I'll do a simple weapon system (not a clone of all weapons in Revolt, but at least two or three examples).

    But I have to be crystal clear in this issue. I can't develop all features that are asked, just the ones that seem reasonable in the planned scope of the asset. Think about somebody who buys the project in a few months from now: if we include everything in, it'll be impossible to understand because it'll just be a mashup of messed-up code and features...

    Also remember that this is how I earn some money and a single asset is not enough because a lot of people don't like racing games as we do. But I'll never leave any project lacking support from my part. Before releasing an update, I can give you some hints on how to develop a weapon.

    Ideas for a weapon system in PUN Rally:

    Let's say we keep the distributed control approach we use for the cars in PUN Rally (physics of local player car are controlled by local computer). So I suggest each shot be controlled and decided (hit or miss) by the computer from where it was made. This is not ideal in terms of anti-cheat safety, but PUN Rally is a simple game only (a cheat-proof game would require an authoritative server infra structure that is completely out of scope for any of you here). This is how I'll do it:

    • A "bomb" (either for drop or throw, or a rocket) would be a prefab that is created using PhotonNetwork.Instantiate, so there's a copy of it in each computer;
    • The physics of the "bomb" would be controlled only in the creating machine, using a simple network sync for its transform to other machines (the most basic game object sync Photon does);
    • Scripts that control trajectory, such as for a rocket, have to be disabled by deafult, and enabled only in the local creating computer, the same for the "trigger" script that computer damage on impact (or time), and spawns visual and audio effects (these can be local only);
    • When a hit happens in the local controlling machine, I'd send an RPC for the remote copies of the "bomb", so they can spawn it's own copies of the FXs and destroy their game object as well;
    • A damage system that disables (or reduce speed) of affected cars should be controlled on the original local machine of each car (such as their physics). I'd send the damage message by RPC, so every copy has it's own values applied.
    What do you think?

    BTW. Don't worry about THIS update, I'll implement the weapon system this weekend.
     
    Last edited: Jan 29, 2016
    stvster likes this.
  2. Andreas12345

    Andreas12345

    Joined:
    Oct 17, 2013
    Posts:
    526
    I think it sounds great!

    You are really fast in updates :)
    If you like i send you a donation for it, because this is since a long time the best asset in the store i have seen.
    just drop me a PN


     
    stvster, perick and chrisabranch like this.
  3. chrisabranch

    chrisabranch

    Joined:
    Aug 15, 2014
    Posts:
    146
    i would like to send a donation also, your very helpful
     
    stvster and perick like this.
  4. dbordzo

    dbordzo

    Joined:
    Aug 14, 2015
    Posts:
    34
    I also think that you should add a PN. You made great project, and when I will get extra money in march I also will donate you. I think that not only me think so, that your procject is great, and you should get more money for this : )
     
    perick likes this.
  5. perick

    perick

    Joined:
    Jun 20, 2008
    Posts:
    235
    Guys, thanks for the kudos and Andreas for the donation over paypal. I'll study the best option for the personal donations (any suggestion?).

    Btw, I'm almost done with the weapon system for PUN Rally. Update 1.0.6 is due next week. I'll just have to wait for Tobias from Photon, who's responsible for code review and publishing and unfortunately is a bit ill. But it won't take long.
     
    Last edited: Jan 30, 2016
  6. Aiursrage2k

    Aiursrage2k

    Joined:
    Nov 1, 2009
    Posts:
    4,835
    What about https://www.patreon.com/ as an option. So people could support you each month or feature whatever. You could offer an updated version of the kit for people who want a complete weapon set as well and have it be an upgraded price, so if people only wanted the vanilla version can keep that.
     
  7. perick

    perick

    Joined:
    Jun 20, 2008
    Posts:
    235
    The idea is interesting, and I thank for the donations and kudos I've received, but I believe I won't focus 100% of my time on a single asset. So, I don't want to sell features themselves, because that tend to get complicated as each one of you is developing a different game. However, I'll put in the features that tend to be useful for most of the users.

    I'll send a solution for custom colours in a few minutes, for instance, and the basic weapon system is almost ready for the next update as well.
     
  8. perick

    perick

    Joined:
    Jun 20, 2008
    Posts:
    235
    Here's a working solution for applying a custom color on each player's car (based on a color pick or whatever other option you have shown him - I'm not sending this part, it's easy enough to find it in the forums). here's how it works:
    • The CreateCar method in the PunRaceManager behavior is executed in every player machine to create the local (controllable) car, and its replicas in the remote machines (using Photon's version of Instantiate);
    • We'll then send the custom colour for the local car just created only, which will be responsible to replicate the message by RPC to its remote copies;
    • The RPC executed method receives the RGB values (Color is not directly serializable) and should be responsible for applying it in the renderer materials, etc...
    Place this code inside the CreateCar method found in the PunRaceManager script (remember to replace the colour by the one your player chose):

    Code (CSharp):
    1.  
    2. // sends a custom color for this car
    3. // replace Color.black by a custom color chosen by the player
    4. car.GetComponent<CarGUI>().SendColor(Color.black);
    5.  
    Now insert these two methods in the CarGUI script. The first one is called by CreateCar for the local car, the second one is called as RPC by the first, and is executed in every copy of the car, include the local one. Remember to include code to apply the colour to the materials:

    Code (CSharp):
    1.  
    2. public void SendColor(Color color) {
    3. photonView.RPC ("ReceiveColor", PhotonTargets.All, color.r, color.g, color.b, PhotonNetwork.player.name);
    4. }
    5.  
    6. [PunRPC]
    7. public void ReceiveColor(float r, float g, float b, string name) {
    8. Debug.Log ("Received color for:" + name);
    9. Debug.Log ("Color:" + new Color(r,g,b));
    10. //Apply color to the appropriate materials, etc...
    11. }
    12.  
     
    Last edited: Jan 31, 2016
    Aiursrage2k likes this.
  9. gamezuv

    gamezuv

    Joined:
    Nov 6, 2013
    Posts:
    82

    Will be nice if the End race panel gives the the time of each racer with positions in this format 01:01:123 ...its nice to know when there is a close finish
     
  10. perick

    perick

    Joined:
    Jun 20, 2008
    Posts:
    235
    Will try to put it... I have a variable counting each player time in CarRaceControl... It's easy to get that from the masterclient and replicate to all other computers...
     
    gamezuv likes this.
  11. Andreas12345

    Andreas12345

    Joined:
    Oct 17, 2013
    Posts:
    526
    Then do 25% ;), really like this idea. :)


     
  12. perick

    perick

    Joined:
    Jun 20, 2008
    Posts:
    235
    As of now it is basically 50%...:) I've already started the new MOBA one, but right now I'm working on update 1.0.6 of Pun Rally. Here's the current status on my change-log:

    - Simple weapon system (doing - 75%);
    - End race panel with locked positions and master-client corrected race-time for all cars (DONE);
    - Back button (DONE);
    - Wait for players to load scene before countdown (DONE);

    Not sure if Tobias will be back tomorrow to do code review and publish the update... But it's almost ready from my part.
     
    gamezuv, Andreas12345 and stvster like this.
  13. stvster

    stvster

    Joined:
    Mar 4, 2013
    Posts:
    70
    I don't remember any mention of a Race Lap picker (2 ,5 10...).Would this be possible?
    (not that perick doesn't have enof to do,lol).
    Thanx
     
  14. perick

    perick

    Joined:
    Jun 20, 2008
    Posts:
    235
    That's dead easy to do (there's a variable in CarRaceControl - totalLaps) that is set to two. It's easy to send this number to all cars before starting the race, so they're set to a different number of laps... Not sure if I'll include this in the update (the lap picker itself), but I'll send the code template that make it work after you create your own pick.
     
  15. stvster

    stvster

    Joined:
    Mar 4, 2013
    Posts:
    70
    Thanx,I've been working with the totalLaps var. to set laps in code and will work on picker.
     
  16. chrisabranch

    chrisabranch

    Joined:
    Aug 15, 2014
    Posts:
    146
    how do i send the RGB? i need it to send the three colors as a float

    car.GetComponent<CarGUI>().SendColor(Color.black);

    the slider color picker stores the colors in playerprefs as floats like below, that way my players can choose any color in the rainbow for there car, instead of just "black, green, pink, red......."
    red = 0.8
    blue = 0.2
    green = 0.2

    i tried this....................

    public float r_color;
    public float g_color;
    public float b_color;

    car.GetComponent<CarGUI>().SendColor(Color.(r_color,g_color, b_color);
     
    Last edited: Feb 1, 2016
  17. perick

    perick

    Joined:
    Jun 20, 2008
    Posts:
    235
    use
    Code (CSharp):
    1. car.GetComponent<CarGUI>().SendColor(new Color(r_color,g_color, b_color);
    You might see that I did just this when in CarGUI when I send the colors as independent RGBs in SendColor (because the color object is not serializable) and then create a color object back in ReceiveColor.

    Please, refer to Unity documentation as well. This is a simple syntax error in object instantiation. You might save A LOT of time in the future if you spend a couple of days studying basic object oriented programming in C#...:)
     
    Last edited: Feb 4, 2016
  18. michtek

    michtek

    Joined:
    Sep 11, 2012
    Posts:
    8
    no, to hard for my
     
  19. perick

    perick

    Joined:
    Jun 20, 2008
    Posts:
    235
    what's the physics pack you're using? because the wheels in the original pun rally work fine.
     
  20. gamezuv

    gamezuv

    Joined:
    Nov 6, 2013
    Posts:
    82
    Hi hope the new update is on the way soon . I am very close to finishing my game . A small question ... is there a way to display player id/names on top of each car ?
     
  21. perick

    perick

    Joined:
    Jun 20, 2008
    Posts:
    235
    Yes, you might create a Text UI object, and position it on the screen (in 2D space) by using the Camera.main.WorldToScreenPoint method...

    Take a look at this thread here (they're discussing how to position a GUITexture/health-bar, but the principle is the same):
    http://forum.unity3d.com/threads/health-bar-over-enemy.26014/
     
  22. gamezuv

    gamezuv

    Joined:
    Nov 6, 2013
    Posts:
    82
    Yes, I should have been clearer with my question. That bit I can do but I want to know how to find out and assign player names to their respective cars ?
     
  23. perick

    perick

    Joined:
    Jun 20, 2008
    Posts:
    235
    They're already there... Just get from any of the car components like this (lets say you put this code inside CarGUI):

    string name = photonView.owner.name;

    This variable already has the nicknames the players chose in the first screen...
     
    gamezuv likes this.
  24. michtek

    michtek

    Joined:
    Sep 11, 2012
    Posts:
    8
  25. gamezuv

    gamezuv

    Joined:
    Nov 6, 2013
    Posts:
    82
    Will I need to buy pun+ from the asset store to publish my game on android+IOS+windows phone ?
     
  26. perick

    perick

    Joined:
    Jun 20, 2008
    Posts:
    235
    No... I haven't used PUN+ in the project and it is tested on Android. As far as I know, in Unity5 you don't need it for iOS as well... Not sure about Windows Phone though (by I believe it works fine with PUN free). I'll ask Tobias from Photon later today.
     
  27. perick

    perick

    Joined:
    Jun 20, 2008
    Posts:
    235
    Here's Tobias' answer:

    "in unity 5, you don't need PUN+ anymore.
    you can buy it to get the 100 CCU subscription for free, if you want that but you don't need PUN+ for technical/export reasons"
     
    Last edited: Feb 3, 2016
    NeoUnity and gamezuv like this.
  28. dbordzo

    dbordzo

    Joined:
    Aug 14, 2015
    Posts:
    34
    Could you tell as when update will be? Of coure I understand that you're doing this and you even don't have to, but we really would like to know : ))
     
  29. perick

    perick

    Joined:
    Jun 20, 2008
    Posts:
    235
    Hi... I finished the update on Monday as expected, but we need to wait for the Photon guys to do some code review and make sure there are no game-crashing bugs in it (it is a big update, with some new GUI objects and scripts, lots of refactoring, the weapon system, etc).

    As I mentioned before, the guy who does code review for this pack was a bit ill last week. He's back now, but he probably will need one week or so to catch up...:(

    I hope we can have everything ready for next Monday or so (I'm reviewing as well to double check for bugs).
     
  30. perick

    perick

    Joined:
    Jun 20, 2008
    Posts:
    235
    While we wait for the Photon guys to review update 1.0.6, I've launched the official thread for the other pack I'm developing (this is the last time I talk about it here, given there's a thread for it now):

    Thread: Photon M.O.B.A - Mecha Online Battle Arena;

    And a short video of an animated mecha showing independent neck movement:
     
    Andreas12345 likes this.
  31. gamezuv

    gamezuv

    Joined:
    Nov 6, 2013
    Posts:
    82
    Question about the track. Can the include :-
    1. up-down slopes ?
    2. can track include obstacles ?
     
  32. perick

    perick

    Joined:
    Jun 20, 2008
    Posts:
    235
    Yes... Two of the tracks even have jumps over gaps...

    Yes... There is an important thing to notice, though:
    - if the obstacle if FIXED, just put it in the track scene with a collider and it is fine...
    - if it is a movable obstacle (lets say a crate or barrel) that can be hit by cars, it is necessary to include network synchronisation, so when one car hits it, it ends up in the same place for all computers
     
  33. NeoUnity

    NeoUnity

    Joined:
    Sep 4, 2013
    Posts:
    156
    "No 100, 20 CCU subscription for free" Is it right?
     
  34. perick

    perick

    Joined:
    Jun 20, 2008
    Posts:
    235
    As I understood, 20 CCU is what you get with a free account. 100 CCU I believe you get when you buy PUN+.

    I just quoted the guy from Photon, I can't speak for them officially. I'm from Sertão Games and developed PUN Rally under their supervision (they're our publishers in the Asset Store).

    I suggest you contact them directly or through their support links in their asset store packs for this matter.
     
  35. chrisabranch

    chrisabranch

    Joined:
    Aug 15, 2014
    Posts:
    146
    i have PUN+, Yes 100 CCU is paid 20 free
     
  36. gamezuv

    gamezuv

    Joined:
    Nov 6, 2013
    Posts:
    82
    Hi , Using edy's physics and photon rally ... can I make a game like Rocket League ?
    . I want to do 1 vs 1 . Game that lasts 5 mins . Player with most goals wins .

     
  37. perick

    perick

    Joined:
    Jun 20, 2008
    Posts:
    235
    I'm pretty sure you can. Make the balls a game-object with a rigidbody and a photonView, instantiating and controlling it from the masterClient. Put triggers inside the goals to detect the ball (also controlled from the masterclient only), and that's it...
     
  38. perick

    perick

    Joined:
    Jun 20, 2008
    Posts:
    235
    Guys, I talked to Tobias from Photon earlier today. Update 1.0.6 will be reviewed this Wednesday, and then submitted to the Asset Store. An update is approved in a few hours after submission, so I believe it will be in the same day.
     
    stvster and Andreas12345 like this.
  39. Silent-Killer

    Silent-Killer

    Joined:
    Jun 24, 2014
    Posts:
    2
    Hi,
    I downloaded android apk but I am getting "App not installed". Can you please provide a working apk so that I can test the demo.
     
  40. perick

    perick

    Joined:
    Jun 20, 2008
    Posts:
    235
    I'll update it later today, but it should work fine, even against players using the multiplatform (PC/Mac) version (that's also a bit behind in updates). It's an unsigned Apk though, maybe this is messing with the installation.

    I'll put a new APK with the updated 1.0.6 version.
     
  41. perick

    perick

    Joined:
    Jun 20, 2008
    Posts:
    235
    Just updated the downloadable demos and the PDF tutorial (they're all 1.0.6 now). I hope the update will be online on the Asset Store tomorrow:

    Demos:
    Android (unsigned APK);
    Mac
    Windows
    Linux

    The updated PDF tutorial can be downloaded for free HERE.

    Some screenshots of the rocket-like (only one for now) weapon:

    weapon.png weapon2.png
     
    stvster likes this.
  42. stvster

    stvster

    Joined:
    Mar 4, 2013
    Posts:
    70
    Awesome Update!The back buttons are great and the weapon made me chuckle thinking of the possibilities.
    Thanx for the effort!
     
  43. perick

    perick

    Joined:
    Jun 20, 2008
    Posts:
    235
    Have you seen the end-of-race screen? That needed some changes in the position calculation, that now has to be "locaked" for cars that ended the race. It's all included in the updated source code for the pack.
     
    stvster likes this.
  44. stvster

    stvster

    Joined:
    Mar 4, 2013
    Posts:
    70
    I've seen it now.Great addition to race finish.Adds a nice Best Time competition feature.
    Well Done!!
     
  45. perick

    perick

    Joined:
    Jun 20, 2008
    Posts:
    235
    Yes, I'd post, the guys at Photon warned me update 1.0.6 is up. Forgot to mention: use Left CTRL (Fire1 at the input setup) to shoot projectiles (3 second cooldown - you can change this at the car prefab).
     
    stvster likes this.
  46. stvster

    stvster

    Joined:
    Mar 4, 2013
    Posts:
    70
    Thanx for v1.0.6
    The new features are greatly appreciated.
     
  47. theappmedia

    theappmedia

    Joined:
    Dec 29, 2015
    Posts:
    17
    I am interested to buy this package. Can you please tell me do i get everything that is mentioned in demo video including all assets physics photon scripts etc...

    Can i publish game on google play store after change graphics or reskinning assets ?
     
  48. perick

    perick

    Joined:
    Jun 20, 2008
    Posts:
    235
    Yes, you get everything and the rights to use anything in a game you publish. This is how the asset store works. There is even more stuff now because the video was made before the recent updates.

    Yes, you can publish a game on the play store based on this. Many users are doing exactly that. The project is tested in android phones.
     
  49. dbordzo

    dbordzo

    Joined:
    Aug 14, 2015
    Posts:
    34
    I wanna ask you guys is this game works on Apple Phone? I don't have any to test it :c
     
    Last edited: Feb 11, 2016
  50. perick

    perick

    Joined:
    Jun 20, 2008
    Posts:
    235
    I didn't test as well, but it should work just fine. I do test every update on my Android (Moto X 2). There are mobile input controls that you might want to replace the icons, etc, but it works.

    Lets wait if any of the guys answer with a positive test on iOS. I'll ask the guys at Photon as well.

    And anyway. If it doesn't work, just let me know that I'll make the corrections needed to make it so. It is supposed to work out of the box on iOS as well...:)
     
    Last edited: Feb 11, 2016