Jump to content

  • Log In with Google      Sign In   
  • Create Account


Programming a Game...


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
14 replies to this topic

#1 Morphex   Members   -  Reputation: 298

Like
0Likes
Like

Posted 23 December 2012 - 08:43 AM

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 


Sponsor:

#2 Poigahn   Crossbones+   -  Reputation: 516

Like
0Likes
Like

Posted 23 December 2012 - 09:19 AM

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 !!


#3 Morphex   Members   -  Reputation: 298

Like
0Likes
Like

Posted 23 December 2012 - 09:48 AM

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 


#4 Blind Radish   Members   -  Reputation: 355

Like
0Likes
Like

Posted 23 December 2012 - 09:54 AM

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.



#5 Madhed   Crossbones+   -  Reputation: 2493

Like
0Likes
Like

Posted 23 December 2012 - 10:18 AM

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.



#6 Morphex   Members   -  Reputation: 298

Like
1Likes
Like

Posted 23 December 2012 - 10:29 AM

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 


#7 Vincent_M   Members   -  Reputation: 560

Like
0Likes
Like

Posted 23 December 2012 - 10:38 AM

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!



#8 Morphex   Members   -  Reputation: 298

Like
0Likes
Like

Posted 23 December 2012 - 11:02 AM

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 


#9 sednihp   Members   -  Reputation: 241

Like
4Likes
Like

Posted 23 December 2012 - 01:19 PM

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.

#10 Ravnock   Members   -  Reputation: 286

Like
0Likes
Like

Posted 24 December 2012 - 06:41 AM

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!



#11 Morphex   Members   -  Reputation: 298

Like
0Likes
Like

Posted 24 December 2012 - 08:59 PM

I think motivation is the main concern when coding a video game, so I think I agree with your opinions of saying, hack first and then reformat later. This way we get something to look at, and at later stage we can fix, clean, and improve our old code.

 

 

Still I feel trouble by my "engine" mentality and my quest for the perfect piece of code, Its a never ending quest for me I guess. Heheheh


Check out my new blog: Morphexe 


#12 Blind Radish   Members   -  Reputation: 355

Like
0Likes
Like

Posted 30 December 2012 - 02:46 AM

Maybe hack out a bunch of concepts one by one, and then look at the best way to mix them??

Or hell man, just make everything reusable if thats how you roll.

The only benefit to not doing that is maybe readability?  I don't know.

Worry less.  Code more.  <3



#13 Morphex   Members   -  Reputation: 298

Like
0Likes
Like

Posted 30 December 2012 - 12:05 PM

Yeah, I going with the just make it work, in the end reuse everything clean code etc. This way I do get things done and dont get bored with the game.

 

I guess I am going to change my work methodology just to make things faster. And then worry with doing then better :D


Check out my new blog: Morphexe 


#14 Blind Radish   Members   -  Reputation: 355

Like
0Likes
Like

Posted 31 December 2012 - 12:18 PM

Let us know if you come up with anything you want to share.  If it's all reusable I'm sure some people would love free code ;)



#15 Morphex   Members   -  Reputation: 298

Like
1Likes
Like

Posted 31 December 2012 - 12:41 PM

I have a few code that can be used, I will write a article on it once I get it on a more decent state.

right now I am going to write a Indepth  article on SAT 2D discrete and swept methods, you might see it popping around sometime soon :D


Check out my new blog: Morphexe 





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS