Jump to content
  • Advertisement

Search the Community

Showing results for tags 'C#'.

The search index is currently processing. Current results may not be complete.


More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Categories

  • Audio
    • Music and Sound FX
  • Business
    • Business and Law
    • Career Development
    • Production and Management
  • Game Design
    • Game Design and Theory
    • Writing for Games
    • UX for Games
  • Industry
    • Interviews
    • Event Coverage
  • Programming
    • Artificial Intelligence
    • General and Gameplay Programming
    • Graphics and GPU Programming
    • Engines and Middleware
    • Math and Physics
    • Networking and Multiplayer
  • Visual Arts
  • Archive

Categories

  • Audio
  • Visual Arts
  • Programming
  • Writing

Categories

  • Game Developers Conference
    • GDC 2017
    • GDC 2018
  • Power-Up Digital Games Conference
    • PDGC I: Words of Wisdom
    • PDGC II: The Devs Strike Back
    • PDGC III: Syntax Error

Forums

  • Audio
    • Music and Sound FX
  • Business
    • Games Career Development
    • Production and Management
    • Games Business and Law
  • Game Design
    • Game Design and Theory
    • Writing for Games
  • Programming
    • Artificial Intelligence
    • Engines and Middleware
    • General and Gameplay Programming
    • Graphics and GPU Programming
    • Math and Physics
    • Networking and Multiplayer
  • Visual Arts
    • 2D and 3D Art
    • Critique and Feedback
  • Community
    • GameDev Challenges
    • GDNet+ Member Forum
    • GDNet Lounge
    • GDNet Comments, Suggestions, and Ideas
    • Coding Horrors
    • Your Announcements
    • Hobby Project Classifieds
    • Indie Showcase
    • Article Writing
  • Affiliates
    • NeHe Productions
    • AngelCode
  • Topical
    • Virtual and Augmented Reality
    • News
  • Workshops
    • C# Workshop
    • CPP Workshop
    • Freehand Drawing Workshop
    • Hands-On Interactive Game Development
    • SICP Workshop
    • XNA 4.0 Workshop
  • Archive
    • Topical
    • Affiliates
    • Contests
    • Technical
  • GameDev Challenges's Topics
  • For Beginners's Forum

Calendars

  • Community Calendar
  • Games Industry Events
  • Game Jams
  • GameDev Challenges's Schedule

Blogs

There are no results to display.

There are no results to display.

Product Groups

  • GDNet+
  • Advertisements
  • GameDev Gear

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Website


Role


Twitter


Github


Twitch


Steam

Found 324 results

  1. Hi! I'm currently looking for a side project to put my time into. I usually put my time into tinkering small features and want to add something into my portfolio later on. Thats why I'm interested to work on a project again that will result in some kind of game. My background with general game programming with focus on a homebrew engine along with homebrew rendering engine for 3D-games all done in C++. Now I just use my programming skills for educating future game developers. Tools that I've used before includes Unity, Unreal and also my own (pretty shitty) engine. I could probably could work on almost any kind of game that would need a programmer, preferably something that has co-op or some kind of multiplayer features. It doesn't need to be a project with motive to publish or anything, just for fun is all I look for Also open for gathering a group to together brainstorm something up
  2. I am using the rts cam script and was wondering if it was possible to stop the camera from going out of sight of an object. This set up is being developed in unity and is for a 3D game. The camera is being used to rotate, pan and zoom in/around an object. At the moment I can move out of sight of the object. Is there a way to block the camera from going out of sight of the object? I have seen multiple ways to keep an object in sight through the camera, however I am unsure which route to take. I have attached the script being used below. public class RTSCam : MonoBehaviour { private float dist; private float orbitSpeedX; private float orbitSpeedY; private float zoomSpeed; public float rotXSpeedModifier=0.25f; public float rotYSpeedModifier=0.25f; public float zoomSpeedModifier=5; public float minRotX=-20; public float maxRotX=70; //public float minRotY=45; //public float maxRotY=315; public float minZoom=3; public float maxZoom=15; public float panSpeedModifier=1f; // Use this for initialization void Start () { dist=transform.localPosition.z; DemoSceneUI.SetSceneTitle("RTS camera, the camera will orbit around a pivot point but the rotation in z-axis is locked"); string instInfo=""; instInfo+="- swipe or drag on screen to rotate the camera\n"; instInfo+="- pinch or using mouse wheel to zoom in/out\n"; instInfo+="- swipe or drag on screen with 2 fingers to move around\n"; instInfo+="- single finger interaction can be simulate using left mosue button\n"; instInfo+="- two fingers interacion can be simulate using right mouse button"; DemoSceneUI.SetSceneInstruction(instInfo); } void OnEnable(){ IT_Gesture.onDraggingE += OnDragging; IT_Gesture.onMFDraggingE += OnMFDragging; IT_Gesture.onPinchE += OnPinch; orbitSpeedX=0; orbitSpeedY=0; zoomSpeed=0; } void OnDisable(){ IT_Gesture.onDraggingE -= OnDragging; IT_Gesture.onMFDraggingE -= OnMFDragging; IT_Gesture.onPinchE -= OnPinch; } // Update is called once per frame void Update () { //get the current rotation float x=transform.parent.rotation.eulerAngles.x; float y=transform.parent.rotation.eulerAngles.y; //make sure x is between -180 to 180 so we can clamp it propery later if(x>180) x-=360; //calculate the x and y rotation //Quaternion rotationY=Quaternion.Euler(0, Mathf.Clamp(y+orbitSpeedY, minRotY, maxRotY), 0); Quaternion rotationY=Quaternion.Euler(0, y+orbitSpeedY, 0); Quaternion rotationX=Quaternion.Euler(Mathf.Clamp(x+orbitSpeedX, minRotX, maxRotX), 0, 0); //apply the rotation transform.parent.rotation=rotationY*rotationX; //calculate the zoom and apply it dist+=Time.deltaTime*zoomSpeed*0.01f; dist=Mathf.Clamp(dist, -maxZoom, -minZoom); transform.localPosition=new Vector3(0, 0, dist); //reduce all the speed orbitSpeedX*=(1-Time.deltaTime*12); orbitSpeedY*=(1-Time.deltaTime*3); zoomSpeed*=(1-Time.deltaTime*4); //use mouse scroll wheel to simulate pinch, sorry I sort of cheated here zoomSpeed+=Input.GetAxis("Mouse ScrollWheel")*500*zoomSpeedModifier; } //called when one finger drag are detected void OnDragging(DragInfo dragInfo){ //if the drag is perform using mouse2, use it as a two finger drag if(dragInfo.isMouse && dragInfo.index==1) OnMFDragging(dragInfo); //else perform normal orbiting else{ //apply the DPI scaling dragInfo.delta/=IT_Gesture.GetDPIFactor(); //vertical movement is corresponded to rotation in x-axis orbitSpeedX=-dragInfo.delta.y*rotXSpeedModifier; //horizontal movement is corresponded to rotation in y-axis orbitSpeedY=dragInfo.delta.x*rotYSpeedModifier; } } //called when pinch is detected void OnPinch(PinchInfo pinfo){ zoomSpeed-=pinfo.magnitude*zoomSpeedModifier/IT_Gesture.GetDPIFactor(); } //called when a dual finger or a right mouse drag is detected void OnMFDragging(DragInfo dragInfo){ //apply the DPI scaling dragInfo.delta/=IT_Gesture.GetDPIFactor(); //make a new direction, pointing horizontally at the direction of the camera y-rotation Quaternion direction=Quaternion.Euler(0, transform.parent.rotation.eulerAngles.y, 0); //calculate forward movement based on vertical input Vector3 moveDirZ=transform.parent.InverseTransformDirection(direction*Vector3.forward*-dragInfo.delta.y); //calculate sideway movement base on horizontal input Vector3 moveDirX=transform.parent.InverseTransformDirection(direction*Vector3.right*-dragInfo.delta.x); //move the cmera transform.parent.Translate(moveDirZ * panSpeedModifier * Time.deltaTime); transform.parent.Translate(moveDirX * panSpeedModifier * Time.deltaTime); } //for the camera to auto rotate and focus on a predefined position /* public float targetRotX; public float targetRotY; public float targetRotZ; public Vector3 targetPos; public float targetZoom; IEnumerator LerpToPoint(){ Quaternion startRot=transform.parent.rotation; Quaternion endRot=Quaternion.Euler(targetRotX, targetRotY, targetRotZ); Vector3 startPos=transform.parent.position; Vector3 startZoom=transform.localPosition; float duration=0; while(duration<1){ transform.parent.rotation=Quaternion.Lerp(startRot, endRot, duration); transform.parent.position=Vector3.Lerp(startPos, targetPos, duration); transform.localPosition=Vector3.Lerp(startZoom, new Vector3(0, 0, -targetZoom), duration); duration+=Time.deltaTime; yield return null; } transform.parent.rotation=endRot; transform.parent.position=targetPos; transform.localPosition=new Vector3(0, 0, -targetZoom); } */ /* private bool instruction=false; void OnGUI(){ string title="RTS camera, the camera will orbit around a pivot point but the rotation in z-axis is locked."; GUI.Label(new Rect(150, 10, 400, 60), title); if(!instruction){ if(GUI.Button(new Rect(10, 55, 130, 35), "Instruction On")){ instruction=true; } } else{ if(GUI.Button(new Rect(10, 55, 130, 35), "Instruction Off")){ instruction=false; } GUI.Box(new Rect(10, 100, 400, 100), ""); string instInfo=""; instInfo+="- swipe or drag on screen to rotate the camera\n"; instInfo+="- pinch or using mouse wheel to zoom in/out\n"; instInfo+="- swipe or drag on screen with 2 fingers to move around\n"; instInfo+="- single finger interaction can be simulate using left mosue button\n"; instInfo+="- two fingers interacion can be simulate using right mouse button"; GUI.Label(new Rect(15, 105, 390, 90), instInfo); } } */ }
  3. I am trying to communicate between 2 scripts that are in 2 different scenes. I start of in the home scene and than press a button that takes me into the main scene. When I go into the main scene I want a list of GameObjects to be disabled and another set of GameObjects to be enabled. - start off in the home scene- press a button that takes me to another scene (I can do this) - When I press button in home scene and enter main scene a list of gameobjects are disabled and another are enabled (struggling with this).
  4. I've got a bit of a weird setup here so to explain real briefly, I have pickups that when hit, the game object is destroyed, but the script of the object is cloned and put into a list. This is so my pick up queue knows which pick ups we have collected, and which one to activate next. This is the error I'm getting: NullReferenceException: Object reference not set to an instance of an object AssaultRiflePickUp.StartCoroutine (Single delay, UnityEngine.MonoBehaviour coroutineHost) (at Assets/Scripts/AssaultRiflePickUp.cs:76) AssaultRiflePickUp.AssaultRifleShot (UnityEngine.GameObject mainBall) (at Assets/Scripts/AssaultRiflePickUp.cs:93) Ball.OnCollisionEnter2D (UnityEngine.Collision2D collider) (at Assets/Scripts/Ball.cs:63) And I've put several debug.Log messages to narrow down exactly when it is throwing the error, in the following code, it is thrown right after AssaultRifleShot - 2, but before AssaultRifleShot - 3, so basically it's something to do with my coroutine I believe. Hopefully someone can help me figure out what is going on with it because I'm confused how it can say null exception when it's already calling a method from the object. Here is the code: using System.Collections; using System.Collections.Generic; using UnityEngine; using System.Threading; public class AssaultRiflePickUp : BasePickUp, ISpecialShotPickUp { private int AmmoRemaining = 35; private float timer = 0.3f; public GameObject newBall; void Start () { //assign paddle to variable paddle = GameObject.FindObjectOfType<Paddle> (); //find the ball and assign it to this variable foreach (Ball ball in GameManager.pickUpManager.allBalls) { if (ball.mainBall) { mainBall = ball; } } } public override void ActivatePickUp (MonoBehaviour coroutineHost) { Debug.Log("ActivatePickUp"); //subscribe to events mainBall.onBallHitPaddle += AssaultRifleShot; mainBall.onBallCollided += DestroyExtraBalls; } public void SpecialShot () { Debug.Log("SpecialShot"); Vector3 mainBallVector = mainBall.GetComponent<Rigidbody2D>().velocity; //grab mainBall's direction and speed before making it a destroyable ball mainBall.GetComponent<Ball>().mainBall = false; Instantiate(newBall); GameManager.pickUpManager.allBalls.Add(newBall.GetComponent<Ball>()); newBall.transform.position = paddle.transform.position + ballSpawnOffset; //use the original ball's vector3 to follow it directly newBall.GetComponent<Rigidbody2D>().velocity = mainBallVector; } public void DestroyExtraBalls (GameObject ball) { if (GameManager.pickUpManager.allBalls.Count > 1) { } //TODO: Implement observer pattern to watch for balls colliding with something. If they do and they are not the main ball, destroy them. } public void DestroyPickUp () { Debug.Log("DestroyPickUp"); Destroy (GameManager.pickUpManager.pickUpQueue [0]); GameManager.pickUpManager.pickUpQueue.RemoveAt (0); GameManager.pickUpManager.pickUpActive = false; } //a timer used for timed pick ups public IEnumerator PowerUpTimer (float delay) { Debug.Log("PowerUpTimer"); yield return new WaitForSeconds (delay); SpecialShot(); } //The coroutine is used to start a short timer so that the balls don't spawn on top of each other all at the same time. public void StartCoroutine (float delay, MonoBehaviour coroutineHost) { coroutineHost.StartCoroutine(PowerUpTimer(delay)); } //Controls the pick up's cycle public void AssaultRifleShot (GameObject mainBall) { Debug.Log("AssaultRifleShot called"); if (AmmoRemaining > 0) { Debug.Log("AssaultRifleShot - Inside If Statement"); //if there is ammo remaining, set the main ball to just a normal ball so it can be destroyed on impact and then start coroutine mainBall.GetComponent<Ball> ().mainBall = false; Debug.Log("AssaultRifleShot - 1"); mainBall.GetComponent<Ball> ().onBallHitPaddle -= AssaultRifleShot; //unsubscribe to event when mainBall is set to false. Debug.Log("AssaultRifleShot - 2"); StartCoroutine(timer, GameManager.monoBehaviour); Debug.Log("AssaultRifleShot - 3"); AmmoRemaining -= 1; Debug.Log("AssaultRifleShot - 4"); } else { DestroyPickUp(); } } } I'll post the cloning code here just in case it has anything to do with it. Maybe I'm not cloning it correctly? But it's working for my other pick ups, which also use coroutines. public object Clone () { //clone the pick up object to prevent a null reference when the pick up game object is destroyed BasePickUp newPickUp = (BasePickUp)this.MemberwiseClone(); return newPickUp; }
  5. Hope rises as pieces of the overworld are coming together. Weighed down by post-delay sad vibes all week and only just now getting back into the swing of things as I write this at 3:30am on a Wednesday. This week was code fever and I wore a programmer cap tight while sprucing up BGP's bones. Lots of things are working better than ever, and lots more are sure to come. The real issue right now is seeing how much can get up and running before BronyCon. The panel is going to be a slideshow about game development in general, some Q&A between slides, how I came up with and created BGP, and what features I have left to create and how I plan to implement them. And all that will be sandwiched between a Trailer to show off the game and a gameplay demo of the battle system and overworld. Then I'd like to have some sort of teaser finale to send everyone off with and encourage them to download the demo to their phones on the way out so they can remember the game later. But how much I can show depends on how far I get in the next 6 days, so fingers crossed, I won't hit any more road blocks. Every precious minute counts right now, and I think I might just barely make it. So let's see what's been done in the past few days.Read More: yotesgames.com
  6. Okay, so I am making a character controller in Unity of a 3D model. it got two layers of animation - the base layer works perfectly fine but the 1st layer in which the character holds a flash light. The animation works fine until the arm starts behaving weirdly when the shoulder is rotated upside or downwards. I am attaching a video along with this https://drive.google.com/open?id=1hLFx3Szx4au4-2PZaAEa3d1f8kNmWMUH if someone knows how to do it then please let me know. It would be a great help I have used IK for this. Set the IK target to the torch but it still didn't work
  7. How to get the selected scene's triangles in code in menuitem?
  8. Hey guys, I am looking for a hobby project to get back into game programming. I havent worked on any games in a couple years due to a career change (not saying I was a professional) but I have the free time now to refresh my skills. My experience is with 2D 16bit style games and I'd prefer to work on something of that nature but I'm not opposed to learning something completely new, I just enjoy that game style. It takes me back to the good ol' days haha. Feel free to email me at mrposotive@gmail.com
  9. Hello all! Thanks for taking the time to read this post. This is a bit of a strange subject, but a very important one nonetheless in my opinion. I've been programming for about 7 years now, and over this duration I've made over 10 small but complete games. Over the past few years, I started working on a bigger project, and this has been through two prototypes. I've noticed that every time one of these prototypes reaches a certain size, the code becomes more and more intertwined and interdependent to the point where productivity slows to a halt and eventually just stops. A lot of people tell me to "create small games" and "see them through to completion", but I have indeed done this, and this problem seems to persist. I'm not working on something overly ambitious or impossible to complete, but it always seems like when I try to create a game with any kind of substance or complexity, coding very quickly becomes this awful chore of backtracking, and progress slows and slows to a halt. I've done lots of research into programming patterns, and I write my code very meticulously with lots of comments and strict formatting, but I can't seem to jump this barrier. For the first time ever, recently, I decided to COMPLETELY document every single aspect of my game, so that creating content won't involve me having to over-engineer and future-proof my code in the hope of future additions. This way, I can completely design the architecture around this content and then shut the doors and agree to not add any more content, no matter how tempting it may be. However, I'm not too sure how to go about starting a new project in a way that will ensure quality control and a nice balance of readability/cohesiveness/modularity. I wondered if any of you have the same problem, and if so, how do you go about combatting it? Is there a tried and tested way create an architecture which allows the addition of code without causing a rippling echo throughout all existing code? Is there some form of diagramming or pre-planning which can help minimize this risk later down the line? I eagerly await your reply! Thank you, Zuhane
  10. I am a talented 2D/3D artist with 3 years animation working experience and a Degree in Illustration and Animation. I have won a world-wide art competition hosted by SFX magazine and am looking to develop a survival game. I have some knowledge of C sharp and have notes for a survival based game with flexible storyline and PVP. Looking for developers to team up with. I can create models, animations and artwork and I have beginner knowledge of C sharp with Unity. The idea is Inventory menu based gameplay and is inspired by games like DAYZ. Here is some early sci-fi concept art to give you an idea of the work level. Hope to work with like minded people and create something special. email me andrewparkesanim@gmail.com. Developers who share the same passion please contact me, or if you have a similar project and want me to join your team email me. Many thanks, Andrew.
  11. Objective The main objective of this post is to give an idea of how to work with wheel collider and physics of Wheel Collider. Want to Make a Car Racing Game? Having troubles with Car Physics? Where to use Wheel Collider? How to use Wheel Collider? What are the components of Wheel Collider? How is Wheel Collider Different than other Colliders? Have these Questions in Your Mind? No worries... You'll know everything about Wheelcollider after reading this post. INTRODUCTION Wheel Collider is a special kind of Collider which is used for vehicles. It has in built collision detection technique and physics of actual Wheel. It can be used for objects other than wheels (like bumper Boats, bumper cars etc which uses suspension force ), but it is specially designed for vehicles with wheels. Is there is anything special which is not in other Colliders? Yes, each and every collider has something special (That’s why Unity created them). In this Collider, you will get all the components which are used to make vehicle drivable. Do have any idea about components..? No problem, I will explain components here. Before that, it's very important to understand how the Wheel Collider component works internally, to get a car working in Unity Here, I have explained everything. This is how you look at your dashing and shiny car. But, Unity doesn’t have good eyesight. So Unity looks at your car like this. 4 wheels colliders and 1 car collider, that’s it! Now Let’s Discover inside Wheel Collider. Wheel doesn’t have any shape it is Raycast based. Mass & Radius: mass and radius of the wheel. (Easy isn’t it ?) Below I had given a little introduction about physics of wheel collider. Every Wheel counts it’s sprung mass. Sprung mass (not weight) is used to apply individual force on each wheel. Suspension Distance is the distance between max droop and max compression. This suspension is calculated based on rest pose. Suspension Force(F) = (sprungMass * g ) +( jounce * stiffness) - (damper * jounceSpeed) jounce -> offset of the wheel relative to the rest pose. stiffness -> that means physics friction. (setting this to 0 means no friction change this runtime to simulate in various ground material). damper -> damping value applied to the wheel jounceSpeed -> wheel moved with suspension travel direction. Tire simulation rather than using dynamic or static material slip-based material is used. To learn more about physics of wheel collider click here First we need to setup Scene for that (Don’t Worry that is Easy part). PART-1: SCENE SETUP Step 1: Create a 3D plane Object give it scale of (100, 0, 100). Step 2: Create an empty Object add Rigidbody 3D. Name it as “Car” Step 3: Import 3D Car Model inside your Scene (you will get download link below) add as a child of Car. Step 4: Take Mesh Collider and add as a child of Car name it ”CarCollider”. Step 5: Create Two empty GameObject inside Car name them as “Wheel Meshed ” and “Wheel Collider”. Step 6: Inside Wheel Meshes add 4 empty GameObject name them as “FL” ,”FR” ,”RL” and “RR”. assign Mesh of Wheel (you will get download link below). Set their Position. Step 7: Inside Wheel Collider add 4 empty GameObjects name them as “Col_FL” ,”Col_FR”, ”Col_RL” and “Col_RR”. Add wheel collider as their component. Set radius of colliders same as the size of mesh and set their position same as the mesh have. Yeap, Its Done! actually that was the Difficult part to setup scene. Now Time for really easy part Scripting. PART-2: SCRIPTING (Check Script Reference Click here) [System.Serializable] public class AxleInfo { public WheelCollider leftWheelCollider; public WheelCollider rightWheelCollider; public GameObject leftWheelMesh; public GameObject rightWheelMesh; public bool motor; public bool steering; } In this AxleInfo Class, we are going to store info for a pair of the wheel. Variable Name Variable Type Description leftWheelCollider / rightWheelCollider WheelCollider To drive a car using WheelColliders inbuilt physics. leftWheelMesh / rightWheelMesh GameObject To Visualize rotation and movement of wheels. motor bool Enable movement of this pair of wheels. steering bool Enable rotation of this pair of wheels. Now, Let's go for long drive . This script is to drive Car. public class CarDriver : MonoBehaviour { public List<AxleInfo> axleInfos; public float maxMotorTorque; public float maxSteeringAngle; public float brakeTorque; public float decelerationForce; public void ApplyLocalPositionToVisuals (AxleInfo axleInfo) { Vector3 position; Quaternion rotation; axleInfo.leftWheelCollider.GetWorldPose (out position, out rotation); axleInfo.leftWheelMesh.transform.position = position; axleInfo.leftWheelMesh.transform.rotation = rotation; axleInfo.rightWheelCollider.GetWorldPose (out position, out rotation); axleInfo.rightWheelMesh.transform.position = position; axleInfo.rightWheelMesh.transform.rotation = rotation; } void FixedUpdate () { float motor = maxMotorTorque * Input.GetAxis ("Vertical"); float steering = maxSteeringAngle * Input.GetAxis ("Horizontal"); for (int i = 0; i < axleInfos.Count; i++) { if (axleInfos [i].steering) { Steering (axleInfos [i], steering); } if (axleInfos [i].motor) { Acceleration (axleInfos [i], motor); } if (Input.GetKey (KeyCode.Space)) { Brake (axleInfos [i]); } ApplyLocalPositionToVisuals (axleInfos [i]); } } private void Acceleration (AxleInfo axleInfo, float motor) { if (motor != 0f) { axleInfo.leftWheelCollider.brakeTorque = 0; axleInfo.rightWheelCollider.brakeTorque = 0; axleInfo.leftWheelCollider.motorTorque = motor; axleInfo.rightWheelCollider.motorTorque = motor; } else { Deceleration (axleInfo); } } private void Deceleration (AxleInfo axleInfo) { axleInfo.leftWheelCollider.brakeTorque = decelerationForce; axleInfo.rightWheelCollider.brakeTorque = decelerationForce; } private void Steering (AxleInfo axleInfo, float steering) { axleInfo.leftWheelCollider.steerAngle = steering; axleInfo.rightWheelCollider.steerAngle = steering; } private void Brake (AxleInfo axleInfo) { axleInfo.leftWheelCollider.brakeTorque = brakeTorque; axleInfo.rightWheelCollider.brakeTorque = brakeTorque; } } I know, this script was a little bit difficult but I am here to help you. Variable Name Variable Type Description axleInfos List List of AxleInfo Which contains a pair of wheels data. maxMotorTorque float maximum Torque is applicable on Vehicle. maxSteeringAngle float Maximum angle at which wheel is rotate. brakeTorque float Torque is applied when a brake is pressed. decelerationForce float This force is applied to stop the vehicle because of friction. ApplyLocalPositionToVisuals (AxleInfo axleInfo) This Method takes one argument: axleInfo. This method is used to Display rotation and position of WheelMeshes. FixedUpdate() This is Unity callBack used to do certain changes in physics at fixed time. Inside that, we will take Input. Vertical: W/Up Arrow for Forward & S/Down Arrow for Backward. Horizontal: A/Left Arrow for Left Side Rotation. & D/Right Arrow for Right Side Rotation. Space: To Stop(brake). Assign this Script to our “Car” GameObject. Add Size of AxleInfo to 2. Now add your Colliders and Meshes to appropriate Location. We have 3 methods to Control Car Acceleration(), Steering() and Brake(). You can relate all the methods listed below. These methods are works like how actually Vehicle we drive in reality Accelerator, Brake(No Clutch here). Acceleration() It is used to make the vehicle move forward and backward. If forward or backward buttons are not clicked then need to add Deceleration(). motorTorque is used to add torque (In forward or backward direction) in a vehicle. When the vehicle is moving at that time brakeTorque is needed to change to 0. Deceleration() It is used to stop the vehicle when forward and backward buttons are not pressed. Steering() It is used to turn angle of vehicle. steerAngle is used to change an angle of the the vehicle Brake() It is used to stop the vehicle using brakeTorque property. PART-3: ASSIGNING VALUES Finally at the end, This is the last thing to make your car drivable. Enable motor if you want to Apply Force and Suspension on That Wheel. Enable Steering if you want to give rotation Force on that Wheel. Maximum Motor Torque change as per your car’s Rigidbody mass. Maximum Steering Angle must be between (30-35). Brake Torque depends on how much Brake Torque you want to apply. Deceleration Force is must be less than Brake Torque. Tip Experiment with This Value to make your Car run smoothly. Caution Brake Torque and Deceleration Force value need to be much higher to stop usually(1e+5 to 1e+8).
  12. ERASERHEAD STUDIO

    13 RONIN - DevLog #4 - Say hello to Ester!

    Ester (Eraserhead Animation Editor) is a new tool I've build that will make it easier for me to describe what different animations a spritesheet contains and their different characteristics e.g. how long each frame should be displayed. I can then export the description, as a json-file, and then together with the spritesheet load it into the game and use it to set up my "in game" animations. This is how Ester looks with a spritesheet loaded and one animation created: I'll easily admit that building this tool has been a detour that's taken far too much time from any actual game development, but please let me give you the background. Background 13 RONIN is a pixel-art game with animations based on spritesheets, just like the one below: The spritesheet together with a json-file describing the sheet are read into the game and turned into different animations. A process that works quite well. This is the "Draw"-animation beginning at row 3 and column 1 as described by the json-file below. In this example each frame is displayed for 150 milliseconds Same animation as above but with individual frame times The description file The description file started out quite small, but since I prefer to hard-code as few things as possible and also want room for adjustment, the file grew. This is a file describing the "Draw"-animation starting at row 3 and column 1: { // General description of the spritesheet "spritesheet": { // Size of sheet in columns and rows, // where each cell is a sprite "gridSize": { width: 13, // The sheet has a size of 13 columns height: 5 // and 5 rows of sprites } // Size of a sprite in pixels "spriteSize": { width: 160, // Each sprite has a size height: 160 // of 160x160 pixels } } // Default values for animation frames "frameDefaults": { // Intended for describing hit-boxes and such. This // example would give a hitbox located at same position // as the sprite and of the same size "margin": { "top": 0, "right": 0, "bottom": 0, "left": 0 }, // Offset value used when positioning and drawing // sprites. "offset": { x: 10, // The sprites should be drawn 10 pixels y: 0 // to the right of the destination point } // Frame duration. Display each frame 200 milliseconds // before advancing to next frame "duration": 200 }, // Animations found in the spritesheet "animations": [ // An animation { // Name used for identification "name": "Draw", // OPTIONAL. Will override default setting "offset": { x: 0, // No offset for this animation y: 0 }, // OPTIONAL. Will override default setting "margin": { "top": 0, "right": 0, "bottom": 0, "left": 0 }, // OPTIONAL. Will override default setting. // Frame duration for this animation is 150 // milliseconds "duration": 150, // Start location in grid "index": { x: 0, // This animation begins with image at y: 2 // row 3 and column 1 }, // This animation contains 13 frames starting // at "index" "frameCount": 13, // OPTIONAL. Using this property it's possible to // set frame duration for individual frames "frames": [ ] } ] } Writing and maintaining the description files is very tedious and it's also very easy to make mistakes. Remember that the file above only contains one animation and that is an animation without any individual frame duration times. To get the animation seen in the second example above following "frames"-section has to be added: "frames": [ { "index": 0, "duration": 200 }, { "index": 1, "duration": 175 }, { "index": 2, "duration": 175 }, { "index": 3, "duration": 200 }, { "index": 4, "duration": 300 }, { "index": 5, "duration": 175 }, { "index": 10, "duration": 175 }, { "index": 11, "duration": 175 }, { "index": 12, "duration": 1000 } ] We now have 3 pages of json and only one animation described. I grew tired of this and felt a need for a tool to assist me in describing and tuning the animations as well as automatically generating the json. Together with a desire to improve my skills as a front-end developer I started the development of Ester. Tech Ester is an Electron based application using React as UI-framework. I'm not really a front-end developer and since this isn't the main focus of the blog I won't dwell and deeper into the subject, but for anyone interested in trying out these technologies, there are a lot of posts written on the subject, so just use your magic friend google and you'll get lucky. And please feel free to browse or clone the Ester-repo. I think the project- and component-structure is quite good, but I'm sure there could be a lot of improvements made on the JavaScript- and CSS-code. If you find something really horrific please let me know. Using Ester If you would like to give Ester a try, please visit my BitBucket account for further instructions. If you find Ester useful, run into bugs or have ideas for new features, please don't hesitate from letting me know. Please be aware that this is not a finished product, but something I'm working on as part of the game development project. Fatal crashes might happen and breaking changes be introduced. You're also very welcome to clone and extend the product yourself. Happy coding! /jan. NOTE. As always, everything I show, share or write about here is work under progress and subject to change.
  13. Some thoughts about ECS Part 1: Unity ECS - briefly about ecs Part 2: Unity ECS - project design Part 3: Unity ECS - operations on Entities Part 4: Unity ECS - ECS and Jobs The rule of thumb explanation How does ComponentSystem often look like: public class SomeSystem : ComponentSystem { private struct Group { public readonly int Length; public EntityArray Entities; public ComponentDataArray<SomeComponent> SomeComponents; } [Inject] private Group m_group; // Inject the group entities with given components protected override void OnUpdate() { float dt = Time.deltaTime; // Nice cached deltaTime, we're on main thread, so we can use Unity's API for (int i = 0; i < m_group.Length; i++) { // some operates on data } } // System was enabled (ComponentSystemBase.Enabled = true) protected override void OnStartRunning() { // probably some more caches for optimization, preparation for Updates } // System was disabled (ComponentSystemBase.Enabled = false) protected override void OnStopRunning() { // probably some clean up } } Let's take a look at this first: struct Group { public readonly int Length; public EntityArray Entities; public ComponentDataArray<Foo> Foos; public ComponentDataArray<Bar> Bars; } What is group? Group is filter of all Entities in active world that have Foo and Bar component It's like array of matching entities with references to all specific given components. So, group is like EntityArray but with references to components, EntityArray itself is just array of Entities (and entity is just an index). Group is constructed with a set of required components, subtractive components. It's also synced. Why do we have Length field? Isn't Foos.Length the same? Yes, you are rigth! They're the same. Length is length of EntityArray, so also Length of Foos and Bars, because each entity has Foo and Bar component It's more obvious in this case: for(int i; i < m_group.Length; i++) { // Using m_group.Foos.Length or m_group.Bar.Length would be a bit confusing in this case // because we iterate over all entities and can get access to ANY of their components } To summarize - every array in injected group would have same Length, because it's length of Entities and each entity has every given component. Separation of Length field is just for convenience. How to manage indexing? The injection magic. for(int i; i < m_group.Length; i++) // iterate over all entities from group { // It's safe to iterate like that, because every array in group has the same length // and indexing is also injected(synced) in that way to use it exactly like this: var actualEntity = m_group.Entities[i]; // Actual iterating Entity var actualFoo = m_group.Foos[i]; // Foo component "attached" to actualEntity var actualBar = m_group.Bards[i]; // Bar component "attached" to actualEntity } How do I manage lifetime of systems? Well, you don't really need to! Unity takes care about that. Systems track injected groups and will be disabled if there are no matching Entities and will be enabled if there appears one as well. But if you really want to, take a look upwards, see OnStartRunning and OnStopRunning ? I mentioned ComponentSystemBase.Enabled = true which is probably what are you looking for. It's property that allows you to active/disable system manually. Systems don't update in order I want Convenience attributes for rescue! Since all systems are updated on the main thread, you need to think about order of updates, there are some attributes to help you with it: [UpdateAfter(typeof(OtherSystem))], [UpdateBefore(typeof(OtherSystem))], [UpdateInGroup(typeof(UpdateGroup))] where UpdateGroup is empty class. You can even control update before/after Unity's phases by typeof(UnityEngine.Experimental.PlayerLoop.FixedUpdate) or other phases in same namespace. How can I get access to system I want? You can just inject it just like [Inject] private YourSystem yourSystem; easy as that. You can also use World.Active.GetExistingManager<YourSystem>() or if you're not sure if it exists but it should, use World.Active.GetOrCreateManager<YourSystem>() Why to use EntityArray in system? What can I do with this index? Since systems most often operates on components, not directly on entities, it raises question "Why do I even need this index". Saying "it's just and index" doesn't mean that is not usable at all. It's very important integer. If you haven't tried Unity's ECS implementation, you probably don't know where is it needed. It's needed among others for functionality from EntityManager that holds EntityData and controls adding/removing (and much more) components from a given entity. But actually you don't want to add/remove components via EntityManager. You'd rather do it after update to not break the group (you'll get error about accessing deallocated nativearray), so you want to use PostUpdateCommands (EntityCommandBuffer). More about that in one of futures part of article. World vs EntityManager EntityManager is not weird, magic class, it's ScriptBehaviourManager and "merges" entities and their components. In ECS we have a lot of managers. ComponentSystem is also ScriptBehaviourManager ! World holds all managers in one piece. We could colloquially say it manages the managers. I know what's your question - yes, we can create multiple worlds, sounds interesting, isn't it? Maybe we'll take a look at this in future. ComponentData and SharedComponentData. What's the difference? The difference is trivial, ComponentData is just a component, SharedComponentData is as it says, component shared between different Entities. Very good explanation you can read in docs: So, with same IComponentData (eg. Position) changes from Entity0 won't change Position from Entity1, ut with same SharedComponent (eg. Renderer) if you change material from Entity0, it'll change also material from Entity1. However you don't really want to change SharedComponents a lot, actually very rarely. More details THERE. Well, there is one more difference - ComponentData have to be blittable. Oryginally published at: https://connect.unity.com/p/part-1-unity-ecs-briefly-about-ecs Go further: Part 2: Unity ECS - project design Give me some feedback in comment section, don't worry I won't hate you if you show me some "anomaly" in my article. If you enjoy my article - like it and follow me. It'll motivate me to write more articles. See you.
  14. C# seems like a good language to learn. The library book is : Head First C# (2nd edition.) The book is published 2010 and it does have a third edition. The thought is "sure it should be worth reading and be advantageous enough especially being a beginner's book." However at chapter two the book mentioned the "CLR" and alarm bells went off. "Isn't this a similarity that was involved in the deprecation before C++/CLI? " So, before this book is read, has it aged nicely enough to be worthwhile? Thank you, Josheir
  15. I'm trying to let one of my classes know when something collides with something else and I think it would be a really good opportunity to learn how to implement events. Basically, I've got a bunch of balls on the screen and if any of them hit anything, I need one of my classes to be notified and to call a method when this happens. How can I implement this? I've looked at this here: https://stackoverflow.com/questions/1249517/super-simple-example-of-c-sharp-observer-observable-with-delegates But I don't really understand what exactly is going on or how to tie this into my own code. For reference, the class that needs to be notified of the collision is AssaultRiflePickUp, and the class that we are watching for is Ball. Thanks for the help!
  16. COMPANY AND THE PROJECT We are an indie game studio consisted of professional and skilled artists who are dedicated indie enthusiasts. Our current project is INT, developed on Unity Engine 5 for platforms Windows, Linux, and Mac. We are recruiting a few more members on the team to finalize our playable demo. INT is a 3D Sci-fi RPG with a strong emphasis on story, role playing, and innovative RPG features such as randomized companions. The focus is on the journey through a war-torn world with fast-paced combat against hordes of enemies. The player must accomplish quests like a traditional RPG, complete objectives, and meet lively crew members who will aid in the player's survival. Throughout the game you can side and complete missions through criminal cartels, and the two major combatants, the UCE and ACP, of the Interstellar Civil War. Please note that all of our current positions are remote work. You will not be required to travel. For more information about us, follow the links listed below. INT Official website Steam Greenlight IndieDB page Also follow social media platforms for the latest news regarding our projects. Facebook Twitter UNITY ENGINE PROGRAMMER We are looking for Unity Programmers. You will be working with our Coding team Lead to implement systems and mechanics using C# language. Your duties will include: Attendance of regular team meetings. Timely completion of implementation of assets. Direct contact with Project Lead and other Department Leads for the implementation process. Utilization of version control suites. Utilization of our project management boards (Trello) and communication channels to obtain up-to-date assets. REQUIREMENTS To be successful in this position, following requirements apply: Clear communication and self starter - pushes to meet deadlines and contribute to the project. Ability to complete tasks with limited input/direction from management. Comfortable with working with people remotely and via Trello management system. Good internet connection with ability to update assets/builds quickly, with large dependencies. At least 15 hours of availability each week. Proficient experience using the Unity Game Engine. Proficient experience in implementing assets into the Unity Game Engine. REVENUE - SHARE This is a great opportunity to get into the game development industry. We have the majority of our art assets completed and are marching towards our crowd-funding campaign, currently planned for mid 2018. We are unable to offer wages or per-item payments at this time. However revenue-sharing from crowd-funding is offered to team members who contribute 15-20 hours per week to company projects, as well as maintain constant communication and adhere to deadlines. Your understanding is dearly appreciated. TO APPLY Please send your Cover Letter, CV, Portfolio (if applicable), and other relevant documents/information to this email: JohnHR@int-game.net Thank you for your time! Please feel free to contact me via the email provided should you have any questions. We look forward to hearing from you! John Shen HR Lead Starboard Games LLC
  17. hey all! We are looking for members for our Unity horror game! Here’s the story: After a deadly virus plunges the world into chaos killing 85% of the human population there are now what they call “zones” these zones are watched very closely by the surviving government, people are checked every day for the virus, even if you touch the spit or any human waste or fluids of the victim who is infected, you will die. But one day, people in the west zone start to go missing, 1 woman goes outside the walls to uncover the mystery, is there more to the virus than meets the eye?, That is where your story starts. This game is not a long development game, I have loads other game ideas, I will also allow you to have a bit of creative freedom if you wish to add or share a idea! And no, it’s not a zombie game lol I feel like zombie games are too generic, in this game you will encounter terrifying beasts! There is some concept art one of our concept artists have made If interested email liondude12@gmail.com
  18. I have a BasePickUp : MonoBehaviour, ICloneable class. Then I have subclasses such as FastBall : BasePickUp. My FastBall class looks like this: public class FastBall : BasePickUp { public override void ActivatePickUp () { mainBall.GetComponent<Ball>().Speed = 2.0f; //increase ball speed... StartCoroutine(timer); //...set time that power up is active } } So I'm getting an error because of the StartCoroutine I guess, but I'm wondering if there is a way around this because I would really like to keep my current layout.
  19. Hi all, I am an experienced Unity dev based in Berlin, Germany and am looking for a fun project to do in my spare time. My main experience is with mobile games and some PC VR/AR applications. Please only contact me if your game is realistically scoped and at least somewhat thought out. I am also available for prototyping. I don't want to work on Horror games, or simple shooters. Please send me a direct message to get in touch. Looking forward to hearing interesting pitches. Marcus
  20. buzylaxy

    Card game AI help

    Hi, My apologies if I am posting in the wrong section. I want to code a card game where the player needs to make pairs, triplet or quadruple to earn points. I need some help/guidance for the AI to make it compute the best strategy based on the hand it draws and the cards on the table. to take decisions. If possible to rise difficulty by teaching the AI to count the cards in some manners to predict the player moves / mimic real players. 1- the game has 40 cards 1st round 4 cards are distributed and 3 cards for each player after that 2- points can be earned by making a match: 1point = a pair, 5points = triplet, 6point = quadruple. I don't Know if this is similar to some existing pattern, the one I found were specific to some pupular card games like black jack. thanks
  21. I'm working on a system for my game that will allow the player to stack pick ups in a queue. As one pick up expires, the next automatically activates. I'm having an issue though where if I pick up the first one, it activates fine, but if i pick up a second directly after it, it overrides the first one, activates the second one, and then once it has run it's course, everything goes back to normal gameplay, no first pick up. I'm not sure why this is happening. Hopefully someone can spot what I'm doing wrong in my code. Here is the code for the pick up manager: // Update is called once per frame void Update () { if (pickUpQueue.Count != 0 && !pickUpActive) { pickUpActive = true; pickUpQueue[0].ActivatePickUp(); } DeactivatePickUp(); } void DeactivatePickUp () { if (pickUpQueue.Count != 0 && pickUpActive) { Destroy (pickUpQueue [0]); pickUpQueue.RemoveAt (0); pickUpActive = false; } } And here is the PickUp: public override void ActivatePickUp () { ball.GetComponent<Ball>().Speed = 2.0f; //increase ball speed... ball.GetComponent<Ball>().StartCoroutine(timer); //...set time that power up is active } There is also a Base Pick Up: public void OnCollisionEnter2D (Collision2D collision) { Vector2 tweak = new Vector2 (Random.Range(0f, 0.2f),Random.Range(0f, 0.2f)); this.gameObject.GetComponent<Rigidbody2D>().velocity += tweak; //if the pickup makes contact with the paddle or ball.... if (collision.gameObject.tag == "Paddle" || collision.gameObject.tag == "Ball") { GameObject.FindObjectOfType<GameManager>().GetComponent<PickUpManager>().pickUpQueue.Add(this); Destroy(gameObject); //...and finally destroy power up object } } As a side note, I am trying to find a solution to this that will work for all of my pickups. Some pickups are ammo based, some are timed.
  22. Hi and thanks for reading, I have an issue with this reactive crosshair script, everything works fine until I start changing the offset. Give the script a go and you will see what I mean, when I do SetOffset(0f); it doesnt always set back to the origional state, if anyone can spot a fix I'd be super appreciative! using System.Collections; using System.Collections.Generic; using UnityEngine; public class ReactiveCrosshair : MonoBehaviour { [SerializeField] GameObject c_limb_prefab; private float center_offset = 0f; private float current_offset = 0f; private float max_offset = .5f; private int number_of_limbs = 4; private float limb_length = .05f; private float limb_width = .005f; private List<GameObject> c_limbs = new List<GameObject>(); public void SetupCrosshair(){ for (int i = 0; i < number_of_limbs; i++) { GameObject line_go = (GameObject)Instantiate (c_limb_prefab); line_go.transform.SetParent (this.transform); Vector3 limb_pos = new Vector3 (0f,0f,0f); //line_go.transform.position = limb_pos; line_go.transform.localPosition = limb_pos; LineRenderer line = line_go.GetComponent<LineRenderer>(); line.startWidth = limb_width; line.positionCount = 2; line.SetPosition (0, line_go.transform.localPosition + new Vector3(center_offset, 0f, 0f)); line.SetPosition (1, line_go.transform.localPosition + new Vector3(center_offset + limb_length, 0f, 0f)); line.useWorldSpace = false; c_limbs.Add(line_go.gameObject); } if (c_limbs != null) { OrientLimbs (); SetOffset (0f); } } public void OrientLimbs(){ for (int i = 0; i < c_limbs.Count; i++) { float rotation_step = 360f / (float)c_limbs.Count; c_limbs [i].transform.RotateAround (c_limbs[i].transform.position, c_limbs[i].transform.forward, 90f + (rotation_step * (float)i)); } } public void SetOffset(float _current_spread){ float offset = Mathf.Lerp (0f, max_offset, _current_spread); for (int i = 0; i < number_of_limbs; i++) { if (offset > current_offset) { Vector3 pos = c_limbs [i].transform.position + (c_limbs [i].transform.TransformDirection (Vector3.right) * offset); c_limbs [i].transform.position = pos; } if (offset < current_offset) { Vector3 pos = c_limbs [i].transform.position - (c_limbs [i].transform.TransformDirection (Vector3.right) * offset); c_limbs [i].transform.position = pos; } } Debug.Log ("SetOffset() offset: " + offset.ToString () + " _current_spread: " + _current_spread.ToString() + " localPos: " + c_limbs[1].transform.localPosition); current_offset = offset; } }
  23. Hi, I am looking for a TCP or HTTP networking library similar to Lidgren (UDP). This is primarily for sending game map data and potentially other large messages from Server to Client. I do want to keep Lidgren for my chat messages, player position, small fast updates etc. I especially love the flow of data and the library usage in general, so any libraries of a similar style would be excellent. Preferably something open source, free and reliable. I also must be able to swap between localhost and an ip address with ease, like Lidgren, as I run a server for singleplayer/mp/lan. My game maps are similar to minecraft, but it is 2d and only one Z-level, so i'm sending a jagged array of Tile object data (currently only enum TileID.Grass) down the pipe to the Client. Problem is if i'm sending a large map 1024 x 1024 tiles down the to client that's quite a lot of data, and Lidgren is relatively slow to build the writes (before the message is even sent!). It is fine when i'm using smaller maps < 512 x 512 ( xTiles * yTiles ). I know about chunking and will look into implementing this later, whilst taking into account the user's position in the world to only send nearby chunks. An example of my code that can be slow: private void WriteWorld(NetOutgoingMessage outgoing) { try { var world = WorldManager.Instance.CurrentWorld; outgoing.Write(world.XTiles); outgoing.Write(world.YTiles); for (int x = 0; x < world.XTiles; x++) { for (int y = 0; y < world.YTiles; y++) { // Write Tile obj data outgoing.Write((int)world.Tiles[x][y]); // <-------- Slow here when xTiles and yTiles are each > 512 ! } } } catch (Exception ex) { // log send error } } I'd love to hear from you guys, especially if any of you have come across a similar challenge.
  24. Hellados

    C# for beginners

    Hello guys, my name is Giorgi and i'm newbie game developer i'm learning Pixel art and after pixel art i want learn C# and don't know how and where start i'm bad with programming language and know only HTML/CSS
  25. Edit Your Profile D34DPOOL 0 Threads 0 Updates 0 Messages Network Mod DB GameFront Sign Out Add jobEdit jobDeleteC# Programmer for a Unity FPS at Anywhere Programmers located Anywhere. Posted by D34DPOOL on May 20th, 2018 Hello, my name is Mason, and I've been working on a Quake style arena shooter about destroying boxes on and off for about a year now. I have a proof of concept with all of the basic features, but as an artist with little programming skill I've reached the end of my abilities as a programmer haha. I need someone to help fix bugs, optomize code, and to implent new features into the game. As a programmer you will have creative freedom to suggest new features and modes to add into the game if you choose to, I'm usually very open to suggestions :). What is required: Skill using C# Experience with Unity Experience using UNET (since it is a multiplayer game), or the effort and ability to learn it Compensation: Since the game currently has no funding, we can split whatever revenue the game makes in the future. However if you would perfer I can create 2D and/or 3D assets for whatever you need in return for your time and work. It's a very open and chill enviornment, where you'll have relative creative freedom. I hope you are interested in joining the team, and have a good day! To apply email me at mangemason@yahoo.com
  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!