SFML community forums
Help => General => Topic started by: Murii on January 13, 2014, 07:29:39 am
-
Hey guys,do you think SFML its good for game james,i`m asking this because right now i`m making a little lib for helping me out to develop games faster.But it seems like its hard to port the games to anathor platform using C# and SFML or SFML in general.So i`m asking you guys(the ones)who actually participated in a game jam and ported the game to all the platforms,how have you made this possible in so little time?
-
If you use SFML and its standard C++ bindings, its very easy to port it to all platforms. Of you are using C# its gonna be much harder, because C# and .NET is meant for Windows and you need additional runtime libraries like mono etc.
-
It really depends. SFML is a great library and easy to work with, however in most Game Jams the goal is to get something up and running as fast as possible, thus you're much quicker with pre-built engines.
I'd still use C++ & SFML since it's never really a race for the higher ranks for me, but it's just about fun, the experience and learning something. :)
As for porting, by using no OS specific code and crossplatform libraries, it's very easy to write portable code in C++. C# with the .NET library is a bit more of a challenge, but should still be doable with Mono. Alternatively you can also often run you Windows applications via WINE on Linux, although you'll always run into a few that don't like WINE.
-
I've done two Ludum Dare and one SFML Game Jam so far with SFML. It's really possible.
But as exploit3r said, I use some bunch of personal pre-built code that allow me to skip the windowing/states/base scene nodes part.
If you want to look at what I managed to achieve :
Ludum Dare 48h #28 (http://www.ludumdare.com/compo/ludum-dare-28/?action=preview&uid=24781)
Ludum Dare 48h #27 (http://www.ludumdare.com/compo/ludum-dare-27/?action=preview&uid=24781)
SFML Game Jam #1 (http://en.sfml-dev.org/forums/index.php?topic=12507.0)
For these three project, I used some kind of framework of my own that I created while following the SFML Game Development (http://en.sfml-dev.org/forums/index.php?topic=11992.0) Book very carefully. Link to it on GitHub :
https://github.com/Lo-X/potato-framework
Concerning the porting, do use C# since it's microsoft only (and Mono is not good enough to be an alternative when it comes to video games).
C++ really is the best option, I used it for every jam to port my code quickly from linux to windows. I also use the exact same IDE on both (Qt Creator) that alows me to not even worry about the makefile, I just copy/paste my files and re-compile the game. (very lazy work, but it's fine when the time is limited)
-
C++ is the best option, but if you want to use .net, mono is best, but Dotnet is just for Microsoft and Microsoft created it for windowsand xBox
-
First of all i dont want to use C++,because its too hard and i really dont like it that much compared to C# or Java.So lets say i`ll stick with C#.If i want to deploy it to Mac or Linux the only thing i need its Mono and the OSs installed on my computer and maybe Wine to be sure that i`ll work perfectly ?? I`m asking this because i really want to participate in the next Ludum Dare competition and i need to port the games on all 3 OSs whitout any problems :) .
-
If i want to deploy it to Mac or Linux the only thing i need its Mono and the OSs installed on my computer and maybe Wine to be sure that i`ll work perfectly ??
At best you just go, write a simple Hello World example, then start your Linux machine, compile and run it, then move to your OS X machine, compile and run it.
After you've successfully done that you'll know on your own how to set things up.
If you have concrete questions about the process, come back and ask, but there's no reason to explain everything in detail, because in the end, you'll just have to try it regardless. :)
-
Ahh!! I don't have an Linux machine or Mac :((
-
Don't worry for Linux, just get yourself a VM (e.g. VirtualBox) and install a Linux on it. For Mac you could try to install OS X on an VM as well, but keep in mind that this could be illegal.
Cross compiling (from one OS for another OS) is partially possible with C++, but in the end, it's never really advised, especially if you have the possibility of doing it natively. For C# & .NET I doubt that there's such an option at all.
-
All you people that don't care for C#, please just stop and learn about the subject before talking about it. And enough of the nonsense that C# is not portable.... As long as you avoid using any OS specific code from the .NET framework you will have no problem moving your program to a different platform. The same applies to C++.
Just because you do not use something does not mean there is something wrong with it or can't be considered as a perfectly valid alternative to something else. Please note I do use C++ also.
As for compiling, no language that utilizes the CLI (C#, VB.NET, F#, ect) is ever compiled to native code until it is ran. This means you can compile a C# program with Visual Studio, switch over to linux and drop that same executable into mono and it will still run without the need for recompilation.
Concerning the porting, do use C# since it's microsoft only
Of you are using C# its gonna be much harder, because C# and .NET is meant for Windows
So untrue, just because Microsoft designed the language doesn't make this the case. It is like saying the entire linux kernel or git was designed exclusively for Linus Torvald's personal use. C# is in fact a ISO and ECMA standard language and was designed to be implemented cross platform. I don't think that all the MS specific stuff that was dropped into C++ was an ISO standard. :)
So lets say i`ll stick with C#.If i want to deploy it to Mac or Linux the only thing i need its Mono and the OSs installed on my computer and maybe Wine to be sure that i`ll work perfectly ?? I`m asking this because i really want to participate in the next Ludum Dare competition and i need to port the games on all 3 OSs whitout any problems
You won't even need Wine, as long as you avoid the very few windows specific namespaces in the .NET framework all you need to do is remap the CSFML dlls to the platform specific naming. Then your program will run without any problem on any platform using mono.
On a side note, Murii if you are looking at participating in the game jam (and I highly recommend that you do) I have ported Thor to C# with my NetEXT library. It contains many helpful classes that should help get you off the ground when you are writing your game. ;)
-
Even if what you said is entirely true and all that, Linux and Mac users still have to install Mono if they want to play the game haven't they ? So in the jam context you ask people to install things that are required to play the game.
It's explicitely said in the advice section of Ludum Dare that the players shouldn't need to do anything other that to unzip your game package and double-click the .exe. And that's a good advice, because I skip games that requires me to install something or switch OS : Unity games, C# games, games that requires VS to be installed, etc. : I just don't play them.
Finally, last time I tried to launch a C# game with Mono on my linux it failed, back in last september.
I'm not a C# hater, that's not a language I use often but I understand it becomes handy and easy to use... when you want to do something for Microsoft devices.
-
Thanks a lot for so many messages!Now i really don`t care if the linux users or mac users need to install mono in order to run my game,they`ll see the game its wroth the effort so yeah :).Now the second thing is ,if i got it correct is that they can run my .exe in linux,mac if they have mono installed?
And zsbzsb i`ve already made a little lib for collision,entities and states but i`ll look over your lib because it sounds good :)
Lo-X,how have you started the game and why do you thing it failed to start?
Thanks again for all the support but in my 2+ years of progamming i`ve switched quit a lot of frameworks,engines and this must stop!
P.S: If i`m going to participate in ludum dare i don`t care if 1 or 2 from 5 can`t start the game,just because they are noobs or whatever.I just need to know if its working for the rest of 3 people or 4 :)
btw : C# - FTW :)
-
Now i really don`t care if the linux users or mac users need to install mono in order to run my game
If i`m going to participate in ludum dare i don`t care if 1 or 2 from 5 can`t start the game
No, you still should care, it is one of the things that you must think over when picking the right coding tool for the job. ;)
if i got it correct is that they can run my .exe in linux,mac if they have mono installed?
Yes, as long as you don't use any windows specific parts of the .NET framework. (Check this (http://www.mono-project.com/Compatibility)) Also if you use SFML.NET you will need to learn to use the config files to remap CSFML to the native counterparts on linux/mac.
And zsbzsb i`ve already made a little lib for collision,entities and states but i`ll look over your lib because it sounds good
Well NetEXT doesn't handle any of that (it is a bit more low level than that), but I have just released Spitfire (https://bitbucket.org/zsbzsb/spitfire/overview) in light of the upcoming game jam which does contain some of that functionality if you are interested.
If i`m going to participate in ludum
Maybe you are a bit confused, but the next ludum dare isn't until April and it will be the SFML Game Jam in about 18 days. ;)
-
I`ve done the test and everything showed green,YAY,now this means i can put it on a linux platform ?
Also how does the config files for remaping CSFML work?
-
I`ve done the test and everything showed green,YAY,now this means i can put it on a linux platform ?
Install linux in a VM and try it out ;)
Also how does the config files for remaping CSFML work?
http://www.mono-project.com/Config_DllMap (http://www.mono-project.com/Config_DllMap)
All you need to do is remap the dlls, don't worry about remapping functions.
-
How can i open and edit those dlls in order to make it run on linux?I`m getting annoyed >:( >:(
-
You don't need to edit any files, just add a configuration files to remap CSFML from *.dll to *.so.2.
Maybe this (http://en.sfml-dev.org/forums/index.php?topic=14140.0) will help you out.