Questions about game development cycle

Hi

The last month or so I have been trying to make my first real game with just LWJGL. When I am working on it, I keep getting caught up in a loop of starting to add in some basic functions and then either deciding that I could write it better by restarting or deciding that the game is poorly coded and restarting. I was wondering if some people could give me some pointers (as there are some very accomplished developers present on this forum) that would point me in the right direction for how you go about starting a game and adding in features. Thanks for your time :slight_smile:

CopyableCougar4

Simple, resist. Starting from scratch once you have something working is pointless, massage your existing code into something that you do think is right to fix the problems. Always remember, players of your game don’t care how it’s coded.

Cheers,

Kev

Hi

Thanks for your advice, Kev :slight_smile:

CopyableCougar4

Well, to put it simply there is no need to reinvent the wheel, that’s why LibGDX, Slick2D and many other Java game engines exist.
Those libraries have been extensively tested by a large audience so there are almost no bugs, most of their functions are highly optimized but they still provide you a nice high-level interface for interacting with hardware and they’re highly portable with many options (LibGDX has like 5 or 6 rendering backends and can be used to export to desktop, web, Android and iOS).
Most of the people here who make their own engines (me included) only do it for the learning experience. Once you’re over that and you fully understand what’s going on under the hood of a game framework there is really no benefit in rolling your own engine. I wrote like 3 game engines since I’ve started my game development journey, none of which comes close to the functionality to the above mentioned frameworks even though I put a lot of time and effort into them. :slight_smile:

You have to choose what you’re interested in: Making engines or making games.
It’s really hard and time consuming to do both at the same time. :point:

What I do is make lists:

  • Have a laid out plan of “core” absolutely required features
  • A second list of features I think should be added, but aren’t required for basic core game play.
  • A third list of features I don’t need, but would be cool to add.

From there, I start coding the core game. I do tons and tons of refactoring as I go, including just code optimizing and general cleanup. Usually this is how I work on something new:
First: Get it working, even if it’s rough and coded poorly.
Second: Optimize the hell out of it, make it run as fast as humanly possible.
Third: Refactoring the hell out of it so it’s easy to read and makes sense.

After that, if down the road I discover a way to do it better, I go back and play with it again when I’m bored. (or when I’m bored is when I start playing with adding fun side-features from my cool-to-add list) But it’s no longer a priority because the current working model is “good enough”. But I’m constantly trying to improve things. For example, I’ve discovered an interesting way to speed off my off screen rendering in my lighting engine, I haven’t tried it yet because my lighting works really well anyway. But if I need a break from writing new code I’ll go back and play with it.

Usually the only time I head into a 100% functional/completed class is if I either am forced to due to adding a feature elsewhere that requires me to modify it or if I come up with a way to improve performance. But after the initial code cleanup, I seldom return to clean up some more just for the sake of cleaning and reorganizing.

Really though, since you’re fairly new, I actually do recommend rewriting your code 500 times every single time you discover a new way to do something. Reason being, the first 10 times you do it will probably suck. Once you become a skilled coder you’ll get that “warm fuzzy” knowing you did it the best way you feel is possible. Right now though the best way to learn is to do exactly what you’re doing. Write it, write it again, put it aside, learn something else, come back to it and rewrite it again, over and over. You’ll take 20 times as long to complete a game, but you’ll learn so much more that way and it’ll make the game you make after it that much better, faster and easier to develop.

[quote=“Rayvolution,post:5,topic:49939”]
That’s good advice :slight_smile: Thanks :slight_smile:

CopyableCougar4

Make small changes and test frequently. Learn how to refactor your code, simple things like extracting methods or interfaces can improve your code a lot. Try to make as much of your code as possible independent of your user interface so you can create test cases.