Becoming a better programmer
I'm nearly finished with my BS in computer programming, but to be honest, my education has been terrible. I know how to use the languages. I've used several different libraries, and can learn more about them as I need it. I've built stock and shipment tracking programs and online storefronts as class projects. I have some experience.
The problem is that I don't understand the more advanced programming topics. For instance, I'm trying to procedurally generate a planet for a game. I'm told I can start with a cube and normalize its vertexes so I get a sphere with made of square faces. I have no idea how I would attempt that, and I'm not even sure what it means. Or I might be trying to generate a dungeon, the rooms and the hallways. How do I go about it?
It's not so much that I need answers to these specific questions. Programmers are supposed to solve problems like this. That's their job. However, I have no idea how to do it. I haven't found any helpful books on it either. At this point, I have no idea where to go for help.
The problem is that I don't understand the more advanced programming topics. For instance, I'm trying to procedurally generate a planet for a game. I'm told I can start with a cube and normalize its vertexes so I get a sphere with made of square faces. I have no idea how I would attempt that, and I'm not even sure what it means. Or I might be trying to generate a dungeon, the rooms and the hallways. How do I go about it?
It's not so much that I need answers to these specific questions. Programmers are supposed to solve problems like this. That's their job. However, I have no idea how to do it. I haven't found any helpful books on it either. At this point, I have no idea where to go for help.
Big Picture: Keep your designs clean, your interfaces as simple as possible and design your system with flexibility so as to make revision easier and more trouble free. Keep the interfaces separate from the implementation of the underlying computations. That way you can substitute on module for another without crumping your entire system.
ruveyn
Good advice. If I may add that keeping modules separate allows you to easily reuse the code for other projects. I've built up a very large library of modules and functions that I frequently reuse from one project the the next to save time... no need to keep reinventing the wheel every time.
_________________
I've left WP indefinitely.
Usually when doing 3D programming, you don't generate the geometry procedurally, you use software to create models (objects and scenery). At least, when you're starting out, it would probably be a lot easier to do it this way. When you feel comfortable loading in lists of vertices and displaying them on the screen, you can move onto more advanced stuff. I'm not sure how much background you have in 3D programming but there are definitely some books out there that explain the basics, or even tutorials on the internet. Remember try not to run before you can walk.. get comfortable with the basics first.
You could geometrically project a cube onto a sphere, but that would give you lots of distortion around the corners of the cube. If you take a sphere and a cube with the same center point, and take a line from the center, the line will intersect the cube and the sphere at one point on the sphere and one on the cube. If you copy whatever you have on that point of the cube to the sphere, then that's the projection.
I don't know if that's the best approach to that problem, but if it is, then you could look up math about projection and geometry.
That depends on what kind of dungeon you're trying to generate. 2D? 3D? On a square grid? Hexagonal grid? Not on a grid?
If someone gave you a dungeon generator, how would you determine whether it was what you were looking for?
Sometimes figuring out what exactly the problem is is part of the problem.
G. Polya's "How to Solve It", although aimed at mathematical problems, is a good book about how to approach problem solving in general.
_________________
"A dead thing can go with the stream, but only a living thing can go against it." --G. K. Chesterton
Good advice. If I may add that keeping modules separate allows you to easily reuse the code for other projects. I've built up a very large library of modules and functions that I frequently reuse from one project the the next to save time... no need to keep reinventing the wheel every time.
That is some really good advice and I do this as much as possible.
I've done some stuff from models, but I've never had to load lists of vertices. I'm sure I don't know how to do that or what the purpose is.
You were probably using a library then that "hid" all that kinda stuff from you. Better to work from the ground up with minimal use of external libraries.. I would suggest learning openGL and a good site to start from is nehe.gamedev.net.
The problem is that I don't understand the more advanced programming topics. For instance, I'm trying to procedurally generate a planet for a game. I'm told I can start with a cube and normalize its vertexes so I get a sphere with made of square faces. I have no idea how I would attempt that, and I'm not even sure what it means. Or I might be trying to generate a dungeon, the rooms and the hallways. How do I go about it?
It's not so much that I need answers to these specific questions. Programmers are supposed to solve problems like this. That's their job. However, I have no idea how to do it. I haven't found any helpful books on it either. At this point, I have no idea where to go for help.
I have been programming games for a couple of years now, and I also got a bachelors degree in game programming, yet I still consider myself an aspiring novice. I have never had to deal with any of those problems. If you want to learn how to make a game you should focus on other things first. Also these things are tasks that a designer would do.
So yea, try to learn the basics of OpenGL ( or DirectX. ) Learn to create shaders, by using shaders you can generate a sphere from a cube ( fragment/geometry shader ) but I think it would be better to just have a sphere model.
For loading assts you could try assimp. I used it to load that adorable little Stanford bunny into my project. It can be quite slow if there are lots of vertices, though...
Two tips:
1. Read "The Tao of Programming".
2. Just because they can take a small statement and convert it to something much bigger, do not ever refer to women as "compilers".
_________________
Oodain
Veteran
Joined: 30 Jan 2011
Age: 34
Gender: Male
Posts: 5,022
Location: in my own little tamarillo jungle,
@ 2.
while i dont have any formal education codeacademy really does have a lot of tutorials with vieos and interactive tutorials.
unfortunately they currently only have lessons in java and python, but if it is the underlying control structures you want to get a better grasp of then they might be of help.
your educational level might be a bit high for most of it but there are some full game write ups where you write games to fit certain criteria, most are text adventures with both static and random room distributiom.
_________________
//through chaos comes complexity//
the scent of the tamarillo is pungent and powerfull,
woe be to the nose who nears it.
I once used OpenGL to create a solar system, that involved vectors and matrixes, and transforming and rotating if I remember correctly. It was fun but never done it since.
Start off simple, get into it (it always takes time and effort at first), then learn more from others on websites dedicated to the languages you're using.
If you have just finished studying then don't expect to know everything, I have been programming various languages for 18 years and am still learning stuff.
Start off simple, get into it (it always takes time and effort at first), then learn more from others on websites dedicated to the languages you're using.
If you have just finished studying then don't expect to know everything, I have been programming various languages for 18 years and am still learning stuff.
They day you stop learning, is the day you are in trouble
ruveyn
I've only done a little simple programming with BASIC and even that frustrates me. The only advice I can give is maybe take a couples days off (no programming) and come back to it. Is there a different approach to meeting your programming goals?
I will liken my advice to my own experience. If I'm trying to learn a new musical piece, chances are highly likely that I won't get it down in one session. I have to work at it a little at a time learning as I go. The first time I go through it I might try to follow it as someone else has specified to do it. The more time that goes on with it, I will find methods that suit me better. Everybody is different and not everyone falls in to the "cookie cutter". I know there are work arounds for programming.
I've only coded a few simple games and programs but I did it in a way that I could understand. I would read manuals and go through tutorials and that was good and all, but some things I couldn't grasp in my head. I just started from scratch and made my idea work on the program but not by methods shown. I'll admit that at times it was very tedious and resulted in a lot of code that probably could've been consolidated in fewer lines, but my point is IT WORKED in a way I could understand. Eventually if I consistently stayed with it, I would figure out those methods of consolidation.
You can't start out at the top. The first couple years of my guitar playing I would get so frustrated because I couldn't switch chords fast enough or remember a scale. Now I've been playing for 19 years and still learning. It's a learning process and takes many trial and error situations to get things right. I commend you on your pursuit of programming because it's very complex.
_________________
When u hit the walls of sanity, u have no-where to go....
The thing I remember from a graphics course I took over 15 years ago was matrix manipulation with a 4 * 4 matrix: x, y, z, and w (usually a constant 1). The represented object could be moved, grown, shrunk, and/or rotated on as many as three axis's before the x and y were carried to points on a screen.
Yup, luckily there are libraries that helps you with the math. Constructian a rotation matrix is hard, and the inverse-transposed ( I think it was ) matrix is even worse.
Similar Topics | |
---|---|
ADHD Autistic programmer and glass blower |
24 Oct 2024, 6:54 am |