C developper, but newbie gamedev, where should I begin?

Started by
13 comments, last by Galdred 11 years, 5 months ago
I used to work as a low level software engineer, and I have mostly written drivers in C language, and before that, I have done some development in Python, Ruby, and C++ (but I'd much rather use C now), but I want to move to indie game development now.
Last time I was writing a real game (ie not a pong or tetris tutorial clone) was with GFA basic on my Atari, so I don't really know much about topics specifics to game development (I'm a complete newbie when it comes to graphic, sound and interface programming).

I plan to make 2D turn based RPGs (like the old goldbox series for instance), but I don't know which libraries or engine to use, and which tutorials/book to read to get started.

What would you recommend me?
Advertisement
Since you're comfortable with C, I'd suggest SDL. It's a good media library that's been used in a ton of games and can be used to handle the game-ish aspects (graphics, input, networking, etc.).

I won't give you the "just learn to program first" spill because you've got that step down, so just get used to SDL, learn how to make a window, get input, etc. Keep it simple with SDL and make lots of mini-games to practice game programming and design. There's going to be a lot of throw-away code between now and when you have created a 2D turn based RPG that you're satisfied with, so just have fun getting lots of game programming practice in.

Maybe start trying to make tic-tac-toe.
[size=2][ I was ninja'd 71 times before I stopped counting a long time ago ] [ f.k.a. MikeTacular ] [ My Blog ] [ SWFer: Gaplessly looped MP3s in your Flash games ]
I'll probably get bashed for saying this but I highly recommend using a more developer friendly and stable language such as C#. Simply put Microsoft has spent millions of hours perfecting code managers, garbage collectors and their IDE that make your life so much easier and frankly you nor I will ever do it any better than they have it right now. By the time you even write your basic dynamic memory management and input collector's you will have already spent over 100 hours on stuff that doesn't even perform half as well as the C# / .NET frameworks do.

It's wiser when developing games to choose a language, engine and development kit that gives you what you need. Which in todays market means C++ or C# period. C is antiquated and not many people use it anymore because it's just an old insufficient language. I understand people will argue with me on this and state how C has way less overhead and it's closer to machine code and it's easier on the processor after compilation and blah blah blah. But these are all counter productive arguments at best, let me offer a few reasons why I think you should move away from C compared to these anticipated arguments.

C has less overhead:
True, but you also have to make the memory manager, library wrappers and many other low level systems. Are you a better programmer than all of the coders at Microsoft? Do you have a doctorate in computer sciences and countless certifications in programming techniques and technologies? No? Then how will you make a better performing memory management system?

C is closer to machine code:
So? The fact still remains that C (and C++) are generalized assembly compile languages. That is to say that when you compile your C or C++ program you target a specific chipset and architecture. This is normally set to a default IBM chipset that normally works decent on any machine. C# is actually an intermediary compilation language. This means that when you compile it you create a binary file that explains to your end users computer how to finish compiling the program. The first time they run your program their computer finishes the compilation process optimizing it to their specific hardware. For you to make a complex C program (like say a game) that runs as fast as it's C# clone you will need to compile your program for your customers specific hardware... In short, your closer to machine code language here is actually slowing itself down where as C# is speeding itself up.

C is faster and easier to process:
This only holds true at the very very very low levels and does not justify the slow downs that you yourself will cause trying to mimic the work that C# already provides. This comes back really to both the above points. C is generic, C# is for YOUR computer. C is bland, empty, theres hardly anything to it. C# Provides almost everything you could ever need coded and optimized by people with way more experience. When you get into the more complex features they will rely on your middle ware coding that handles memory management like functions. This is where you will lose performance in contrast to C#.

Just some final notes here, there are more tutorials and learning sources for other languages such as C++, C# and Java than there are for C. If you are not a master of the language who can answer all of your own questions you should heavily consider support material availability. Make sure that if you get stuck you will have places to turn for more information and help. Keep in mind MSDN has millions of examples, documents and tutorials on C++ and C#, gaming communities and engine websites also provide C++ and C# or Java tutorials.

Dan Mayor

Professional Programmer & Hobbyist Game Developer

Seeking team for indie development opportunities, see my classifieds post


[...] I highly recommend using a more developer friendly and stable language such as C#. [...]


Why re-invent the wheel when he could just use the numerous engines and libraries already written in C. By the way C# isn't easier for low level tasks, better off just using C/C++ and wrapping in a high level scripting language.
Galdred, use whatever you feel like using regardless of opinions. I've used C, C++, C#, VB, ect... But I never liked C# for games and I just use C++ regardless of opinion and I'm doing just fine!

The Allegro library is something I've been using for a long time. However, SDL is also a good option. Best thing to do is just download them, and get started!
GameDev Journal: http://www.gamedev.n...-rooks-journal/

OpenChess - 1.0 done!

Classic RPG #1 - Task 9 -> January 1st 2013
Well, like I often write to new game developers, any well supported language is just fine for making games. Fantastic games have been made in all of the major ones. Now we are talking game development here, which is a whole coding and software environment added to the making of a game. Another consideration is that you have experience as a software engineer and I assume pretty good with C.

I have done in the last two months a couple hundred hours of research into game development. Let's see if any experts or intermediate experienced people agree with me. It's just a friendly challenge... smile.png

Galdred, if you are going to stay with making 2D games, then C would be excellent. If you are going to eventually go to 3D, then I would say migrate to C++ or C#. Though C++ is the majority of 3D AAA games being made, many beginner and intermediate 3D games are being made in other languages and a few AAA games in Java, C, or C#, or other. Okay, that stuff is given, too, now.

Looking at the languages themselves, the more complex the game, then in general the more need for object oriented programming for the core and scripting language for game functionality. Right now and in the foreseeable future, both C++ and C# have huge repositories of libraries, many software applications, and large community support. The C++ is much larger in major ways than C#, but C# is evolving to likely close the gap to a great extent in the coming years. We know that C++ will dominate AAA game development for at least several more years and rightfully so for a bunch of reasons, but many less complex games being sold are written in other languages.

Both object oriented and dynamic writing are improved and will continue to be improved in C#. I believe that C# will eventually fade the need for a scripting language for a C# game because of being more programmer friendly and it is evolving.

As for C, it will be a viable language for quality games for many years to come, as I am sure we can agree. I feel that C would be a great language for 2D games. Having experience as a 2D and 3D artist in the industry for more than two years now, I know how art assets effect game performance of high quality ones made in Java and C++. I can assure you that your turn based 2D games can use the advantages of C while not being able to take full advantage of some performance characteristics of C++ an C#, yet not needing them for most 2D games. Once you get large libraries of code and many art assets in a couple years, then performance might get critical - or maybe not.

I am recommending that you stay with C and make full advantage of your experience in the language and software engineering. Stay with it until you complete your tour with 2D game making. After a year or two, if you then decide to start making 3D games or your 2D games have been filled in order to need the extra performance, then consider C++ or C#. (Who knows: Maybe Java or C will be in the league for the highest performaning games again in a few years.)

Get good at 2D game making before you do deep contemplation about a scripting language. That will take you probably several months to a year or more because you will need to learn the art aspects with the programming.

1) Start game making immediately, such as Tic-Tac-Toe, Pong, Tetris, PacMan, Space Invaders, and/or a clone of a contemporary popular one. You need to understand game programming structure more than anything else at this point.

2) Get a general IDE and/ or a language specific game making SDK. Research and decide this while you make your first few games.

3) Until you need to make art or mod existing ones for your games, get involved in artist forums supporting your plans, incuding in this website. Here we have plenty of information in the beginners forum and the artist forums to help you decide on art software and assets, even in the last few days being posted.

4) Eventually you will likely find a community which focuses on the genre of games that you do in your language.


Working hard is something you already do. You get results. My last advice is to remember to enjoy it all! biggrin.png


Clinton

Personal life and your private thoughts always effect your career. Research is the intellectual backbone of game development and the first order. Version Control is crucial for full management of applications and software. The better the workflow pipeline, then the greater the potential output for a quality game. Completing projects is the last but finest order.

by Clinton, 3Ddreamer

Even though I now write my games in C++, I've made plenty of fun games using C, and just a few years ago too. My current Library of choice for graphics, input, audio and windowing is SFML, but that's a C++ API, so you can use SDL for now.

Once you get comfortable, you may also want to look into a 2d physics library. I use chipmunk-physics, and it's API is in C. It makes writing 2d action games so easy.

My Gamedev Journal: 2D Game Making, the Easy Way

---(Old Blog, still has good info): 2dGameMaking
-----
"No one ever posts on that message board; it's too crowded." - Yoga Berra (sorta)

Thank you very much for your advice : I am learning SDL right now.


Why re-invent the wheel when he could just use the numerous engines and libraries already written in C. By the way C# isn't easier for low level tasks, better off just using C/C++ and wrapping in a high level scripting language.


I was thinking about using Python or LUA for the game logic indeed (Python because I am quite used to it, and LUA because it seems to interface really effortlessly with C).

Which engine would you recommend me? Most 2D game engines seem to be targeted at non programmers, or towards making flash games, except for a few like SIO2 (but it is mostly targeted at making mobile games), cocos2D and Torque2D.

I can assure you that your turn based 2D games can use the advantages of C while not being able to take full advantage of some performance characteristics of C++ an C#, yet not needing them for most 2D games. Once you get large libraries of code and many art assets in a couple years, then performance might get critical - or maybe not.


After a year or two, if you then decide to start making 3D games or your 2D games have been filled in order to need the extra performance, then consider C++ or C#. (Who knows: Maybe Java or C will be in the league for the highest performaning games again in a few years.)

A small correction is needed here as you seem to be assuming that C++ and C# have a better performance than C which is not the case at all (especially in the case of C#). The reason the majority of the industry shifted from C to C++ was do to it being easier to maintain larger codebases with multiple people working on them, and requiring less lines of code... so it was to save time and energy and had nothing at all to do with performance. As the C language is basically an "easier to read" version of assembly you aren't going to get any faster.

A small correction is needed here as you seem to be assuming that C++ and C# have a better performance than C which is not the case at all

As the C language is basically an "easier to read" version of assembly you aren't going to get any faster.

You are in fact the one who needs correction.
Most C++ compilers actually convert the code to C before further compilation.
What C++ offers is nothing but “features”, and if you were to implement the same features in C manually (as apposed to having the language do it for you) you would find the performance to be exactly the same.
In other words, just because the compiler detects a .CPP extension does not mean the same code will compile to a slower run-time than if it was instead inside a .C file.
The exact same code, in either language, results in the exact same assembly output.
The difference is that C++ allows you to take advantage of features that could also be done in C with exactly the the same run-time cost, but with a much easier implementation.
And it is yours to decide whether or not to take the performance hit from these features.

If you choose not to use virtual functions, for example, your code will be exactly the same speed whether in C or C++, but with C++ you get templates which can result in better performance than C, since the compiler can reduce templates to the bare-bones minimum set of code, with is then optimized by (again) a C compiler.


L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

This topic is closed to new replies.

Advertisement