Data Structures Crushed My Game Design Dream...

Hi, this is my first post here. I’m studying for a 2-year CompSci degree. I only got diagnosed with ADHD Inattentive type last year towards the end of Spring semester. I had to retake every Computer Science class twice, essentially starting from scratch two years in. After being diagnosed I was put on medication (Adderall Generic 15mg) and those classes were rendered a non-issue and I’ve been doing quite well in most of my classes as I find ways to improve myself alongside medication. Suffice to say, things have been improving, and I’m still learning. Ultimately, my end goal is to get an associates degree in Computer Science and then transfer to a school for a 4-year in Game Design.

I’m currently at the final programming-centric course of the curriculum, which is Data Structures. This is currently the most difficult course I’ve ever had to take, and not because of what the professor requires of us nor is it the workload, but moreso how algorithm-centric it all is. I’m wondering if anyone here has the same issue, actually. These abstract concepts are extremely difficult to visualize. I know that Visualization is key to putting Theory to Code, but I’m still having an extremely difficult time actually coding these recursive methods from scratch, from Hash Tables to Binary Trees. The only reason I have a slight chance of passing this course is because I’m very sufficient in Theory and Visualization, but when it comes to typing the code out, I’m making constant mistakes and I can almost feel my nervous system just “noping” out of the boring redundancy of coding search algos.

Worst part is that I was finding a way to go straight for my Game Design degree instead of mucking about with CompSci. My thought process was that, yes, the skills are transferrable and very useful to that degree, but I feel like I’m losing focus on my end goal at this point, and I’m losing motivation. I just wanna do Game Design already!
Brought this up to my advisor, he said “This is nothing compared to what you need to know in Game Design. You absolutely need to get this down in order to pursue it.”… hence the title…

I know of some people with ADHD who can hyperfocus and code like it’s no tomorrow. I am just not able to in Data Structures. How do some of you handle this? Does anyone feel the same way?

I am aware of some issues I have:

  • Lack of Foresight: I cannot spot errors the errors in most plans I come up with.
  • Autopilot: My brain loves to shut off during all the typing and then I lose what the heck I was supposed to type.
  • Nuance: I get so frustrated when I cannot spot a subtle error, not like missing semicolons, but moreso the errors you need to trace variables and stack frames.
2 Likes

Little understanding of the technical concepts . . . But, I’d like to welcome you here and wish you well in whatever life-decisions you make!

3 Likes

Yes, welcome and kudos for your lovely user name!

I’m not in CompSci but in web development but I think some things apply whereever coding is involved, so I’ll give it a shot.

In my book, this is exactly why ADHD and programming can be a good combination. Not the repeptitive typing out of stuff, obviously. (I know a programmer with Asperger’s, though, who pointed his condition out as a skill in his job application because he’s more or less incapable of not spotting a code error.) Just the opposite: We’ll spend hours writing a function that will help us avoid any redundant typing! I’d much rather craft a complex system of functions than type or even just copy&paste the same code over and over.

It can get in the way, though: A while back, I took courses in both PHP and databse design, side by side. In PHP, there were a lot of instances where you’d have to, say, open an array of data, copy bits of it into a new one just to work with a certain sub-set of the data, all by calling up several functions. Stuff I could have done in SQL with one line. That kind of redundancy rove me nuts at the time! Why can’t it all be that elegant?

And of course, you’ll still have to create the arrays. So nothing is perfect.

Foresight can be a problem, right. When I start a new project, I do a lot of the planning on old-fashioned paper, to the point where I write out the actual code – but in prose. Mostly, though, I’ll draw the block structure in different color pencils and then add notes. This gives me more of an overview of how everything is supposed to connect. I don’t know if that’s applicable to CompSci, of course.

As for spotting errors, aren’t there code validators for that? In web design, you often don’t even need that. You just comment out bits of code till you find the part without which the rest works.

3 Likes

Thank you!

2 Likes

Not too familiar with Web Design, I only studied a fair bit of HTML and CSS independently but didn’t find it useful to me so I dropped it. But the scenarios described is similar enough to Object Oriented Programming.

I’ve tried various forms of foresight but I found that no matter how hard I’d try, I always logically miss something that I should’ve taken into account prior to the coding process. I’ve tried building all the flow charts and visualizations I could but all-in-all, almost none of which worked for me. My brain really just lacks the attention span to deeply predict and map out an algorithm.

Blockquote As for spotting errors, aren’t there code validators for that? In web design, you often don’t even need that. You just comment out bits of code till you find the part without which the rest works.

Yeah, we have debuggers that are absolutely lifesavers (Commenting them out usually comes after the debug process, to fix the issue). But the errors I have issues with are not the typos, data type, and simple errors that can be spotted right away with a keen-eye and some time to walk through the code.

The errors I have issues with are the ones that aren’t “technically” errors! I shouldn’t have called them that, I apologize. They’re logical errors, meaning they’re not syntactic errors and the compiler doesn’t detect and issue with the code. Essentially, the code runs, and everything is normal… But then you realize the code is not doing what it’s supposed to. You can kind of think of it like when you click on a link in HTML and it doesn’t take you to the right directory, except much, much harder to nail down.

Data Structure programming is abstract and you must be capable of visualizing every aspect of code. But I quite simply am not capable of that. I write it out, work it out, and hey, I’ll even admit I’d rewrite some “example code” to find out what could’ve gone wrong. It just feels far beyond my capacity.

I mean, even with Math, Calculus and all, I enjoy doing it! But even with Medication, what essentially makes me concentrate on calculus, IT (Info. Tech), and even prior programming courses, I fail to even focus well on Data Structures to get Linked List code on paper.

2 Likes

Hello and welcome.

I’m an electronics engineer and computer scientist by training, and have been doing stuff, for oh 30 years; Also I thank you for your patience in advance because I write this more to remind myself than perhaps to help you …

I feel your pain, not directly with regards to data structures, but to programming structures in general. Like Von Newman said about Mathematics You never realy understand mathematics, you just get used to it

At the moment I’m trying to turn our research into a production code base that incorporates a server with data feeds, as well as talking to things like Programmable Logic Controllers on site that will control a chiller plant to freeze and melt thermal storage batteries. (don’t believe me, look me up … I can’t be bothered hiding … )

  • The best positive advice I can give you (and remind myself): the why to is more important than the how to. Seek out and gorge on game developers output … their twitter feeds, their habits the things they do and the things they struggle with. See if they don’t have some of their coding on git hub, even if it’s not games related, you’ll see things. Read great code and you will write great code *a chapter title from the Hitchhikers guide to python, and sooo very applicable to programming.

    • look at what ppl are doing with blender for game dev … just a(nother) thought
  • Don’t sweat the data struct stuff: ultimately you need to know there are Stacks, lists, dictionaries? (well in python anyway) and whatever the language/library set you happen to be using has abstracted into something to make the job, of doing the job, easier. Usually it’s the garbled mess that everybody inevitably makes in getting the job done as best as they can in the time they were given.

    • Document everything as best you can, invariably, you will thank the guy/gal who did this when you look at it two weeks from now … I will to this day write comments like
      #TODO: I think I should use some sort of object here, or external config file but for now I'll just declare a global variable and get on with it
      Also something I learned recently, copy the link to the stack exchange answer or webpage sub-headding into the bit that you made it work for you …
  • Read the errors as best you can, Use the rubber duck method: read it out aloud to the rubber duck, or plush toy or pet rock … again look it up. works for when you have to design code/… data structures ;).

    • I kid you not the other night I spent three hours moving string specifications with the python logging library (ok there was dinner and kids and dogs involved as distractions) only to discover that something was complaining at the initialisation level, that I’d copied, pasted from a python cookbook, and inadvertently edited out ONE CHARACTER and the thing was complaining there and generating 20+ lines of ERROR blah blah …
  • You never have to visualise every aspect of the code, you can always pair it down to the necessary couple of things, and the more you see, and do the more you will be familiar with. Keep in mind that programming is like playing in a sand pit (only relatively cleaner) If you don’t try you will fail to learn.

  • You will always be at the whim of the language, or the library or the community/company that made it (case in point - this website uses a variant of structured text … so I’m re-reading and using the structure that provides)

    • another book recommendation: algorithms to live by authors don’t readily come to mind.
    • If you don’t like procedural programming look into functional programming (it’s a maths thing every time you put in a set of values, you guarantee the result is identical, one set of values in, one unique value out) haskell is the only one that comes to mind, but you know … wikipedia.

I think the briefest not so nice advice I can give you is: all jobs have their equivalent of 'cleaning the toilet’ and at the moment it might seem like data structures is an unnecessary learning burden, but will pay off, even if all it does is give you a slightly faster way to google/duck duck go for it. When I started out it was all mystery and you had to learn things like make and makefile and a bunch of stuff that is now buried for you in an IDE. I’m so old that the first time I saw the web hyperlinks where numbers in square brackets [1] a emacs text editor.

If I look back one thing that I can do relatively well is see stuff that I think will work for the job I have to do and then bludgeon it into something that does that required job. always keep the job in the forefront of your mind, if you want to learn data structures, find out the problems that they solve in the game dev domain and tackle problems like it (I’d imagine that if you read/edit the text based config files of any game that has them you’ll start to appreciate it a bit more)

I hope some of the above helps, I’d write something more succinct (and relevant to your specific concerns) but you know … brains.

I’m finding that all my sign offs are along the lines of 'deadlines to meet, gtg … ’ and please understand that this is the best I could do in the time I’ve spent (way too long, not good enough)

cheers and good luck!

2 Likes

First, welcome! Second, don’t let your advisor demotivate you. You can do this! I get the feeling you are wanting to run (Game design) before learning to walk (data structures). I believe taking it one step a time, and slowly at the beginning, will get you there.

I have done a bunch of programming so perhaps I can help you… I mostly self-taught myself as I am incapable of paying attention in a class. One thing that helped me was drawing pictures. I would draw before and after pictures. And may be a few more until I understood how things were supposed to work and could predict what the next picture would look like. Once you gain this, writing code becomes easier.

Second, it makes sense to think about data structure properties before and after some operation. These allow you to at least manually check if your code works right.

Third, when stuck, try to describe your problem to someone else. In trying to describe it in a way that is understandable by someone else you will often find your logic error.

Fourth, work on the simplest problems first so that you can get positive feedback soon. I would often write a program that did nothing first! But it would compile and I could run it. Success! Then I would introduce one new thing and then recompile it. Similary you have to find ways to motivate yourself! Game design can be a wonderful and exciting things to do but you have to pay your dues (i.e. learn the basic etc.).

Let me know what language you are using, what if any data structure book and may be describe a specific problem you are having with some data structure. That will give me some idea on what hints may be of more help to you.

Good luck! You can do this! You did a good job of describing your difficulty, which tells me you are articulate and that is half the battle won!

3 Likes

What’s funny is that I find myself rather enjoying doing math when I otherwise didn’t, thanks to my medication helping me focus on the actual process. Everyone finds Calculus difficult and yet I find it rather easy and straightforward. The only issue I have with Calculus is moreso with time management and algebra due to barely passing with a C- after failing multiple courses before I diagnosis. Anyway, I don’t mean to go off on a tangent, but I do enjoy problem solving and get such a rush when I solve problems. This is why I love programming, but creating classes and then algorithmic methods doesn’t feel like problem solving to me, it just feels like trial and error.

Programmable Logic Controllers on site that will control a chiller plant to freeze and melt thermal storage battery

To be honest I have no idea what you even said here, that sounds crazy.

Don’t sweat the data struct stuff: ultimately you need to know there are Stacks, lists, dictionaries? (well in python anyway)

We’re coding with Java in this class and yeah, we have those, although Dictionaries are called HashMaps here. Here’s the thing, I excel at Theory, which is the easiest part, of course. I can nail down the pros and cons of each sorting algorithm and the attributes of various classes. My issue is converting all that to code from scratch. What’s even worse is that I’m aware that in most jobs we won’t even need to code these things from scratch, just use the built-in libraries and documentation, and that we’re just learning to do so that we understand the fundamentals of Data Structures

I would love if you’d elaborate on this, actually. I’ve visited plenty of text-based config files for games but I’ve never seen any coding in them. They’re usually user-friendly where all you have to do is change a value of a variable i.e “LOD_distance = 1”.

Thanks for the advice, I really appreciate it. Sorry if I didn’t address all points, I read them thoroughly and will look into them! I’m taking notes!

2 Likes

I actually do that! It’s how I was finally able to understand how to code Linked_List insertion algos, but even then I still had an error that took me an entire day to find out, and I didn’t actually find out what it was, a friend of mine dug through it and commented what I needed to do. And I find that’s my biggest problem.

Yes! I do this with math all the time. Lui mentioned doing this, but to a rubber duck, and while I haven’t done it to inanimate objects except myself, I have done it to my girlfriend with algebra and my programmer friend whom often just let me ramble and then give me a thumbs up when I figure out my problem. It’s a good method, I’ll see about doing it more, somehow… without bugging them.

Every single time I write a loop, I compile and run to make sure that loop works as intended, as the last thing I want is to have to iterate through loops until find an issue. I used to even compile “hello world!” when starting every single program and calling every single method, but I broke that habit. The positive feedback does help!

I’m using Java, which is fine, since I studied C# for an entire Summer and the languages are very similar (apart from some nuances I don’t understand, but the syntax translation is easy), which is also good bc I’m aware C# is used for engines like Unity!

Thank you for the advice as well :slight_smile:

3 Likes

Hi,

With the clarity time and your responses have given me I’ll try to refine my advice. A lot of progress is like long division … take a shot, see where you end up, refine your aim for the next shot, know when to stop and move on to the next digit, if you need to.

Khagen, has also given great advice and more focussed.

Java seems to still be out there in teaching land and last I read it still has a following if you’re into landing things on extraterrestrial planets or banking systems … ultimately once you learn one language you find they are more or less the same. Think hammers, some have nicer handles and all but ultimately if you have one, nails better look out.

From what you’ve responded I’m remembering why they teach it … because that’s how the instructor learned it … once you start coding a bit more you’ll discover that most times someone has already written a library that a. Does everything you wanted and more and b. Is speed and architecture optimised ie better. Right now you’re learning what to look out for, and turning your talents into skills.

The bit about maths … well it applies to computing just as much. Matter of fact see if you can find "the art of computer programming” by Donald Knuth, me thinks there is a whole volume on algorithms and data structures, it’s old but it’s true now as it was when it was first written.

Now what I know about game dev is mostly from what I see our two teenagers play … and I came across a yutube channel “war stories” from ars technica that might be “inspiring” for u.

also there is Boris who will give you much better survival tips and life skills … right now one son is brewing mead for the other 18 birthday … I have a lot to thank Boris for though he is not what u call 100% family friendly, but he respects his grandmother, so there is that.

Also python … and blender … and 17 ms 3d frame rate rendering, I read a paper on just how much has to be done to render your average FPS game and well that’s why u learn data structures because eventually all that sky and rock and sword have to be stored and manipulated and rendered and resources like gpu memory and time are limited so best you appreciate what has to happen under the hood.

khagens advice, on working on the simplest problems … eventually, and I have not yet mastered this though I have seen ninja mathematicians and coders do this … is make all the problems as simple as you can: eg for a double linked list you need the head, the tail and two pointers for each item one pointing to the next and one to the previous, oh and the data itself so lots of little functions that say a. find the spot to insert and just returns the two pointers that you’ll use to b. set next and previous pointers in the new item in another function. This is better than one big function that does it all; why? because lots of little things are easier to debug than one big one; and you know, limited frontal cortex executive function so best to do one little thing well and move on than try too many things and get frustrated in the process.

I have rambled again, hopefully some of it helps, like @khagen has highlighted you’re already ahead of the curve because a. you know how to ask for help and b. you’ve gotten this far now you’re just honing your skills to give you a shot at the boss fight(s)!

good luck.

1 Like

@PoopyVlad, Sounds like you’re on the right track! Upon reading your other responses, sounds to me like you just need more practice until you know something like the back of your hand. Since you already know the theory (or it comes easy to you) and you have time management issues like most of us, practice is what will improve your speed. It is what kids do for example when they first learn to walk. They keep trying until it becomes natural. This is also what top performers in any field do. Even if you are talented, your talent simply means early successes come easy but without hard work you can’t go far. And if you are not talented, practice and hard work can help you fake it much better : ) Bottom line: with enough practice you will know which data structure to use in what context and you won’t waste time getting tangled up in low level details.

Elsewhere you said “most jobs won’t even need to code from scratch”. First, in any job interview you will be asked to code from scratch. Second, you only really learn something really well if you code it from scratch. Even if you pick up some open source package, you need the ability to evaluate its quality and if it breaks you need the ability to fix it because if you just throw it away and pick up another open source package, you not only wasted your time (and your employer’s), you didn’t learn from the experience and likely you will have the same issue with the new package.

1 Like

This brings up another point. I work under the assumption that any code I write can be (and often will be) thrown away and replaced with something better. So I don’t get too attached to any code and don’t mind throwing it away if it will simplify things. Often my first attempt at solving a problem is clumsy and its main function is to teach me more about the problem and its properties. I then rewrite it but I do it in small pieces. Because 1. given ADHD I am unlikely to finish a complete rewrite!! 2. the code is modular and loosely coupled so it is written to be thrown away and not hard to replace pieces. Also, I try to iterate on some clumsy pieces several times until I am satisfied. Often some properties only become apparent after iterating the design/code a couple of times and new opportunities for simplification present themselves.

2 Likes

Yeah, I wish I’d learned this earlier too. I’d forgotten to mention step 1 in code writing is get it to work then write little functions, as you have highlighted.

It was only in the last year when trying to learn something like flask on udemy that I realised the power of writing some throw away code that you tidy up as you understand better.

I guess when you’re studying/a student and the pyramids are around you it’s easy not to realise they were built a couple of stones at a time, by many many participants.

cheers

1 Like

more stuff … this time free text books; well you will always pay the price of time.

Data structure specific:
https://link.springer.com/search?facet-content-type="Book"&package=mat-covid19_textbooks&facet-sub-discipline="Data+Structures"&facet-sub-discipline="Programming+Techniques"&showAll=false

Originally this link from someone I follow on twitter … https://link.springer.com/search?package=mat-covid19_textbooks&showAll=false&facet-content-type="Book"

1 Like

Hi! What days structures and algorithms are you having troubles with?

As a rule of thumb, never approuch an algorithm as is. It’s extremely difficult to understand what a thing dose without knowing what the desired results are.

To visualize you can:
YouTube (https://youtu.be/ywWBy6J5gz8 for example)

Start with Small cases first, a trick my lecturer
and I agreed is better when teaching a systematic solution to a general problem.

Make the data you work with present itself in every step you do on it, and add comments on each action step.

Source: am final semester of practical software engineering diploma.

2 Likes