TheMyst's picture

Learning C# and want to Use OpenTK

If youre going to say "Learn it" or "Read the documentation", I already have/have tried, and you are of no help to me whatsoever. Hit the back button on your browser now.

Alright, here is my problem. Where are some good sources to begin looking at how to bring everything OpenTK has to offer together into a game? I need some good online tutorials or something. I am currently taking a course where we are using C# and I am really starting to get the hang of things. The trouble is that everywhere I have looked has gotten me nowhere as far as making anything feasible is concerned. I understand how to put a triangle on the screen, but that teaches me abso-fucking-lutely nothing about using OpenGL for game development. If anyone can take the time and help me out, I really would appreciate anything you have to offer.

And for the record, NeHe has done jack squat for me, so don't even bother recommending them to me. Long story short, I am extremely frustrated and just want to make something.


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
JeffM2501's picture

I think the primary reason you haven't gotten anything out of what you've read so far is that there are MANY ways to use OpenGL for games. It all depends on what you want to do for your game. How you use GL in a FPS is very different from how you use GL in board game, etc..

NeHe does have all the parts that you would need for the graphics of a game, but a game is so much more then graphics. You have input,sound, network as the other basic things, but the core is the actual gameplay.

I can understand your frustration, and I think the best thing to do would be to take a step back and lay out what you want your game to do. Then break that idea down into the component parts that you'd need to make it a reality. Once you have that done it becomes much easier to focus on one thing at a time until you have your game realized.

You don't have to get it right the first time ether, it's very common to go back and fix up things as you get into a project.

OpenTK is not a complete game system, it is simply a set of tools that can perform specific tasks. There are a couple ways you can get a better understanding of how games work;

1) find a simple game and study it.
2) find sample code that is as close to your game as you can find and see what you need to extend it.
3) talk about your game design with others and see how they would do it.
4) use a higher level "game engine" library that does most of the work for you.

As I said, I can understand your frustration, and I can tell you that being rude to the people here isn't going to win you any friends. Game development is a daunting task, especially for a single person, so I recommend just laying out your ideas and asking for comments/ideas/help on it. That should give you a better perspective of what is going on :)

Simply put there is no "magic bullet" site that simply teaches you how to make "games", but there are lots of people who could be willing to help you understand the process for a specific example. Consider that modern game development degrees are thought as a full 4 year college course. What you are asking is somewhat like "tell me a website that tells me how to become a doctor". Sure there are sites on first aid, but that's just one small bit of the entire thing :)

Jeffery Myers
3dspeeders
A silly experiment in C#

Inertia's picture

Jeffrey has made some good points already, but what I tend to tell people curious about game development first is that they should take a few steps back, take a look at themselves and find out if they are more interested in the design work of making a game fun and enjoyable for others, or whether they are interested in making such a design become interactive (as in implementing it with code).

If you find design appealing, stop looking into programming libraries and either use a commercial engine (you can start creating a mod and deal with licensing the engine when release is in reach) or find a free engine that suits your needs.

If you're interested in programming, do realize that the presentation of a game is about ~10-15% of the coding involved. You will spend far more time finding and eliminating bugs than doing the more pleasant things. Also getting player controls to act like you want them to is far more difficult than it might look at first, in fact it might be impossible to create error-free controls of the player avatar. Even in AAA titles you will find spots where the avatar gets stuck, falls through the floor etc.

While playing games is fun, making games is work. While work can be fun to some degree, it usually is not. It is very important to realize this.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

"Inertia" wrote:

It is very important to realize this.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

So, you're still here. Now some leads how to start writing games ;)

First, aim low. Some "casual" game like Tetris, Pong, card games etc. is what you should start with. The most important reason for this is, you know the game rules exactly, the graphics/sound involved are not hindering you much (art assets do not grow on trees, yet) and the scope of the game is small enough to easily find bugs by single-stepping through the code.

You need this learning experience and it cannot be skipped. Do not overdo it by attempting to make the most-perfect-Tetris-ever, because this is a learning project and you will put it to the shelf at some point and rarely look back. Also success or failure does not matter much, because you learn from both. You should pick a game that you enjoy though, if you hate Tetris you will most likely not complete it. Repeat this excercise until you're confident that you are ready for bigger challenges. When you are, take a look at SDKs, map editors, source code, etc. from existing games. It will start to make sense then.

Dinberg's picture

Inertia has said it so well, I support him 100%. You said you are frustrated - there's alot more in store if you go down the route of making it yourself ;)

That said, the challenge can be rewarding, and the satisfaction is beautiful when it all comes together. What you have to realise is that (and I'm actually guessing your in the same boat as me so dont take it badly!):

1) You are probably going to do this part time, as a hobby.
2) You are likely one man, alone, doing everything from media to networking.
3) Resources required are proportional to time required
4) You probably have a job/school/uni/college and real life commitments like girlfriend/partner/friends/pub/clubs that will leave you ocassionally without hobby time.

So if you are expecting to pull of a full feature game that takes a studio of dedicated artists and professionals a considerable length of time to achieve, you may need to re-judge perspective.

What may be a good solution as inertia mentioned was a game engine that already handles the difficult and fiddly bits for you, or a higher level language. DarkBasic, Unity, Garage Games, Source - just google things like 'game engine', youll find them ;)

"take a look at SDKs, map editors, source code, etc. from existing games"

Another way of doing it could be to join an open source project already attempting to make a copy of a game in existance - this is a good way of assembling a larger group of people to achieve a goal, and generally will be able to produce more than a single person. You will have to realise though that doing this will give you less of a say in the direction of the project, because you will be working with other people who may have ideas of their own. But it could be the difference between a finished cake or a half-baked mess.

It also gives the benefit that if you dont know something, you can look at someone elses code to see how they've handled it! It can be invaluable experience, but be wary as some open source projects vary considerably in the skill of participating programmers, so dont assume any solution is the best way of doing it.

Anyway, good luck!

flopoloco's picture

Best way to start game development is from here! No theory, no blah blah, just code for coders... When you have fully understood what you did there (and why you did it this), then move to OpenGL.

Practically, there are more ways to make a game, they are not right/wrong neither hard/easy. The point is how much time you want spend to achieve your result (that parameter comes with how much control you want over your system, is it going to be designed and implemented as you imagined it)?

The long way:
- Learn about game developement Concepts/Tricks/Theory/Math.
e.g. What is Sin/Cos? What are GameStates?
- Learn about OpenGL.
- Develop your game.

The fast way:
- Learn about game developement Concepts/Tricks/Theory/Math.
- Develop your game using an existing game engine.
axiomengine.sourceforge.net
http://chrisk.free.fr/cariboost2/crbst_0.html
http://www.jadengine.com/

TheMyst's picture

Thank you all for your words of wisdom. I decided today to take JeffM's advice and take a step back and look at what I am doing, then everything hit me like a ton of bricks. I started writing down everything I thought of, and now it seems like it's all going to come together. Dinberg, you are right on some points. I am a lonely guy, but I do not plan to do this all by myself. HELLno. There's programmer art, and then there is programmer art. Mine is very much the latter. I'm going to a school where everyone is eager to add to their portfolio. I plan to get the framework laid out, and then work with other talent to bring something together. Who knows, I might end up making a start up company or something with those guys. I'll cross that bridge when I come to it.

As per development experience, I have worked with other engines and frameworks before (read: Game Maker with a 3D extension and ripping/animating models for Source, as well as making a couple maps.), and from there I got a good sense of how a game is made. This is just me taking it to the next level.

EDIT: If the "Next level" is me bashing my head against my desk because I have no fucking clue what I am doing. Maybe I should just stick to other frameworks. Oh well, all of that was fun to think about/plan out anyway. I just want more freedom is all. Expand my horizons, you know?

JeffM2501's picture

Sounds like what you want to do is find a group of people ( probably on an open source game proejct ) and see if they will let you bounce ideas off them. This will help you get that clue you need for direction.

I work on BZFlag and we have a "chat" channel on IRC where some of our community members sometimes come to talk about game dev stuff. A few of them are enrolled in some classes on the subject, and it helps them a lot to just have someone to talk to about the stuff.

Also as others have said, it helps a lot to start simple, it gives you a good idea of the core concepts of game design.

Jeffery Myers
3dspeeders
A silly experiment in C#

Dinberg's picture

Oh, one more thing - don't underestimate the values of willpower and perseverance. I'd argue they are the programmers most vital skill!

Inertia's picture

Thanks for writing down these verbose opinions, the different angles of view are a very interesting read so far: keep them coming :)

Question at those who suggest to join a team/group: Have you actually made positive experiences with that and can recommend it because of those good experiences? I cannot confirm this, my experiences with game projects run over the internet were ... poor ... to say the least. I'd rather recommend doing a small project at your own pace than a medium sized one with a group. Yes, a group is more than the sum of it's parts, but if parts are broken, refuse to work or turn out just to tag along for the credit, you end up dealing with social and morale problems rather than with creating a game.

Looking back, the work with Fiddler on OpenTK is the only thing I'd do again if I could turn back time.

P.S. I do not mean to discourage you from making your own experiences, but that's how it worked out for me so far. Thus my recommendation.

objarni's picture

Inertia:

I joined a local group of wannabe-artists, and to some extent wannabe-programmers (some extensive experience, others almost none). That experience lasted for a year. I was the first one to depart because we had actually made no progress at all, and everybody had their own "castle in the sky"-idea. The group disbanded some months later, when others found out the same thing I did (my guess) ;)

All concrete experience of mine, even though it is limited, has instead stemmed from the following procedure:

1. Learn some new computer graphics technique/physics formula/cool phenomenon
2. Imagine the smallest possible project in which I could implement it. Often "proof of concept" or "demo": for example a "necklace of springs" to simulate the spring-formula, with keys to alter the coefficients
3. Implement idea from (2) (to the best of my ability -- 90% of all those projects go down the dust bin before they are even finished).
4. Repeat from 1

That's the way I've learned to program.. Step 2 is not as hard as it sounds, it is just about being a little "daring" or "creative", whatever word you prefer ;) "Not being afraid" some might say..

One downside to this "algorithm" is that not many "complete projects" come out of it. That is why I've started to look at things "from above" instead of "from below" the last few years. Instead of feeding the urge to implement the latest algorithms I've learnt, I try to think of new things that I want.

That is much harder, I will admit. My Dogfight2008 project was an example of this kind of thinking, and it wasn't finished either ;) Guess I'll maybe have to alter my "productivity algorithm" some.

Dinberg's picture

Intruigingly, I've had a completely different experience from you lot. My first foray into open source was when I started fooling around in Dawn of Light; while there are some less-than-gentlefolks in any project thats open to all, I've met some absolutely solid gold team members who do everything in their power to assist others. I only intended to poke around in that project, but I've been active for two years now. While some have moved on to other projects, we still regularly keep in contact and occasionally do a bit of coding together. I'm hoping in the summer after my exams I'll have the time to undertake a more serious project with them.

That said, what I was trying to say earlier was that you should join a project that already has a decent start and good activity - if you are using sourceforge, I've found that the 'activity' rating on the projects is worthless - dont even take a peek at it. Browse the svn and check for recent activity; both size and frequency of commits are important.

The idea behind joining the project is not necessarily to make the game you want, but rather so that you can see and browse the code of a game already being developed and work out the key features and the various techniques of their implementation - this is the most valuable bit! Consider it not so much a game you are making, but a tutorial if you will ;). Usually active projects have a friendly userbase from my experience, and will appreciate any constructive feedback or questions that you have as to the code.

"Often 'proof of concept' or 'demo'..."

Building something like the classic Game of Life, or a flock of birds or animals could be a good way forward - while the algorithms are very easy in themselves, the results that they generate can have startling complexity given the simplicity of the rules. This means you don't spend so much time fussing around with one particular aspect of the program.

Also as a suggestion, if you do decide after all of these little programs you do want to make a game, try and make it easy on yourself; space is good, you don't have to worry so much about pathing and collision/movement is much easier than terrain for example