playMaker

Author Topic: Virtual Pet game - Where to Begin?  (Read 4678 times)

Gorotoro

  • Playmaker Newbie
  • *
  • Posts: 3
Virtual Pet game - Where to Begin?
« on: March 13, 2014, 07:41:59 PM »
Hi everyone,

I've designed a Virtual Pet game that I'm ready to start building in Unity.  I have all of the features designed, and I know exactly what I *want* to do, but I just need to know where to begin.  This is my first Unity/Playmaker game, outside of tutorials I've done online. 

Without getting into too lengthy an explanation, I'll just explain a few concepts that I'd like some advice on.

This pet has 3 categories of "Care" that the user needs to address.  Each "Care" category has a value.  This "Care" value is received via player interaction, like feeding the pet food, playing with the pet, or washing the pet. 

These "Care" values degrade over time, so in essence, they are basically timers that, when they reach a value of "0," cause the pet to become "sad."

From what I understand about Playmaker, and my limited knowledge of the technical side of gaming, all of the "Care" categories are, in essence, variables?  And I know the "Care" interactions will be tied to both Actions and Events, but I'm just not sure how to construct these variables from the get-go.  Which Action in the Action Browser would this type of variable fit in with?

If anyone can point me to where in Playmaker I should begin, that'd be great.  I've searched the forums for "virtual pet," but haven't really found much. 

Thanks in advance!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Virtual Pet game - Where to Begin?
« Reply #1 on: March 14, 2014, 07:08:46 AM »
Hi,

 I suppose this timer is absolute, so basically you should record the current time in a variable, save it the player prefs and when the game is running compare the current time with this inital time, you then get the total amount of time elapsed, that would be for 1 care.

 typically, you'll need to look at at time and date as well as playerprefs actions.

"Get System Date Time", and get/set playerprefs actions.


bye,

 Jean

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Virtual Pet game - Where to Begin?
« Reply #2 on: March 27, 2014, 03:17:04 AM »
Hi,

 It indeed is right that it saves it as a string. IF however your date format is a number ( just the milliseconds or just the year), then you simply can in turn parse this string back to an int or a float using the action "Convert string to int" or "convert string to float".

bye,

 Jean

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Virtual Pet game - Where to Begin?
« Reply #3 on: April 02, 2014, 07:38:15 AM »
Hi,

 yes, it doesn't look right indeed.

separate your view to your logic, so have two fsm. One with the health value and the draining. and one that will show this health on screen.

for the draing logic, is it a deduction per seconds or else?

bye,

 Jean

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Virtual Pet game - Where to Begin?
« Reply #4 on: April 03, 2014, 08:30:23 AM »
Hi,

 ok, typically, send event ever 1 sec ( there is a delay option in the send event), and move to state where you deduce by 1 your value.

 If you want an float ( so you see floating point numbers animated), simply tween it, using a curve animation, a tween or else. Typically that's the best way.

Use "float animate" for example, and have a straight curve and you are done.


bye,

 Jean