Making a Browser Game That is Persistent with MP

Get help using Construct 2

Post » Thu Dec 11, 2014 4:51 am

Hello,

I am having trouble with my game but is not exactly C2 related. I currently have a mostly working prototype that with it I plan to move my game into a Alpha state. The Game is a browser based game with a navel table top war game esq play style. I also have a lot of customizing ability mostly with choosing a crew with attributes to man each ship. Also a mostly working custom character maker. The game will have a multiplayer function to. Which will allow the players to play each other with their fleets. I also will at some point incorporate a persistent war element where players play matches to claim territory.

Anyway

The issue I have right now is that I can not find a way to save the player data so when they relaunch the game they will be able to access their game data. I have been using JSON with the webstorage but am having trouble getting it to stick. The custom character maker for an example. I am trying to save that to somewhere and then come back to it after relaunching. I have a sprite with empty frames and when I click a button to save it the game will take a screenshot of the character and then set the frame of the sprite to that screenshot. Then it is suppose to save that sprite to local storage with a key called "(PlayerName)MyCharacters" and have it be the JSON of that sprite.

When you go into a MP match on a different layout, it will call that sprite and display it. So your crewman "Bobby" will then now be playable and can even face off with your opponents "Sally". Having just one sprite store all your custom made crew just with a different face on each frame will greatly save time and how much resources are needed. I did start with trying tilemaps but I could not find a way to change the image of just one tile, but this will do, hopefully.

So seeing as I cant get the JSON to save how should I approach the problem? I do at some point want to host my own website that will securely store all the data. I do not want the player to keep the files. However I really don't want to build the website in parallel to the game, least this prototype so I am mostly looking for a patch so I can move on.

Which brings up another but separate point, C2 allows for exporting to a number of hosting sites but those are not built for what I have in mind for this project. Is it even feasible to take my C2 game and host it myself. I know the basics of HTML and a pinch of CSS so actually building the site is not really a issue just how to marry C2 and the Website.

All of which brings back to storage. Do I slap a Website together and then go back to the game? If so than how do you store data on 3rd party web server? Or is there a way that I can keep it small scale and still get my data to play nice.

Thank You,
CrazyVulcan
"Were all mad here. I'm mad, your mad." "How do you know I'm mad?" Asked Alice. "You must be" Said the Cheshire Cat. "Or you wouldn't have come here"-Lewis Carroll: Adventures In Wonderland
B
7
S
2
Posts: 113
Reputation: 1,245

Post » Thu Dec 11, 2014 5:17 am

I can't help you with your game question but I can touch on the website part.

I just finished testing my game using the html export option.
Uploading to a webhost is extremely easy, I just copied and pasted the files and boom my game was up.
It comes embedded on a standard html file that you could edit and integrate into your website.
Saving and reading from your website storage should't be an issue.
B
4
Posts: 9
Reputation: 220

Post » Thu Dec 11, 2014 5:27 am

Hayeck904 wrote:I can't help you with your game question but I can touch on the website part.

I just finished testing my game using the html export option.
Uploading to a webhost is extremely easy, I just copied and pasted the files and boom my game was up.
It comes embedded on a standard html file that you could edit and integrate into your website.
Saving and reading from your website storage should't be an issue.


Huh, I could export a test file to see what happens, thanks. As a newcomer to web development could you explain what steps I need to store that data? I have not looked at XML yet for storing my data but you can save those. So just put all the JSONs of each player in their XML file and call that when they log in.

I will look again at the tutorials here but any resource/tips will be welcome
"Were all mad here. I'm mad, your mad." "How do you know I'm mad?" Asked Alice. "You must be" Said the Cheshire Cat. "Or you wouldn't have come here"-Lewis Carroll: Adventures In Wonderland
B
7
S
2
Posts: 113
Reputation: 1,245

Post » Thu Dec 11, 2014 6:32 pm

XML is no go due to C2 being set to read only. I'm at a complete loss with this. I can not use Webstorage, because there is not option to save to a server. NodeKit because this is a HTML game and nothing will be saved to disk. Not XML for afor mentioned resin. AJAX just calls items and has no ability to save anything. And I've looked though just about every plugin available on this site and can find nothing. Someone has to have done this before in C2.

Please I need your help.
"Were all mad here. I'm mad, your mad." "How do you know I'm mad?" Asked Alice. "You must be" Said the Cheshire Cat. "Or you wouldn't have come here"-Lewis Carroll: Adventures In Wonderland
B
7
S
2
Posts: 113
Reputation: 1,245

Post » Thu Dec 11, 2014 7:15 pm

AJAX can save data, and that's actually your only avenue of saving anything on a server. You might have overlooked that important part in the manual. Look it up, it's the "Post to URL" action.
B
67
S
28
G
24
Posts: 970
Reputation: 18,675

Post » Tue Dec 23, 2014 6:28 pm

Magistross wrote:AJAX can save data, and that's actually your only avenue of saving anything on a server. You might have overlooked that important part in the manual. Look it up, it's the "Post to URL" action.


Yes I did seem to overlook that, thank you. So I've spent the last few days looking for a platform to build my website and I have decided on "Google Web Designer". And am currently working on how to get my exported html5 file into there so when I go to that URL it will load my game. Lest for now till I actually get things like a homepage and forum built, not looking forward to that task.

Then I will come back to the issue at hand, untill then, thanks
"Were all mad here. I'm mad, your mad." "How do you know I'm mad?" Asked Alice. "You must be" Said the Cheshire Cat. "Or you wouldn't have come here"-Lewis Carroll: Adventures In Wonderland
B
7
S
2
Posts: 113
Reputation: 1,245


Return to How do I....?

Who is online

Users browsing this forum: 99Instances2Go, Malhog and 12 guests