Game engine or graphics library? - graphics

Should I use a game engine or a graphics library? I was just thinking of making a simple game to start out with, but what about when you get to higher-end stuff and high poly models? Which would be faster?
Also, should I choose Xith3D or JMonkeyEngine?
Or if I were to go with a graphics library should I go with JOGL, LWJGL, or the new JOgre?
Java is fine for making games, if I wanted to switch to c++ I wouldn't be asking.

There is in fact 2 questions to ask yourself to find the answer :
Do you want to make the game in no time or learn about more technical side of game programming?
Does the game is a variant of a well known/established genre or is it structurally different?
If you answered:
1==game && 2==genre : Use a game engine. Choose one that have been used for the target genre. Just make the game with this tool as fast as you can.
1==game && 2==different : As the structure of your game will be different, it will be hard to make something that match your game structure with a full engine. Maybe using a framework (made of several separated libs) will be of better use. Anyway, it will not be really fast to make but at least with a framework you'll not have to build the lower layer code and check that all libs are compatible.
1==technical && 2==genre : Well in this case you could study an engine or make your own. If it's your first game or your first 3D app, I recommand using DirectX or OpenGL directly one time, then pass to an engine later, like Ogre. Anyway, try to right yourself what techniques you want to learn about.
1==technical && 2==different : Take time to choose several libraries for each side of your game, then work on getting things together to make it work in your specific case. It might be the most interesting case but it's also the most time consuming. Anyway, use libs. Use ogre for graphics, etc.
Now, there is still a question to ask yourself when choosing your lib/engine, whatever the previous choice : does your game need to be cross-platform?
Check that your tool/engine match your answer to this question.
By the way, if you want to get in the industry OR want to get technical, you'll have to talk to hardware (at least if you want to learn about graphic programming) so use C++ (or C) instead of java. It will go in your way.

I wouldn't recommend Java for game development, as it tends to be slow and games require performance. To make a simple game, a graphics library would be enough. For a complex game, although, a game engine would offer you more interesting stuff.
A simple set of graphics libraries with some cool utilities to make simple games would be openGL + GLUT. I've already used it for small games...

Ok, so you want to learn game programming. You have a lot of options, but I don't see much of a plan in your question or comments, nor am I quite sure what your exact goals are. The only sure thing I get is that you want to work with 3D graphics.
The thing is, you're asking about performance without actually running into performance issues. Your question feels premature.
For the sake of making a choice, start building with JMonkeyEngine. It seems to be a fairly advanced 3D engine in Java. Starting with an engine allows you to concentrate more on the design of the game instead of having to fine tune everything yourself.
Take the time to make the game complete, with all the finishing touches, such as menus, player options, whatever completes the game. Finished projects teach you a lot about game design, and look good in your portfolio.
Repeat this process with slightly higher-complexity projects, over and over again. Depending on how quickly you advance the complexity and how well the engine is built, you will eventually reach a project where the engine doesn't keep up with your expectations. From here, you can take advantage of the Open Source aspect of the engine and figure out exactly HOW the engine is handling your design.
From this point your learning path switches gears. Instead of learning about generic game programming (which, by this point, you should have a fair bit of expertise in), you start to dig deeper into hardware interaction and low-level optimization.
This all assumes that you are only just beginning to get into game design and game programming, but have a fair amount of experience in your chosen language.

Related

Best language to manipulate sound?

I would like to make an "simple" program that after i clap the hands would do an certain event like open a browser. However i want do other things after this, so the program must be able to evolve.
Which programing languague should i choose in order to do this?
I know vb, python, c, c++, learning java(isnt going very well).
Thanks.
To be honest, I just don't believe that you 'know' vb, python, c, and c++. Because if you did - you'd know that all you have to do to is google the problem, and you'd find a solution for multiple different languages.
I think instead of trying to jump into a 'clap detection app', a better idea would be to start slowly and actually MASTER (or at least start trying to master) one language. A jack of all trades is a master of none - and this is especially true in beginning programming. Just dive into one of the languages you 'know', I'd suggest Python due to its general user-friendliness and diverse supporting libraries. Just keep learning and eventually you'll be able to do almost anything!
I would like to give a simple, non-opinion based answer. A programming language serves two purposes:
"it provides a vehicle for the programmer to specify actions to be executed,
it provides a set of concepts for the programmer to use when thinking about what can be done."
(Bjarne Stroustrup: "C++ programming language, 1.3.2.)
Your problem is not simple at all - clap detection is not a trivial thing to do: it involves real-time detection of a time characteristic, spectral characteristic and possibly a visual gesture (not to be confused with a similar sound from a different source). Take into account that a clap from the same person in different spaces also sounds differently. Take into account possible dynamic variations.
Only by learning languages in depth you'll be able to get familiar with language specific concepts for the programmer to use when thinking about what can be done, as well as with specifying actions to be executed for any particular language.
Also, when dealing with sound, you need a basic knowledge of acoustics.
As a rule of thumb, almost all serious real-time audio processing code is written in languages which are mature, small and can make fast runtime executables.

I want to do a project on sound programming, but I don't know where to start

At my high school we can take a class where we basically learn about a subject on our own for a semester. I was thinking that I want to learn about "sound programming," but I realized that I have no idea what that entails. I'm interested in learning about, for example, how a synthesizer works, how I could write a VSTi, and how sound works in computer science. Is this a feasible subject? Are there any good tutorials out there for somebody completely new to this? Any tips or suggestions would be greatly appreciated.
Edit: This is the sort of thing that I'm interested in.
VST plugins are normally written with C++. But it's possible to use other languages as well. Building a VST plugin with C++ is quite an involved project. Without pre-existing experience it's probably too much for a school project. Additionally you'll probably spend as much or more time implementing the VST part and GUI as you will actual sound programming.
However there are a other ways to create a VST plugin and still get your hands dirty writing code.
SynthEdit is a modular environment for creating synthesizers and effects. Modules such as oscillators, envelopes etc are connected visually with wires. Patches can be exported as VST plugins. SynthEdit allows additional modules to be programmed with C++.
SynthMaker is another option similar to SynthEdit. It features a code module which allows you write DSP code without the difficultly of compiling modules in another language.
The advantage of using SynthEdit or SynthMaker in your situation is that you can focus your programming efforts on a particular area, such as creating a filter or oscillator module. SynthEdit/SynthMaker can then handle the other areas (GUI, voice logic, etc).
Using SynthEdit or SynthMaker will also allow you to prototype ideas quicker. So you will have more time to experiment with different synthesizer or effect architectures before settling on something to complete for your school project.
DSP theory can be quite involved and maths heavy but that alone shouldn't put you off. Depending on what you want to do, a basic understanding of digital audio principles and algebra level maths may be enough to take you a surprising long way.
You might try looking for resources on DSP (Digital Signal Processing) and/or Audio Signal Processing. The programming itself (unless you're looking for an existing audio library) will likely be more math intensive than programming intensive, so it might be a good fit for a query at math.stackexchange.com.
There's a very flexible and powerful audio application called Plogue Bidule. You could use it to learn about audio processing and synthesis, by creating your own 'bidules' or groups using low-level math and logic building blocks. There's an existing user community, and I've had a hard time finding a limit to what it can do. You're not going to be doing any code with this tool, but it's great for performance and learning about audio processing and synthesis fundamentals.

How to improve programming knowledge, and how to test the current state of it?

Hey guys, I'm very excited about how experienced I am in programming.
The first, working program that I have written, was in 2004 with C. Since this I have tried many programming languages, now got stuck with php. Currently I'm working as a web-developer, and everyones pleased with the work I do. Except me :) Thats the reason why i want to know, how high my experience and my knowledge is.
Could you tell me, some tips, tricks, test, or anything, on what I can see how much I need to learn and practice to get a mastermind in programming? (at first place in php)
I'm also a programmer who doesn't like to stagnate, so perhaps I can offer a few tips:
1) What's your weakest area? Networking? Graphics? Regex? What is the one area that if someone asked you "I need a program that can do X" and that X scares you what is it. Now study as much as you can on that subject. Hack out a few prototypes and make it so that you understand it allot better. I used to hate Regex commands, now I use them whenever I can.
2) Study "different" languages. I'd recommend learning a "functional" language such as Erlang, Lisp, or perhaps certain aspects of Python. Get a book on "functional programming" and read it through, and then think how you can apply these concepts to your current work. Start using map() and filter() in python instead of for loops, etc.
3) If you're doing web programming, get yourself a massive set of data and start doing some number crunching. A while back I was playing EVE Online, so I fired up SQL Server Express and hacked out some market analysis routines in it. It was around 4 GB of data the server crunched through, but I learned allot about SQL Server in the mean time.
I recently was watching a lecture on Lisp and the Professor said: "Computer Science is not about computers and not about science. It's about knowledge, and how to manipulate that knowledge to obtain more knowledge" So true, so the more tools you have for manipulating and gaining knowledge, the better programmer you'll be.
Start a new programming project and take your time to make every single aspect of it as good as possible.
Use git or Mercurial for source control. Use submodules (or whatever the Mercurial equivalent is) to manage external frameworks. Set up post-commit hooks to run your unit tests and zip up your executable. Use new branches for everything and do octopus-merges to get them all back into a single branch.
Script everything you do. Deploying a new version of your app (including website updates!) should be as simple as running a single script.
Make your app 100% localized. Deploying in a new language should be as easy as sending a strings file out to a volunteer to get translated, then popping that translated file into your source code, no additional work needed.
Optimize, optimize, optimize. Spend the extra week to make your app load 100ms faster.
Refactor, refactor, refactor. Don't just go for orthogonality and abstraction, aim for pure code beauty. Using your classes should be like using Duplo blocks, they just snap into place with not an error in sight.
Unit test everything. 100% coverage. Don't let a single regression go unannounced. Automate the entire test suite so that you can't promote your code without all the tests passing.
Put your app in the cloud. If you're writing something for the desktop or a mobile device, give your users a way to sync their data to a website. Write that website. If your project is web-based, give your users a mobile or desktop front-end to access their accounts.
Accessibility. Handicapped users should be thrilled with the care you put into designing your app.
Keep in mind that if you do everything I listed here, you'll never ship, but you'll be a well-rounded a developer, an asset to most any team.

Prerequisite for learning directx

I am from .net C# background and I want to learn DirectX. I have knowledge of C++ but I am fairly new to graphic world.
I am little confused about how to start learning directx, should I start learning direct directly or buy a basic graphic book like hern and baker and then jump to directx.
Which is the recommended book for learning basic graphic concepts, is it hern and baker? Is there any directx book which will cover graphic concepts as well?
I think that keeping a basic graphics book is allways good, because i can use it as reference anytime
Any suggestions from experts here?
You say that you have a C# background so I am going to assume you are more comfortable with C# then C++. Also, you say that you have knowledge of C++ so I will assume that you already have an understanding of memory management.
If you just want to learn and become more comfortable with the graphics pipeline you should check out SlimDX and XNA. They both allow you to use DirectX without having to dive into C/C++.
As for whether to learn the theory or API first I don't think you should do either one first. It makes sense to learn them asynchronously. Pick up a book on the theory but mess around with an API at the same time.
I highly recommend XNA. People commonly say that you should stick with C++ if you want to develop games but I strongly disagree. XNA will allow you to learn more high level game concepts in less time than if you use C++ and DirectX alone. You will be able to focus on learning why you are doing something rather than how to manage the memory. If in the future you decide that game development is a serious passion then by all means C++ is the way to go. You will find that XNA's graphics pipeline closely mirrors DirectX 9 and wont have much trouble moving to C++.
Also, DirectX 9 should be good enough for any beginner and it will give you a better understanding of how and why things have changed in 10 and 11. However, if you really want bleeding edge technologies you can try out SlimDX which is a C# wrapper for DirectX.
With all this said, XNA offers many easy to understand samples that you can start playing with on their educational catalog page. Also, check out ziggyware (great collection of xna tutorials).
Also, there are many blogs you can check out. A lot of them have excellent tutorials on them. Here are some off the top of my head:
Reimer Grootjans
Shawn Hargreaves
Richard Dodsworth
Renaud Bédard
Nick Gravelyn
Finally, here are 2 graphics books that I highly recommend (they are pretty complex and will last you a long time):
Fundamentals of Computer
Graphics
Real-Time Rendering
They are not directly related to DirectX, but rather they cover the theory every graphics developer should know. (from linear algebra to texture mapping to volumetrix rendering...)
Well I have to disagree with the C# option. If you don't have a deadline to finish the game, then I recommend using the language that teach you most. Working with 3d graphics is A LOT about management so if you are avoding it you are not actually learning but just using it, ie. you not only have to manage memory but the actual render calls you make and the device state changes, a lot of things that you will never know by avoding lower level, and which applies for other APIs too such as OpenGL or for other kind of devices. I think the best way of knowing how the api works is by using the api, instead of a bunch of helper libraries. You can use the helper libraries when you really need it instead (which you can find in their C++ version anyway).
In the DX SDK you can also find the Sample Browser with some sample applications with their documentation and you have the DirectX Utility Toolkit which contains a framework and libraries to make a DirectX app without having to worry much about the nasty device things such as enumeration and config. It also comes with a GUI system and a settings dialog for the device config. I doubt you can find those in C# and they are very good if you want to start with DX.
Some resources that helped me when I started were
the zophusX tutorials
and a book called "Introduction to 3D Game Programming with DirectX 9.0c", by Frank D. Luna (there is the DX10 version now)
and probably the book 3d Game Engine Programming by Stephan Zerbst also helped me to understand some things about how to work better with the apis. Though you may have to buy them in order to read them. They are helpful to start with both some theory and using the API at the same time.
I think if your target is to learn how to make a game then you can use any language/library you want you don't even need to know a programming language :) but if your target is learning DirectX and graphics APIs you should definitively start with the C++ api which is the "actual" DX.
If you have a bit of extra money, I was very impressed with the DirectX graphics courses from http://www.gameinstitute.com. The textbook they provide was very good as far as the other DirectX books I've seen are concerned. The first module DirectX Graphics I starts off with a bit of a math review and some 3D fundamentals before diving into setting up and using DirectX. By the end of the first module you will have built a textured terrain renderer and an indoor scene.
Overall the courses are not that expensive when you consider how much books on the subject cost. I would definitely recommend checking it out!

Crystalspace vs. Irrlicht vs. .....?

So, I use Linux, and I've been trying to find the time to get into game programming. I started out with Panda3d and had some pretty decent results and got a feel for many of the concepts in game programming. Not too long after that, I decided to step it up a notch and go to something more powerful and C or C++ based.
I'm probably just really dumb, but I could never really figure out how to use Crystalspace correctly. If somebody has any useful resources on how to use it, I would appreciate that. But in the meantime, I was messing around with Irrlicht and I like it, but I would like to know what more knowledgable people have to say about the subject. And maybe theres another awesome option out there I don't know about.
If you ask me, Irrlich is the best open source engine - it has clear architecture, good performance and requires lesser code to be written by programmer. I can not honestly compare Irrlicht with Crystal Space or Orge. I consider CS as mess of code, written by many different programmers in different manners - I am hard to imagine how to use it too (due to absolute lack of documentation). As for Ogre, it is not easier than D3D. I've examined different samples and fount plenty multyline fragments of code that are done with a single line in D3D. So, I simply can not see a reason, why to spent months learning OGRE's terrible API - if one has free time, I would advice to learn D3D itself.
I can say even more - Irrlicht is better, than many commercial engines, for example - Torque (absolute lack of documentation, forces to start project over existing one etc.), Truevision etc. Of course, Irrlicht lacks some great features, AAA grade engines must have, but it is quite sufficient for smaller projects.
If you have not BIG money to acquire Gamebryo and similar grades engine, I would advice to stick with Irrlicht - for first several projects at least.
I've spent some time working in the game industry. I'm also a Linux guy. I used Irrlicht to make a couple games, and used those as part of my resume, which helped get me get a job as a game programmer.
Irrlicht has a cleaner API, lower system requirements and works better across platforms than Ogre, in my opinion. I've had a blast making games with Irrlicht. It's also fairly lightweight (much lighter than Ogre), with a very open license for any use, commercial or otherwise.
Working with that engine did a lot to prepare me for working within the commercial game industry.
Ogre3D
http://www.ogre3d.org/
Is typically named together with crystalspace and irrlicht.
Ogre and Irrlicht both are said to have a cleaner design than crystalspace so I wouldn't worry to much about problems with the latter.
If you're looking for productive game development, then my best bet would be to use Unity 3D. I started off by using Irrlicht but quickly backed out because of non intuitive tools and a lot of stress on programming. Ogre seemed to be even more complex.
Unity on the other hand is rapidly gaining grounds with each release. The recent Unity 4 is packed with a ton of features. With very little game dev knowledge, I've managed to write my own flight sim engine in Unity Android. Even learned to write shaders easily.
Though advanced Unity licenses are paid, but they are well worth it. But you can always use Unity free edition to make commercial PC games. In all, game development is all about getting the hang of a game engine. Master any, and you will rule.

Resources