What are some great books for beginning game programming? - graphics

I've been programming for a little over 2 years now, and I want to get started with graphics programming and make some simple games to start with. A lot of the books I've looked at for learning directx assume you know the basics of it, which I don't, or that they'll just give you some snippets and assume you'll be able to digest their cryptic code without an explanation. So what are some good books for somebody that is truly new to graphics programming but has a some knowledge with general programming?

Hands down, the best 'graphics programming' book I have ever seen is "An Introduction to 3D Game Programming with DirectX 9.0c: A Shader Approach" by Frank Luna. It starts from the ground up with a linear algebra primer (absolutely critical), then explains how the 3D pipeline works (model, world, camera, ndc, view) and how to deal with the programming nightmare that is Directx ;)
It also covers some advanced techniques, suchs as reflections and refractions etc, but once you've gotten the essentials down (the first 8 chapters) you can basically write anything you want in directx and the rest of your graphics programming time will be spent reading books like the "Shader X" series by Wolfgang Engel, (Shader X7 is particularly good), GPU Pro (same author), and Nvidia's GPU Gems, which they have on their website for free: Gpu Gems.

Android NDK Game Development Cookbook http://www.amazon.com/Android-NDK-Game-Development-Cookbook/dp/1782167781 has pretty few things to do with Android NDK. However, it focuses on implementing a portable game engine from scratch in C++, regardless of the platform. Its topics mainly include low level things like filesystem, networking, audio and so on.

Related

Do computers still use the Z80 CPU?

I have seen that some people are asking questions about assembly programming using the Z80 CPU. I used it years ago. It it still being used in new pieces of hardware or is it totally obsolete?
Yes, the TI-84+/TI-83+ line of graphing calculators (besides the CE, which uses the faster eZ80 processor) use it: https://en.wikipedia.org/wiki/TI-84_Plus_series
Zilog still appears to sell the Z-80 though it does look like they're mostly selling the eZ80 in that line which is compatible but much improved.
Hobbyists still use it and there is even a kickstarter for building a ZX Spectrum clone: https://www.kickstarter.com/projects/1835143999/zx-spectrum-next However, they don't technically use the Z-80 but a 100% programming compatible clone using an FPGA. Certainly that's still a Z-80 as far as the programmer is concerned.
I was curious about this myself so I looked around a bit. The most extensive list I could find was from Wikipedia: https://en.wikipedia.org/wiki/Zilog_Z80#Embedded_systems_and_consumer_electronics
Here are the more modern pieces of equipment from the list:
Gasoline dispenser flow-rate controllers. US Patents 4930665 (1988), 4962462 (1983), 5602745 (1995). I would bet many of these are still in use today.
Breathalyzers (2008)
Looking through Google Patents I found these (after 2000):
Set-top box (2001)
Energy-saving cooking stove (2010)
Currency counting system (2013)
"Digital language learning machine" (2003)
Pinball Game Machine (2011)
Pachinko machine (2014)
Slot machine (2014)
Game machine processor (2019)
Many of these are low-cost Chinese embedded devices or Japanese arcade machines.
There is hobbyists project of ZX Spectrum clone that uses Z80 exactly http://nedopc.com/zxevo/zxevo_eng.php
This computer is still in production as well as several extension devices for it.

Ex Commodore 64 programmer wants to get back into programming- any suggestions?

When I was a kid I wrote hundreds of programs in BASIC but then as I got older I got out of it (when I discovered girls). Now I want to get back into it again and I don't want to let my prior knowledge & experience go to waste - is there a modern language that is at least somewhat similar? Every time I try to search I get pushed toward Visual BASIC but I would rather learn a modern language that's more widely used. Any suggestions? Thank you in advance!
Start from scratch.
Programming in a modern language (Object or Functional) is different enough from programming basic on a C64 that you will probably carry over more bad habits than good ones.
I would pick a language you like the look and feel of, but mostly think of what you want to do:
Java is probably the "safe" bet, especially if you want to start a career in programming or if you want to work on Android development.
If you want to program for Windows / Microsoft devices then C#
If you want to want to write for the Mac or iOs devices then Swift.
If you like the idea of functional programming then Clojure is a good bet.
If you want to do web development then Javascript and maybe Ruby
If you want to work on things like machine learning or statistics then Python to start and then maybe R
If you want to be cutting edge and maybe work on some DevOps kind of things I would suggest Go
With all of these I would suggest also learning some flavor of SQL
Languages I personally would generally avoid either because they are overly complex or tend to teach bad programming practices:
Objective C, C++, Perl, Lisp, Ruby
If you want to explore some other more esoteric languages I recommend two books:
Seven Languages in Seven Weeks
Seven More Languages in Seven Weeks
Keep in mind, that just because you might start from scratch it doesn't mean your prior experience goes to waste, it just may not be as useful as you may like.
I was in this exact position about eight years ago; whilst I could do some assembly and BASIC, these skills were (and are) generally not required in a modern context. So I went to study a Foundation Degree in Enterprise Computing in the UK (MMU affiliated) because this had Java. Due to a Government change in 2010, that cut funding to Higher Education, the 3rd year of that course was scrapped for all affiliated establishments, so I spent a year at the University of Derby on its Games Programming degree, which was all programming in C, C++, MIPs assembly, C# and Java.
I found the following useful:
6502 is good if you want to learn more modern assembly like MIPs; Z80 is probably good for x86/64, though that is an educated guess rather than fact (I use both 65x and Z80 in personal projects today mixed with C when I get the chance);
C is the most beautiful language that I've ever used. I did C programming on Windows and for the PSP. I've since made Sinclair ZX81 games with C and done a bit of experimental programming for the Commodore 64 and Sinclair ZX Spectrum. I love C;
Object Orientated programming took me a while for me to get my head around. At first, I thought an object was simply a container for computer RAM. Maybe this is a good base to think about it, maybe not;
Going to University is a good thing because you will always learn something if you apply yourself;
8-bit BASIC can still teach you a thing or two if you can transpose your logic without bad practises that 8-bit BASIC encourages;
I had most difficulty understanding databases, mostly the relational algebra side but also all other database stuff. I finally got my head around M:M relationships sometime last year after years of looking at it. If you struggle with SQL/Database stuff, don't give up;
I now work at a PHP Web Application developer with bespoke OO and Procedural frameworks. I have also worked with simpler off-the-shelf solutions such as Magento, CodeIgniter, Joomla! and ExpressionEngine (built on CodeIgniter).

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!

What are some good resources for writing a chess engine? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm interested in writing a chess engine (mostly as a learning exercise) and would be interested in any resources that people know of that could be of interest or use, anything really: Papers, Books, Theory, Tutorials, anything that could be useful.
From my archives:
This is a useful chess programming wiki.
This is a simple introduction to chess programming.
This is a (free) book on chess algorithms.
This contains several easy step-by-step YouTube tutorial series' ranging from beginner to advanced level.
This is a more advanced introduction.
This is Adam Berent's interesting computer chess blog.
This is a good analysis of MTD(f), an interesting search algorithm.
This is a good guide to validation of move generation.
This is lots of good information on the Rebel chess engine.
This is lots of good information on the Dark Thought chess engine.
Good information and source code for the Monsoon chess engine.
These are more notes on chess programming.
A reasonable introduction to rotated bitboards.
A reasonable introduction to magic bitboards.
A reasonable introduction to late move reductions.
A look at null-move pruning.
A collection of position sets for testing purposes.
Here is an old report from 2 students who wrote a chess program.
A bunch of miscellaneous chess programming links.
Finally, here is Wikipedia's take on computer chess.
When creating my chess engine I spent months trying to collect good resources that describe some of the harder aspects of creating a chess game. Here is a list of the ones I found most useful:
Chess Programming by François Dominic Laramée
This is the article that got me into computer chess, It is a great overview of how computers play chess. It is extremely easy to read and it will introduce you to all the terms and keywords.
http://www.gamedev.net/page/resources/_/technical/artificial-intelligence/chess-programming-part-i-getting-started-r1014
Computer chess wiki, this has really expanded over the last few months. It is an excellent resource for reference material.
https://www.chessprogramming.org/Main_Page
Louis Kessler's Computer Chess Links
Once you go through the above resources the remainder can be found at the following links page.
http://www.lkessler.com/cclinks.shtml
Last but not least I write a Computer Chess Blog that takes you through all the steps of writing a chess engine in C# from scratch, it includes a computer chess links section and a chess game starter kit.
http://www.chessbin.com
Adam Berent
I have joined the same league of Paul Wicks(above), I too want to write a chess engine for my own learning sake's, only constraint is my day job(which is to work on boring web services and stuff..) but its worth the pain.
I decided to build it using layer-by-layer approach.
I'm almost through with the multi-player part i.e. (HUMAN vs HUMAN).
Once I'm done with this, I would love to incorporate the AI layer to support (COMPUTER vs HUMAN) playing scheme.This is the part that I'm most worried about, I have found very nice help tips here in this thread, a big thanks to all of you.
Currently the language that I'm well versed with is Java, in case there's a performance hit
then I might port it to C++.
This is basically in the field of Artificial Intelligence (AI).
The most common way to make a computer "think" in chess game is using the mini-max method where computer "think" by analyzing the results from making different moves ahead of time from the current state.
The "goodness" of results from different moves can be determine from many criteria such as score, number of enemies left, winning state, for example. For instance, if you move the player to the right and you win the game, that's a very good state. But if you move it to the left you get nothing. It is reasonable to move to the right. This function that define "goodness" is usually called Heuristic Function.
This process is done recursively for many turns. The greater the number of turns, the more time you will need. And the greater the number of turns, the more intelligent your software is. Thinking ahead in only one turn may only result in greedy selection. Intelligent chess software has great heuristic function and think ahead in many turns.
ps. There are some details of mini-max algorithm I didn't explain here but this should cover the basic idea.

Computer Graphics: Raytracing and Programming 3D Renders

I've noticed that a number of top universities are offering courses where students are taught subjects relating to Computer Graphics for their CS majors. Sadly this is something not offered by my university and something I would really like to get into sometime in the next couple of years.
A couple of the projects I've found from some universities are great, although I'm mostly interested in two things:
Raytracing:
I want to write a Raytracer within the next two years. What do I need to know? I'm not a fantastic programmer yet (Java, C and Prolog are my main languages as of today) but I'm slowly learning every day. Also, my Math background isn't all that great, so any pointers on books to read or advice on writing such a program would be fantastic. I tend to pick these things up pretty quickly so feel free to chuck references at me.
Programming 3D Rendered Models
I've looked at a couple of projects where students have developed models and used them in games. I've made a couple of 2D games with raster images but have never worked with 3D models. What would I need to learn in regards to programming these models? If it helps I used to be okay with 3D Studio Max and Cinema4D (although every single course seems to use Maya), but haven't touched it in about four years.
Sorry for posting such vague and, let's be honest, stupid questions. It's just something I've wanted to do for a while and something that'd be good as a large project for me to develop in my own time.
Related Questions
Literature and Tutorials for Writing a Ray Tracer
I can recommend pbrt, it's a book and a physically-based renderer used to teach computer science graduates. The description of the maths used is nice and clear, and since it is written in the 'literate programming' you can see the appropriate code (in C++) too.
The book "Computer Graphics: Principles and Practice" (known in the Computer Graphics circles as the "Foley-VanDam") is the basic for most computer graphics courses, and it covers the topic of implementing a ray-tracer in much detail. It is quite dated, but it's still the best, afaik, and the basic principles remain the same.
I also second the recommendation for Eric Lengyel's Mathematics for 3D Game Programming and Computer Graphics. It's not as thorough, but it's a wonderful review of the math basics you need for 3D programming, it has very useful summaries at the end of each chapter, and it's written in an approachable, not too scary way.
In addition, you'll probably want some OpenGL or DirectX basics. It's easier to start working with a 3D API, then learn the underlying maths than the opposite (in my opinion), but both options are possible. Just look for OpenGL on SO and you should find a couple of good references as well.
The 2000 ICFP Programming Contest asked participants to build a ray tracer in three days. They have a good specification for a simple ray tracer, and you can get code for the winning entries and some other entries as well. There were entries in a large number of different programming languages. This might be a nice way for you to get started.
The briefest useful answer I can give is that most of the important algorithms can be found in Real-Time Rendering by Tomas Akenine-Möller, Eric Haines, and Naty Hoffman, and the bibliography at the end has references to the necessary maths. Their website has a recommended reading list as well.
The most useful math book I've read on the subject is Eric Lengyel's Mathematics for 3D Game Programming and Computer Graphics. The maths you need most are geometry (obviously) and linear algebra (for dealing with all the matrices).
I took such a class last year, and I believe that the class was wonderful for forcing students to learn the math behind the computer graphics - not just the commands for making a computer do what you want.
My professor has a site located here and it has his lecture notes and problem sets that you can take a look through.
Our final project was indeed a raytracer, but once you know the mathematics behind it, coding (an inefficient one) is trivial.
For a mathematical introduction into these topics, see
http://graphics.idav.ucdavis.edu/education/GraphicsNotes/homepage.html
Check http://www.scratchapixel.com/lessons/3d-basic-lessons/lesson-1-writing-a-simple-raytracer/
This is a very good place to learn about ray tracing and rendering in general.

Resources