Raylib-cs
WaveFunctionCollapse
Our great sponsors
Raylib-cs | WaveFunctionCollapse | |
---|---|---|
18 | 99 | |
676 | 22,620 | |
- | - | |
8.6 | 4.8 | |
about 1 month ago | 23 days ago | |
C# | C# | |
zlib License | GNU General Public License v3.0 or later |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Raylib-cs
-
How to add graphics
Glad I could help! Just one more disambiguation -- it's not built in. raylib is created by Ray/raysan5,and the C# bindings are created primarily by Chris Dill. Dill has packaged the bindings as a NuGet package, which you can add using the command line. The command downloads the package from the online repository and installs it.
I recommend raylib. Check out a basic example; it's about as straightforward as it gets.
-
Where to find more information on using languages beside c++?
Generally the respective Github pages for the binding would be a good starting point so for C# go here if you have not already https://github.com/ChrisDill/Raylib-cs
-
Need help with converting C++ to C#
I'm converting rlImGui from C++ to C# so I can use it with ImGui.NET and Raylib-cs but I'm getting stuck at a couple places. I don't know how to convert line 331 to C# since in ImGui.NET cmd.UserCallback is an IntPtr and not something I can call. I did a quick google search and you can use the Marshal library to convert it to a callable delegate but I think you need to also have the delegate known to do that. There's also line 82 but that is specific to Raylib. The function it calls does not seem to be included in Raylib-cs. Also, rlImGui keeps using a Texture type but that is not defined in Raylib-cs or ImGui.NET. I assume I can substitute it with Texture2D from Raylib-cs but I'm not to the point in porting to see if Texture2D has the necessary fields/properties/methods.
-
Simple 2D graphics framework for C#/Java
You can go with raylib: https://github.com/ChrisDill/Raylib-cs
-
If you were to start a new project that require OpenGL 3D graphics on C# What you will choose on 2022?
I've been using raylib-cs C# wrapper for raylib and have been quite happy with both. raylib is a relatively thin layer on top of OpenGL, especially if you use the rlgl functions.
-
Any official C# wrapper?
Not sure about "official", but I use raylib-cs and it works perfectly for me.
-
Help!
Raylib-cs is very easy to use: https://www.raylib.com/ https://github.com/ChrisDill/Raylib-cs It's a binding to the Raylib C library.
-
What are some good tutorials for making 2D games with C# in visual studio without a game engine?
If you find the structure of MonoGame too opaque or technical -- totally reasonable given that you're learning your way around -- check out Raylib-cs, a C# wrapper for the C games programming library raylib. It doesn't get much simpler.
-
Ideal method for including resources in Raylib-CS?
I am currently creating a prototype using Raylib-CS, C#, and Visual Studio Community 2022.
WaveFunctionCollapse
-
It's Okay to Make Something Nobody Wants
Thank you! And yes, I agree. I was looking at uh https://github.com/mxgmn/WaveFunctionCollapse and wondering if that were applicable here :)
Have a good day!
-
Kullback–Leibler Divergence
Intuitively, it measures the difference between two probability distributions. It's not symmetric, so it's not quite that, but in my opinion, it's good intuition.
As motivation, say you're an internet provider, providing internet service to a business. You naturally want to save money, so you perhaps want to compress packets before they go over the wire. Let's say the business you're providing service to also compresses their data, but they've made a mistake and do it inefficiently.
Let's say the business has, incorrectly, determined the probability distribution for their data to be $q(x)$. That is, they assign probability of seeing symbol $x$ to be $q(x)$. Let's say you've determined the "true" distribution to be $p(x)$. The entropy, or number of bits, they expect to transmit per packet/symbol will be $-\sum p(x) lg(q(x))$. Meaning, they'll compress their stream under the assumption that the distribution is $q(x)$ but the actually probability of seeing a packet, $x$, is $p(x)$, which is why the term $p(x) lg(q(x))$ shows up.
The number of bits you're transmitting is just $-\sum p(x) lg(p(x))$. Now we ask, how many bits, per packet, is the savings of your method over the businesses? This is $-\sum p(x) lg(q(x)/p(x))$, which is exactly the Kullback-Leibler divergence (maybe up to a sign difference).
In other words, given a "guess" at a distribution and the "true" distribution, how bad is it between them? This is the Kullback-Leibler distribution and why it shows up (I believe) in machine learning and fitness functions.
As a more concrete example, I just ran across a paper talking [0] about using WFC [1] to asses how well it, and other algorithms, do when trying to create generative "super mario brothers" like levels. Take a 2x2 or 3x3 grid, make a library of tiles, use that to generate a random level, then use the K-L divergence to determine how well your generative algorithm has done compared to the observed distribution from an example image.
-
collapsed
wave function collapse studies - this is done with the https://github.com/mxgmn/WaveFunctionCollapse algorithm after I saw https://github.com/CodingTrain/Wave-Function-Collapse mention it. done in P5! IG https://www.instagram.com/ronivonu/
-
Wave Function Collapse - A stateful node graph framework (constraint problems, procedural generation, etc.)
Inspiration and entropy propagation algorithm derived from https://github.com/mxgmn/WaveFunctionCollapse.
-
Ask HN: What weird technical scene are you fond/part of?
https://www.youtube.com/watch?v=Dfc-DQorohc
Craig Reynolds said the name "Boids" was inspired by The Producers Concierge scene, so that's how you should pronounce it:
Boids. Dirty, disgusting, filthy, lice ridden Boids. Boids. You get my drift?
https://www.youtube.com/watch?v=aL6mTMShVyk
The other really cool rabbit hole to explore for generating tiles and even arbitrary graph based content (I'm sold: hexagons are the bestagons!) is "Wave Function Collapse", which doesn't actually have anything to do with quantum mechanics (it just sounds cool), but is actually a kind of constraint solver related to sudoku solvers.
https://escholarship.org/content/qt3rm1w0mn/qt3rm1w0mn_noSpl...
Maxim Gumin's work: https://github.com/mxgmn/WaveFunctionCollapse
Paul Merrell's work:
https://paulmerrell.org/model-synthesis/
https://paulmerrell.org/research/
Oskar Stålberg's work:
https://twitter.com/OskSta/status/784847588893814785
https://oskarstalberg.com/game/wave/wave.html
There's a way to define cellular automata rules by giving examples of the before and after patterns, and WFC is kind of like a statistical constraint solving version of that.
So it's really easy for artists to define rules just by drawing! Not even requiring any visual programming, but you can layer visual programming on top of it.
That's something that Alexander Repenning's "AgentSheets" supported (among other stuff): you could define cellular automata rules by before-and-after examples, wildcards and variables, and attach additional conditions and actions with a visual programming language.
AgentSheets and other cool systems are described in this classic paper: “A Taxonomy of Simulation Software: A work in progress” from Learning Technology Review by Kurt Schmucker at Apple. It covered many of my favorite systems.
http://donhopkins.com/home/documents/taxonomy.pdf
Chaim Gingold wrote a comprehensive "Gadget Background Survey" at HARC, which includes AgentSheets, Alan Kay's favorites: Rockey’s Boots and Robot Odyssey, and Chaim's amazing SimCity Reverse Diagrams and lots of great stuff I’d never seen before:
http://chaim.io/download/Gingold%20(2017)%20Gadget%20(1)%20S...
Chaim Gingold has analyzed the SimCity (classic) code and visually documented how it works, in his beautiful "SimCity Reverse Diagrams":
>SimCity reverse diagrams: Chaim Gingold (2016).
>These reverse diagrams map and translate the rules of a complex simulation program into a form that is more easily digested, embedded, disseminated, and and discussed (Latour 1986).
>The technique is inspired by the game designer Stone Librande’s one page game design documents (Librande 2010). If we merge the reverse diagram with an interactive approach—e.g. Bret Victor’s Nile Visualization (Victor 2013), such diagrams could be used generatively, to describe programs, and interactively, to allow rich introspection and manipulation of software.
>Latour, Bruno (1986). “Visualization and cognition”. In: Knowledge and Society 6 (1986), pp. 1– 40. Librande, Stone (2010). “One-Page Designs”. Game Developers Conference. 2010. Victor, Bret (2013). “Media for Thinking the Unthinkable”. MIT Media Lab, Apr. 4, 2013.
https://lively-web.org/users/Dan/uploads/SimCityReverseDiagr...
Agentsheets: Alexander Repenning (1993–)
Interacting agents are embedded and interact within
-
how would you avoid making your randomly generated map look like a mess?
I thought you were kidding but it's an actual thing!
-
ggez Falling Sand Simulation: Best way to draw massive amount of individual pixels every frame
https://github.com/mxgmn/WaveFunctionCollapse - Honorable mention, same guy.
-
Ultra-high resolution (4900x800) generation in 1 step, 3GB memory, no manual editing, pure stable-diffusion
Neat! This approach reminds me a lot of Wave Function Collapse.
-
Wave Function Collapse
Initial source of inspiration: https://github.com/mxgmn/WaveFunctionCollapse
-
Yeah, I'll call this variable viscosity
It is actually a pretty new algorithm for procedural content generation. Check out this repo
What are some alternatives?
MonoGame - One framework for creating powerful cross-platform games.
raylib - A simple and easy-to-use library to enjoy videogames programming
bgfx - Cross-platform, graphics API agnostic, "Bring Your Own Engine/Framework" style rendering library.
eShopOnContainers - Cross-platform .NET sample microservices and container based application that runs on Linux Windows and macOS. Powered by .NET 7, Docker Containers and Azure Kubernetes Services. Supports Visual Studio, VS for Mac and CLI based environments with Docker CLI, dotnet CLI, VS Code or any other code editor. Moved to https://github.com/dotnet/eShop.
rlImGui-cs - A Raylib-cs integration with DearImGui
OpenFK - An open source replacement for the U.B. Funkeys executable.
SDL2-CS - SDL2# - C# Wrapper for SDL2
FontStashSharp - C# port of https://github.com/memononen/fontstash
DeBroglie - DeBroglie is a C# library implementing the Wave Function Collapse algorithm with support for additional non-local constraints, and other useful features.
dnSpy-Unity-mono - Fork of Unity mono that's used to compile mono.dll with debugging support enabled
CairoSharp - A C# wrapper of cairo http://cairographics.org/
rres - A simple and easy-to-use file-format to package resources