Questions tagged [unity3d]
24 questions
11
votes
2 answers
Best practices for version control in Unity?
I'm a bit confused how to use version control with Unity, especially with objects such as scenes or prefabs that are not just code.
We had an issue recently when my colleague and I were working on different parts of the same scene. which resulted…

Kaworu
- 251
- 2
- 8
6
votes
0 answers
Incorporating existing 2D OpenCL/OpenGL application in 3D scene
There is an existing real-time, scientific visualization application that uses OpenCL and OpenGL to render complex 2D graphs. My goal is to incorporate this application into a 3D rendered scene. At the very minimum, the desired application would…

Liam Kelly
- 169
- 4
4
votes
3 answers
How to do grid systems with floats given precision causes problems
I've been trying to create a grid system that can use any grid size and start at any given anchor point rather than always at 0,0.
The problem however is imprecision makes it impossible, even the simplest imprecision and i can't get it to work, yet…

WDUK
- 2,032
- 3
- 13
- 23
4
votes
7 answers
Sync one thousand vector3 across network with minimal bytes?
I am making a game with Unity, and am having problems attempting network synchronisation. Deterministic simulation is impossible because Unity's internal logic is float based. I am trying to make a solution which works on an authoritative…

inappropriateCode
- 149
- 5
4
votes
1 answer
Between JS clients and a Unity game server : TCP or UDP?
I'm currently building an interactive game which has a very special use case : The game is displayed on a giant screen on stage in a theatre, and the audience can play it with their smartphones (http://www.augmented-magic.com/)
My tools are :
A…

Caillou
- 256
- 1
- 7
4
votes
1 answer
C#: Structuring Saved Data for a Game
I'm working on the structure of the fields that are persistent in my Unity game. Things like inventory, etc. It is saved by serializing a class and saving to disk (as explained here). The problem I'm having is figuring out the best practice to…
Flaring Afro
3
votes
1 answer
Transforming a long-running operation into a step by step operation?
I am working on a video game in Unity and at some point I'm facing a tough problem to solve:
The game freezes while loading level data.
Let me lay down what's happening in that process that takes a few seconds:
load track mesh data consisting of…

aybe
- 727
- 6
- 16
3
votes
1 answer
What's an efficient data structure to make a lot of queries between parents/childs?
I have the following scenario for which I've been experiencing performance problems:
The context is a level editor of a new engine for an old video game (whose source is unavailable) in Unity. Basically I'm writing a level editor for Unity to shape…

aybe
- 727
- 6
- 16
1
vote
1 answer
State machine - how to handle outside environment values?
I've got a state machine implementation in Unity that I'm working on (C#), the plan being that it will be mostly used for AI related things.
I'm not sure how I should deal with various "inputs" / how it should interact with knowledge from the…

Jake1234
- 129
- 4
1
vote
2 answers
Avoiding duplicate code between the player and npc classes deriving from Unity's MonoBehaviour
These would be the base classes like Npc and NpcTask.
public abstract class NpcTask
{
public Npc Npc { get; private set; }
public NpcTask(Npc npc)
{
Npc = npc;
}
public abstract void Update();
}
public abstract class…

user2640145
- 33
- 2
1
vote
1 answer
Handling multiple game modes with a game controller
I have a basic GameController with a finite state machine to handle game logic.
I'm adding game modes and coming across problems cleanly implementing them. The core functionality of the game stays the same--Physics, input handling, level…

GameDev
- 13
- 2
1
vote
2 answers
Test a wrapper to external static/singleton
I am integrating an external library that declares a singleton, like this:
public class External : MonoBehaviour {
public static External Instance { get {/*setup inner stuff*/} }
public void Method1(int arg);
...
public bool…

M R
- 21
- 2
1
vote
1 answer
Encrypting my data and keeping it safe in Unity
I have a RPG kit in the Unity Store and I wanted to add some protection for the consumers for when they want to save pretty much any information. From the gear the character is wearing to inventory, bombs, keys, locations where objects were moved…

JoeyL
- 113
- 1
- 4
1
vote
3 answers
Is interface containing every method of given class a good thing?
I'm trying to write a simple game and I really want to finally create something that would be "programmatically correct". I stuck with a problem like this: I have class
public abstract class ProjectileLogic where T : ProjectileInfo{
protected…

user3387666
- 111
- 1
1
vote
4 answers
Abilities interacting with aspects of other abilities - how to implement efficiently
In my game I want characters to be able to cast spells which deal a certain amount of damage of a certain type to other characters in the game.
I also want abilities that negate an amount of damage of a certain type to be equipped to a character.
I…

M.Anthony
- 11
- 3