playMaker

Author Topic: Saving List of Watched Video  (Read 2214 times)

gregacuna

  • Full Member
  • ***
  • Posts: 142
Saving List of Watched Video
« on: July 21, 2017, 02:07:46 PM »
Hi All...

We're creating a virtual world which will have different worlds with lots of different videos with each world representing a different category. Trying to figure out the best way to save in the info about which videos have been watched by a player. I'm using SmoothSave and Playmaker.

Thinking about creating an array for each category (algebra, geometry, etc.) where the index represents the number of the video in that category and an entry where 0 is unwatched and watched is 1. Would that work? Would I be better off creating the full array filled with zeros at the beginning or only add the one as they watch? This is important because there are over 4,000 total videos which will be referenced....so I'm worried if I fill the arrays at the beginning it could slow down the game.

I'm pretty new to all this so I'm hoping someone might tell me a way which fits this scenario well.

Thanks, Greg

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Saving List of Watched Video
« Reply #1 on: July 22, 2017, 04:19:17 AM »
hi,
Arrays is a good way to go, but you can use a bool instead of an int variable.

Do you need to know the result of all videos on the start of the game?
Meaning you need to loop thru the whole array, then it is better to split them.

If you only need to know a certain video on a certain moment of the game and you know in advanced on what index number, then a single array would be fine.

But for better clarity when placing all your videos, maybe it would be better to split them up (for each world or for each category as you said)

gregacuna

  • Full Member
  • ***
  • Posts: 142
Re: Saving List of Watched Video
« Reply #2 on: July 22, 2017, 08:06:07 AM »
Hey djaydino...

Makes sense to make it an array of bools...thanks for suggesting it. Honestly, I haven't really figured out how it is going to work. I feel I need to have logic which will remind a player if they have skipped a video, but will allow them to watch "lessons" out of order if they choose.

Since this is just a prototype I don't think I'll be trying to get the full functionality in the first version.

Cheers,
Greg

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Saving List of Watched Video
« Reply #3 on: July 22, 2017, 08:39:53 AM »
Hi,
You can use a 2nd bool array (has skipped) for that,
or use a int array as you had 1st,
Then an 'int switch' (0: movie not watched, 1: movie watched, 2: movie skipped)
and do what you want to do on the next state for each switch.

gregacuna

  • Full Member
  • ***
  • Posts: 142
Re: Saving List of Watched Video
« Reply #4 on: July 23, 2017, 06:44:27 AM »
The array with the option to have something for skipped videos could be very helpful. I have to think about it. I like the simplicity of the bool array, but you idea offers much more flexibility. Could even add an int value for a video which has been stopped before finishing so there could be another array where resume time could be stored.

Cheers!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Saving List of Watched Video
« Reply #5 on: July 23, 2017, 12:07:34 PM »
Hi,
Arrays are pretty powerful.
Also like for example to store objects and if you need to find something you can find it in that list instead of using 'find GameObject' which is very expensive (cpu usage)

indeed you could store and save the time.

good luck with your project :)

gregacuna

  • Full Member
  • ***
  • Posts: 142
Re: Saving List of Watched Video
« Reply #6 on: July 24, 2017, 12:01:45 AM »
Wow...the idea of storing game objects in an array list is quite interesting. It's one of the things I've struggled with since I've been saving game objects as global variables in order to turn them on and off.

I'll have to try it using an array of game objects.

Thanks yet again!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Saving List of Watched Video
« Reply #7 on: July 24, 2017, 03:44:21 AM »
Hi,
No problem :)

Btw you can find many tutorials here.

gregacuna

  • Full Member
  • ***
  • Posts: 142
Re: Saving List of Watched Video
« Reply #8 on: July 24, 2017, 05:21:06 AM »
Thanks! Haven't looked through the tutorials in a while. Will check again as I'm working on these things.

Cheers,
Greg