Help! Loading is taking 2-3 minutes :( - Any help would be greatly appreciated!
The loading for one of my scenes is taking more than two minutes! So, what I'm trying to do is have it update the levels score to display in a "total score".
So what used to happen was I'd get 100 points for level 1, then I'd replay level 1 and get a 100 AGAIN, then it would say my total score was 200, and it kept adding my score. What I wanted it to do was only update my score, so if I kept getting a 100, then got a 125, it would change the score to 125 rather than keep adding all of the 100's. So its similar score system to Angry Birds.
What I did was:
tableCellValue( game.Score, Stars and Dollars ,1,1)+tableCellValue( game.Score, Stars and Dollars ,2,1)+tableCellValue( game.Score, Stars and Dollars ,3,1)+tableCellValue( game.Score, Stars and Dollars ,4,1)+tableCellValue( game.Score, Stars and Dollars ,5,1)+tableCellValue( game.Score, Stars and Dollars ,6,1)+tableCellValue( game.Score, Stars and Dollars ,7,1)+tableCellValue( game.Score, Stars and Dollars ,8,1)+tableCellValue( game.Score, Stars and Dollars ,9,1)+tableCellValue( game.Score, Stars and Dollars ,10,1)+tableCellValue( game.Score, Stars and Dollars ,11,1)+tableCellValue( game.Score, Stars and Dollars ,12,1)+tableCellValue( game.Score, Stars and Dollars ,13,1)+tableCellValue( game.Score, Stars and Dollars ,14,1)+tableCellValue( game.Score, Stars and Dollars ,15,1)+tableCellValue( game.Score, Stars and Dollars ,16,1)+tableCellValue( game.Score, Stars and Dollars ,17,1)+tableCellValue( game.Score, Stars and Dollars ,18,1)+tableCellValue( game.Score, Stars and Dollars ,19,1)
***All that means is that change "total score" to "score for level 1"+"score for level 2"+"score for level 3"...and so on.
I'm also doing the same thing for stars and dollars. The thing is that it's all loading on the same scene, which makes that scene take 2-3 minutes to load!!
Now I'm certain that there's a better way to do this, with less loading, as all GS-made games that have levels with points/stars/dollars have to be able to do this. I don't know, is there a way display the value of an entire column? I know for a fact it's possible...
Any help would be greatly appreciated.
So what used to happen was I'd get 100 points for level 1, then I'd replay level 1 and get a 100 AGAIN, then it would say my total score was 200, and it kept adding my score. What I wanted it to do was only update my score, so if I kept getting a 100, then got a 125, it would change the score to 125 rather than keep adding all of the 100's. So its similar score system to Angry Birds.
What I did was:
tableCellValue( game.Score, Stars and Dollars ,1,1)+tableCellValue( game.Score, Stars and Dollars ,2,1)+tableCellValue( game.Score, Stars and Dollars ,3,1)+tableCellValue( game.Score, Stars and Dollars ,4,1)+tableCellValue( game.Score, Stars and Dollars ,5,1)+tableCellValue( game.Score, Stars and Dollars ,6,1)+tableCellValue( game.Score, Stars and Dollars ,7,1)+tableCellValue( game.Score, Stars and Dollars ,8,1)+tableCellValue( game.Score, Stars and Dollars ,9,1)+tableCellValue( game.Score, Stars and Dollars ,10,1)+tableCellValue( game.Score, Stars and Dollars ,11,1)+tableCellValue( game.Score, Stars and Dollars ,12,1)+tableCellValue( game.Score, Stars and Dollars ,13,1)+tableCellValue( game.Score, Stars and Dollars ,14,1)+tableCellValue( game.Score, Stars and Dollars ,15,1)+tableCellValue( game.Score, Stars and Dollars ,16,1)+tableCellValue( game.Score, Stars and Dollars ,17,1)+tableCellValue( game.Score, Stars and Dollars ,18,1)+tableCellValue( game.Score, Stars and Dollars ,19,1)
***All that means is that change "total score" to "score for level 1"+"score for level 2"+"score for level 3"...and so on.
I'm also doing the same thing for stars and dollars. The thing is that it's all loading on the same scene, which makes that scene take 2-3 minutes to load!!
Now I'm certain that there's a better way to do this, with less loading, as all GS-made games that have levels with points/stars/dollars have to be able to do this. I don't know, is there a way display the value of an entire column? I know for a fact it's possible...
Any help would be greatly appreciated.
Comments
try to make size of your screen 1536 x 768, use only 1024.
remaining area, place all your items, when ever changes happen simply call these items to your scene area using attribute true and false and then send them back to the out of stage area. This will save you loading time and memory leaks.
spawning and destroying causes loads of problems, use tables to simple shift them on and off scene, will be troublesome but saves loading time.
and my graphics are for retina 2048 size.
tableCellValue( game.Score, Stars and Dollars ,1,1)+tableCellValue( game.Score, Stars and Dollars ,2,1)+tableCellValue( game.Score, Stars and Dollars ,3,1)+tableCellValue( game.Score, Stars and Dollars ,4,1)+tableCellValue( game.Score, Stars and Dollars ,5,1)+tableCellValue( game.Score, Stars and Dollars ,6,1)+tableCellValue( game.Score, Stars and Dollars ,7,1)+tableCellValue( game.Score, Stars and Dollars ,8,1)+tableCellValue( game.Score, Stars and Dollars ,9,1)+tableCellValue( game.Score, Stars and Dollars ,10,1)+tableCellValue( game.Score, Stars and Dollars ,11,1)+tableCellValue( game.Score, Stars and Dollars ,12,1)+tableCellValue( game.Score, Stars and Dollars ,13,1)+tableCellValue( game.Score, Stars and Dollars ,14,1)+tableCellValue( game.Score, Stars and Dollars ,15,1)+tableCellValue( game.Score, Stars and Dollars ,16,1)+tableCellValue( game.Score, Stars and Dollars ,17,1)+tableCellValue( game.Score, Stars and Dollars ,18,1)+tableCellValue( game.Score, Stars and Dollars ,19,1)
so how to make it smaller/faster, and get the same result? @wickedsunny
Thanks
ok I think my initial explanation of my problem was too long/complicated.
All I'm asking is how to display a "total score", as in the score of level 1+the score for level 2+ the score for level 3...
In other words, how to display the value of ALL of the cells in 1 column without having a super long loading-time-lengthening rule? I'm sure that this is possible as all level-based games have it.
can anybody help?
From what I understand, You want ONLY the highest score for any given level to save.
So if you play the same level and you get scores of 89, 125 and 100 respectively, It will display 125.
If you can achieve this then you will abandon adding all the scores together?
Well then to do that all you need to do is create a rule that fires when each level is complete that says:
Attribute WhateverHoldsLevelScore is > LastLevelScore:
Change Attribute LastLevelScore to WhateverHoldsLevelScore
What this does (obviously) is change the old score to the new score only if the new score is higher.If that isn't what you needed, you will need to be more clear as to what you are trying to achieve. Because this: Doesn't make sense. Why would you want to display a score for the totals of all the levels? How would that lessen the loading time? Also, adding a bunch of values from a table shouldn't take more than half a second (whether the values come from a table or a number you input, it is still just saying add x+x+x+x+x+x+x with each x having a target in a table, behavior or memory). I would look at other culprits in your level for lag, such as timers, errant spawners, etc.
Also, as a side note i just tried creating an expression adding 12 values from a table together and displaying them as text and there wasnt an extra second of noticeable loading time. Your lag problem lies elsewhere.
Thanks for the reply. I think using specific examples will help describe my problem. What I have is a total score display that shows the TOTAL score of the entire game so far (I'm thinking about maybe adding a GameCenter Leaderboard for most total points). So what I want is that if I got 120 on level 1, then replayed level 1 and got a 150, then played level 2 and got a 115, then replayed level 2 and got a 125, I want the TOTAL score to display 275, which is the highest score for level 1+ the highest score for level 2. But the game adds 120+150+115+125, and displays a total score of 500.
So my question is how can I get the TOTAL score of each level's HIGHEST score OR how can i display the TOTAL value of all the cells in a column?
Also- I know this sounds confusing so if you don't understand me please let me know so I can post a video
Thanks
@MarkOnTheIron and @wickedsunny, Thanks for your reply, but it has nothing to do with the other actors, as it is in a level-select scene with nothing but display-text actors and change-scene actors. Also, loading was fine until I fixed the problem that added all scores for a level rather than keeping the highest score. But I fixed the loading with a super-long attribute which greatly lengthened the loading time from a few seconds to a few mins.
Is there a way to get the total value of all the cells in a column?
Can anyone help?
So basically all I'm asking is how to display the total score, as in the sum of the highest score from each level.
I'm convinced that this is likely to be a stupid question, so sorry for wasting people's time.
Thanks
And let me know if you want a video of my problem
@MobileRocketGames @wickedsunny
One problem that I see in the expression you posted in your first post is that it seems like there are 4 values separated by a comma in the tableCellValue() Probably because you named the table "Score, Stars and Dollars". I'm not sure if this is causing your issues, but try to rename the table without non alphanumeric characters, something like "ScoreStarsDollars".
Thanks for the reply
Yes! That is exactly what I did- make a rule that added up all of the levels' score, and that super long rule is what made the loading so long.
*****So my question is, is there an alternative way to doing that, which is not as long of a rule*****
I will try your suggestion about renaming the table, but I doubt it will change anything, as the table name is highlighted blue anyway.
Thanks
I tried your name-change idea, but it did not work.
Ok so here is my only question: How do I update the TOTAL score of the games progress so far, as in the sum of the score of EACH individual level, BUT how to make it UPDATE the score rather than adding a higher score? @MarkOnTheIron and @wickedsunny
I hope it's that simple instead of saving score in table for each individual level. I am still not sure what exactly is the problem you are facing. Hope this helps.
Total score - current level score (replace your level # with the variable for your current level) is equal to total score. Save.
Change table score to new current level score. Save.