Saving State and Object Collections

Get help using Construct 2

Post » Thu Jun 28, 2012 7:42 pm

FIRST THING!
How are other people managing state. This is what I consider state to be for more games.

    Score
    Progress in Game
    Achieves
    HATS

Has anyone tried tackling this? I think my crazy large solution will be to create a Azure web service, and have it store a app GUID and a small amount of meta data per user. No login or pass so your data is only as secure as how much you give out your guid. I think with some JSON behind the scene you can just write data to an array/dictionary as the game goes on, and then you can save it to the web service when online. Or save it to a file on dropbox maybe.

SECOND ITEM!
I have seen a couple of threads on object collections before, but I wanted to touch on them again.

One thing that was always helpful when I would build games in XNA was the fact you can use classes to represent objects. You could easily group objects together to form complex ones.

One example is a boss spaceship. It has many moving parts on it, all with different behavior and sprites. Like turrets, bullets, parts of the boss that move etc.

This is more of a feature request than anything: I'd like some way to organize an object and attach it to other objects (not pinning). So if I have a boss enemy called Boss1 and I have a bunch of turrets attached to it, I would like to call them like this Boss1.Turrets[0].Angle or something along those lines. Basically the attached objects become part of the parent object allowing you to make complicated objects. Is there a way to do this already?

firebelly2012-06-28 19:44:38
B
30
S
10
G
7
Posts: 416
Reputation: 7,239

Post » Thu Jun 28, 2012 8:24 pm

Most people use WebStorage to save data like this...
If I am being ignorant, sorry, I don't know much about this web tech stuff :P
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Thu Jun 28, 2012 8:26 pm

Physics Attachment ?

Edit : Or you can make the BossShip Family !kbdmaster2012-06-28 20:27:21
B
35
S
16
G
16
Posts: 2,222
Reputation: 16,589

Post » Thu Jun 28, 2012 8:55 pm

Regarding your second request, what you are looking for is the 'Containers' feature, very commonly requested (It was in CC)

A way to work around this is to give all the 'child' objects an instance variable called 'ParentUID' or something, which is set to the parent's UID at the start of layout. Then, when you want to pick the child of certain parent, you can pick the parent with that UID.

In terms of attaching them together, image points are probably the best option ATM.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Thu Jun 28, 2012 9:15 pm

I am going to kick around these ideas as much as I can.

I haven't looked at WebStorage yet, I'm still getting used to the HTML5 world (coming from ASP.Net). I think what webstarage is doing, is standardizing page state? This way any browser should in theory be able to share these states. My idea was to shove that into the cloud with a key. So if you move around and you have your key, you can get your state anywhere. (Azure costs money use FYI).

Alternately, you could just specify a google drive,mobile me, dropbox or skydrive folder to save the state to an XML file.
B
30
S
10
G
7
Posts: 416
Reputation: 7,239


Return to How do I....?

Who is online

Users browsing this forum: Justin1967, Nifl, Yahoo [Bot] and 25 guests