HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Huge bug with saving/loading games.

08-20-2006, 05:02 PM#1
Vexorian
1. Download the caster system's map.
2 . Play the map, save the game.
3. Load the saved game

It would crash.

http://www.wc3campaigns.net/showthread.php?t=86545

Hunter says that stopping to call InitArrayIndexes fixes the problem, but that doesn't make much sense does it?
08-21-2006, 02:51 AM#2
DioD
CS_r2i

Return bug for this like for strings, it unsafe after load/save
08-21-2006, 02:59 AM#3
Vexorian
really? But how come? argg I would have thought that real 2 int conversion had nothing to do with addresses but just values. I am now pissed at blizzard.

I can't remove the new features of CSCache, I can't forget about campaign maps either. I am now screwed up
08-21-2006, 07:30 AM#4
Daelin
May I ask why you made your own R2I function? Isn't there already a native taking care of that? As PipeDream said (was it him?), real values are not just inherited floatings from C++. The native function is safe, so I don't see why you shouldn't use it.

~Daelin
08-21-2006, 09:26 AM#5
DioD
not every real can be integer...
08-21-2006, 09:31 AM#6
Daelin
Hmm... really? Then there are cases for which R2I does not work? Strange...

~Daelin
08-21-2006, 10:48 AM#7
HunTer
so problem in return bug? but how spell inferno causes crash.When i remove call ExecuteFunc('InitArrayIndexes') using inferno writes error messages in arrays and i have save-load crash.But when haven't use inferno in Caster System i haven't crash, if i haven't call ExecuteFunc('InitArrayIndexes') in function CSCache.

I make many mistakes in this text, because i badly speak english, but i think u understand :)
08-21-2006, 12:57 PM#8
Vexorian
CollisionMissiles also use CS_r2i.

Daelin, reals have don't hold every single digit so if you lose some decimals or digits (for big numbers) some times, and since we use it for things like handles it is kind of lame.

Not initializing the Array indexes might actually cause more problems than the crash on load/save so better wait till I figure out a way to fix this ..
08-21-2006, 01:33 PM#9
Anitarf
I ran a test when discussing this with PipeDream, I think, handle adresses begin at about 1000000, and so I did a comparison R2I(I2R(i))==i for all integer numbers from that point on and it got to more than 16000000 before not evaluating to true.

As long as you don't generate 15 million handles you should be safe with R2I(). That's not very convenient for public systems, because you can't know how many leaks people using them will have.

Edit: attached the test map, I was also testing ItoR at the time, to see if it always gave a positive real, in that case it could be used in rect data structures because you could use positive values for maxX/Y and negative values for minX/Y.
Edit2: removed the test map as I cleaned old unneded attachments.
08-21-2006, 03:24 PM#10
Toadcop
Vexorian - if you use ExecuteFunc(something get from cache) it can be easy a cache problem to solve it DON'T use pure string as mission example

call StoreString(cache,only integer string like "1","34342","354", I2S(45312) ,"somestring",yourstring)
and you will not get this problems ! Darky have this problem in NCCD. i had it 1 year ago =) and solve it...

r2i() - RETURN CONSTANT DATA thats all...

Quote:
to see if it always gave a positive real
- the negative reals have handles above 4000000000 (or something like this =) ) i have tested this ! and reals have CONSTANT handles ! 100%%% =) maybe so huge numbers can't be normal stored... or i don't know...
08-21-2006, 03:45 PM#11
Vexorian
Toad I would have loved to understand at least a little part of what you said, but I couldn't, I am sorry.

Anitarf: Problem is that you don't always store handles there, the linked list for example could even mess with rawcodes, at least it helps for return bug, arrays won't ever have such big indexes and handles have much smaller values.

Makes me figure that caster system always had a crash because of this because it saves some rawcodes with return bugged i2r in the super huge array.

I think that this can be solved with a function that takes care of the stuff on initialization, but this is just random guessing
08-21-2006, 04:02 PM#12
Toadcop
Vexorian - sorry i am nooob =( my Eng is worth nothing... the caster sys 13.7 ?
i don't think what reals can cause crushes...
i will check it... it's my specialization =)
08-21-2006, 04:23 PM#13
Vexorian
Not knowing english does not make you a noob.

According to diod, using return bug between integer and real, causes crashes when loading the game , because the indexes change. And I actually believe him because it is the only logical explanation for this crash.
08-22-2006, 09:38 AM#14
HunTer
but cs 13.4 doesn't have this bug and cs 13.5 have this bug.see what u add in cs 13.5 and i think u find a problem
08-22-2006, 09:40 AM#15
HunTer
i don't find this bug in cs before 13.4