New account registration is temporarily disabled.

[RM2K3] NEED HELP WITH STEP COUNTER!

Posts

Pages: first prev 12 last
I have to run the loop constantly though so it doesn't mess the fog up when the character moves which moves the screen as well. I'm currently working on something else, but in about 30 mins I will redo the coding and see if it works.
Nope, you don't. The regular loop is not just a little faster, it's tremendously faster than the parallel process. Within a loop, it can execute 10,000 commands within a single frame before it times out. If you reach the limit of 10,000 commands within one frame, it's time to rethink the code (probably even way before that).

Assuming you execute 10 event commands per tile, that would mean 3,200 commands, which is a lot, but still significantly below the limit. At this point, you really really want to tell rm2k3 that it can stop executing this code, such that it can move on to other event scripts. If you don't you'll be executing 6,800 more lines of code which does practically nothing useful before it can move on to the other event scripts. This is very likely to cause lag.
Ok after some testing it only seems to be slightly faster, maybe 2-3 seconds faster. I thought I found the solution to make this event work, but guess not. I think it's because it cycles one part about 48,000 times or more total(Scanning entire screen), just a rough estimate. It's the part in your trigo script where it checks SIGHTEND is less than GUARDX. I created a counter to check how many times it cycles through that and it ranges from 30-350 per tile. It has to execute 10(commands) x 48,000(cycles) which is way more than the 10k limit per frame.

Edit: Do Dyn plugins operate outside of the 2k3 engine? If it does then I can try to use that to eliminate the 10k limit.
Yes, using the trigonometric event solution to check every tile is probably going to be a rather bad idea. You would have to make several clever optimizations for that to work, and even then there's no guarantee it would be efficient.

As for DynPlugins, you could indeed say they are working "outside" the rm2k3 engine. Calling a the plugin with a comment or so is not entirely free though in terms of performance, but I suppose you could still try.
Well thanks for the help, at least I learned some good stuff for future projects. I think I've learned more stuff from you than any other source so far lol.
Pages: first prev 12 last