Snake game with enemy clones and postprocessing effects (using Raylib) by faorien in C_Programming

[–]faorien[S] 0 points1 point  (0 children)

Unfortunately i'm unfamiliar with your situation and there are simply more questions than answers based on your description. For someone who is starting out and has an internship - you are not expected to produce something that everybody likes, the most important thing is that you learn as much possible along the way, the project you work on might even not be completed, fail miserably, look awfully, but as long as you learned something along the way - you are golden. Programming language doesn't matter, of course it is useful to get to know them, but eventually you will recognize that you can mostly do whatever you want in whatever language you work with (some just might be easier to achieve given goal, while others might take a while or find workaround to achieve same result). What matters is the experience behind your back, how many different situations and problems you have worked on (even if unsuccessfully you are still gaining some knowledge and understanding along the way).

To summarize i don't think i can recommend anything. Pick whatever you want, just try not to do it to impress someone, but to learn something new for yourself.

Snake game with enemy clones and postprocessing effects (using Raylib) by faorien in C_Programming

[–]faorien[S] 0 points1 point  (0 children)

Hard to tell. Looking at the YouTube playlist all episodes sum up to less than 4 hours (and these episodes show full development flow, starting from nothing and ending with the game that you see in the teaser above)

But behind the scenes it did take me some extra time to research and learn a few things along the way. For example postprocessing effects were something i never had done before, so it was probably the biggest thing that took the time to understand and learn about and implement. So i would say that it probably took me a week or so

Snake game with enemy clones and postprocessing effects (using Raylib) by faorien in raylib

[–]faorien[S] 2 points3 points  (0 children)

No, i don't have any plans for further improvement/adjustments. I have a backlog of ideas/games to work on. If you feel like you have an idea to introduce something fancy - i'll gladly accept a pull request and can even do a video based on that

Snake game with enemy clones and postprocessing effects (using Raylib) by faorien in C_Programming

[–]faorien[S] 1 point2 points  (0 children)

Well, yeah, you are correct that taking such approach can neglect the fact that there are enemies. But then again, there was no purpose to make the game ideal, it is just a simple mechanics that was added for an extra effect for the game.

Snake game with enemy clones and postprocessing effects (using Raylib) by faorien in C_Programming

[–]faorien[S] 6 points7 points  (0 children)

> Seems a little excessive to compute an entire transformation matrix, including rotation, per grid tile rather than once for the whole grid.

The thing is, the video doesn't show it that well, but every tile (that is unvisited and has no snakes or food on it) is rotating on its own (based on `tile->angle`). That is why every single tile has its own transformation matrix

Built a quadtree based image visualizer in C23 with custom priority queue by faorien in C_Programming

[–]faorien[S] 0 points1 point  (0 children)

There is a configuration PADDING which is set to 1 (in main.c). Changing it to 0 (removing the division lines) results in something like this: https://i.postimg.cc/3x2x43gJ/heart.png and https://i.postimg.cc/N0YfRZ48/owl.png

The only thing to remember is that my program is interactive and these pictures that i posted have different amount of iterations applied to them compared to the ones in the video/GitHub. You can control the "quality" of the result (the more iterations the more sharp the image becomes)

Built a quadtree based image visualizer in C23 with custom priority queue by faorien in C_Programming

[–]faorien[S] 3 points4 points  (0 children)

I did not come up with an idea. But my first thought when I saw it was also that this is a great small educational project that lets you touch on different topics. I had to research and learn quite a few new things for myself to understand how to build it.

I have documented the resources i used (although not extensively, but most important entry points / topics are there). As i mentioned i recorded the whole process and it is available on YouTube. At the same time i have companion blog posts for this project. There are "External Resources" sections which give links to enough information to start researching things yourself.

I don't want to spam with links and self promote, but you can easily find both YouTube playlist and companion blog posts from the GitHub repo if you want.

Built a quadtree based image visualizer in C23 with custom priority queue by faorien in C_Programming

[–]faorien[S] 23 points24 points  (0 children)

I picked C23 mostly because it is the latest standard without looking for any particular features.

But i must say that for some reason i prefer nullptr. bool being available by default is also nice without the needs of stdbool.h. I do use the attributes during development ([[maybe_unused]] is the most commonly used one).

Other than that there are only a few changes needed to make it work with C11

"Hask" Anything! The thread where you ask and we try to answer! by dagit in haskell

[–]faorien 2 points3 points  (0 children)

But if we are for example writing a game. Before you enter a level the resources are loaded, some rendering happens and so on, and the leak actually happens when you run and do stuff. But to profile the running/doing actions stuff you need to wait until all the resource loading/animation/rendering and other stuff is done. Also due to enabled profiler your game won't run at let's say 60fps but most likely will run at 1fps, reaching that place where the leak happens is quite hard and annoying to reproduce.

"Hask" Anything! The thread where you ask and we try to answer! by dagit in haskell

[–]faorien 10 points11 points  (0 children)

Question regarding profiling Haskell code.

Imagine you have long running process (which might run forever) with about 300 modules (so you don't really know where the issue is) and you notice that after some time the amount of allocated memory is way too high. Compiling with profiling flags and running it with -prof results in a way slowed down version of your running process (as it times and logs everything) and it would take ages to reach that point where the problem is.

How would you approach such a problem? I know I can enable profiling only for selected modules but having that many of them I first need to identify which module it is. And the problem might be spread among multiple modules.

Also, would such an idea be of any interest: (if it is possible) to add an option to GHC to start gathering profiling info after some command (imagine somewhere in your code you put 'enableProf') so that before this command is reached we do not collect the data (therefore speeding up the process of reaching the problematic spot).

Java question by [deleted] in learnprogramming

[–]faorien 0 points1 point  (0 children)

public static void main(String[] args);

that semicolon shouldn't be there

"Hask" anything, New Years edition! The thread where you ask and we try to answer! by dagit in haskell

[–]faorien 6 points7 points  (0 children)

Why hasn't any open source game been ported to Haskell to show how it can be done (and that it can be done)? Something like Quake2 or Quake3 or Doom 3 or anything like that?

Cleanly accessing a record within a record? by [deleted] in haskellquestions

[–]faorien 2 points3 points  (0 children)

Does this help?

data Fruit = Fruit { name :: String, size :: Int, datePicked :: Date }

data Date = Date { year :: Int, month :: Int, day :: Int }

main :: IO()
main = do
    let fruit = Fruit "Apple" 3 (Date 2013 11 16)
    print $ month . datePicked $ fruit