2017년 7월 8일 토요일

laggy blocks editor


I noticed a VERY huge problem in app inventor2...
It is the laggy blocks editor.
Everything is working fine, but since my project got very large (400-500 blocks in the blockseditor on a single screen) the blockseditor is VERY VERY laggy. It takes up to 10sec. (!!) untis it reacts.
Per example: if I drag a block into the editor. I have to wait 10sec until I can drag the next blog. That  kills the my ide of deveoping a RPG using App Inventor. But is very sad, because AppInventor is a great tool. It is definitly possible to invent a real RPG like final fantasy, if there were not this problem with the blockseditor!
My PC has a Intel i7 prozessor ans 8 GB ram and a Nvidia Gforce with 3 GPUs, and even though the blockseditor is laggy! What is more, not even 20% of CPU and GPU are used. Also my Internet connection can not be the problem. it has 30Mbit up and dpwnload.
Also collaping all the blocks does not help!
SO: my question:
Is it possible to have up to 5000 blocks on a single screen without laggy blocksditor?
I do not need the blocks there all the time. They can also be saved anywhrer else and puted back in, bevore building the apk. But I can not use more screens. All the blocks have to be at the same screen. (I know: if the blocks editor is laggy on one screen, the ohers are not effeckted)

I really need your help, because I do not want to give pu my project just because unless lagg problems!

--
Is it possible to have up to 5000 blocks on a single screen without laggy blocksditor?
no ;-)
there might be some redundancy in your project?
probably it helps to read chapter 19 - 21 in Wolbers book http://www.appinventor.org/projects to get an idea how to do DRY programming with App Inventor https://en.wikipedia.org/wiki/Don%27t_repeat_yourself

it also might help to look into how lists and list of lists work, 
there are these 2 pages for AI1 

--
We are aware of the lag problems for large projects, and have been working to fix this problem. We've made some progress, but I can't yet predict when our improvements will be incorporated into a release.  Our goal is to support large projects, but we don't yet know how much of the lag we can remove. 

--
I know how lists and stuff like that works. But if I invent a RPG I need to set the HP SP MA AP and a very parameter of the monster and also set random probabilitys for item drops and damage range... also dialogues and the positions of evey grafic stuff must be set in the blocks editor. Money HP, item and questlogs, even if there is a item or a moster already collected/defeated must be saved. Threrefore I need to have much blocks in the editor.

So my question was, if I can save some of the blocks on my computer (or anywhere) and put them back in the editor, before building the apk. And why does te app inventor do not use full CPU ??

--
Can you partition your app into different screens? that could reduce the number of blocks you have to work with. You can use TinyDB to share values between screens.

--
Nice idea, thanks!
i already thought about that, but it causes a LOT of extra work. Eg: if i collect an item on screen 2 i must add it in menu in screen 1 because everything must bi in one menu, what is more to open the menu i must change screens. when i collect an item. i set a Textboxes text to 0 and save it in a tinyDB. So i ca not collect it twice because when I restart the app: if textbox item1 text is 0 set the image sprite to invisable.
Stuff like that makes it nearly impossile to make different screens
Is there really no option to save blocks is a file and delete it form the editor to restore it before building the apk ??

--
Nope; no option to do that just now.

--
That is really sad, because of the limit of blocks appinventor is just to 'try out' programming. but it has the potential to become a real coding editor if this bug gets fixed...

--
I know I'm arriving late to this party, but after reading your post, I think 500 blocks is excessive... You should probably start writing multifunction procedures with multiple passed variables that handle several of your blocks each time.  You should try to consolidate operations into more functional blocks... Now, this is a guess because I haven't seen your blocks, but one thing I learned long ago is that MANY procedures can be combined into one procedure block with multiple conditions based on the passed variables...
Just a thought...

--
...sounds interesting...

please take a look at my project... it is not finished at all. just the battel system and the menu as well as the saye system. not even the first quest is done. Also the pictures for buttons and stuff are not ready. I think with this 'source' I can make a full RPG. Just add the dungeons and the monsters, items and stuff.
right; well, App Inventor is an open source project, so feel free to
play with the sources and contribute any enhancements you come up
with: https://github.com/mit-cml/appinventor-sources

--
OK, I loaded your project and it brought my system to a crawl.  Please don't be offended by this because it's meant to be constructive, not derogatory...  Only YOU could follow these blocks and code... if something happened to you and someone else were to have to take over this project, they'd never figure it out!   You need to CONSOLIDATE some of this stuff!  It all looks interesting, and I'm not going to do the programming for you, but the first thing I saw when I opened up the project was that you have, for example, 5 notifiers on that first screen.  You really only need ONE... just create a global variable called something like message number, set that when you want to put up a message, and in the ONE notifier block, handle ALL of them based upon that global message number in a single if, else if statement..  Having 5 components when you only need one makes the system work tons harder than it has to work.

That's just an example, and I don't have time to look at all of these blocks, but I'm POSITIVE you can consolidate a lot of them... if you have things that are constantly going invisible and then reappearing, have one function with a conditional that when called, if true/false etc, sets those things visible/invisible.  Then you just have to call ONE proc rather than 75 set blocks...  Your proc could have 5 passed variables so that when it goes through and evaluates those, it sets some on, some off, some enabled, some disabled etc.  To have a single block for each and every one of these amounts to a HUGE number of unnecessary blocks...

You get my point I hope... Look at ways to cut this down.  It's SO big that even if AppInventor DIDN'T have the lagging issues right now, you'd still lag... you're causing the system to do WAYYYY too much work.

Hope this helps... It looks very interesting, but my system now needs a rest lol!

--
THANKS! it is really nice from you giving me this tips!
i will try to do as you told me ^_^

--
Have a look at the DRY links that Taifun sent; they will be really helpful.
--

댓글 없음:

댓글 쓰기