Warning: Long text.
TL;DR: I think we need to have tutorials to fill the gap between basic functions and real use cases.
I think that my feel is like be drowned in too much information, there are many papers indeed, presentations, talks, GDC math/physical/rendering sessions. Humbly I think there is a gap here to be filled to enhance the transition from a non game developer to a game developer.
Or that someone say how to do it. It’s very different to say “This function does this” to: “If want to implement this feature use this function”.
The first approach puts on reader the weight to connect the ideas and uses, some of them are not clear when the reader is reading about that function.
A good and recent example was the International keyboard issue that we discussed previously. I had already read about both ways (Scancodes and Keycodes), but in time I was reading I didn’t saw the whole picture, maybe in a future I would face exactly that same problem and I would remember (or not) of the function.
The second approach is better (IMHO), since we start with a practical problem and a usage, in both methods you learn about the codes, but just on second one you get on a real use case, and real use cases are more suitable for learning and memory fixing.
I’m not saying that tutorials need to be complex, I think they are very good and help a lot newcomers. But as I said before there is a “documentation” gap between tutorials and real use, is often left (implicitly) to the reader.
It’s far different to
- lets create a character and move it around with gamepad/mouse.
- Lets create a way to handle game entities being controlled by configurable user input methods.
The complexity of code gets far bigger in the second option. In fact right now I’m trying to do exactly this. How should I map a user input with a in game event. How can I reconfigure a user input for a different in game event. How can I handle different user input methods, should I treat them differently? Should I add a layer?
For example I could not find any “tutorial” explaining how to do it (SDL or not).
IMHO There are levels. Many people have already written tutorial about basic drawings, primitives, basic game loop, drawing a few sprites. But I could not find SDL tutorials to fill gaps after that. Ok, we can handle 1, 2, 10 sprites, but how to manage association between a character and it’s animations? How to connect inputs to characters and animations, how to transition between states? Of course this is a far more complex thing than teach about topics isolated 1. Drawing sprites, 2. drawing animated sprites, 3. handling game input. 4. a simple Finite State Machine. The total complexity is larger than the sum of complexity of each parts.
Sure it is.
Indeed. Although I personally do not feel I fit the “non-programmer” profile, besides I’m not a C (not C++…) wizard, I can code using pointers very well (not by trial and error as many do), I can write my own structs, dynamic loading, pointers to functions, have even written my own C Poor Man’s Object Oriented approach using Vtables. I’m not good in C as I would like, I don’t know ASM and because of that I have problems to optimize code and debug very well (I will fix this in near future). I don’t know enough of C internals and implementations details to be able to write a complex multi architecture and multi plataform software (and I would like very much to learn that). Have completed with success (and a good grade), algorithms and data structure courses in graduation (implemented myself lists (all kinds), queues, trees, hash maps, search algorithms, path algorithms, computational geometry algorithms), also worked with numerical computation (differential and integral multi dimensional equations).
The problem is most of these issues are handled in a separately, I wrote an algorithms to find a path there, an search heuristic in another code, code to verify spatial positioning, but never together, never really caring about performance.
And when its come to game development is all about performance. I had started to write a entity lookup system using an ordered array, where the order is based in the object UUID that is a string. The struct was like
struct entity {
char uuid[37];
// .. other entity stuff
};
My available objects were stored in a array (for memory speed).
struct entity active_entities[MAX_NUMBER];
Adding new elements to array of course, would take some time, since I need to order the array. Because of that I created a delayed sorting, with that I’m able to just append new entities then sort them.
Of course to find a entity handle (its index position in array) I need to somehow find it using a search algorithms (binary search is a good one here since we have a ordered list based on UUID strings.
I was happy with that, then, watching some GDC video someone said: If you use string comparison you should be shot in head.
Then I got thinking, what to use? A hash map? But isn’t memory contiguous hence not cache friendly.
The problem is, I always get myself in that kind of dilemma, and never move forward.
(and here I’m not even discussing about Object orientation vs Data Orientation designs, that I’m far more inclined to the second one to avoid cache misses).
I have worked in software development (in scientific computation), there is no need to be a “coach” attitude, but in a working environment you often get in discussions like, how to approach to a problem, their experiences and methods, what worked best for each case.
In industry (not gaming industry) I often saw that junior employees has a bare minimum knowledge, and by minimum I say really minimum.
Finishing off, it’s hard to be a wannabe indie developer in game industry, there is a lot of things to learn, Engine development, Rendering Pipelines, Audio Processing, Physical Collision techniques, Code optimization, Usability and game feel, Game design. It’s being a hell of a trip, but I’m really enjoying.
Hope I can learn more from all of you, and sorry for my questions that often can seems like kind stupid sometimes.