Really, I do not get why so many users on this site try to build an ORPG. This genre is not easy and comes with a lot of work. Most I have seen here is 08/15 crap that does not meet any of my requirements.
Yeah "challenge", when they have not even acquired the basis of technical knowledge, ask for very essential stuff in the forums afterwards and a team that realizes their project.
All of the above + small save/load codes. Save/load codes that are larger than they need to be (most maps have codes more than 2x longer than they should be) just piss me off ;\.
i save 12 ability level, 10 item (refine level for each and for 5 item the socket stone was gold be max ~8-9 and i got 6 different socket stone)
then regular str/agi/int/lv/class/gold and lumber
but if most of rpg save alot thing then code must be long :/
Or you could just make your own game then. Why bother compressing the data through obscure algorthims when you can store 256 int values per kilobyte.
Oh, you can make it shorter if you do good catalog design and use a proper save/load system. If you are using Acehart's or any other save/load system besides the one I wrote, your codes will be longer (possibly >2x) than necessary >.>.
For example, you don't need to save all of the abilities... if you always save 12 abilities all the time, your save/load is already setup incorrectly. If you save the full strength using some constant value, then you are saving stats wrong. If you always save all of the items, you save items wrong. If you always save items using a catalog containing all of the items, you design your catalog wrong (same with abilities). If you are saving out of your max gold or dividing by some constant, you are saving your gold wrong.
If you are doing all of the above, your save/load is 100% completely setup wrong.
If you are using Acehart's or Pipedream's lib for save/load, then you are using the wrong save/load system, meaning that not only are you saving more data, but that data is taking up more space, meaning now you get extra size from both your poor design and the poor design of the system you are using.
Sadly, your save/load code appears to be longer than necessary.
It doesn't appear that you are converting everything into 1 massive number, so it grows larger there. Furthermore, you are always saving all of the information rather than saving partial sets.
You are using BigInt right?
function ItoS takes integer i, integer len returns string
local string s = ""
local integer m = 0
local integer c = 0
local integer l = StringLength(udg_LoadCode)
local integer v = l * l * l * l * l
local string n = SubString(udg_LoadCode, 0, 1)
loop
exitwhen i==0
if i > v then
set m = i / v
set i = i - v * m
set s = s + SubString(udg_LoadCode, m, m + 1)
elseif v==1 then
set m = i
set i = i - m
set s = s + SubString(udg_LoadCode, m, m + 1)
set i = 0
endif
set v = v / l
endloop
loop
exitwhen StringLength(s)==len
set s = n + s
endloop
return s
endfunction
function SPos takes string s returns integer
local integer l = StringLength(udg_LoadCode)
local integer i = 0
local string spos = ""
loop
exitwhen i == l or spos == s
set spos = SubString(udg_LoadCode, i, i + 1)
set i = i + 1
endloop
if spos != s then
set i = - 1
endif
set spos = null
return i - 1
endfunction
Rather than using many integers, you can form them all up into 1 giant one.
http://www.hiveworkshop.com/forums/jass-resources-412/system-bigint-188973/
My save/load stuff in Spells section runs off of BigInt.
Furthermore, you are still saving the actual data incorrectly... not only the wrong format, but the wrong way... you don't know how to save a partial set do you?
not only the wrong format, but the wrong way... you don't know how to save a partial set do you?
I'm going to make this very simple for you to understand
2 and 1 are smaller than 2 and 1 as separate integers
2*2+1 = 5
2 and 1 make up 21
5 < 21
If you have more than one integer making up your save/load code, your code is longer than it needs to be. The more integers you have in your code, the longer it will be.
21 has 2x more digits than 5 does. This is the reason why most save/load systems, including AceHart's, have codes around 2x longer than the ones produced using BigInt. BigInt makes it possible to store all values into 1 integer. Without BigInt, you have to store them using multiple integers or you have to write your own BigInt library.
As for partial sets, we'll deal with that after you get your stuff saved correctly.
edit
If you want, you can convert my vjass BigInt 2 lib to JASS : ). It'll help decrease the size of your save/load code ;p. The alpha is in a thread in this forum =D.
The idea of saving partial sets is this.
If you have your standard wc3 inventory that can save items and the hero is only holding 4 items, don't save the extra 2 empty slots... that's just a waste of space... only save 5 slots, 4 for the items and 1 for holding 0 so that you know when to stop. An empty inventory should only save 1 slot.
After this, you also use advanced catalogs to lower the amount of space that each item takes up. If a hero can only equip warrior items, there is no need to use a catalog that includes wizard items... only use the warrior catalog. If a slot can only hold axes, there is no need to include armor when saving that slot.. just save axes. If you can only hold 1 sword and you just saved a sword, there is no need to include the sword catalog with future saves... remove it from your general catalog.
Someone was just asking me how he should do this and I gave him an algorithm that'll allow him to save partial inventories + remove catalogs as the necessary items are being saved.
If you are saving abilities and the hero is level 1, you shouldn't be saving level 40 abilities... that's just silly >.<. If you look at my SaveAbilities function, it saves abilities smartly... just like my SaveItemCharges function saves item charges smartly.. it doesn't save an item charge if the item can't have a charge >.<. It doesn't save a max item charge of 99 if the item can only hold 3 charges like other resources do... no, it saves the exact and precise item charge.
This is the exact thing I was talking about... most map makers are just sloppy about what they do. Later when you talk to them and say that there is a better way, most people will just say, "nah, you're wrong, what you say is just totally impossible." What's funny is that they will continue to say this even after you prove that you are right... they'll just go, that can't be working, even when it saves and loads properly.
For save/load, you always want to use BigInt and Catalog >.<. For saving values like gold, you want to use CompressInt.
There are many, many save/load resources out there (most of which that I have written) that help make good save/load easier, yet people will try to do it on their own and then wonder why their code is so much longer than it would have been if they had just taken the easy route and used the already made resources... yes, even map specific save/load systems lose to the general resources. Why? Because the general resources are used to create map specific save/load systems >: O. Notice that my resource isn't called The Ultimate Super Badass Save/Load System of the world >.<. It's called Save/Load With Snippets, meaning that it will teach you how to make your own save/load system using a collection of snippets >.<. Not using the snippets to make your own save/load system and instead writing your own snippets that don't even work as well is just silly. But then again, we have many GUI users who go, "I just want a save/load system." You can't have a general all purpose save/load system because not every map needs the same things or saves in the same way... they don't seem to understand that >.<.
You can still save partial custom inventories... it sounds like slots in your inventory equip specific items, so you can take advantage of that.
You don't understand what I am saying..
Can you wear a staff weapon in a slot that holds armor pieces?
Can you wear gloves in the helm slot?
its something like u create a item pool (i mean here item pool like in gui the unit group array) then u can sort item to different groups, right?