Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Any .NET open source game written in SFML.NET?  (Read 9875 times)

0 Members and 1 Guest are viewing this topic.

Rydra

  • Newbie
  • *
  • Posts: 4
    • View Profile
Any .NET open source game written in SFML.NET?
« on: November 09, 2013, 10:58:52 pm »
Hello there,

I'm looking for a SFML.NET open source in order to study the code and learn. Does someone know about any game like that?

Kind regards.

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: Any .NET open source game written in SFML.NET?
« Reply #1 on: November 10, 2013, 03:23:17 am »
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.
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: Any .NET open source game written in SFML.NET?
« Reply #2 on: November 10, 2013, 03:54:02 am »
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.
« Last Edit: November 10, 2013, 03:56:31 am by FRex »
Back to C++ gamedev with SFML in May 2023

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Any .NET open source game written in SFML.NET?
« Reply #3 on: November 10, 2013, 12:32:04 pm »
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.
« Last Edit: November 10, 2013, 12:33:39 pm by Nexus »
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Rydra

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Any .NET open source game written in SFML.NET?
« Reply #4 on: November 10, 2013, 03:06:57 pm »
First I would wish to thank you all for your answers.

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.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Any .NET open source game written in SFML.NET?
« Reply #5 on: November 10, 2013, 03:19:48 pm »
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#?
As mentioned, we use some rather advanced C++ features. For example templates, function objects or lambda expressions. In most cases, C# offers corresponding language features (generics, delegates, lambda functions) so the transition should be possible. Sometimes you will probably not be able to write code 1:1 and instead use idioms from C#. There will be several places where your code becomes simpler, since you don't have to care about memory management, move semantics, pointers and smart pointers (std::unique_ptr, std::shared_ptr). Keep also in mind that SFML.NET is smaller than SFML, because some modules like Network are already implemented in the .NET framework. Others such as event handling look differently in C++ and C#.

If you're not sure about it, you can have a look at the GitHub code and see if you understand the C++ code that's used there. Don't hesitate to ask here if there are questions.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Grimshaw

  • Hero Member
  • *****
  • Posts: 631
  • Nephilim SDK
    • View Profile
Re: Any .NET open source game written in SFML.NET?
« Reply #6 on: November 10, 2013, 09:48:48 pm »
Hey,

I found this person in gamedev.net reporting to be using .NET for SFML development, maybe you could contact him and try to solve your problem that way? :)

http://www.gamedev.net/blog/1468/entry-2258878-new-engine-and-game/

He should also be a user of this forum, hopefully!

Good luck

kpulv

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: Any .NET open source game written in SFML.NET?
« Reply #7 on: November 13, 2013, 04:08:59 am »
Hi!  I actually have an open source dotnet framework using SFML as the underbelly.  You can check it out at http://otter2d.com :)

edit: Oh whoops you're looking for a game sorry!  I'll be open sourcing a game soon though!
« Last Edit: November 13, 2013, 04:33:09 am by kpulv »

Tigre Pablito

  • Full Member
  • ***
  • Posts: 226
    • View Profile
    • Email
Re: Any .NET open source game written in SFML.NET?
« Reply #8 on: August 23, 2014, 07:00:02 pm »
Hi all there, Ladies and Guys from SFML

I was looking on this section of the forums, and casually saw this ... Rydra, have you found what you needed?

I know we are the fewest who use C# .NET for making games with SFML , I also had some difficulties to get started, since this

I have 2 games, for which I have asked help in these forums many times ... actually 12 hours ago I posted to ask if someone knew why on some 64 bit systems they ran slower ...

Here is the code ... it has to be compiled with the 3 SFML DLLs (32 bit or 64 bit) sfml*.dll (add them on the References node), and all 8 them have to be in the .exe folder

https://www.dropbox.com/s/7evk5fjbmk0cgyo/SOURCE%20CODE%20MY%20SONIC.rar?dl=0

perhaps this app is quite big for you to get started, ... maybe I could make a smaller demo ... what kind of game you want to make?

this is the entire pack, for 64 bit systems, you can replace DLLs and rebuild if yours is 32 bit
obviously it can be improved much, and it has had problems ... but works  ... not so far ago, I had thought on making some kind of tutorial with it -as I haven´t seen (or found) another one that type (2D - plattformer) - but the idea didn´t prosper

https://www.dropbox.com/s/nq1ga7zpceuu0p1/Sonic%20The%20Hedgehog%2064%20bit%20by%20Pablito.rar?dl=0

please let me know in case you are not already done on this SFML.NET issue

Regards


xlar54

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Email
Re: Any .NET open source game written in SFML.NET?
« Reply #9 on: September 03, 2014, 08:55:44 am »
https://pacclone.codeplex.com/

its GPL, released today.  have fun!

 

anything