1
SFML projects / Re: Any .NET open source game written in SFML.NET?
« on: November 10, 2013, 03:06:57 pm »
First I would wish to thank you all for your answers.
By order of response:
I've been trying to translate the code of a SFML game I found while following some comments and tutorials and explanations to C#. While everything is rather similar regarding SFML in C++ and C#, there are substantial differences in the event management between C++ and C# (C# uses delegates and so on). That's why I needed some C# solutions to better understand the way C# manages events in comparison with C++.
Hell, I've been trying the demo and, against any expectation I had regarding performance in C#, it works very smooth and fine. I'll consider getting it and contacting him for that purpose (although I feel rather... dunno... "jerky" by asking for the code of a commercial product to someone who doesn't know me... maybe I could ask for the portions of code I'm interested in).
I basically require to use C# as my professional environment revolves around .NET technology. I want to learn videogame development as a hobby which can improve at the same time my skills at my job. Yeah, I saw some C++ code (Battle for Wesnoth) and I had a hell ahead to understand it.
I'll consider picking up the book (I guess it uses C++ as the main language). Just as an opinion, do you think I will have any issues or complications to adapt any code from the book to C#?
Thanks and kind regards.
By order of response:
SFML.NET is just a wrapper around SFML, so any SFML game can be easily ported to SFML.NET. Or read to understand how games work.
I've been trying to translate the code of a SFML game I found while following some comments and tutorials and explanations to C#. While everything is rather similar regarding SFML in C++ and C#, there are substantial differences in the event management between C++ and C# (C# uses delegates and so on). That's why I needed some C# solutions to better understand the way C# manages events in comparison with C++.
I don't know of any, however, if you are willing to pay 10$ and persuade Brendon* to GPLize Atom Zombie Smasher then you might get rather good commercial grade fully finished and polished indie game written in C# with MONO and SFML 1.6, not a bad one too.
Here's Brendon:
http://en.sfml-dev.org/forums/index.php?action=profile;u=2003
*It might sound idiotic to even try but he is using id techs for his 3D games(= forced GPL on all code) and is generally not super against idea of sharing some of his work(7DFPS Doom 3 code) so he might be willing to do it for AZS too if you ask him kindly.
Hell, I've been trying the demo and, against any expectation I had regarding performance in C#, it works very smooth and fine. I'll consider getting it and contacting him for that purpose (although I feel rather... dunno... "jerky" by asking for the code of a commercial product to someone who doesn't know me... maybe I could ask for the portions of code I'm interested in).
You should be careful with the approach of looking at other's code in order to learn programming. Keep in mind that such code is not taylored to education, and often contains compromises, hacks, or ancient techniques. When there are economic goals, it sometimes doesn't pay off to keep code clean (at least that's the short-sighted view, often it will cause more work and frustration in the long term). For C++ it's extreme, you'll find a lot of code that does more harm than good if you adopt it
For C# it's a bit less problematic, because the language is more restrictive and more modern from the beginning.
If you're interested in how to develop a game from the very beginning, you might want to have a look at our book SFML Game Development. If you're only interested in the code and not the explanations and design decisions behind it, it is freely available on GitHub. Although it's C++ and contains some language-specific features, a lot of the concepts (such as the scene graph) can be applied to other programming languages. I'm sure there are also similar books for C# programming, most of them probably related to XNA. There are also books focusing on game development in general, with the programming language used only to demonstrate some concepts, rather than to build a complete game.
I basically require to use C# as my professional environment revolves around .NET technology. I want to learn videogame development as a hobby which can improve at the same time my skills at my job. Yeah, I saw some C++ code (Battle for Wesnoth) and I had a hell ahead to understand it.
I'll consider picking up the book (I guess it uses C++ as the main language). Just as an opinion, do you think I will have any issues or complications to adapt any code from the book to C#?
Thanks and kind regards.