Advertisement

How to Start to Code a Game

Started by December 04, 2014 04:42 PM
3 comments, last by Brain 10 years, 1 month ago

Hi guys!

First of, I'd like to know people from around the world who are beginners like me and who are into game dev. If you feel you are open minded, creative an easy going with others you have a friend here smile.png. Just send me a private message or something.

My name is Ruben Idigora, I am studying game development in Spain first year, but I have been studying Multimedia so I can code a little. I started Object Oriented Programming and now there is a game project that needs to be done.

The problem is that I have no idea how to plan my code as I have never planned such a big project, and in our uni they are only focused on c++ learning with little examples.

What I did to assess this problem is to try UML or even drawing it on a notebook but I don't know which classes are usually used in game development except for the characters in the game, monsters etc. Is there like a game Manager class which controls everything?

Ok, so my question is, can you point me to some resources that show the components of a game like the main loop, usual etc.. or just explain them to me?

Just any piece of information will be appreciated.

Thanks,

Ruben.

Does this have to be a graphical game? Have you built graphical applications before? If you've only ever dabbled in console-mode C++ programs you're going to have quite the leap to take.

Advertisement

what are the rules? Can you use frameworks like OpenGL, tools like Mono or even full engines? Do you have to write everything from scratch?

If its the latter, why not have a look how a simple Game Engine is built up? There are many good books on Engine creation, and there are many open source engines and games on the net you could have a look at. Maybe not start with the biggest most complex 3D engine as a start though.

A good book I have myself: http://www.amazon.com/Engine-Architecture-Second-Jason-Gregory/dp/1466560010/ref=sr_1_1?s=books&ie=UTF8&qid=1417769248&sr=1-1&keywords=game+engine

Generally, you have your main loop, that will run through multiple phases or states. There is a part of the loop that updates game logic, and then there is a part for rendering the graphics for example. Most engines give behaviour scripts and other code linked to the game objects hook-ins to execute custom code at the right game loop phase/state, so you can make sure game logic is run before everything is rendered to screen, and not afterwards.

Gian-Reto thank you so much. I think you gave me the answer to what I was asking.

The rules are pretty basic, but with my partner we really want to learn and we want to make something challenging. We thought about making a of mud without the graphical part, just messages about results from attacks, description of rooms and things like that. And if we can we would like to network it to try it.

So basically we are doing this to train ourselves with classes and all that's been taught to us. We are doing this in c++ with the sfml library.

I'll give a look at the book also.

You might want to look up a book called "game coding complete". I have had the second edition for many years which is now showing it's age, but the newer editions are worth a read and even the original and second edition are still full of valid points and useful code and available quite cheaply...

This topic is closed to new replies.

Advertisement