SFML community forums

Help => General => Topic started by: Viruses on December 29, 2011, 10:57:04 pm

Title: Distributing SFML games on other websites.
Post by: Viruses on December 29, 2011, 10:57:04 pm
So how do you distribute games over the web that you make in SFML? And do the SFML dlls have to go with the package because then people would know i made it in SFML which would mean they could modify it by some way.. and also the dlls take up alot of more memory and then the game itself with the assets all take up a lot of mb just for a flash game.. And could i earn money by advertising in my game? Im a noob in this kind of stuff..
Title: Re: Distributing SFML games on other websites.
Post by: Nexus on December 30, 2011, 12:30:42 am
Quote from: "Viruses"
So how do you distribute games over the web that you make in SFML?
Look at the Projects forum...

Quote from: "Viruses"
And do the SFML dlls have to go with the package
When you link dynamically, yes (unless the player has exactly the same version of the DLLs).

Quote from: "Viruses"
because then people would know i made it in SFML which would mean they could modify it by some way..
Huh? Where did you hear that?

Quote from: "Viruses"
and also the dlls take up alot of more memory and then the game itself with the assets all take up a lot of mb
If you compress a game, its size should be acceptable to download and install.

Quote from: "Viruses"
just for a flash game..
I thought you talked about C++?
Title: Re: Distributing SFML games on other websites.
Post by: eXpl0it3r on December 30, 2011, 10:27:55 am
Quote from: "Viruses"
And do the SFML dlls have to go with the package

Additionally you can link the SFML library staticly, so you won't have any DLLs to ship with, although your game itself will have an incresed size.
Quote from: "Viruses"
because then people would know i made it in SFML which would mean they could modify it by some way..

Wrong!
Quote from: "Viruses"
And could i earn money by advertising in my game?

Sure, that's why SFML is under libzip license (= do what ever you want with SFML, just don't claim you created SFML).

I suggest you read a bit more though this forum. There are a lot of questions which have some similarities to yours.
Title: Distributing SFML games on other websites.
Post by: Viruses on January 01, 2012, 01:28:37 am
What i meant that the players would know i made it in sfml is that since the dlls are named sfml-whatever, they would know its sfml and then what if they also programmed games in sfml too? So then they would know..
Title: Distributing SFML games on other websites.
Post by: Grimshaw on January 01, 2012, 03:39:07 am
They would know how to decode machine's native code by their naked eye, woooooo :)

Absolutely not. If someone is about to attempt cracking your game executable, it will be probably the same whether he knows what you used or not.
Title: Distributing SFML games on other websites.
Post by: Nexus on January 01, 2012, 01:12:57 pm
Quote from: "Viruses"
So then they would know..
...that you are using SFML and that you're linking dynamically. No more, no less.

I think you really overstate the problematics, it's highly unprobable that a hacker community spends hours to reverse-engineer your game ;)
Title: Distributing SFML games on other websites.
Post by: Neomex on January 01, 2012, 01:21:00 pm
Quote from: "Nexus"

I think you really overstate the problematics, it's highly unprobable that a hacker community spends hours to reverse-engineer your game ;)


+ if something like this happen, it means you made succes and you should be very happy  :D
Title: Distributing SFML games on other websites.
Post by: Viruses on January 02, 2012, 05:43:00 pm
Alright thanks!
Title: Distributing SFML games on other websites.
Post by: Viruses on January 22, 2012, 01:26:37 am
Does anyone know of websites where i can distribute the game? And how will i put ads in it to make money? And how do i even put the game in there? Like will i have to put all the files of the game in a rar file and then people download it or how does this whole thing work? Also, if they download the files, then they see my game assets(music,sprites,etc). All they have to do is change those to change how the stuff looks. How do i "lock" the assets? And also, earlier i sent my friend the files of the game. On his computer, it said he needed some dlls. But on my computer, those dlls arent necessary for the game to run. So how do i know if it will even work on peoples' computers? I know this is soo many questions but i have no clue what to do when it comes to actually distributing my game. Thanks a ton!
Title: Distributing SFML games on other websites.
Post by: RedIrony on January 22, 2012, 02:23:57 am
1) If your game is really good, and really polished (emphasis on really), you can talk to a publisher about getting it published. Chances are, it isn't at that stage, in which case you'll need to distribute it yourself. You can get your own web space, or you can look for a regular file hosting server to link to. I believe there is one dedicated to SFML projects.

2) As far as ads go, I guess you would need to find someone to pay you to display their ads (such as Google's AdSense). You'd need to work with the network package so that you can send a message out to the web and retrieve the ad and display it inside your game.

3) For distribution, it will depend on the platform. For windows, you really should go and learn how to make a windows installer so that they can install/uninstall your software. This will allow you to check for and install any .dll files you need (I suspect it would he ones for sound, but that's just a guess).

And of course, all of this stuff is online in articles published by people far more educated than myself.
Title: Distributing SFML games on other websites.
Post by: Viruses on January 22, 2012, 03:11:52 am
About the whole distributing/publishing part, do i have to pay to do that? And are ads the only way to make money because in my opinion, not a lot of people click on ads anyways. And you said i would have to get my own web space. But doesn't it cost money in order to host your website on a web server?
Title: Distributing SFML games on other websites.
Post by: Tank on January 22, 2012, 02:06:36 pm
So you want 100% profit out of 0% investments?

Nobody cares what you've used to create your game. Users usually want to play, not reverse your software (and that's even possible with everything; why trying to avoid it?).

Speaking of myself I'd immediately quit a game that displays ads in-game. What about simply selling your game?!
Title: Distributing SFML games on other websites.
Post by: Viruses on January 22, 2012, 04:37:12 pm
Okay listen when i go into any games directory(like an MMORPG for example), i dont get to see all the game assets and open them up and change them. They have dlls. So if they used a program that i could get online to change their models, the game would screw up because now the models have changed because of my EDITING. I want to make my assets so that they can't be changed. And what do you mean selling? Like online..?
Title: Distributing SFML games on other websites.
Post by: Tank on January 22, 2012, 06:42:45 pm
If you're afraid of prople stealing your work: You don't have to. All assets created by you are copyrighted.

The other stuff you mention is well-known as "security through obscurity". If someone *really* wants to get your assets, they'll manage it. Decoders/unpackers are always included with your binary, so with some knowledge and time one will always be able to get your assets (and also change them).

I suggest to concentrate on more important things, like creating a good and working game. And something to think about: If your users are *able* (by design) to change things, doesn't that also mean that your product may get better without any work? Just look around and find games that are being played and enjoyed for many many years. The majority of them is modificable.

Regarding selling: Yeah, selling your product online or even boxed, doesn't matter. Ads in a game are just annoying and I don't think the revenue is that high. Do a good job, create an interesting game and people will be willing to pay some bucks.
Title: Distributing SFML games on other websites.
Post by: julen26 on January 22, 2012, 07:25:34 pm
Quote from: "Tank"
I suggest to concentrate on more important things, like creating a good and working game. And something to think about: If your users are *able* (by design) to change things, doesn't that also mean that your product may get better without any work? Just look around and find games that are being played and enjoyed for many many years. The majority of them is modificable.


That's right, I have never sold any game, but I can guarantee that one of them (specifically Dbzbx wich I made in GameMaker) is still at the present played so much. Why? It's highly editable and people use to make their own versions of it.


Sell the game itself online, you can read this amateur and nice article (http://studioeres.com/games/content/tutorial-how-sell-games-shareware). It'll give you some starting point, but note that for now you will have to MAKE a good game.
Title: Distributing SFML games on other websites.
Post by: Viruses on January 22, 2012, 08:38:44 pm
Well im not really afraid of people "taking" my assets. In fact, i couldnt care less. Its just that if they MODIFY them and then they play the game, they get to play the game with watever thing they make. So for example, in a 3D game you might have to pay money in order to get some items or clothing. Some clothing is only for looks. So lets say you modify the game and then you get to get the clothing for free because you modified it YOURSELF. So now the developers lose money because you get everything for free by doing it yourself. Now im talking about online 3D games and im making 2D games which arent even good, so you might ask that why do i care? Well i just want to learn from now how to lock my assets. And also ive noticed that in games directories they have file formats(like ".pak" or something) that are unknown and those formats contain the scenes and models or watever. So do i have to make my own formats to protect my assets?
Title: Distributing SFML games on other websites.
Post by: texus on January 22, 2012, 08:58:32 pm
Quote
Its just that if they MODIFY them and then they play the game, they get to play the game with watever thing they make.
If they would modify the models, then on your computer your player will look a little different, but you only changed your own models so all other players would still see you with your old clothes.
The clothes might look different to u, but its not like you get a better defense or something like that.

Quote
So for example, in a 3D game you might have to pay money in order to get some items or clothing. Some clothing is only for looks. So lets say you modify the game and then you get to get the clothing for free because you modified it YOURSELF.
They can't just add new clothes, your game decides what models are loaded.
If you decide that certain models are only loaded after they pay then it doesn't matter if they add the models to the files or not.

There isn't that much for people to change. I wouldn't bother about it.

Quote
So do i have to make my own formats to protect my assets
You can always make your own encryption and decode all files when the game starts, but then the loading would take longer.
Title: Distributing SFML games on other websites.
Post by: Viruses on January 23, 2012, 12:50:58 am
Ok.. I downloaded this game 2D and for some reason it only has a music file and an exe file. Where did all the dlls, assets go?? How come only the executable is needed in some games that you download and it runs fine? Also, if they change the artwork then the game will actually run with that specific picture. All they have to do is open with paint or photoshop or something and then they can modify it and play with that. I know this because i did it myself..
Title: Distributing SFML games on other websites.
Post by: model76 on January 23, 2012, 12:58:22 am
Ah, the old "But what if the users won't pay?"

Well, it's pretty simple: If they won't pay, they aren't customers, and you simply shouldn't care about them.

The old "Our game didn't sell because of pirates!" is just a bullshit line that some developers use to try to get investors to give them more money, even though they didn't get their market research right for their previous game.

Don't waste your time on that stuff.
Title: Distributing SFML games on other websites.
Post by: MarekkPie on January 23, 2012, 02:33:03 am
I think something like DLC or microtransactions don't fall under the economic theory that stolen material from otherwise non-buyers doesn't count as lost sales.

Suppose person A buys the game and person B pirates the game. Person A has been shown to be willing to pay for the game, while person B may or may not have bought the game otherwise. In this situation, that theory holds.

Now suppose person A then pirates the DLC costumes or whatever microtransaction nonsense. This is undeniably lost sales, since person A was willing to purchase the game, but unwilling to buy the DLC. Since owning the game is a pre-requisite, they are willingly stealing content that they would have paid for if it came in the original game.

That said, I agree that Viruses is thinking too hard about this NOW, when there are already so many things stacked against him (or anyone for that matter) making any money. Make a game (or a few games), get a handle on your skills, and if you think you've made a game that will earn you money, then start worrying about it. I doubt that the security of your games content is the first thing you need to worry about, or is even required until you have a completed product.
Title: Distributing SFML games on other websites.
Post by: texus on January 23, 2012, 03:59:27 pm
Quote
Where did all the dlls, assets go??

I still think that it is better not to worry about all those problems, but if you distribute the game for windows only then you can do some things:
- link statically (if possible), then there will be no dll files.
- You can add your images as a resource in your exe. This is probably what they did with the 2D game you were talking about.
Do note that there are ways to extract the resources from the exe. I wouldn't be surprised that you would find the images inside that exe file of the 2D game.

If you really care about it then do what I said before: encrypt your files in some way and change the extension. Nobody will ever understand how to open these file unless they start disassembling your exe file.
Title: Distributing SFML games on other websites.
Post by: Tank on January 23, 2012, 05:24:24 pm
There is no protection, and there will never be one. Security through obscurity has no benefits, you waste your time.

Look at all the protections of nowadays games/music/programs. Do you know a single product that has not been cracked? Save your customers the trouble and don't rape their rights on the product they bought.

It's like selling a car and disallowing the customer to repaint it. Forcing limited freedom at the customer's side is never a good idea imho. And like someone said in this thread: Piracy will always happen, but the majority of the guys downloading your stuff illegally wouldn't buy your product if they hadn't have the chance to download it.

Just concentrate on making the game. And enjoy the PR you automatically get when people can change stuff easily (e.g. they tell their friends "This game is cool, look what I've added to it!").
Title: Distributing SFML games on other websites.
Post by: Viruses on January 28, 2012, 01:57:22 am
How do i encrypt my files?
Title: Distributing SFML games on other websites.
Post by: texus on January 28, 2012, 12:49:47 pm
Quote from: "Viruses"
How do i encrypt my files?

You will probably want a unique encryption so that nobody knows how to decode it.
The problem is that you will have to do this completely by yourself.

Start with writing a simple encryptor program: read the file and add 1 to every byte. Then save the file with a different extension.
Nobody will be able to open it now. Only your game can read it, because it reads the file and decrements every byte before is starts.

For a stronger and more secure encryption you will have to make a better formula (not just adding 1). You do this by adding, subtracting and multiplying bytes with each other.
Eventually you can even use more bytes for your file (original is e.g. 1kb while the encrypted version is 2kb).
But always make sure that the encryption can be reversed by your game.


Although the above will give you a little bit more protection, I completely agree with what the other people already told you: nothing is completely secure.
I wouldn't waste my time in writing a good encryption and I would want my game to be good: not letting it start slower because it first has to decode every file.
Title: Distributing SFML games on other websites.
Post by: julen26 on January 28, 2012, 01:31:43 pm
Use xor encryption with each byte.

Code: [Select]
A xor B = C // encrypt
C xor B = A //decrypt


You can use B as your password for your encryption.
Title: Distributing SFML games on other websites.
Post by: Viruses on January 28, 2012, 08:50:51 pm
Okay then i wont worry about encryption.. but about what texus said earlier that you can have resource inside .exe, how do you do that? And also, is there a way in SFML, that i can change the directory of my assets? So like for example, in my game folder i will have a subfolder named "Sprites" and then put all my sprites in there. The problem is that when i used sf::Texture::LoadFromFile it only looks in the game directory, not the sub folders.
Title: Distributing SFML games on other websites.
Post by: texus on January 28, 2012, 09:02:53 pm
Quote
The problem is that when i used sf::Texture::LoadFromFile it only looks in the game directory, not the sub folders.

You can just call LoadFromFile("subfolder/filename").

Quote
you can have resource inside .exe, how do you do that?

It is a long time ago I did this, you should just search information about using resources in Visual Studio.
Title: Distributing SFML games on other websites.
Post by: Tank on January 28, 2012, 09:28:59 pm
Sigh, I give up.
Title: Distributing SFML games on other websites.
Post by: TechRogue on January 28, 2012, 11:31:46 pm
Don't worry Tank. Five abandoned projects later and maybe he'll take your advice.  :wink:
Title: Distributing SFML games on other websites.
Post by: binary1248 on January 29, 2012, 12:59:09 am
Quote from: "Tank"
There is no protection, and there will never be one.


Oh, but of course there is... but it is on such a level higher than what is popularly known that it might not even count.

Distribute a thin client (http://en.wikipedia.org/wiki/Thin_client) that forwards user input to a server and does nothing else but draw the primitive data it receives to the screen. That way, that which is unique to the game (it's mechanics) never gets fully exposed to the end user. Of course the resources that you send the user will be on his system and thus Tank's other points count. But he won't have the game without it's mechanics will he? This will of course only work if your users all have a 1Gbit connection and <1ms network latency, oh wait...

Hope those AAA game companies didn't see this. Ah *$%#, too late :evil:

Why do I release my code under GPL and then write stuff like this? I will never know...
Title: Distributing SFML games on other websites.
Post by: Viruses on January 29, 2012, 04:18:53 pm
Ok guys listen. The only thing i care about is that they can't CHANGE my ART assets and then play in MY SPECIFIC game with assets that they changed. For example, lets say im desiging a space shooter and i have bullets. Well the bullets are going to be sprites. So i made collision detection that if the bullets hit the enemy they die. Now listen. All they have to do is go into the directory of my game, look for the bullet sprite, change it so that it fills the entire screen or watever, and then when they shoot all enemies die because of the collision detection. I want my ART ASSETS LOCKED. You guys are thinking about copyright and people stealing my work. I just don't want my game to be played differently then its supposed to. I want to make sure it plays the way its supposed to with the assets that i created. Like, earlier i told you that in this game i had downloaded, they had the maps and models in dll files so there was nothing i could do to change the maps or models. I want to do something like that. In other games i've seen files with changed extentions.
Title: Distributing SFML games on other websites.
Post by: binary1248 on January 29, 2012, 05:47:11 pm
Quote from: "Viruses"
Like, earlier i told you that in this game i had downloaded, they had the maps and models in dll files so there was nothing i could do to change the maps or models.


That must be the most idiotic thing I have ever heard of. Packing resources into dlls in the hope that they won't get modified at the expense of good software development practice is a crime against the user as well as the developer who has to put up with the weird antics of people who come up with such ideas.

If they are able to play the game on their own PC disconnected from the internet then I'm very sorry, but there is ABSOLUTELY NOTHING you can do to prevent them from changing the way the game looks or functions. You really shouldn't care either because as long as they keep it to themselves they don't bother others do they?

If on the other hand you want to play the game in multiplayer, the typical method used by many games out there is to keep a copy of the game state on every player's computer and perform the same calculations every frame on the game state. If a player's state deviates from the other players' states then his game goes out of sync and he is kicked or whatever. This would indicate to the other players that he manipulated his game in some way.

So to keep it simple. In single player, don't give so much effort, it isn't worth it. In multiplayer, there are methods, one of them I described here.
Title: Distributing SFML games on other websites.
Post by: julen26 on January 29, 2012, 06:00:57 pm
Quote from: "Viruses"
Ok guys listen. The only thing i care about is that they can't CHANGE my ART assets and then play in MY SPECIFIC game with assets that they changed. For example, lets say im desiging a space shooter and i have bullets. Well the bullets are going to be sprites. So i made collision detection that if the bullets hit the enemy they die. Now listen. All they have to do is go into the directory of my game, look for the bullet sprite, change it so that it fills the entire screen or watever, and then when they shoot all enemies die because of the collision detection. I want my ART ASSETS LOCKED. You guys are thinking about copyright and people stealing my work. I just don't want my game to be played differently then its supposed to. I want to make sure it plays the way its supposed to with the assets that i created. Like, earlier i told you that in this game i had downloaded, they had the maps and models in dll files so there was nothing i could do to change the maps or models. I want to do something like that. In other games i've seen files with changed extentions.


You don't have to use the image size as bounding box collision, just use a constant boundingBox size independent from the image size.
Title: Distributing SFML games on other websites.
Post by: Nexus on January 30, 2012, 09:35:13 am
Quote from: "binary1248"
hat must be the most idiotic thing I have ever heard of.
Why? I don't understand this almost fanatic aversion I sometimes see when it comes to protecting source code or content. I can completely reconstruct that there are people who aren't willing to expose the raw building blocks of which a game was made, either because they don't want to give the possibility to alter the game and claim to be the author, or to keep it original, or whatever.

Whether a developer allows mods of his game, is his personal decision, and not the one and only way. Speaking about "good software development" while ignoring the fact that most commercial games protect their code and resources is a little bit questionable. Sometimes it isn't bad to look beyond the horizon of the holy open-source world.
Title: Distributing SFML games on other websites.
Post by: binary1248 on January 30, 2012, 12:37:38 pm
Quote from: "Nexus"
Quote from: "binary1248"
hat must be the most idiotic thing I have ever heard of.
Why? I don't understand this almost fanatic aversion I sometimes see when it comes to protecting source code or content. I can completely reconstruct that there are people who aren't willing to expose the raw building blocks of which a game was made, either because they don't want to give the possibility to alter the game and claim to be the author, or to keep it original, or whatever.

Whether a developer allows mods of his game, is his personal decision, and not the one and only way. Speaking about "good software development" while ignoring the fact that most commercial games protect their code and resources is a little bit questionable. Sometimes it isn't bad to look beyond the horizon of the holy open-source world.


I was referring solely to the fact that that developer chose to pack his game assets into shared library files, meant for code! If he really packed them with his executable code or if he just used the DLL purely as a container for the assets I do not know. But if he really did cause the whole DLL to get handled by the dynamic linker, then... there are better ways. I have nothing against people protecting their code or assets, but there are more effective ways of doing it than mixing them with the bits and bytes that are needed to get an executable running. Most commercial games also do not pack their resources into one giant DLL file AFAIK.
Title: Distributing SFML games on other websites.
Post by: Nexus on January 30, 2012, 05:40:56 pm
Okay, with that I agree (but not with the generalized version ;)). By the way, even Laurent does that for the Arial font, even if it's not for the purpose of obfuscation ;)
Title: Distributing SFML games on other websites.
Post by: Viruses on February 03, 2012, 05:36:08 pm
Earlier someone mentioned i would have to make a windows installer because when i sent the game files to someone, they needed some extra dlls. First, why did this happen? Second, if i make a windows installer, how would it know to install those dlls and how would it install them? Third, where could i learn this?