Programming a Game...

Started by
13 comments, last by EduardoMoura 11 years, 3 months ago

Well, I am not even sure if this is the place to post this, but still here it goes.

Right now I am messing around with a simple game concept, a 2D platformer. But one of those never ending games, think Robot Unicorn. WIth a few twists on it (more on that later).

For the first time, I am trying the approach build the game not a engine, but I find myself troubled. When I writting code (that does what it is supposed to do), I always find myself trying to code the a generic approach so that I could use to other games, this mostly applys to refactoring the working code, separating class creating managers for everything.

Is this the way its supposed to be? What your experiences with this, do you find yourself always trying to make the "perfect" code, or do you hack and slash to just get something to work.

Any pointers on which kind of methodology I should ensure in my coding habits?

Just a little background, I have created games before, and a lot of decent engines for me and other folks, so I like to think of myself of decently knowledgeable on this subject (Just as a hobby of course, got much to learn). So I am not asking how to start, but more on how should I proceed to improve.

Check out my new blog: Morphexe

Advertisement

Wow !! That is a tough question I believe most of us ask ourselves everyday. I usually rely on 2 things.

1 - What I have done in the past that is reliable, I use to move forward and build on that. If I am working on a new game where I can utilize what I have done in the past and make some improvements on that, I do it.

2 - I tend to build on the game and let the game engine develop itself, unless I already have and established an good engine that could, with a little fixing here and there.

If all is working well, I make a backup copy and store it where anything I do what effect that code. Then I review over my new code to see if there is any streamlining that can be done, Make my modifications and then run that code over again to see if the changes were effective.

Your Brain contains the Best Program Ever Written : Manage Your Data Wisely !!

Yeah, but the godly advice we get when we ask "Where should I start with my Engine is" . Build Games not engines.

The problem is , I am building a game, but I always have a build a Engine mentality, and always try to write the most performance/slick/General code. So I am not sure where I going wrong, but I tend to take alot of time to develop a game infrastructure, or the engine part of it. Some times I take too long and get bored and stop. Most of the times I go back and see my code and think, I could do this better and then redesign most of the code. Then its Rinse and repeat!

Check out my new blog: Morphexe

Eric over at ElderGame once said that [your supposed to code perfectly the first 90%, so that when you realize you've made a terrible mistake you can screw up the last 10%, and it'll still work properly.] Or something like that.

I'd say do whatever is comfortable for you. If you want to waste a little time being generic, it might help you out later on. Either in this project or another. I don't think it matters, either way, because mostly the take away will be experience which you can always reuse.

If you picture yourself doing something similar in the future, especially a sequel, plan to reuse the code. If you need to release ASAP, do it any way that it will work.

I'm not really a programmer though, so don't listen to me. I'm studying so I got tons of theory but hardly any experience at all.

It's hard to come up with the perfect design from the start when you are making up your game as you go. I would plan in time for refactoring your old code to accomodate for new ideas that you have included.

Do you use version control? Git for example is very useful because it is really easy to create branches to test out new ideas/prototypes and after refactoring, merging them into your master branch.

For small project I usually don't use Version control. But I think that might be something considering. Create a main repository for my "engine code" and branchs for games, thats something that just came to my mind, maybe worth to try.

Check out my new blog: Morphexe

How thorough is your design? I would code generically enough so that it fits the scope of just this specify game itself. Once your game is complete, you can integrate parts you like into what you currently have in your engine. I wouldn't add any features to an engine until that code's been used effectively in a game first. This way, you're not adding any guesswork for constant end-all solutions.

Even saying that, I get hang-ups about it, but those are signs of perfectionism and procrastination. Those are common symptoms preluding the death of any project I've ever worked on and didn't finish.

Good luck!

How thorough is your design? I would code generically enough so that it fits the scope of just this specify game itself. Once your game is complete, you can integrate parts you like into what you currently have in your engine. I wouldn't add any features to an engine until that code's been used effectively in a game first. This way, you're not adding any guesswork for constant end-all solutions.

This is a amazing sugestion, I think I am going to setup a environment like this for all my projects, I was looking at my design and I think my major problem is not having a strict feature set for the game, I put them on as I come along. This is wrong, completly wrong. and I think its holding me back.

Check out my new blog: Morphexe

I'll be honest I still hack away and make something work first, then go back and improve the flow, break it up into functions, look for areas where I can cut out repetitions. It's much more fun to have something working and playable that's badly coded then the most amazing looking code that does nothing.
I'll be honest I still hack away and make something work first, then go back and improve the flow, break it up into functions, look for areas where I can cut out repetitions. It's much more fun to have something working and playable that's badly coded then the most amazing looking code that does nothing.

I think it depends.

Do you want to learn? Try little hacks at the begining and when it's working, go back and make little improvements if you want.

Do you want to make a video game? Code like hell!

This topic is closed to new replies.

Advertisement