Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a loop or feedback SN constructor #181

Merged
merged 2 commits into from
Aug 9, 2022
Merged

Add a loop or feedback SN constructor #181

merged 2 commits into from
Aug 9, 2022

Conversation

turion
Copy link
Owner

@turion turion commented Aug 8, 2022

  • Test at least with an example application
  • Consider renaming Loop to Feedback
  • Resolve FIXMEs
  • Add missing cases in combinators (this should have been a compile error, separate PR)

Thanks @SheetKey for inspiration

@turion
Copy link
Owner Author

turion commented Aug 8, 2022

@SheetKey can you have a look at the RandomWalk example and see whether the function feedbackRhine and the Loop constructor cover your use cases?

@turion
Copy link
Owner Author

turion commented Aug 9, 2022

@turion
Copy link
Owner Author

turion commented Aug 9, 2022

  • Clean up git history
  • Check & complete haddocks

@turion turion merged commit 63abc28 into master Aug 9, 2022
@turion turion deleted the dev_loop branch August 9, 2022 08:42
@SheetKey
Copy link

SheetKey commented Aug 9, 2022

@turion its exactly what I was looking for! I'm using an ECS and using only ClSFs with feedback for my main game loop forced everything to happen on the same clock where I would rather have the ability to have different processes happen at different rates.

@turion
Copy link
Owner Author

turion commented Aug 9, 2022

That sounds great :) what's an ECS? In case your code is open, feel free to share.

@SheetKey
Copy link

SheetKey commented Aug 9, 2022

Entity component system. You essentially treat every game object as a collection of components (mostly wrapped in Maybe), then define functions, in my case signal functions, that do things with the components. For example I have position and velocity components with corresponding signal functions that update the velocity (from user input in the players case) and another that updates position from the velocity. My game state is a list of entities and I compose signal functions that do various things. Right not my ECS is just a big record but there are some libraries that I'm considering using once I have a better grasp of SDL: apecs and ecstasy.

@turion
Copy link
Owner Author

turion commented Aug 10, 2022

Ah yes :) that's the kind of thing that we started to develop dunai & rhine for. Have you looked into gloss and rhine-gloss? In case you want some simple SDL 2D vector graphics without worrying too much about the backend.

@SheetKey
Copy link

I haven't really looked into gloss. I decided on sdl2 because of the various graphics libraries for haskell it seemed like the most well documented for game programming. Even though its mostly C++ it translates to haskell with very little changes. That being said I haven't done any vector graphics, just loading pngs. If I run into issues I might switch but I haven't had any problems using sdl so far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants