All Questions

Filter by
Sorted by
Tagged with
152 votes
11 answers
57k views

How closely can a game legally resemble another?

Most games build on other games' successes and many are downright clones. Where is the limit of imitation before legal issues come into play? Is it down to literary or graphic work like characters and ...
user avatar
  • 2,328
267 votes
11 answers
105k views

When should I use a fixed or variable time step?

Should a game loop be based on fixed or variable time steps? Is one always superior, or does the right choice vary by game? Variable time step Physics updates are passed a "time elapsed since last ...
user avatar
14 votes
3 answers
8k views

NullReferenceException in Unity

Since many users are facing the NullReferenceException: Object reference not set to an instance of an object error in Unity, I thought that it would be a good idea ...
user avatar
  • 2,889
57 votes
2 answers
26k views

I'm rotating an object on two axes, so why does it keep twisting around the third axis?

I see questions come up quite often that have this underlying issue, but they're all caught up in the particulars of a given feature or tool. Here's an attempt to create a canonical answer we can ...
user avatar
  • 112k
12 votes
3 answers
7k views

Why use Time.deltaTime in Lerping functions?

To my understanding, a Lerp function interpolates between two values (a and b) using a third value (...
user avatar
  • 609
184 votes
1 answer
47k views

What is the role of "systems" in a component-based entity architecture?

I've been reading a lot about entity components and systems and have thought that the idea of an entity just being an ID is quite interesting. However I don't know how this completely works with the ...
user avatar
  • 1,951
72 votes
9 answers
32k views

What's a way to implement a flexible buff/debuff system?

Overview: Lots of games with RPG-like statistics allow for character "buffs", ranging from simple "Deal 25% extra damage" to more complicated things like "Deal 15 damage back to attackers when hit." ...
user avatar
  • 993
96 votes
6 answers
154k views

What is the proper way to handle data between scenes?

I am developing my first 2D game in Unity and I have come across what seems an important question. How do I handle data between scenes? There seems to be different answers to this: Someone mention ...
user avatar
315 votes
26 answers
168k views

What are good games to "earn your wings" with? [closed]

I believe that in order to become a good game developer, you need to make games. From a programmer's perspective, what are some good entry level games to get your hands dirty? What skills and ...
33 votes
4 answers
7k views

Legal issues for a "fangame" of a commercial franchise? [duplicate]

I've played around in the past of the 2D Flash fan-made version of the popular Valve game Portal. It has basically the exact same mechanics, but as a 2D side-view flash game. Lately I've toyed ...
user avatar
  • 854
16 votes
3 answers
3k views

What's the largest "relative" level I can make using float?

Just like it was demonstrated with games like dungeon siege and KSP, a large enough level will start to have glitches because of how floating point works. You can't add 1e-20 to 1e20 without losing ...
user avatar
  • 5,203
16 votes
1 answer
10k views

What makes scaling pixel art different than other images?

Recently I was coaching a developer who's new to making pixel art games, and realized there's some "conventional wisdom" around scaling pixel art that's not obvious to a newcomer, and might not be ...
user avatar
  • 112k
85 votes
5 answers
19k views

What is the point of update independent rendering in a game loop?

There are dozens of articles, books and discussions out there on game loops. However, I pretty often come across something like this: ...
user avatar
  • 823
43 votes
8 answers
33k views

How do I create a weighted collection and then pick a random element from it?

I have a loot box that I want to fill with a random item. But I want each item to have a different chance of being picked. For example: 5% chance of 10 gold 20% chance of sword 45% chance of shield ...
user avatar
  • 5,161
13 votes
3 answers
5k views

How can I launch a GameObject at a target if I am given everything except for its launch angle?

I am trying to launch an object at a target, given its position, its target position, the launch speed, and the gravity. I am following this formula from Wikipedia: $$ \theta = arctan \bigg( \frac{v^...
user avatar
  • 5,161
137 votes
1 answer
95k views

What should a main game loop do?

Generally, what are the core things that one should do in the game loop, and what are some things that one shouldn't do in the game loop?
43 votes
5 answers
11k views

Should actors in a game be responsible for drawing themselves?

I am very new to game development, but not to programming. I am (again) playing around with a Pong type game using JavaScript's canvas element. I have created a <...
user avatar
  • 763
41 votes
4 answers
70k views

How to not freeze the main thread in Unity?

I have a level generation algorithm that is computationally heavy. As such, calling it always results in the game screen freezing. How can I place the function on a second thread while the game still ...
user avatar
  • 1,401
32 votes
4 answers
9k views

How can I protect my save data from casual hacking?

What options are there for saving game data in a secure manner? I'm interested in solutions specifically tailored for C++. I'm looking for something that is fast and easy to use. I'm only concerned ...
user avatar
  • 983
4 votes
1 answer
3k views

Any way to combine instantiated sprite renderers into one texture so I can apply into a plane at runtime?

So I am procedurally generating a tile set in Unity by instantiating different tiles that only have a transform and sprite renderer components. I managed to pack the sprites using unity sprite packer ...
user avatar
  • 65
52 votes
10 answers
23k views

Game State 'Stack'?

I was thinking about how to implement game states into my game. The main things I want for it are: Semi-transparent top states-being able to see through a pause menu to the game behind Something OO-I ...
user avatar
23 votes
1 answer
9k views

Isometric rendering and picking?

I've been looking for a formula to plot (world->screen) and mouse pick (world->screen) isometric tiles in a diamond-shaped world. The ones I've tried always seem to be, well, off. What's the usual/...
user avatar
  • 547
28 votes
1 answer
17k views

Orienting a model to face a target

I have two objects (target and player), both have Position (Vector3) and Rotation (Quaternion). I want the target to rotate and be facing right at the player. The target, when it shoots something ...
user avatar
  • 445
169 votes
13 answers
148k views

What math should all game programmers know? [closed]

Simple enough question: What math should all game programmers have a firm grasp of in order to be successful? I'm not specifically talking about rendering math or anything in the niche areas of game ...
126 votes
13 answers
137k views

How to develop RPG Damage Formulas?

I'm developing a classical 2d RPG (in a similar vein to final fantasy) and I was wondering if anyone had some advice on how to do damage formulas/links to resources/examples? I'll explain my current ...
user avatar
  • 1,863
115 votes
21 answers
75k views

Why is it so expensive to develop an MMO? [closed]

I want to develop an MMO, like World of Warcraft, but some basic research says that it is going to take a lot of time and money. I'd like to know why. Why is it so expensive to develop an MMO?
user avatar
  • 5,115
46 votes
2 answers
77k views

How to make a character jump?

I am currently making a game in C# using Direct X 9.0. The game remake is Donkey Kong NES. I have nearly everything completed, but I am having problems with the physics of Mario's jump. I have ...
user avatar
  • 463
67 votes
7 answers
18k views

How does A* pathfinding work?

I would like to understand on a fundamental level the way in which A* pathfinding works. Any code or psuedo-code implementations as well as visualizations would be helpful.
user avatar
50 votes
6 answers
19k views

How can I promote my game? [closed]

I am a beginning indie developer, and I want to get the word out about my game. What sites can I go to to ask about reviews of my game, and where might I be able to talk about and get feedback on my ...
70 votes
6 answers
31k views

Why do we use scripts in development?

In my current project, Lua scripts are called by the C++ functions on the server side. After that, the scripts again call the C++ functions still in that solution. Why should we do such things and not ...
user avatar
3 votes
2 answers
558 views

Nestling into contact with a group of physics objects without exerting forces on them

I'm making a pool game, and would like the circle (imaginary) to be in contact with the table and balls, and to fit perfectly as a ball would. Now I thought I would use Rigidbody and lerp the ...
user avatar
  • 1,217
0 votes
1 answer
1k views

Why rotating an object only on its local X axis result in sudden 180 degrees changes in Y and Z axis rotation values

I have an object (cube) in the scene and I want it to continuously rotate on its only local X axis but suddenly while rotating on X axis its Y and Z axis rotation value goes 180 degrees for some ...
user avatar
0 votes
1 answer
3k views

Car driving through walls with transform.Translate()

I need help with a script for a very simple car that uses transform.Translate: ...
user avatar
429 votes
1 answer
41k views

How can I effectively manage a hobby game project?

How can I successfully finish a hobby game project in my free time? How do I motivate myself to keep it up and drive right through to the finish without losing interest or motivation along the way?
88 votes
8 answers
36k views

How many threads should I have, and for what?

Should I have separate threads for rendering and logic, or even more? I'm aware of the immense performance drop caused by data synchronization (let alone any mutex locks). I've been thinking of ...
user avatar
  • 1,013
47 votes
10 answers
16k views

How can I prevent false score reports to global highscore tables?

Browser and mobile games commonly have global highscore tables. It's also common for those tables to contain scores of 2,147,483,647 — where people have figured out the webservice call that ...
user avatar
  • 661
16 votes
2 answers
14k views

How can I rotate about an arbitrary point in 3D (instead of the origin)?

I have some models that I want to rotate using quaternions in the normal manner, except instead of rotation about the origin, I want it to be offset slightly. I know that you don't say, in 3d space, ...
user avatar
  • 3,817
144 votes
10 answers
84k views

How do you generate tileable Perlin noise?

Related: Simple noise generation Understanding Perlin Noise I'd like to generate tileable Perlin noise. I'm working from Paul Bourke's PerlinNoise*() functions, ...
user avatar
  • 16.7k
74 votes
7 answers
44k views

Good resources for learning modern OpenGL (3.0 or later)? [closed]

I stumble upon the search of a good resource to start with OpenGL (3.0 or later) . Well, I found a lot of books but none of them can be considered a good resource! Here two examples: OpenGL ...
80 votes
5 answers
39k views

How does Dwarf Fortress keep track of so many entities without losing performance?

In Dwarf Fortress you can have hundreds of Dwarves, animals, goblins, etc in game at any one time, each with their own complex AI and pathfinding routines. My question is how does this not produce ...
user avatar
  • 1,422
77 votes
11 answers
24k views

How to design a replay system

So how would I design a replay system? You may know it from certain games like Warcraft 3 or Starcraft where you can watch the game again after it has been played already. You end up with a ...
user avatar
  • 821
68 votes
26 answers
33k views

Game Development Degree vs Computer Science Degree [closed]

I'm at the point in my life where I'm starting to look at schools, and was hearing a lot of mixed things about schools such as Digipen or Fullsail that target game development specifically. As someone ...
user avatar
  • 855
33 votes
5 answers
14k views

Lag compensation with networked 2D games

I want to make a 2D game that is basically a physics driven sandbox / activity game. There is something I really do not understand though. From research, it seems like updates from the server should ...
user avatar
  • 2,049
57 votes
3 answers
16k views

Optimizing an XNA 2D game

Does it make sense to implement the logic to skip rendering objects outside the viewport or should I not care about it and let the Framework do it?
user avatar
  • 691
32 votes
3 answers
11k views

How do you approach resolution independence in raster based graphics content?

Those games that are not fortunate enough to run on a locked platform spec, like handhelds, need to run across various resolution formats and aspect ratios. In a 3D game you might have a HUD or menu ...
user avatar
  • 2,321
25 votes
5 answers
32k views

When should I use velocity versus addForce when dealing with player objects?

I'm confused about these two methods in the Unity framework. Both make the player object move, stop, change direction, etc. When should one be used over the other and when is one appropriate?
user avatar
  • 574
19 votes
5 answers
17k views

How can I develop my Android game for different phone resolutions?

For instance, the Motorola Droid is as wide as the G1, but has more height. Should I try to spread the UI out across the extra height found on the Motorola Droid? How do others handle this problem? ...
user avatar
  • 5,083
17 votes
3 answers
13k views

Scaling my pixel art platformer from 720p to 1080p

I'm developing a pixel art 2D platformer for PC and smartphone, but I'm stuck on a technical issue. I chose to have a 32x32 tile resolution, and a 64x64 character sprite resolution. The levels are ...
user avatar
158 votes
8 answers
54k views

Why are MVC & TDD not employed more in game architecture? [closed]

I will preface this by saying I haven't looked a huge amount of game source, nor built much in the way of games. But coming from trying to employ 'enterprise' coding practices in web apps, looking at ...
user avatar
  • 1,711
88 votes
15 answers
52k views

What are some good learning resources for OpenGL? [closed]

I have been using the OpenGL ES on the iPhone for a while now and basically I feel pretty lost outside to the small set of commands I've seen in examples and adopted as my own. I would love to use ...

15 30 50 per page
1
2 3 4 5
94