Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

304 Neutral

About brunopava

  • Rank
  1. brunopava

    Unity3d movement reverses

    - Make sure your character model pivot is correct so the Z axis is on the front of the char. - Rotate him only on the Y axis, move him forward only on the Z axis.  - This dude converted the built in scripts for cameras do C#:  http://psychicparrotgames.com/blog/2013/06/06/unity-third-person-controller-and-third-person-camera-scripts-converted-to-c/   You should check the scripts out and tweek it how you like it. But personaly I think the public parameters that they provide are usualy enough to achieve what I want most of the time.     Hope that helps.
  2. brunopava

    Creating a Homing Missile in Unity

    I would also add a RayCast on the tip of it to check if it is about to collide with something and then auto destroy it on act.   Lets say the player uses an obstacle to block the incoming missile.  The translate function ignores colliders, so the missile would be passing through walls and etc.
  3. brunopava

    RPG Playground - Make your own web RPG

    Indeed a very nice tool.   It only lack of a SHIFT+Select implementation to assign multiple tiles and not have to draw an entire object one tile at a time. Other than that I think it is a very usefull level desgin tool.     Keep up with the good work and hope to see a game of yours soon!
  4. brunopava

    scripting and unity3D

    There is also the Unity Youtube Chanel, wich contains a lot of video tutorials for both scripting and learning to work with the editor. I suggest for you to watch some of the videos to learn the basic workflow for the engine.   Hope that helps.
  5. brunopava

    How to make this work?

    Based on the complexity of your project I would use Unity3D engine and build a Web Player version. The engine have both paid and free versions and suports C# and JavaScript.   As for the networking capabilities I'd go with Photon from ExitGames.     Hope that helps.
  6. I'll ilustrate with C#: // Here you create a create a variable, but is empty or null. GameObject myGameObj; // Here you assign a instance to that variable, so that is no longer null. myGameObj = new GameObject(); /** The code you posted is just and shortcut for doing what I did. The advantage? You can create multiple instances using a for and assign them to a list. Every time the "new" keyword is used, it means that a new object of that type is being created. */
  7. brunopava

    Where to start?

    Mainly Game Designers use tools or plugins that developers make for them specifically for determined task. I guess there is not a magical tool that solves your problem unless you ask someone to make it. Then again, I didn't quite understand WHAT are you trying to do. So...
  8. Check this out:  http://u3d.as/content/unity-technologies/car-tutorial/1qU     With a few tweeks I think you can manage to do what you want.
  9.  This script should do the trick for you. Save is as NetworkRigidbody and attach to your ball.   This kinda solves the latency issues. And all you need to do about the ownership of the ball is:   Each player has its own ball, on an event, say the player kicks the ball. You send an RPC across the network and update the position of the ball in all clients.     Check this out: http://docs.unity3d.com/Documentation/Components/net-RPCDetails.html http://docs.unity3d.com/Documentation/ScriptReference/NetworkView.RPC.html   Although using too much networkviews can be desastrous. I suggest you to look into photon networking, it's an api from http://www.exitgames.com/ //Note: Example code from the unity networking examples using UnityEngine; using System.Collections; public class NetworkRigidbody : MonoBehaviour { public double m_InterpolationBackTime = 0.1; public double m_ExtrapolationLimit = 0.5; internal struct State { internal double timestamp; internal Vector3 pos; internal Vector3 velocity; internal Quaternion rot; internal Vector3 angularVelocity; } // We store twenty states with "playback" information State[] m_BufferedState = new State[20]; // Keep track of what slots are used int m_TimestampCount; void OnSerializeNetworkView(BitStream stream, NetworkMessageInfo info) { // Send data to server if (stream.isWriting) { Vector3 pos = transform.position; Quaternion rot = transform.rotation; //Vector3 velocity = Vector3.zero; //rigidbody.velocity; //Vector3 angularVelocity = Vector3.zero; // rigidbody.angularVelocity; stream.Serialize(ref pos); //stream.Serialize(ref velocity); stream.Serialize(ref rot); //stream.Serialize(ref angularVelocity); } // Read data from remote client else { Vector3 pos = Vector3.zero; Vector3 velocity = Vector3.zero; Quaternion rot = Quaternion.identity; Vector3 angularVelocity = Vector3.zero; stream.Serialize(ref pos); //stream.Serialize(ref velocity); stream.Serialize(ref rot); //stream.Serialize(ref angularVelocity); // Shift the buffer sideways, deleting state 20 for (int i=m_BufferedState.Length-1;i>=1;i--) { m_BufferedState[i] = m_BufferedState[i-1]; } // Record current state in slot 0 State state; state.timestamp = info.timestamp; state.pos = pos; state.velocity = velocity; state.rot = rot; state.angularVelocity = angularVelocity; m_BufferedState[0] = state; // Update used slot count, however never exceed the buffer size // Slots aren't actually freed so this just makes sure the buffer is // filled up and that uninitalized slots aren't used. m_TimestampCount = Mathf.Min(m_TimestampCount + 1, m_BufferedState.Length); // Check if states are in order, if it is inconsistent you could reshuffel or // drop the out-of-order state. Nothing is done here for (int i=0;i<m_TimestampCount-1;i++) { if (m_BufferedState[i].timestamp < m_BufferedState[i+1].timestamp) Debug.Log("State inconsistent"); } } } // We have a window of interpolationBackTime where we basically play // By having interpolationBackTime the average ping, you will usually use interpolation. // And only if no more data arrives we will use extra polation void Update () { // This is the target playback time of the rigid body double interpolationTime = Network.time - m_InterpolationBackTime; // Use interpolation if the target playback time is present in the buffer if (m_BufferedState[0].timestamp > interpolationTime) { // Go through buffer and find correct state to play back for (int i=0;i<m_TimestampCount;i++) { if (m_BufferedState[i].timestamp <= interpolationTime || i == m_TimestampCount-1) { // The state one slot newer (<100ms) than the best playback state State rhs = m_BufferedState[Mathf.Max(i-1, 0)]; // The best playback state (closest to 100 ms old (default time)) State lhs = m_BufferedState[i]; // Use the time between the two slots to determine if interpolation is necessary double length = rhs.timestamp - lhs.timestamp; float t = 0.0F; // As the time difference gets closer to 100 ms t gets closer to 1 in // which case rhs is only used // Example: // Time is 10.000, so sampleTime is 9.900 // lhs.time is 9.910 rhs.time is 9.980 length is 0.070 // t is 9.900 - 9.910 / 0.070 = 0.14. So it uses 14% of rhs, 86% of lhs if (length > 0.0001){ t = (float)((interpolationTime - lhs.timestamp) / length); } // Debug.Log(t); // if t=0 => lhs is used directly transform.localPosition = Vector3.Lerp(lhs.pos, rhs.pos, t); transform.localRotation = Quaternion.Slerp(lhs.rot, rhs.rot, t); return; } } } // Use extrapolation else { State latest = m_BufferedState[0]; float extrapolationLength = (float)(interpolationTime - latest.timestamp); // Don't extrapolation for more than 500 ms, you would need to do that carefully if (extrapolationLength < m_ExtrapolationLimit) { float axisLength = extrapolationLength * latest.angularVelocity.magnitude * Mathf.Rad2Deg; Quaternion angularRotation = Quaternion.AngleAxis(axisLength, latest.angularVelocity); //this is some code from a character wich only rotated on the y axis /*transform.position = latest.pos + latest.velocity * extrapolationLength; transform.rotation = angularRotation * latest.rot;*/ rigidbody.velocity = latest.velocity; rigidbody.angularVelocity = latest.angularVelocity; } } } }
  10. brunopava

    RPG Beginner Steps - Update

    If you have some bucks to spend, these packs are really great:   http://www.frogames.net/content-packs.html   But, some of them cost a shit load of money.   The CS:Warriors and Commoners pack have just what you need.
  11. If you want to work on indie games like me, I'd say the way to go is:   - C# or JavaScript to work with Unity3D; - ActionScript 3 for flash games (and actualy you can compile and publish flash to android and ios); - LUA to work with corona SDK (a great engine to develop games for mobile);   I think these are the main languages that I've learned over the years.   And of course there is C++, wich I think is the must know for all game developers.
  12. In my opinion, storing data in json or xml is the best way to acomplish that. Keeps things simple, the early you start the easier it gets.           When it gets too hard you will spend more time going over your code than if you actualy did the right thing at the beginning.   50% of the programmers work is to figure out how not to do the other 50%.
  13. brunopava

    Finding Points on a Irregular 2D Shape

    I guess if you can find the the external points like Cosmic314 said, you can also use the Ramer Douglas Peucker algorithm.   Here's a link for that: http://www.emanueleferonato.com/2013/03/13/from-png-to-box2d-first-attempt/   Hope it helps you.
  14.   Yeah, thats exactly what I was thinking about. Yesterday I was watching the interview with Edmund from team meat and he talks about that.   http://www.design3.com/industry-insight/team-meat/item/2387-interview-with-edmund-mcmillen-of-team-meat     He says that a common mistake from game developers is start too ambicious and too big. My sugestion is for you to start with something really simple, and finish it. Thats the whole point, finishing it. Try to start with something realistic and that uses your whole potential. Explore fully all that you are good at.      Well, good luck on your quest and may the force be with you.
  15. Awesome, nothing more to say. Thank you.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!