Info and Links on Game development

Status
Not open for further replies.

pallavnawani

Broken In
Hi all,

Since there was some interest in game development in a different thread, I thought I will post some information and URLs that might help those who want to start making games the old fashioned way. Note that the libraries/compilers mentioned here assume that you know either C or C++. If not, you can use game maker or something like blitz basic or even flash (for small games). Whichever way you choose to go, you will realise that you will have to learn some programming to make good games. Even game maker has a programming script.


Tutorials, forums, Articles
-----------------------------
*www.gamedev.net
*www.gamasutra.com
*www.gamedeveloper.net

Free Libraries
----------------
SDL: *www.libsdl.org
Allegro: *alleg.sourceforge.net/

Free Compilers/IDE:
-----------------------
*www.mingw.org
*www.bloodshed.net

How to start out:
-------------------
You can start by using either SDL or Allegro for game programming. Both libraries are crossplatform and your game can be run on windows as well as linux. SDL is lightweight, and this means that you a have to do a little more work if you use SDL. Beginners therefore, may start with Allegro, but both the libraries are very easy to use, so you can use either.

Also, there are add on libraries for SDL which allow you do do most of the things which SDL cannot do by itself. Three very important libraries are: SDL_Mixer (for music playback), SDL_Image (for image loading), SDL_Net (for network coding). Also useful is SDL_ttf, which allows you to use true type fonts. You can find lots of other libraries and games (most of them free) at the SDL home page (*www.libsdl.org). I use SDL myself.

SDL ( and probably Allegro also) has a mailing list where you can post your queries if you don't understand something.

For compilers/IDEs, you can use Vc++ if you have it, or you can use the Dev-Cpp compiler, which I use. You can download SDL and Allegro packages for Dev-Cpp. You will have to download and install Dev-cpp packages for SDL and Allegro before you can start using them. Similarly for VC++ some setup is required to start using SDL/ Allegro. You can download packages for Dev-cpp from:
*devpaks.org/

I suggest you use Dev-Cpp, because it is very easy to install dev-packs (Just double click).

Finally, Gamedev.net has a lot of tutorials which cover basics of game programming, which can help you started.

Finally, game programming is not always fun, Sometimes it is very taxing and boring, and in general it is hard work. But it is a great feeling when you have developed a game and it actually works!

Enjoy!
Pallav
 

cg84

Broken In
hello pallav,

nice post...i just completed my first game today - a tetris clone which i made in C using openGL. and riotball is really great fun man...good job!!

just wanted to know what about borland?? i use borland's c++ compiler(v5.5). where can i get sdl libs for borland? or will the implib command work?

also, does dev-cpp have a debugger? theres no debugger with borland's free compiler...and as i found out this time around...that's a real pain...
 
OP
P

pallavnawani

Broken In
cg84 said:
hello pallav,

nice post...i just completed my first game today - a tetris clone which i made in C using openGL. and riotball is really great fun man...good job!!

just wanted to know what about borland?? i use borland's c++ compiler(v5.5). where can i get sdl libs for borland? or will the implib command work?

also, does dev-cpp have a debugger? theres no debugger with borland's free compiler...and as i found out this time around...that's a real pain...

Congratulations.
Completing a game is a nice milestone. Very few people complete the games they start.

I don't know much about Borland's C++ compiler, I have never used it. I found that gcc (Which is the compiler in Mingw) is a better compiler when I compared the speed of my chess program, when compiled with different compilers ( I tried Borland also at that time). So afterwards I am sticking with Mingw/Dev-cpp

Dev-cpp uses Mingw compiler system. Mingw compiler is a windows port of gcc and therefore, Mingw also includes Gdb, the Gnu debugger. In short yes, Dev-cpp supports and includes a debugger.

Btw, you can use OpenGL with SDL. In such a case, SDL takes over the job of glut.

Anyway, are you going to make your game available for download somewhere?

Pallav
 

mako_123

Ambassador of Buzz
hi

hi friend
can you suggest a site where i an get basic tutorials on graphics function in C and C++..

Madhur
 

aadipa

Padawan
Re: hi

mako_123 said:
hi friend
can you suggest a site where i an get basic tutorials on graphics function in C and C++..

Madhur

If you want to work with Turbo C (which most starters do), then have look at *www.brackeen.com/home/vga/
 
OP
P

pallavnawani

Broken In
Re: hi

mako_123 said:
hi friend
can you suggest a site where i an get basic tutorials on graphics function in C and C++..

Madhur

C/C++ don't have graphics functions.
However, there are some libraries, which will allow you to use C/C++ to draw/animate. SDL is one such library. Allegro is another one.

Check here for some computer graphics tutorials:
*www.student.kuleuven.ac.be/~m0216922/CG/
*www.graphics.cornell.edu/online/tutorial/
More advanced stuff:
*www.faqs.org/faqs/graphics/algorithms-faq/
*www.faqs.org/faqs/graphics/

Note that you don't need to study any of this to make 2D games (Unless you are making vector based games)!

Finally I advise not to use Turbo C for graphics, it is outdated, it does not support resolution switching, hardware sync, etc. Allegro + Dev-Cpp is a much easier and better way for a beginner.

Pallav
 

Delta

Journeyman
aadipa said:
Can u please give some idea about the AI u used?

Sure!!!

First of all I've taken an array of a board, each block has value of 2. If X will be placed then value of that block changes to 3 & if O will be placed value of that block changes to 5.

In first & second turn, there is condition checking that the middle block has value of 2 or not. If it has then computer places its turn there. If not it places its turn above middle block.

In third turn and onwards there is a check of rows, columns and diagonals checking multiplication of the same. If multiplication of any row, column or diagonal has value of 18 (3x3x2), if true then it replaces 2 by 5. If condition is false then it checks if multiplication of any row, column or diagonal is 50 (5x5x2), if true then it replaces 2 by 5.(AND Fianlly Computer Wins!!! 8) ) If not it places its turn anywhere else.

But in this code, user can win also. I've tried a lot but i couldn't improve my code.

Thank You very much. And pls give me suggestions to improve this Code. :)
 

cg84

Broken In
Download?? i'll put it up for download very soon...but who'll play it? its just a barebones tetris. it does what u would expect in tetris...but its still got bugs(due to bad design, so i'll have to make some big changes to fix them). and u'll never play it twice. for me, it was just a learning experience...didnt do any fancy stuff with it...i just wanted to understand the very basics of game programming. still, i'll upload it and its source code too, which might just help others who r interested in game devel.

hmmm...if sdl can do what glut does, and with its add-on libraries, it looks very interesting to me...'ll surely give it a try. might try dev-cpp too.

and delta, congratulations on ur first game too. btw, heres another tic-tac-toe game u might want to try out...

*www.cs.utsa.edu/~wagner/obfusc/ttt.html
 
OP
P

pallavnawani

Broken In
Delta said:
aadipa said:
Can u please give some idea about the AI u used?

Sure!!!
But in this code, user can win also. I've tried a lot but i couldn't improve my code.
Thank You very much. And pls give me suggestions to improve this Code. :)

It is possible to make a Tic tac Toe program that never loses. Of course that is not much fun for the user if the maximum he can hope for is a draw. In any case, the algorithm you are looking for is called minmax algorithm. Here is a link:
*ai-depot.com/LogicGames/MiniMax.html

Minimax can be improved to Negamax and then to alpha beta:
*ce.sharif.edu/~ahmadinejad/gametree/

Just for the record, my chess program Natwarlal uses a modified version of alpha-beta called NegaScout.

And don't forget to tell us how your game goes!
Edit: What about the user interface? Is it graphical?

Pallav
 

Delta

Journeyman
pallavnawani said:
Edit: What about the user interface? Is it graphical?

Pallav

No. Game is made in non-graphical mode using ordinary line and gotoxy().

BTW Thanx for link. :)
 

mako_123

Ambassador of Buzz
hi pallav
thanks for answering my questions. I downloaded Dev C++ and allegro. Can you tell me how to install it.
 

mako_123

Ambassador of Buzz
hi

Also tell me whether Dev C++ is different from Turbo C. Can i use Visual C++ with allegro. Also tell me now where should i start.
 

cg84

Broken In
hello all,

i've finally uploaded my game. u can download it at:
www.geocities.com/timpu84/source/CG_Game.zip

controls are left, right and down keys as usual and the 'a' key for rotation.

as i said before, playing it is not much fun...but it might be helpful to those trying to write their own first games. there r still a few things i havent fixed, most notably in rotation(like try rotating the square). then theres no interface...and a few other things mostly due to my limited knowledge of glut. if u do check out the source, though, first look at the file 'gameflow.txt'. would make everything much clearer. and apart from the rotation and glut, if theres something i could have done to improve the overall design...do tell me...pallav??
 
OP
P

pallavnawani

Broken In
Re: hi

mako_123 said:
Also tell me whether Dev C++ is different from Turbo C. Can i use Visual C++ with allegro. Also tell me now where should i start.

Dev C++ is an installer package. You just install it in the normal way. After installing Dev C++, just double click on the Allegro devpak. It will be installed automatically.

Yes, Dev C++ is different from Turbo C. Dev C++ is a windows port of gcc + IDE written by Colin Laplace. Turbo C is an old Dos C/C++ compiler+IDE by Borland.

Yes, you probably can use Visual C++ with allegro, but I don't know how to do it since I don't have VC++.

To start, you can read allegro_vivace.txt (or just vivace.txt) that is supplied with Allegro. This was long time ago - I haven't checked Allegro for a long time. Anyway, that document explains the structure of a game program and then explains some basic techniques. It is perfect for a beginner.

@cg84:
I have just downloaded your game. I will post about it tomorrow.


Pallav
 

cg84

Broken In
hehe pallav i m waiting 4 ur review!!! anyway, theres something else i wanted to know...i m quite interested in sdl because of sdl mixer and sdl network addons. but for graphics, i want to stick with glut. can i use those addons with glut??

and i hv been searching a lot for sdl vs glut, but really all that i can get is ppl's opinions on the forum...although most of them hv been in favour of sdl. still, wanted to know ur opinion?
 
OP
P

pallavnawani

Broken In
cg84 said:
hehe pallav i m waiting 4 ur review!!! anyway, theres something else i wanted to know...i m quite interested in sdl because of sdl mixer and sdl network addons. but for graphics, i want to stick with glut. can i use those addons with glut??

and i hv been searching a lot for sdl vs glut, but really all that i can get is ppl's opinions on the forum...although most of them hv been in favour of sdl. still, wanted to know ur opinion?

Sorry, I went on a gaming spree and just finished Warlord's Battlecry. When I am on a gaming spree I tend to forget about everything else :) Btw, Warlord's Battlecry is a much better game than Warcraft 3 and is superior to Wc3 in almost every respect!

I will give my review either today or tommorrow for sure :)
I think you should be able to use SDL Mixer and SDL Net with Glut, if that is what you want to do. You will also need to use SDL of course.

Pallav
 
OP
P

pallavnawani

Broken In
cg84:
Ok, I have played your game now. Initially I could not run it since glut32.dll was not present in my system. I downloaded it and was able to run the game. As you said, its a very basic game. I went through your code and I think you have done a good job.

Only thing I want to mention is the programming model you have used. Glut seems to have a model where you have an Idle loop, and You have separate functions to handle user input. Games usually have a different model:

Code:
while(game_not_over()) {
   check_for_user_input()
   if (user_input)
          handle_user_input()
   move_things()
   Update_entities/monsters/buttets/objects()
   draw_stuff()
}

This simplifies things and is more flexible. You can choose when to handle or when not to handle the events. For example, you can handle events after move_things() instead. Glut model is more suited to making applications.

Also, be sure to bundle glut32.dll with your game!

Pallav
 
Status
Not open for further replies.
Top Bottom