Tilengine step-by-step? - Printable Version +- Tilengine - The 2D retro graphics engine forum (http://tilengine.org/forum) +-- Forum: English forums (http://tilengine.org/forum/forumdisplay.php?fid=3) +--- Forum: Support (http://tilengine.org/forum/forumdisplay.php?fid=7) +--- Thread: Tilengine step-by-step? (/showthread.php?tid=533) Pages:
1
2
|
RE: Tilengine step-by-step? - megamarc - 08-31-2020 C language is still prevalent nowadays because it's the "lingua franca" of programming languages. It can target everything, from tiny microcontrollers with few kilobytes of memory, to huge supercomputers. It's the systems language in which foundational core components are written: operating systems, device drivers, graphics libraries, protocol stacks, virtual machines and interpreters of other languages... Everything can be built in C, however it's not the right tool for everything. It doesn't get in the middle, so you need to be really careful about what you're doing. It's easy to break things messing with pointers, buffer overflows and mismatching data types. It's a powerful yet dangerous tool, as you have a gun that can shoot your own feet. Yes' there's C++ too, but its implementation of OOP is quite cumbersome, and being unmanaged makes it vulnerable to the same problems as plain C. "Modern" languages have appeared that are more suitable for end application development, that hide system complexities managing them themselves and avoiding entirely these kind of dangers. I say "modern" because they-re not so new: Python is nearly 30 years old, Java is about 25. But they haven't replaced C because these languages aren't suitable to create system components. Their runtimes require an underlying OS, a virtual machine, a JIT compiler... They require big infrastructure programmed in C, and were created for a different task: end applications. Programming paradigm is not the problem. C is a procedural and modular language. It provides mechanisms to create independent and reusable components, with good separation of external interface and internal implementation. You can create unstructured spaghetti code in pure OOP languages, too. OOP is well suited to model a wide range of problems, but it's not the right tool for everything, either. OOP can be abused to create endless chains of inheritance and method overwriting that are hard to follow and easy to break, especially when you're trying to "force" a solution to fit inside a OOP paradigm when the real-world problem doesn't. However, we're here talking about building games, and games are a field very well suited to OOP. You have lists of "entities" with common attributes, that then specialize in more specific types of entities (subclasses). Games can be programmed without OOP support (and traditionally have been), but you end modelling something that resembles the kind of subclassed objects that OOP natively provide. That's why the main Tilengine library is built in pure C (portable system component accessible from many high level languages) but bindings for application languages (Python and C#) are already modelled in OOP. RE: Tilengine step-by-step? - Richard Kain - 09-02-2020 (08-31-2020, 08:46 PM)megamarc Wrote: Programming paradigm is not the problem. C is a procedural and modular language. It provides mechanisms to create independent and reusable components, with good separation of external interface and internal implementation. You can create unstructured spaghetti code in pure OOP languages, too. OOP is well suited to model a wide range of problems, but it's not the right tool for everything, either. Yes, you are correct. It is important not to think of different approaches to programming as being some kind of magic bullet. One of the lessons experienced programmers learn is that there is never one right way to approach a problem. Every approach has different pros and cons, and which one you choose depends on personal experience, preference, and the circumstances and context of the problem itself. Different paradigms are just tools to be leveraged in addressing those problems. The more tools you have, the more options are available to you. All of this comes with experience and practice. C's procedural nature and modular abilities make it extremely fundamental as far as programming is concerned. Procedural code is the basis of all modern programming, and it MUST be learned. No matter what other methodologies you employ, your program will have SOME procedural code in it at some point. Getting decent at procedural code is programming 101, and everyone ought to strive to understand it. And as you point out, the fundamental nature of libraries like Tilengine is part of what makes them so flexible and modular. They can be compiled and run on just about anything, without worrying about external dependencies. They can be referenced and re-used in other projects, without forcing the developer to adhere to one particular approach to coding. Sadly, a lot of modern tutorials don't go into how to reference other libraries, or how to wrap your head around different approaches. Some decent tutorials on how Tilengine works would be a good thing to labor at. But it would also be helpful to have a few tutorials that detail some of the fundamentals of game engines using modern programming structure, and how Tilengine could effectively be tied into those. RE: Tilengine step-by-step? - RootBeerKing - 09-19-2020 (09-02-2020, 02:44 AM)Richard Kain Wrote: And as you point out, the fundamental nature of libraries like Tilengine is part of what makes them so flexible and modular. They can be compiled and run on just about anything, without worrying about external dependencies. They can be referenced and re-used in other projects, without forcing the developer to adhere to one particular approach to coding. Yes, that's what I'm discovering the more things finally click into place in my mind. Programming is a lot like building blocks, once you know all the pieces you can build with it becomes easier to build what you need from your mind. Again, I will say I would love more tutorials, it sounds like you have some great ideas for some, I look forward to reading them if you get around to writing them. Cheers! RE: Tilengine step-by-step? - megamarc - 09-19-2020 Yes you're right. As a kid my favourite activities were construction games -like LEGO- and drawing. When I discovered programming, it instantly felt like building in a canvas, that was magical. I'm glad you're enjoying the process right now |