All Questions

Filter by
Sorted by
Tagged with
155 votes
11 answers

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 ...
Fuu's user avatar
  • 2,358
15 votes
3 answers

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 ...
Hellium's user avatar
  • 2,949
271 votes
11 answers

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 ...
Nick Sonneveld's user avatar
64 votes
2 answers

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 ...
DMGregory's user avatar
  • 134k
14 votes
4 answers

Why use Time.deltaTime in Lerping functions?

To my understanding, a Lerp function interpolates between two values (a and b) using a third value (...
AzulShiva's user avatar
  • 669
185 votes
1 answer

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 ...
bio595's user avatar
  • 1,961
320 votes
1 answer

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 ...
106 votes
6 answers

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 ...
Enrique Moreno Tent's user avatar
73 votes
9 answers

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." ...
gkimsey's user avatar
  • 1,003
13 votes
4 answers

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^...
Evorlor's user avatar
  • 5,793
16 votes
3 answers

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 ...
jokoon's user avatar
  • 5,243
33 votes
4 answers

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 ...
Justin L.'s user avatar
  • 854
86 votes
5 answers

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: ...
Sam's user avatar
  • 833
1 vote
1 answer

Car driving through walls with transform.Translate()

I need help with a script for a very simple car that uses transform.Translate: ...
Starnight Studios's user avatar
18 votes
1 answer

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 ...
DMGregory's user avatar
  • 134k
137 votes
1 answer

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?
44 votes
8 answers

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 ...
Evorlor's user avatar
  • 5,793
42 votes
4 answers

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 ...
DarkDestry's user avatar
  • 1,431
43 votes
5 answers

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 <...
alex's user avatar
  • 763
32 votes
4 answers

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 ...
dan369's user avatar
  • 983
4 votes
1 answer

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 ...
Kepol's user avatar
  • 193
52 votes
10 answers

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 ...
PrettyPrincessKitty FS's user avatar
47 votes
2 answers

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 ...
Sarah's user avatar
  • 473
30 votes
1 answer

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 ...
Marc's user avatar
  • 465
23 votes
1 answer

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/...
mpnk121's user avatar
  • 547
4 votes
2 answers

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 ...
John Smith's user avatar
  • 1,255
0 votes
1 answer

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 ...
Javed Rehman's user avatar
170 votes
13 answers

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 ...
125 votes
13 answers

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 ...
user127817's user avatar
  • 1,853
115 votes
21 answers

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?
Dr. Snoopy's user avatar
  • 5,105
79 votes
10 answers

In Unity, how do I correctly implement the singleton pattern?

I have seen several videos and tutorials for creating singleton objects in Unity, mainly for a GameManager, that appear to use different approaches to instantiating ...
Zack Brown's user avatar
  • 1,459
427 votes
1 answer

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?
72 votes
6 answers

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
68 votes
7 answers

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.
Daniel X Moore's user avatar
50 votes
6 answers

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 ...
47 votes
10 answers

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 ...
teedyay's user avatar
  • 671
150 votes
10 answers

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, ...
bobobobo's user avatar
  • 17.1k
88 votes
8 answers

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 ...
j riv's user avatar
  • 1,013
24 votes
1 answer

What are screen space derivatives and when would I use them?

I see the ddx and ddy glsl functions and the hlsl equivalents come up in shader code every now and then. I'm currently using ...
NeomerArcana's user avatar
23 votes
4 answers

Saving player's progress in a Unity game

I am making a game using the Unity game engine. I want to save the player's progress including level, experience points, chosen character, etc. Presently I am using playerprefs but I want to know ...
Shantanu Singh's user avatar
18 votes
3 answers

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 ...
Xargon Wan's user avatar
16 votes
2 answers

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, ...
notlesh's user avatar
  • 3,877
80 votes
5 answers

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 ...
Rory Harvey's user avatar
  • 1,422
77 votes
11 answers

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 ...
scable's user avatar
  • 821
74 votes
7 answers

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 ...
68 votes
26 answers

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 ...
Chris Bui's user avatar
  • 855
58 votes
3 answers

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?
smnbss's user avatar
  • 701
34 votes
5 answers

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 ...
jmasterx's user avatar
  • 2,099
33 votes
4 answers

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 ...
Keyframe's user avatar
  • 2,321
28 votes
5 answers

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?
Robert's user avatar
  • 604

15 30 50 per page
2 3 4 5