Creating Social Games

Discussion and feedback on Construct 2

Post » Tue Mar 04, 2014 12:13 pm

Is it possible to build a social game on Facebook with Construct 2? What are the requirements?
B
40
S
9
G
5
Posts: 177
Reputation: 6,805

Post » Tue Mar 04, 2014 12:28 pm

Which requirements are you referring to?
To answer your question, it's very easy.
B
11
S
2
G
1
Posts: 172
Reputation: 1,486

Post » Tue Mar 04, 2014 12:34 pm

Social games like the legendary Restaurant City or Farmville. Where will the data stored, how to retrieve information and data for the "neighbors" system and so on. So much is needed for a good social game. I don't see how Construct 2 can do this yet unfortunately...

and I don't think it's easy. Correct me if I'm wrong
B
40
S
9
G
5
Posts: 177
Reputation: 6,805

Post » Tue Mar 04, 2014 12:40 pm

Addendum: It's easier on C2 than elsewhere.

And where there's javascript there are ways for you to save individual account data to a server/database. Of course if you're new to making commercial games and you want to make such a game, you've got a long road ahead of you, but to say it can't be done is not the way forward. Instead, try asking "How can I do this?" rather than "This isn't possible, right?"

If you are not a programmer you might want to consider picking it up, though, for such an ambitious project. Look into the javascript SDK, by the way. That's probably the best place to start. Well, the best place to start would be in making the game. Then if you have a prototype you can start adding those social features you were talking about.
B
11
S
2
G
1
Posts: 172
Reputation: 1,486

Post » Tue Mar 04, 2014 12:47 pm

The game is there just got to start adding those actions from Facebook Object. The implementation can be a pain in the neck!
B
40
S
9
G
5
Posts: 177
Reputation: 6,805

Post » Tue Mar 04, 2014 1:11 pm

Jaydon wrote:Social games like the legendary Restaurant City or Farmville. Where will the data stored, how to retrieve information and data for the "neighbors" system and so on. So much is needed for a good social game. I don't see how Construct 2 can do this yet unfortunately...

and I don't think it's easy. Correct me if I'm wrong


Hi, I never play Farmville or similar game, I just saw to play my friends...

you need to make a database to store all of the information... like, when someone connect in your game, construct2 should take the UID and save in database... all of the data (JSON, variable...) should be on the database.

for the neighbors you need to make a code like "show friends who play the same app", this is easy, you can do that with php, after that you need to get the data from your friend (from the database) but how get in the games depends... in the game for example, you can appear a list of your friend with the avatar, and when you click to one, just open the data of your friend to show his game, and you can also add action....

you need to know mysql, php, and the API of facebook...

it's possible, I never try to show the friends who play the same application, but I'm sure it's easy
B
21
S
9
Posts: 298
Reputation: 2,967

Post » Tue Mar 04, 2014 1:22 pm

Ribis wrote:
Jaydon wrote:Social games like the legendary Restaurant City or Farmville. Where will the data stored, how to retrieve information and data for the "neighbors" system and so on. So much is needed for a good social game. I don't see how Construct 2 can do this yet unfortunately...

and I don't think it's easy. Correct me if I'm wrong


Hi, I never play Farmville or similar game, I just saw to play my friends...

you need to make a database to store all of the information... like, when someone connect in your game, construct2 should take the UID and save in database... all of the data (JSON, variable...) should be on the database.

for the neighbors you need to make a code like "show friends who play the same app", this is easy, you can do that with php, after that you need to get the data from your friend (from the database) but how get in the games depends... in the game for example, you can appear a list of your friend with the avatar, and when you click to one, just open the data of your friend to show his game, and you can also add action....

you need to know mysql, php, and the API of facebook...

it's possible, I never try to show the friends who play the same application, but I'm sure it's easy

Thanks for the guide! Studying Facebook's API now...
B
40
S
9
G
5
Posts: 177
Reputation: 6,805

Post » Tue Mar 04, 2014 1:24 pm

You should know JSON or XML too, I think. JSON is easier.
B
11
S
2
G
1
Posts: 172
Reputation: 1,486

Post » Tue Mar 04, 2014 1:57 pm

Jaydon wrote:Thanks for the guide! Studying Facebook's API now...


no problem, I suggest to register on stackoverflow, is a perfect community for this problem... for the facebook API you need to know hot to implement facebook with php...

at the first I suggest you to install XAMPP to test your application in local server... after that you need to make application on facebook and set the url of your application in the options of your application (search how test app in localhost with facebook)

now, I suggest to load all information of the user with the API, you need to implement this code in your index.html of construct2 (rename in index.php, search how get the user data and the permission)

now, you need to have a database and a php for communicate with the php..., should be like:

when the user connect on the application, load the UID from the php (or plugin) with username,email...etc and send this information to a registration page in php. the registration page will save all of the data on the database.

now, you need to make a code to see if the UID already exist on the database, and if the exist jump the registration, and if exist load all of the information in a specific page on php, and extract the data with construct2 to a specific variable.

now, the problem can be how store the JSON file, because the database has a limits of the string, and you can't save the JSON file in one value. for this, you can make another code in php when the user is on registration... Remember, the UID of facebook is unique and this is very good, so that you can use this to make a folder in a specific server with a php code, and when some one need to save the json file just make another code to upload the file in the same folder of the UID.

the easy way is:

You can do it to send the JSON string with the AJAX, the limits of url is 2000 characters, for this you need to make more of JSON if your characters are more than 2000. if you make a map like farmville, you can store the tilemap in one JSON for example, another one for another things etc etc....

for load the file will be easy because you know where the savegames are stored, by UID of every user...
B
21
S
9
Posts: 298
Reputation: 2,967

Post » Thu Mar 06, 2014 3:13 am

Ribis wrote:
Jaydon wrote:Thanks for the guide! Studying Facebook's API now...


no problem, I suggest to register on stackoverflow, is a perfect community for this problem... for the facebook API you need to know hot to implement facebook with php...

at the first I suggest you to install XAMPP to test your application in local server... after that you need to make application on facebook and set the url of your application in the options of your application (search how test app in localhost with facebook)

now, I suggest to load all information of the user with the API, you need to implement this code in your index.html of construct2 (rename in index.php, search how get the user data and the permission)

now, you need to have a database and a php for communicate with the php..., should be like:

when the user connect on the application, load the UID from the php (or plugin) with username,email...etc and send this information to a registration page in php. the registration page will save all of the data on the database.

now, you need to make a code to see if the UID already exist on the database, and if the exist jump the registration, and if exist load all of the information in a specific page on php, and extract the data with construct2 to a specific variable.

now, the problem can be how store the JSON file, because the database has a limits of the string, and you can't save the JSON file in one value. for this, you can make another code in php when the user is on registration... Remember, the UID of facebook is unique and this is very good, so that you can use this to make a folder in a specific server with a php code, and when some one need to save the json file just make another code to upload the file in the same folder of the UID.

the easy way is:

You can do it to send the JSON string with the AJAX, the limits of url is 2000 characters, for this you need to make more of JSON if your characters are more than 2000. if you make a map like farmville, you can store the tilemap in one JSON for example, another one for another things etc etc....

for load the file will be easy because you know where the savegames are stored, by UID of every user...

I'm no hardcore programmer and I only know some fundamentals of javascript and C++ OOP. Where can I get started? Or should I ask for assistance? If so, I'm on the wrong board I guess...
B
40
S
9
G
5
Posts: 177
Reputation: 6,805

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 12 guests