Jump to content
  • Advertisement
Sign in to follow this  
DevlinHealy

Basics On Code Implementation

This topic is 2611 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

This may be in the wrong forum if so my bad sorry.

There are a lot of question marks in my head when it comes to programming games. For example, I understand that you use classes for players, monster etc, but there are some more complex things I don't understand exactly how to code PROPERLY. A link on this would be nice, I'm pretty sure I'm looking for software development type stuff, but I don't know exactly what to look for in google.

Kinda stuck in that limbo where I can do some aright coding, but I don't know how to use it, like knowing words and not being able to put them in a full sentence, and how to properly arrange the words in that sentence.

I'm also trying to figure out how to make code "plugins" ie: I develop a graphics library, I can rip it out of one engine and put it in another. What kind of things to I have to implement and look out for to ensure my code is at least semi plugin friendly (a link to a basic tutorial would be awesome on this topic).

This is my first attempt at a game, which will probably turn into an engine at SOME POINT, and the falls gonna be hard so I'm bracing for it, but I'd be nice to get a headstart and be able to use at least some of the code for the next one.

Your input is appreciated,

soaren

Share this post


Link to post
Share on other sites
Advertisement
An engine is pretty much just all the bits of your game that you'll want to reuse. I wouldn't worry about making the engine untill you start the next game, when you start the next game and think "I made this class/function before", then you copy the files into your library project and use them through that. Making a lib is fairly straight forward, there's plenty of very irritating things that can go wrong but its very similar to making an executable, just you won't run it.

I found this, might be of some use:
http://msdn.microsoft.com/en-us/library/ms235627(v=vs.80).aspx

Share this post


Link to post
Share on other sites
It's a little hard to tell where you're coming from, what you know, and what you're trying to do, so i'm making this post assuming that you have experience making small projects, but you haven't worked on anything as large or complex as even a simple game like Pong.

It sounds like you're having trouble getting started, so here are some tips: Don't worry about your eventual goals, segment your work into milestones. For example, the first milestone would be creating a window and being able to close it. Then get something to display on screen, make it move, etc.. This way, when there's something complex you just don't get, everything else has already been worked on and you can get help on just that one issue, while working on other sections of your code. Google "game loop" if you want an outline of how your code should work.


BTW: By plugin, do you mean just designing it orthogonally so it fits in any game you make? That should happen naturally without any extra effort, if i understand you.

[font=arial, verdana, tahoma, sans-serif][size=2]

Kinda stuck in that limbo where I can do some aright coding, but I don't know how to use it, like knowing words and not being able to put them in a full sentence, and how to properly arrange the words in that sentence.
[/font]
I remember feeling like that at one point. I was disappointed with myself in that i knew i could code just about anything (naive, i was), but i wasn't able to make anything complex proportionate to my skill. I stuck with it and a few years later, i feel the opposite is true. What you're describing will fade away as long as you keep practicing.

How to write good code.

Share this post


Link to post
Share on other sites
Okay allow me to try to reexplain my question:

I didn't mean to come off cocky, I've read quite a few of the more ridiculous "I'm gonna make an engine out of nowhere, what language should I learn?" questions on here in the Beginner forums. I'm well aware it takes hundreds and hundreds of people to make a game like Halo, and I'm sure OGRE and all the other indie Open Source Engines are almost just as big.

I'm looking for resources that explain WHY something was coded the way it was, how to implement more complex problems other than asking someone in a text rpg what class they want (enter numbers 1-4) and what their name is, and how to make a computer calculate basic stats. I'm still learning C++, but I'm getting along to more of the complex topics, and I'm starting to get to the point where I'm trying to "see the big picture" on how things are properly implemented as a whole. How many header files I should have for a particular application, how they should be divided, what should and shouldn't be together, how to organize my .cpp files, what to separate and what to keep together. Basically how code a particular problem efficently, because in programming there are many ways to solve a particular problem, but more often than not there are BETTER and BEST ways to do something more effectively.

My comment (and this is where I think I was greatly misunderstood, I'm not at this point yet but I will be) was about how to make code more reusable? Because that's one of the golden rules of coding amiright?

And Splinter of Chaos, I never claimed I'd be able to program a 3D, fully lighted graphics library with AA and all the sparkly stuff, please don't act like I did. lol. If I ever get to the point where I'm working on 3D (unlikely) there's gonna be someone else doing that, I'm more interested in the "invisible code" and implementation of GUI's and the actually combat system in 1's and 0's.

I still have some things to cover in C++, but I'm at the point where coding is getting fuzzy because I don't have enough theory of design yet. That's the "limbo" I was talking about.

And here I am.

Share this post


Link to post
Share on other sites
Did i act like you said you'd be able to do 3D? I was responding only to what i gathered your position is: some programming experience, no game programming experience. Though, reading your reaction, i can see that i still don't understand what your position actually is.

As to your WHY question, i'm still stuck on that WHAT. In the few games i've coded, i figured everything out best i could and found ways of getting everything to fit together, so i know why my code works, but not why or how other people's code works.

As for BETTER/BEST practices: It's situational. Sometimes, a best solution has not even been discovered yet. You have to pay attention to a functions complexity, or in the case of containers, insertion/sort/etc. complexity. I really don't know if this question is answerable, but you can develop the skills to analyze a solution's efficiency vs simplicity.

For the text adventure example: parsing is what you want to google, but i've never found much useful information.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!