RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Lagging [2K3]

0 Members and 1 Guest are viewing this topic.

****
Touhou Fantasy Developer and all around cool person. :)
Rep:
Level 85
T.G. "Thunder God" Xenomic
So, I decided to try my hand at making my own crafting system. I have everything set up and it seems to work perfectly...save for the game lagging hardcore. Note, I used one variable for EVERY item in the game, and have it set in a Common Event as a Parallel Process (no switch trigger) so that it constantly checks how many of each item is available. Is there a way to reduce the lag given? I tried putting in "Wait: 0.0 sec", which helps in some areas, but other areas still lag badly. Or should I just make it check each time the player enters the crafting shop? (Note, I have not done this with the equipment yet, so that's even more to add to the list, so this is roughly about 500-1000 variables being checked at once at the same time. I don't know how to mitigate the problem at all...x_x;; )

*
Rep:
Level 82
Quote
Or should I just make it check each time the player enters the crafting shop?

I would expect this to help contain the lagging to when the player is crafting, but then the lag will kick in as soon as you set the script running.

Without knowing exactly how you've designed your crafting system, I'm not really sure how to help. Are you using some kind of custom menu system? Or perhaps just checking what particular items the player could make given his inventory? Or something else?

A little more info would be helpful, but I'd say a CMS based approach would definitely be a start as you can do all the setting up for the craft before running a check (which is where the lag would kick in but it's not a real issue here) to see what item(s) can be made from the ingredients provided - if you're not already doing that.
(Why do I always feel like it's the end of the world and I'm the last man standing?)

****
Touhou Fantasy Developer and all around cool person. :)
Rep:
Level 85
T.G. "Thunder God" Xenomic
This is my first time doing a crafting system (I've never tried a CMS before...as I'm not THAT advanced ^^; ). The coding I'm using for the crafting is as follows:







That's just testing it with one craftable item (I just repeat that for each one, and have a custom handler for canceling to end the event processing. I did try with the switch option, and yeah it does lag that part hardcore (but at least it keeps the rest of the game from lagging). Sadly, I'mma have to repeat this for each different kind of character/items too, which may take a while in itself since I know nothing of CMS making x_x

*
Rep:
Level 82
Maybe now is a good time to learn something new?

You don't have to go overly crazy with the CMS idea. I know it looks pretty daunting to start with, especially if you look to other peoples' creations first. The hardest part is probably in the presentation rather than the actual system itself.

Rather than having a common event check through the entire inventory list and assign individual variables for individual items, you could just have enough variables to cover the maximum number of items possible in any given synth/craft - probably four or five - and assign them only for the items you need at that time.

So after the Divine Red-White choice has been selected just before you print the message showing how many items the player has/needs, you would have your variables assigned:


: [Divine Red-White] Handler
 <> Variable Oper: [0001: Item 1] Set, Item 1 Possessed
 <> Variable Oper: [0002: Item 2] Set, Item 2 Possessed
 <> Variable Oper: [0003: Item 3] Set, Item 3 Possessed
 <> Variable Oper: [0004: Item 4] Set, Item 4 Possessed
 <> Message: ...
 <> Show Choices: Craft/Cancel
etc etc

You'd also want to take out that switch in line 1.

I've attached a screenshot of what I mean. I'd put it on photobucket but I can't be bothered to figure out my log in details.

Whilst it does mean a fair bit more work on your part, it's easier than making a CMS and won't have anywhere near as much lag as running a parallel process to assign however many variables you have items for. You'd also reduce the number of variables you need for this down to a handful which is far more easier to work with than having to look through pages of them to find the right items.

It's been a while since I really used 2k3 since I converted to VX after seeing how much easier it is to script things using the included scripting tools.
(Why do I always feel like it's the end of the world and I'm the last man standing?)

****
Touhou Fantasy Developer and all around cool person. :)
Rep:
Level 85
T.G. "Thunder God" Xenomic
Man...I was thinking of doing it this way originally too lol. But yeah, this works a lot easier than the other way, that's for sure. I may look into CMS stuff later (perhaps to update my game to be more unique than it is, I always like doing that), though that'll be for much later methinks. I do appreciate your help on this, makes things so much better.

I did think of using VX for this project when I started, but I wasn't fond of trying to script everything myself back then x_x;;