Jump to content

  • Log In with Google      Sign In   
  • Create Account

Vodahmin

Member Since 03 Aug 2012
Offline Last Active Dec 15 2012 09:32 AM

Posts I've Made

In Topic: Game Engine from scratch using C++ and python - Where do I start?

07 October 2012 - 05:41 AM

In either case, I think that "typdefing a pointer to save a few keystrokes" is fundamentally wrong. Unless you have really good architectural reasons for doing that, you should find a better text editor that can automate those "too long to type" situations.

It's a matter of aesthetics. The code is also more readable, which can save you some time when debugging - that's what typedef was made for.

In Topic: Game Engine from scratch using C++ and python - Where do I start?

07 October 2012 - 02:21 AM


Actually, typedef'ing pointers is common in game industry, smart pointers that is.


I would still argue against it: It's something that carries certain benefits, I'm sure, but it makes code more difficult to read, because now I have to look for what opaqueDataType actually represents.

If I just have SDL_Surface*, it's immediately clear.

I think it's only a matter of getting used to it. There is no apparent reason for typedefing SDL_Surface* but if your pointer declaration looks like "shared_ptr<SDL_Surface>" or something longer, then it can be a bit frustrating to rewrite it every time, so why not just typedefing it to "SDL_Surface"? Then, as a matter of good practice, you can add a "p" before the pointer declaration (for example "pSurface"), so there is really little room for mistake.

In Topic: Organizing Assets

06 October 2012 - 12:01 PM

I think the more efficient approach would be to create a global package for all common assets (such as UI, background music, common texture/models etc.) and then unique packages for each level (such as cinematics and level-related actors, textures and sounds). The level-related packages could also contain AI scripts and level-related configs.

If you're planning to make your own memory-pool, you'll find this design to be quite straight-forward. After each level, you unload the entire package and load a new one, while still keeping all the common files in the memory.

In Topic: Programming Tutorial

06 October 2012 - 11:36 AM

If you haven't decided on the languages yet. I'd also recommend Python and C# for the starters. If you're planning to take a university course in the near future, you may expect that they will teach you Java (hopefully - some schools start from C - which is a great language but not the easiest to master).

As for the complete guide for beginners, I'd highly recommend this book. I used it myself to learn Python and I must say, that the book is well organized and straight to the point.

In Topic: Game Engine from scratch using C++ and python - Where do I start?

06 October 2012 - 01:00 AM

By the way: You should never, ever typedef a pointer. That's an unnecessary level of indirection, and it's something that has no place in your example, because you're not even using it anywhere.

Actually, typedef'ing pointers is common in game industry, smart pointers that is.

PARTNERS