Even though Python is designed to be user friendly (which i still doubt), its syntax is very different than C++ or Java. Therefor i would suggest you to go on either C# or Java, then move on to C++.
Both C# and Java are taking care of alot of programming aspect for you already, so you can skip things and keep learning, and when you feel ready, you can start learning C++ and learn all those "dark corners" as mhagain has mentioned.
Java syntax is also very different from C++. C# is a lot closer. But I don't think there's a problem anyway. If you're going to C++ from a managed language, you're going to have to relearn a lot anyway, so a different syntax doesn't make things any harder. And it might even be an advantage because it stops you from trying to just do the same things, which is usualy a bad idea. (Ever seen Java coders write C++ which is full of void pointers and pointless dynamic allocations everywhere)?
If you know regular expression and a decent script, such as Perl or Python, or you are a master of Unix commands, it's easy to change all headers to remove "boost/". Or if you only use several boost headers, how about change them manually, just spending half an hour?
I actually tried writing a Python script to fix all the include paths. It's harder than it sounds because they use macros to define some of the includes, and filenames of headers also appear in the comments. However, I managed it eventually.
For a standard vector, random access erasures are linear time, due to shifting all the elements. However, sometimes you don't care about ordering, so you instead want to do a constant time erasure by swapping with the final element and then removing it. Is there any standard implementation of this? It seems like a common task, but I couldn't find anything by googling.
Here's a brief summary of the current implementation
Dodging: For this part, the other player is completely ignored.
The ai projects the trajectories of everything into the future and essentially does a tree search of possible actions to minimize future damage. Obviously a full search has exponential complexity, so it uses the heuristic of using the same input for many consecutive frames, so that it only branches occasionally. It searches 123 frames into the future but it only branches 3 times. To make it easier, I also set it to completely ignore bullets and mines after 25 frames of depth. The rest of the search tree is only to avoid the moon.
Aiming: Calculate whether firing a bullet would cause it to hit if the other player does nothing. If so fire. A small error amount is added to the collision detection so that it sometimes has a close miss.
The main requirement of the dodging is that I want to make it so that the ai virtually never crashes into the moon. It looks really stupid and gives the player an instant unearned victory. This is why it searches far into the future for moon collisions even though it ignores bullets and mines after the first few frames.
I made an approximate clone of Space Duel. Each player controls a little spaceship which orbits around the moon and can shoot bullets or lay mines. Trajectories follow the inverse square gravity from the moon and wrap around the sides of the screen. Collision with the moon or another player is instant death.
Anyway, I have had a lot of difficulty making a fun AI opponent. I want something that is very challenging, but which can be mastered with a little practice. I want an opponent that doesn't fall for cheap tricks but is beatable normally. The problem is that no matter what I try, I can't manage it. I've figured out how to make a near unbeatable AI, but not how to make a fun one. Even when I try weakening it, it doesn't really work.
The main advantage of the AI is the ability to calculate exact trajectories into the future. I've intentionally simulated some uncertainty in the aiming calculations so the AI will sometimes shoot a close miss. However this isn't enough.
I don't have much experience in Java (I've mostly done C++). However, whenever I try it, it seems very awkward to program in. A lot of common features like operator overloading and first class functions are missing, so it seems to require unnecessarily complicated constructs and boilerplate code to accomplish simple tasks. This isn't a necessary difference with high level languages either. I've done a little C# and Python programming, and they are much nicer to work with.
But Java is a commonly used language. So I feel I'm missing something. Perhaps due to my unfamiliarity with the language, I don't understand all the tricks and idioms that people use in Java to make programming easier. So the question is, how do people stand Java?
I'm also making some games for fun. I started with C++ and have made several games, including one that I've been working on for almost two years. I haven't made any games in Python, but I do find it useful for automating other tasks involved in game development. For example, I wrote a script which takes in a description of a level and automatically generates the background image and collision data, which I can then put into my C++ game.
Python is really useful when you want to code stuff quickly and the task isn't performance intensive. I've heard there are ways to improve it, like Psyco or adding C modules, but I think these are way beyond the scope of a beginner. I haven't managed to do either of those successfully yet.
1. Some compilers require that no variables are null.
Too True! Some compilers will actually, if you leave a variable null, grab whatever randomness is/was in that memory space and assign that value to your variable (if you attempt an operation with that variable unassigned).
So, for example, if I have three variables, call them FirstNumber, SecondNumber, and Thirdnumber, and I don't initialize them, then I get some user input and assign that to FirstNumber, and do Thirdnumber = FirstNumber*SecondNumber ...... ThirdNumber is gonna be something totally random, because SecondNumber was never declared and is now whatever random garbage was in that memory space. Added bonus, I'll have zero errors and zero warnings. In a big block of code it could be a pain in the keister trying to figure out why (maybe not so much why, as where) I keep getting random answers when nothing is wrong. Granted, having something like that happen means you goofed big time, but maybe that was the moment you started thinking about a ham sandwich.
It's not just SecondNumber which is an unknown state. If you invoke undefined behavior, then literally anything could happen. While compilers don't intentionally mess things up, compiler optimizations can spread the errors around. For example, I read about one case in which an unexpected interaction between two different GCC optimizations caused a signed overflow to result in an infinite loop in a seemingly unrelated loop.
I guess you've all seen c++ apps that display an error along with the line of code that causes it. It's usually used in games, but other apps use it, too. I heard that this can be implemented using macros, but I can't seem to find any resource on the interwebs. Anyone has any ideas how this is implemented?
are you talking about assertion failed errors ?
those are caused by the assert macro (which basically takes an expression, if it evaluates to true nothing happens, if it evaluates the false the program displays an error and exits) , normally those aren't used in release builds though. (most assert macros are written so that they'll be automatically stripped out unless its a debug build)
For a large commerical game that is performance intensive maybe. But often times it is helpful to leave asserts in the release build. I've had cases where I could fix bugs because users reported an assertion failure. Without asserts it would be significantly harder, if at all possible to locate such bugs. I'd say when in doubt, leave them in.