Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - XxSpeedDemonxXx

Pages: [1]
1
SFML projects / Re: CosmoScroll - space shooter game
« on: April 05, 2013, 03:06:34 am »
Thanks for the kind words! The source code could be greatly however (conception mistakes, too many singletons, half of the documentation is written in French...).
It's been a while since last release, but I'm still working on it time to time (migration from SFML 1.6 to 2.0 was a big change).

You're welcome, and yeah, but the rest of the code was pretty good. Hope to see a new release soon!

2
General / Re: [CMake, MSVC, win8] Application crashes when it starts
« on: April 03, 2013, 11:46:20 pm »
Honestly, if you really want to learn good efficient C++ and learn on game development, read "Bjarne Stroustrup The C++ Programming Language", "Accelerated C++ 2000", "Effective C++; More Effective C++", and for game development: "Core Techniques and Algorithms in Game Programming".

3
General / Re: [CMake, MSVC, win8] Application crashes when it starts
« on: April 03, 2013, 12:45:33 pm »
Quote
Doom 3 was written in the 2000's, C++ has evolved a lot since then. I don't only mean C++11, rather "modern C++" in general, as taught by Meyers, Sutter, and so on. One recognition was that "pure" OOP, like Java used it all the time, was too limited on its own. Alternative abstraction techniques, most notably templates, became interesting, and people began to combine different approaches. For example, the STL is extremely flexible, although the container classes don't use inheritance. Or std::function is the perfect example of type erasure, a combination of static and dynamic polymorphism. It is much more powerful than the pure OOP equivalents (observer/command pattern).

That is true, but you should consider looking at the following link: http://kotaku.com/5975610/the-exceptional-beauty-of-doom-3s-source-code

It's more than just the code itself, it's the organization of it. The placement of braces, spacing, etc. Also, John Carmack's comment:
Quote
"In some ways, I still think the Quake 3 code is cleaner, as a final evolution of my C style, rather than the first iteration of my C++ style, but it may be more of a factor of the smaller total line count, or the fact that I haven’t really looked at it in a decade. I do think “good C++” is better than “good C” from a readability standpoint, all other things being equal.

I sort of meandered into C++ with Doom 3 – I was an experienced C programmer with OOP background from NeXT’s Objective-C, so I just started writing C++ without any proper study of usage and idiom. In retrospect, I very much wish I had read Effective C++ and some other material. A couple of the other programmers had prior C++ experience, but they mostly followed the stylistic choices I set.

I mistrusted templates for many years, and still use them with restraint, but I eventually decided I liked strong typing more than I disliked weird code in headers. The debate on STL is still ongoing here at Id, and gets a little spirited. Back when Doom 3 was started, using STL was almost certainly not a good call, but reasonable arguments can be made for it today, even in games.

I am a full const nazi nowadays, and I chide any programmer that doesn’t const every variable and parameter that can be.

The major evolution that is still going on for me is towards a more functional programming style, which involves unlearning a lot of old habits, and backing away from some OOP directions."

Just something to reflect on.

Also:
Quote
PS: Please, please, please don't put dots between acronyms, it's just not the way to go, i.e. S.F.M.L or O.O.P. or A.P.I., it's SFML, OOP and API - thanks!
I just feel like changing it up a bit, it's just more entertaining to me; not sure why to be honest, haha. I guess I'll quit doing that.

4
General / Re: Compiles with no errors, crashes right after.
« on: April 03, 2013, 09:46:24 am »
Quote
Thanks for all the help guys I guess I have a lot of reading to do.

Troubleshooting your own problems is a great thing to do; it will make you a better programmer.

5
General / Re: [CMake, MSVC, win8] Application crashes when it starts
« on: April 03, 2013, 09:43:21 am »
Quote
such a small, uncommented and not clean, regarding code design, example won't teach him much

Well, it's pretty straight forward and I honestly didn't think it would require comments. Considering that's a similar piece of code out of "Doom 3"'s source, I wouldn't call it "unclean", considering "Doom 3" had some of the cleanest, most efficient code ever written.

How does it fit in this topic? Containers for data, which was the main issue in the program he wrote. - Preventing the usage of global variables.

EDIT: Also, polymorphism is the base of object oriented programming, so saying:
Quote
it's a better code design to avoid polymorphism where ever possible
would be saying to avoid O.O.P., would it not?

Quote
or better said, use it only when really needed and not as general formula.
Doesn't that go for almost all techniques?

Programming is much more than polymorphism and debugging, but we are not talking about the definition of programming; we are talking about good programming structure and efficient, effective code. My example also showed pointer, abstract class, and inheritance usage. Not only that, but the usage of a class to store functions and variables in general.

6
General / Re: [CMake, MSVC, win8] Application crashes when it starts
« on: April 03, 2013, 12:23:45 am »
Quote
As I wrote previously, I'm still learning. I didn't know that global/static variables are so bad for good code design. I've written one module for global managing resources (based on static variables), so there's long way to go through for me  Thanks for advice!

Global variables are never a good thing. Use classes, data structures, and enums to hold your variables. Declare your variable inside a data container then define them in a function held inside a class. Also, use abstract classes. Here's an example:

// Class.h //
class IDClass {
public:
    virtual void function(void) = 0;
    virtual void function2(void) = 0;
};
extern IDclass* idclass;

// Class.cpp //
class IDClassLocal : public IDClass {
public:
    virtual void function(void);
    virtual void function2(void);
private:
    int integer;
    bool boolean;
};
IDClassLocal idclassLocal;
IDClass* idclass = &idclassLocal;

void IDClassLocal::function(void) {
    integer = 5;
    boolean = (false);
}
void IDClassLocal::function2(void) {
    integer = 2;
    boolean = (true);
}

// main.cpp //
int main() {
    idclass->function(void); // integer = 5, boolean = (false)
    // Other code
    idclass->function2(void) // integer = 2, boolean = (true)
}
 

The following shows the abstract class being declared in a header, then being inherited and defined in the cpp. This is polymorphism at it's best. Using this style will get rid of a lot of issues. If you have an issue you can't seem to solve, run your program in debug mode under a debugger; doing this, you should be able to find the cause.

7
General / Re: Compiles with no errors, crashes right after.
« on: April 02, 2013, 11:39:38 am »
Run your program in debug mode under a debugger in order to fix this issue. "ntdll.dll" is not crashing your program.

8
SFML projects / Re: CosmoScroll - space shooter game
« on: April 02, 2013, 11:03:13 am »
Great game. I enjoyed the mechanics of it, and I looked through the source code; it looked clean and efficient. I'll be honest, I don't use S.F.M.L.; I have, but I prefer using DirectX for rendering and the Windows A.P.I., but, it's interesting to see new projects from different libraries; especially games. This game you've created actually kept me going on a project I've been working on called "XeroSpace". I was about to give up on it and figured it was a waste of time, but then your game kept me going. Keep it up, the gaming community needs more stuff like this.

Pages: [1]