PDA

View Full Version : [2.51+] Fix Bitmaps Persisting?



ZoriaRPG
01-10-2017, 11:25 PM
This is a 'should be do it' type of question, and debatable.

At present, when you exit a quest (but not ZC), any bitmaps in memory are not cleared. This means that the next quest to load can potentially draw these bitmaps, and unintentionally.

Say that quest A had written to b itmap 1, and quest B tries to write to bitmap1, and draw it tot he screen. Whatever datum was written to it by quest A, persists, and will be written by quest B. That is, unless the quest author knows to clear them first with Init and OnContinue.

As far as I know, no quest has used this as a 'feature', and I have warned several scritpers against ever[I] doing this, and I believe we should do something about it.

Clearly, the simplest solution is to wipe all bitmaps on quest load. IDK how this will affect user-generated bitmaps either. I think those will be destroyed on quest exist, but only Gleeok can answer that, as he wrote those.

Another solution, is to allow the user to statically save user bitmaps with the quest file. This would be [I]ideal, but I do not know if it is practical. Then, system bitmaps (stock 2.50 bitmap pointers) can be wiped, but the user can stills ave some bitmaps perpetually. This would speed up complex draws that occur regularly, so that they need on be set up one time. They could even be set up in such a way that they are embedded in the quest, but likely they will need to be in the .sav file.

The third option, is to do nothing, which may well result in bizarre quest bugs in the future. I feel this is a bad idea.

Whichever we choose, we need to determine of the behaviour that we change carries backward--this meaning, if it only affects quests on 2.51+, or if it also affects 2.50 quests. There is a very small chance of a backward-compatibility concern with wiping bitmaps, and again, I know of no quest that uses this bug/oversight for any kind of speed advantage, Obviously, whatever we do, we need only clear stuff when the quest fully exits, not merely on retry/continue. Clearing on those, IMO, would be a bad idea, as there is no reason that the quest author shouldn't prefabricate bitmaps to use on retry/continue.

What are all of your thoughts on this matter?

Gleeok
01-11-2017, 12:04 AM
I'm pretty sure I already fixed it, along with some other stuff. I just haven't committed anything yet, or maybe I did and it got deleted, idk, I can't remember yesterday right now.

I definitely won't save them to the quest file though; I know we already had this discussion.

DarkDragon
01-11-2017, 01:43 AM
Data leaking from one quest to the next is obviously a bug. The bitmaps should be wiped (sounds like gleeok did this already).

Gleeok
01-11-2017, 02:53 AM
I was putting stuff off until after the holidays, but now I've been sick all week. :(

Mitsukara
01-12-2017, 09:47 AM
One thing this made me think of that could be kinda cool, would be if you could deliberately save a small external file in a quest via scripts (Like saving a .txt file mid-play from ZC, basically) and then load such files in another quest- maybe even have the external file contain a readable variable array that either quest can read/write from. That would be a really cool way to set up things like Oracles-esque linked games, or weird instructions for sequels or connected reactive storylines that track how you did things, etc.

I realize that's a little off-topic from the subject of clearing bitmaps, but, it might be neat to have a deliberate way to carry data from one quest to another, and this is what made me think of it.