Need some programming advice

Hey guys, I’ve been off and on this board for years as well as programming off and on… I seem to be getting nowhere slowly.

I started playing around with original vb years ago and I enjoyed the idea of programming. I never really stuck with it and would find myself going back to it here and there… Fast forward a little bit and I started playing around with the idea of fame programming. I originally bought an xna book and made a couple really small things before moving to java… Which is where I’ve been for a few years. I would program a little each night until I got bored and wouldn’t code for a few months…

As long as I’ve been trying with it, I should be more advanced than I am. I don’t have an issue with the language… But it seems my barrier is with actual programming logic. I’ve used libgdx and made a few small games here… Mostly pong, breakout, and Pac-Man. I attempted tetris recently but had an issue getting it to work right…

Now all the back story is out of the way, do you guys have any advise or suggestions for me? I’m to the point that I’m getting frustrated and ready to find a new hobby. I should be much further along than I am in terms of skill. I looked around for some decent free (or even paid) courses but could not find what I was looking for…

Any help or advice is greatly appreciated.

I’m to the point that I’m getting frustrated and ready to find a new hobby.

I’ve long held the belief that a programmers greatest asset is patience. It’s going to take time to get better especially if you don’t work professionally in the field and are taking stabs here and there at it.

I should be much further along than I am in terms of skill.

As silly as it may sound learning to enjoy the journey is just the nature of tech in general.

Given that you have dabbled with libgdx there are plenty of open source examples of projects out there of the pong / breakout style. Perhaps consider putting what you have worked on up on Github as open source and then post the links for comments and specific questions on JGO. Going through the process of perfecting a simple clone game can be useful and even publishing it via libgdx / Android or wherever such that you go through the all the steps of releasing an app at a state that others may use it however small the audience. If you are in an area where there are tech meetups go to some and talk to others. Perhaps participate in any “hackathons” and be ready to join a team and collaborate at whatever level you can.

Another useful thing to do is to keep a journal. This will definitely help if you are on / off again. There are a lot of articles out there to peruse.

A journal isn’t a bad idea. I’ve stuck with it a little more lately but I just don’t feel like I’m progressing fast enough. I enjoy learning. But lack of progress hurts that.

I haven’t 100% completed and polished any game, which I know is something I need to do. I’ve made breakout probably 5 different times. I’ve finished the mechanics and loaded a level as well as the collision detection. I normally run into problems getting the physics right and get bored. I’ve tried box2d as well which worked great for the physics.

I think my biggest frustration is getting everything to work together. I’ve read about entity component systems and factories and such. I just don’t grasp when and how to use them.

Basically, the different patterns and similar knowledge as far as intertwining everything is what I have trouble with the most. That and figuring how what algorithm I need to use to complete something.

A team is a great idea. I’ve thought about that but it isn’t easy to find. Especially being that I haven’t fully completed any game yet.

I agree about doing it professionally. It would make it much easier. I thought about going into a computer science profession. There just aren’t many jobs near me and I’m not ready to move away from this area yet.

I also dabble in other things such as web design and web development. Games are where I struggle the most.

I definitely appreciate that information.

Yea no reason to reinvent the wheel especially if you hate doing it, please use frameworks then.

I know this is JGO, but try Unity, seriously. If there was such a thing for Java I would recommend that. But there isnt and you sound like the type who would enjoy using a lot of premade tools and not having to code low level, which even in libgdx you still have to, to some degree.

I mean what really is the point of doing lower level code and fiddling if you dont even care for it and it makes little sense to do anyway.
The next best thing is libgdx if you wanna use Java, but we just dont have the kind of Editor.

But it also depends on your objective. Do you wanna make games or get better at programming or… whats your ultimate goal?

My posts didn’t come off the way I wanted them to, sorry. I was on break at work.

I enjoy programming. I love planning it and writing the code and learning how it works and seeing it work. I get disheartened about it quite a bit from the frustration of feeling like I’m getting nowhere. The ultimate goal is to learn to code(better) . I’m just having trouble getting past the intermediate level… Or maybe advancing to the intermediate level… I’m not really sure. One of my problems is that I jump around a lot while learning. Unity would definitely help me get a game going quicker… But it wouldn’t benefit me as much toward learning to code.

I feel like I’m right in the middle of the learning curve or right at the top and just can’t get past it. Its not really the language. As far as for games, it’s figuring out how to structure the code or which patterns/algorithms.

For example, and I’ll do my best to try to explain what I mean.
I love 2d games and would like to finish a top down game… I would set a libgdx project up, load a tiled map, make a player class and draw the player but from there, I would be stuck as in how to progress. Maybe an entity component system? But how would I tie it in? How would it actually apply to the game? Will it work? And so on. I’m moreso just rambling now… It’s difficult to explain.

I think a large part of the problem is that I’m not sure where I’m at in terms of skill and what I need to work on or learn next. I’ve been searching for books but they’re either way too basic or way too specific. I can’t seem to find the resources that would be beneficial in moving me forward. I’ve watched a lot of you tube videos on libgdx like Dermetfan and thenewboston and they’re great. But they all pretty much go over the same basics.

Another example are bits, I don’t seem to understand how to use bits. I know that I can find resources to help me with this, but other issues, I don’t even know what to search for.

It seems like you are enjoying your first major plateau experience. Plateauing happens to every programmer, but can be more intense and longer in duration especially if you are working alone / self taught. There are articles out there about plateauing and I’m sure you can find more in a search, but here is one. A cycle forms in this process where when you make the jump to that next plateau the first half of the experience is often refactoring your existing code then potentially problems once again pop up and the search for the next cliff to scale starts once again.

From a game dev perspective going down the traditional OOP route leads to not the best modular code / entity system. The anti-pattern that develops is the “god / blob” object; IE your base game object that everything extends from… As more and more systems are developed the tendency is to push the majority of them up to the god object. What you have built so far is not complex enough for this to have reared its ugly head; note OOP dependency injection should be avoided as it’s not a good solution; just a band-aid. This is the main impetus to move to an entity / component system.

Some good book resources (I’ve not read the first two):
Game Programming Patterns (free web version!)
Game Engine Architecture
OpenGL Superbible

On entity systems / components:
Data Oriented Design
Adam Martin’s ES series

I’d start with Game Programming Patterns since it’s free; jump right to ECS discussion as it gives a good overview on the why. The others will be much more dense in content and take a lot of time to absorb. Adam Martin has quite a few ES / Java articles though don’t take the design advice 100% as the way to do things; it’s just one way.

Since you are still getting a grasp on OOP two oldie, but goodies for that is Head First Java and Head First Design Patterns which will provide reasonable coverage of “traditional OOP”. This will probably help provide the vantage point to embark further down the data oriented design / entity / component system direction.

About data oriented design… At a glimpse this is the discipline in game dev (or any performance oriented programming area) of understanding how the underlying hardware works best to efficiently process data. Your GPU processes data in parallel; you can also process data on the CPU in parallel. Entity / component systems are the high level realization of DOD that organizes ones code / data for better processing. A central premise is that a good data component collects all the data that is associated with a given domain (physics, etc.) such that one can do the processing necessary without retrieving or collating multiple areas of code to get all of the data necessary to perform the processing. There may also be cases where a data component for all entities is pre-processed creating one giant block of data that needs processing in bulk.

Hand in hand IMHO at least with DOD / ECS also comes event driven programming. This is how components communicate with each other and the rest of the system aiding modularity and control flow. You will be familiar with the listener pattern from the various Java SDK implementations for say input, etc. It’s 2017 now and the 90’s can keep the listener pattern. You’ll want to look up “Java eventbus”. You may find a bunch of links about Google’s Guava; stay away from Guava or at least that is my opinion.

To make the jump to fully understanding how ECS work in Java one needs to thoroughly understand generics and in particular generic methods. As things go this is a rather advanced subject and can be a bit mind bending. The best reference is this resource. It took me 5 years ('05-'10) to fully appreciate Java generics and realize the applications beyond just the syntactic sugar applications (where 95%+ of folks stop).

Eventually you’ll need to master concurrency, but this is an advanced topic; a good starter book though. For now just keep all your code single threaded on the CPU.

Though you’ll want to learn how GPUs work (older article, but good start). Go directly to shaders and don’t bother to implement in your code the much older fixed pipeline approach except at least read about it for educational purposes. What shader programs do is define an algorithm for vertex & fragment (the final pixel rendered) processing that is applied across multiple data at the same time. The OpenGL Superbible is your first stop for this direction.

Since you have a go getter attitude and are using libgdx. Certainly put something together as a demo then examine the libgdx code for how and why it works especially sprite batching (advanced topic). You can also check out the available Java entity / component systems; I’d suggest Junkdog’s Artemis ODB as the best candidate. On the latter there though none of the public ones are what I consider to encompass the complete picture of what is possible.

As far as some of the previous discussion. When I mentioned find a team to participate with that is more about the temporary hackathon experience versus finding a distributed ongoing team.

Another example are bits, I don’t seem to understand how to use bits.

Bit masking can be useful as the first implementation of state tracking, but it is fragile. The fragility comes as more and more states are added and that this type of approach is not suited for modularization where one combines state across multiple domains. The better approach is using Enums and EnumSet, however even that is not complete as you can not mix two different types of enums together. You can though create extensible enums and use a HashSet at first. Sadly there is no publicly available ExtensibleEnumSet implementation that I’m aware of out there which is the next step in efficiency allowing EnumSet performance across multiple extensible enums. Some starter references; the grand master is from Effective Java (a good book itself); here are some notes. It should be noted though that Joshua Bloch in his exposition on extensible enums stops just short of some of the really powerful applications.

It should be noted that the info above is coming from my perspective. You’ll find a fair amount of folks on JGO that are more pragmatic or eschew some or all that I’ve mentioned above, so you may come across varying attitudes.

And just be ready to spend years getting a hold of most of the above. Be ready to spend several months to really grasp some of these topics as they can be deep and are complicated. Learning OpenGL / shader programming will be one of those areas that simply put just takes time even if you are already an accomplished programmer. I wouldn’t recommend for instance even looking at Vulkan until you have a thorough understanding of OpenGL.