How do you handle daunting problems in Game development?

I know this isn’t a support forum and I’m not sure that this is the right place to ask this but it’s a question I have to ask. I’ve made various projects in unity over the past 2 years, but i’ve never finished a project completely because I always find my way onto a problem that I can’t figure out by myself and I can’t find any solutions online even when I ask for help. It really discourages me and is I think why I can’t seem to finish anything. One example of a problem like that is enemy/ai interactions.

I spend hours creating a functional script that works the way I want it to, but when a second enemy is added into the scene a number of different problems erupt. Now the enemies are all jittery when they move, Now the enemies interrupting each others pathfinding, now they’re pushing each other out of attacking distance, now they’re blasting each other all over the place because they are all trying to reach the same target position and their rigidbodies are being squished together. They are always unique to their respective projects, but there is always some crazy issue that comes from multiple enemies being in the scene.

I just don’t know how to handle these kinds of problems. It makes me feel like my problem solving skills are non-existent when I know that’s not the case. How am I supposed to find the solution to a problem when I don’t know what the problem is and I don’t know that the solution even exists in the first place. I fall into this hole where I feel like I can’t do anything on my own and my game development journey is pointless.

In your specific case I would excise pieces of the overall script, one at a time, to see when the problem appears/disappears when using more than one enemy.

In a general response to your question, I’ve never come across something I couldn’t develop that stopped me, it’s always been a lack of motivation on my part. My hope is that by choosing projects better I can avoid that. Just today I was thinking about a sort of bullet hell shooter, but my thoughts were too vague and undefined for there to be any hook to the game–and I have other projects that I’m putting off for no discernible reason.

1 Like

If you want to overcome big obstacles, you have to learn how to compartmentalize problems and solve each part in its simplest form. You describe the problem in a big, chaotic way but it is actually a set of very small problems that I’m sure you could solve easily.

There seem to be two small problems in this case:

  1. Enemies are all trying to reach the same position.
  2. Enemies cross paths and collide when moving in the game world.

The first problem could be solved easily by simply not sending all enemies to the same position. If you think about it for a minute, the most obvious thing is to create a set of enemy positions in a circular pattern around the player. You could create the positions in code with maths, or simply create a set of gameobjects around the player and send each enemy to one of those.

The second problem is also easy to solve. If you think about it, solving problem 1 has already fixed most of problem 2. If the enemies are going to different positions, they will rarely collide. In this case, the simplest thing is to prevent collisions altogether by disabling enemy-on-enemy collisions in the collision matrix settings. If you want enemy collisions, then you’ll have to come up with a pathfinding solution of some kind. Most pathfinding problems already have ready solutions and you can find answers by googling.

Every problem can be solved by first defining it clearly and then breaking it down into small pieces. If it seems complicated, implement a crude and simple solution first and improve it bit by bit.

4 Likes

Hi there! Just a 2 cents.

For my part, I realized that game development is just (too) massive, and it is why it is very hard to be solo indie dev; unless your game is small; and, most likely, the game will have to be downsized somehow/someway (scope); if solo.
In this case, it becomes your case, because you hit a road block and it stops you from progressing; that does not leave much for progression; and as you felt, we may feel like abandoning/losing hope that we will never finish making the game because one problem after another; unsolved. But part of game dev is problem solving/solution finding. I say solution but it could be a ‘work around’; when we have no solution to a problem, sometimes a workaround (cutting corners/rough) can be the only viable ‘solution’ (or else, the project ends there and never becomes/sees the light of day). Very little solo developers I think can be excelling in every facet of game developing; Jacks-of-all-Trades are what we become; but as said, some may add, ‘but-master-of-none’. Mastering Many skills in video games takes so long, if we are weak/less skilled, I mean we can learn some more/hone skills but…we still find it too hard/long to overcome some problems (I felt that; thus, we have to accept our limits and try to overcome them ‘creatively’…creatively could mean anything and whatever you want it to mean… you just have to find that solution (to problem) whatever it is); in my case, I realized, that certain things/aspects of video game development were best left to Others who spend their time doing that (mostly, just that…as (excelling) specialists…not as jack-of-all-trades…like indie solo devs that need to dab in everything and surely, may not be good at Everything as sole person making a game; when as said, video game are multi-task/multi-teams/cooperative works by nature - solo indie dev are going against that and trying to do it all; it’s a feat.); like you I am a solo indie dev and sometimes I realize that we ‘bite more than can we chew’; but that is because we hope to overcome most of the problems; it’s those ‘other’ problems like the ones you mentioned (pathfinding/AI messing up…); these ones are hard to solve alone if we are not superproficient in coding, logic, etc…it is when it is better to seek help from someone that does this full time or purchase/change the current system; change script change the whole thing. Or if not possible, maybe reduce the number of ennemies, make a smaller game, less things so that it is feasible for you. many peolpe would say : ‘‘It’s unfeasable as one solo person…doing this; it takes a team of 10 people to figure that out’’…but some overcome that; many don’t. I guess I would end by saying, don’t give up, try ‘work arounds’ - no matter cheap they may sound; that solution IS the solution, for you; not fancy ‘do it that way’…it could not work; if for you it works - It Works.
That is what I learned of game dev…if it works, it works…Next thing…don’t spend eternity on perfect(ing) that single thing; make it good (enough let’s say; you may polish it even more later); but ask yourself the question:
What is worse…perfecting that single thing…and failing and never releasing game…
Or finding a (quick?) fix…that fixes it (for now at least)…and releasing a game one day?

Thanks for reading,
Just a 2 cents.

It sounds like you are trying to tackle custom AI before you are ready for it. Designing solid AI code can be quite difficult, depending on the type of game and the complexity that you’re looking for in the AI.

One potential solution is to look for an existing system (on the Unity Asset Store, or Github, or elsewhere) that either meets your needs or can be adapted to meet your needs without too much difficulty. Not only can this save you a lot of effort, but looking at a working system created by someone else might teach you a few tricks for coding your own AI in the future.

If you’d prefer not to use someone else’s system, then you might consider focusing on all other aspects of the game first, building up your fundamentals and developing more skills in general along the way. Getting stuck on a feature during game development can be a bit like an author getting writer’s block. One approach is simply to put the feature you’re having trouble with on hold and work on other parts of the game. A new idea might come to you later.

If your AI-controlled enemies are interfering with each other’s AI, that sounds like a deep design issue. One way you can reduce the risk of different AI entities interfering with each others’ AI is to make things fully self-contained. Instead of having a master controller that loops through and moves all of the AI entities each frame, create one or more self-contained AI components that you assign to each enemy and let these components control the enemies independently of each other. This way there’s no chance of mixing up variables between enemies or anything like that. You’ll probably have to give them some basic awareness - e.g. have them check to make sure a space isn’t occupied before trying to move into it - but you can still do that while maintaining a self-contained design approach.

Don’t be afraid to ask questions on help sites like Stack Overflow or the Game Development Stack Exchange . I wouldn’t bother with Unity Answers as the quality of answers you’ll get there is often terrible.

In my opinion, unless there is a fundamental barrier such as not having any coding skills, it’s best to implement a crude and simple solution yourself first before using an asset or implementing someone else’s complex solution.

Not only is it generally easier to prototype this way, but you quickly narrow down the set of acceptable approaches based on what works with everything else in the game. It should always be possible to implement an ugly solution - if that’s not possible then you don’t actually know what you want, and that will need to be solved first, for example by looking at how other games do it.

For example, if the OP simply teleported enemies for now into a circular pattern around the player, they could find out if that even works. Let’s say the enemies cause a wide area damage, it might turn out that it’s actually better to send them after the player one by one, or something like that.

After you know what you need from an asset, then it’s much more likely you’ll choose one that has the functionality you need.

The usual approach is to break down problems into smaller pieces and keep solving till your’e done.

Read about “Boids” and apply similar principle.

The object has multiple direcitons where it wants to go, and the final movement vector can be based on a sum of all those direction.

For example, an enemy object might want to go towards the next waypoint, but it may also want to move away from other enemies that are too close. Calculate movement vector away from each nearby enemy, add them together, and find an average. The add vector towards next waypoint to that. Then move in resultingdirection.

It works quite well, but you will no longer let navagent control movement and instead will have to read “desired movement” from it.

If other games had thsi solved, then a solution exists. To solve it try to sit down with a pen and piece of paper and think (and write down) how would you avoid collisions as an algorithm. Then program it.

The problem is largely psychological, because you’re worrying about your problem solving skills.

AI code can be quite primitive and does not need complexity. A basic combatant can be 10 or 20 lines of ode.

Stackoverflow and stack exchange are awful and should be avoided, especially by beginners. The community is too hostile to everybody, so it would be best to never ask a single question there. Information that is found on stackoverflow via google can be used, of course.

How complex have the projects been? If you haven’t been able to finish any of them it’s very likely you’re aiming higher than you should for your skill level.

That completely depends on the type of game. And “quite primitive” isn’t necessarily good enough for gameplay purposes.

That’s not true at all. If you ask a bad question, it may get closed, but a well-formulated question is likely to get helpful answers without any hostility. Maybe you had a bad experience, but that doesn’t mean everyone will.

My personal experience hasn’t been unwarranted hostility, but rather no real answers.

Stack-Exchange-going-through-brain-drain has been pretty well known for a while.

If you look at the Unity tag for gamedev.stackexchange.com , most good questions are answered promptly with a high-quality answer. The main exception is that sometimes DMGregory (who is practically running the Unity section by himself) will give a hint in a comment instead of posting the answer, if the answer is so simple that a hint will suffice.

When I say “good questions”, I mean “questions that don’t violate the site’s question guidelines, aren’t vague or incomprehensible, and wouldn’t take hours of one-on-one tech support to resolve”.

1 Like

I speak from experience, as I used to participate there. (25k rep or something in C++/OpenGL, couple of years)
I quit when community turned into bunch of lunatics/soup nazis.
The best thing I heard “Stackoverflow is not a learning resource”. Having incompetent people with strong, but incorrect, opinions with moderator privilegies (you can farm to 50+k rep with a lot of free time) was a lot of fun too.

Basically, when you post a question, one of the following will happen:

  1. You’ll receive no responses.
  2. Someone will attempt to merge your question with an unrelated problem, because they didn’t bother reading the whole thing. You’ll waste time debating the merge.
  3. Someone will try to argue about unrelated topic which is not actually related to your question, because they didn’t bother reading the whole thing. You’ll waste the time pointing obvious to them.
  4. Someone will try to act sarcastic about it.

The site is worthless, and is best avoided, because for newbies it is too hostile, and non-newbie questions don’t get answered. Additionally too many people seemed to think that the purpose of stackoverflow is maintaining rules of stackoverflow.

Rather than using that, I’d advise to learn the “how to find an answer in documentation”, which is turning to be an uncommon skill now.


It is useful for obscure or unpopular languages, for example, if you ask something about Prolog or Common Lisp, you’ll get some useful responses.

But for anything remotely popular, participating will be a waste of time. Too many people there have their rep counter go into their head, and forget that human communication is also a very valuable programming skill.

1 Like

My recent experience has mostly been with the “Unity” tag at the Game Development Stack Exchange, where I don’t see any of the problems you’ve described. And it doesn’t hurt to ask a question, even if it doesn’t get answered. The worst that can happen is they close it.

He’s not going to find an answer for how to write AI code in the official Unity documentation. There is documentation for relevant features, like NavMesh AI, but documentation can’t always answer your questions (and is sometimes incomplete/inaccurate/out of date). Tutorials are another matter, which now that I think about it nobody has brought up yet. There might be a tutorial that helps him figure out what he’s stuck on, depending on the type of game he’s making.

It does, because you waste time writing it, and then end up wasting time arguing with lunatics and being annoyed by it.
Proper programming question requires minimal non-working example with isolated problem, detailed description, and list of things you tried to do that didn’t work. That takes time. Obviously all of this will be ignored by people who will waste your time “finding duplicates” and arguing.

Then he should ask that question HERE. This community is better than stackoverflow.

I see a lot more hostility on these forums than on the Game Development SE. And gamedev.stackexchange.com != stackoverflow

But you suggested both.

Either way. My advice is to avoid both sites, and never participate there. Google search results are fine, but nothing beyond that. Reason for avoiding Stackoverflow is high hostility. Reason for avoiding gamedev stackexchange is it being part of stackexchange network and rather dubious advice I saw on it in the past.

My suggestion for any new user is to invest into their own problem solving skills first. Today people overly rely on community help of all kind, and community help ceases to exist when you’re no longer dealing with beginner questions.

This is only the first part of it. After you’re done solving those sets of problems, you have to iterate on it. Sometimes you build this incredibly complex system and realize that it doesn’t actually make the game better. Take a hard look and see if it actually satisfies your requirements. You should be prepared to continue to make it better or tear it down and rebuild it if it doesn’t agree with your game’s overall vision.

For example, I’m going through my 3rd revision of my AI, slowly adding different systems that I can turn on and off, seeing what works, what doesn’t. I was going in a wrong direction at one point, and I only found that out after having built it. That code ends up highly educational, but ultimately will probably not make it into the final build.

Another example is UI. I’m on my 4th pass on some elements, and some only needed 1 pass to nail down and say, hey, that works and feels good. Those other elements of UI, need constant reworking because they just don’t feel right.

Beginner game developers don’t realize this until they get to the point of giving up. The repeated iterations just take way too much time that is unidentified on the outset, and this is like the norm for software development in general. Over time you get better at estimation, but with something creative like gamedev, you have to build stuff, realize it doesn’t work, and rework it until it does.

1 Like