Really odd game engine design idea
Jun. 13th, 2011 07:59 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
I never realized just how much knowing about different programming languages would affect my knowledge of other programming languages.
For instance: I learned C, Java and C++ before I attended university, where I learned more about them and programming in general.
While at university, I learned that the above languages were all the same type of language, namely, they're all Imperative languages, which means you give the processor a list of instructions that it executes pretty much directly.
I also learned about two more types of programming languages, such as Logic Programming, which is where you construct a solution to a problem and let the built-in logic solver solve the problem itself, without specifying the exact sequence of instructions, as well as Functional Programming, which is similar to Imperative Programming, without giving you any form of global state, which means that every function returns the exact same result when given the exact same parameters.
(Functional Programming is often used for low-level systems programming, such as for low-level Operating System functions and BIOSes)
I learned about these programming language types by learning about programming languages that implement these types, such as Prolog and Erlang.
While designing the Event system for my Tetris Power project, I started to realize just how using a Logic Programming language would simplify the core of the system.
For instance, many events more-or-less directly trigger other events, like a "block_land" event might trigger a "row_full" event, which itself triggers a "score_add" event, which then has to add a floating score to the screen.
Theoretically, it should be relatively easy to do something like this if I use Prolog (the only Logic Programming language I know at present), though it could be a little awkward in places, due to the extra layer between the game logic and the rendering system.
I'm going to be examining this more fully and even starting a new branch to work on this to see what happens in practice.
More will be posted as I learn about it.
For instance: I learned C, Java and C++ before I attended university, where I learned more about them and programming in general.
While at university, I learned that the above languages were all the same type of language, namely, they're all Imperative languages, which means you give the processor a list of instructions that it executes pretty much directly.
I also learned about two more types of programming languages, such as Logic Programming, which is where you construct a solution to a problem and let the built-in logic solver solve the problem itself, without specifying the exact sequence of instructions, as well as Functional Programming, which is similar to Imperative Programming, without giving you any form of global state, which means that every function returns the exact same result when given the exact same parameters.
(Functional Programming is often used for low-level systems programming, such as for low-level Operating System functions and BIOSes)
I learned about these programming language types by learning about programming languages that implement these types, such as Prolog and Erlang.
While designing the Event system for my Tetris Power project, I started to realize just how using a Logic Programming language would simplify the core of the system.
For instance, many events more-or-less directly trigger other events, like a "block_land" event might trigger a "row_full" event, which itself triggers a "score_add" event, which then has to add a floating score to the screen.
Theoretically, it should be relatively easy to do something like this if I use Prolog (the only Logic Programming language I know at present), though it could be a little awkward in places, due to the extra layer between the game logic and the rendering system.
I'm going to be examining this more fully and even starting a new branch to work on this to see what happens in practice.
More will be posted as I learn about it.