| 02-01-2007, 11:41 PM | #1 |
I want to use my own system to store values via the return bug (so I can learn), and I would like to stay away from using a GameCache (performance). My map in question will be a single-player map, so I intend on using variable arrays to store information. Now, I need a way to find what array the handle is using, so I can reference different a different array to do stuff with it. How would I go about doing this in an efficient manor? The brute-force method would be to look the array until I find matching values, but I believe there is a better method. Can someone enlighten me? |
| 02-01-2007, 11:44 PM | #2 |
game caches -Av3n |
| 02-01-2007, 11:56 PM | #3 |
I'd hate to think that would be the only reasonable way to accomplish this. There are a few issues I am worried about that can be found Here. Basically, if a player exceeds their limit of caches, everything would go to hell (that uses caches) or am I missing something? If variables are used, you can do just as much as GC, but without the worry (IMO). If I am totally hitting the wrong spot, someone tell me. The other problem about GameCaches and single-player is that I will be using the save game cache function (to save data between maps). This would then save all the other storage caches (which I don't want) and effectively reducing the amount of caches left for use. And thats where I stand. |
| 02-02-2007, 12:21 AM | #4 |
Creating a new profile might work ;P Having native hash tables would be a blessing. You could emulate one by having a fucking huge array (probably by hacking common.j), and using an StringtoIntegerId function to get an index value. I don't know how unforgiving would be in terms of memory or actual effectiveness, but you could give it a try and vene post results ;P |
| 02-02-2007, 12:22 AM | #5 |
The only way to save across maps is gamecache, and it's perfectly fine since you're not gonna be saving more than 3 or 4 tops, and you'll never really be in danger of reaching that limit. Besides, gamecache is more than flexible enough for a singleplayer map. |
| 02-02-2007, 12:34 AM | #6 |
Hmm, kk. Maybe I'll combine all my systems into one uber-cache. That way there is only 1 cache to worry about instead of 3 to 4. Yes, creating a new profile does work, but if someone downloads my map and gets huge errors right off the bat, I doubt they would want to read up on how to fix it, and just not play period. I was thinking of the huge array, but that may be worse than a GC (because it's not native to WC3; and were not talking about any side effects; like some stupid variable limit). Thanks again. |
| 02-02-2007, 01:04 AM | #7 |
Just throwing another idea out there: Moyack was working on a memory system at one point (It was called the Moyack Memory System), and I know there's a thread about it around here somewhere. I'd suggest that you find that thread and/or PM Moyack about it to see if he can help to enlighten you. |
| 02-02-2007, 02:22 AM | #8 |
I did find the thread, and I also PMed Moyack. We'll see what happens. I tried increasing the array limit, but it didn't work. This problem would be so much easier if it wasn't for stupid limitations. I'll keep brainstorming though. |
| 02-02-2007, 02:40 AM | #9 |
We already have native hash tables, they are called gamecache. Ammorth, if you really care about efficiency, you only need to attach 1 integer to a handle, then you can use structs or a low level equivalent, (just array lookup related to the attached integer) That's the fastest way available as of now |
| 02-02-2007, 04:09 AM | #10 |
Thanks for the info. Iv decided to just use the GC cause it will be easier to code with instead of trying to learn some new idea. |
| 02-02-2007, 04:49 AM | #11 |
bah that's kind of the worst conclussion you could have made, |
| 02-02-2007, 05:15 AM | #12 |
Haha, but it is the easiest conclusion! Anyways, my systems are doing fine (so far) with the GameCache method. You'll also be pleased that I have become addicted to coding in JASS with JassCraft. It's so much easier than the GUI! [sings] Amazing grace, how sweet the sound. I was blind but now I see! [/sings] I can still convert to another system if something does come up (only have like 5 GC calls atm). [offtopic]Oh vex, any idea when my Pathing System will be approved, or even checked?[/offtopic] |
