dataservices and game scoring persistence?


hey guys, may drastically overthinking , need quick reality check.

 

i'm using flex data servies communicate server running php.

 

i have different actions within game can happen result of user doing inside flex app, or things being done them while swf not loaded (php, cron, etc).

 

all want update user changes since last log in.

 

ex:

 

"you earned 3000exp, made $232, ran out of ammo, found furbie, , gained 5 new friends since last login!"

 

pretty basic right?

 

the problem i'm having how determine has changed between logins.

 

currently i'm looking @ creating php/mysql-based event system records actions happen (either due online action, or offline action), , have column in table "displayedtouser" basic bool updated when user logs in , updates displayed.  when user logs in, intersticial screen pulls records have not been displayed, , voila.  messaging.

 

i've contemplated sharedobjects store pertinent user data breaks when hop different browser (not train wreck).

 

also, i'm having hard time conceptualizing how abstract action types have own pertinent data...

 

ie:  new friend have friendid, new award may have awardid, etc.

 

i started looking @ game engines hopeful type of support... found push button engine, flixel, flashpunk, etc, etc.. seem overkill simple (i'm not doing kind of 'game play' front end isometric or otherwise -- yet).

 

is there more simplistic elegant way or on right path?

 

thanks lot insights

wow.. lots of stuff cover.  don't think of flex specific; more architecture oriented.  but, i'll give shot:

 


when user logs out, or when user's session time outs; time stamp account how.  let account remain inactive.  next time sign in; run script figure out should have happened while gone.  if users affect each other, can queue in database somehow.  otherwise have algorithms along lines of:

 

"every 24 hours earn 1,000 experience points; , since didn't log in 3 days, 3,000 experience points."

 

or

 

"you have 4 farms , 2 guns; therefore able kill 1 wolf each gun on farm protected making $200 per wolf, other 2 unprotected farms lost 6 sheep each, losing 700 each, net total loss of $1,000"

 

or whatever.

 

implement stuff; use command design pattern each special action.  command design pattern class has "execute" method.  can pass in value object of relevant data.

 

so, example; every 'command' accepts userid or user object.  when user signs in, make database call (they have 4 farms); , call "farm.execute" method passing in user object.  farm object pings database find out 1 farm has 2 sheep; , means since last login (3 days) user generated 4 wool coats can sold ....

 

 

having "displayedtouser" table fine; use archive purposes.  care happened between last sign out , login.  create "entries" stuff when user logins in; store in 'displayedtouser" table (archive) , show user.

 

if there social aspect game; can queue said requests based on userid.  don't take affect until user logs in , run "execute" command.

 

i hope i'm not massacring whatever cool stuff in game making scenarios.  hope helps; more of brainstorm specific solution you.



More discussions in Flex (Read Only)


adobe

Comments

Popular posts from this blog

Joomla site hacked, cant see front and - Joomla! Forum - community, help and support

Christian Home School Programs - Joomla! Forum - community, help and support

Trouble with PF_OutFlag_I_USE_AUDIO and PF_CHECKOUT_LAYER_AUDIO