HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Cooler Has found a way new way to make classes

01-19-2004, 02:12 PM#1
COOLer
Basicly right now to make class you have to have an endless aray of data because you cant create global variables from triggers. but what if you saved a local varable to the game chach ! This would allows you save data in an easier ways. You would be able to make 2d arrays by using strings label and category and you could have multple type of classes by jsut saving to differnt game Caches. you can use locals to access and save data from the game Cache. tell me what you all think.
01-19-2004, 06:54 PM#2
COOLer
Just did a test to see if it did any game lag as far as i can tell in sigle player there is no lag. Im not shure in multplayer thou.
01-19-2004, 08:18 PM#3
COOLer
heres a demo map for you non belivers it has no lag what so ever.
01-19-2004, 08:56 PM#4
Targash
This is very similar to what i did a long time ago.
01-19-2004, 09:05 PM#5
alastor_ac
wow u guys are awesome, this works and its great
but is there any way of doing it with less code?
just wondering, thanks!
01-19-2004, 09:12 PM#6
COOLer
lol compared to weaadars old method this 10x less code! and it is a lot less limting. It about the same amout code it takes to create a c++ class
01-19-2004, 09:24 PM#7
weaaddar
Err my old method is not code intensive because of my fake object. Its code intensive because of all the stuff I make my object do.

Ix and Ix2 are about the only methods I use that do anything related to handling the object.
01-19-2004, 11:11 PM#8
COOLer
Updated version of the map with lots of commets and 1 new fuction.
It also expains how this new method works!
01-20-2004, 01:38 AM#9
dataangel
Nifty, I'd like to see a heap implementation that used the game cache.

Would this work in multiplayer? If I'm not mistaken the game cache is enabled in multiplayer, it just gets deleted as soon as the game is over.

BTW, you don't need to the Do Nothing actions. Not sure if that's a style thing or if you thought they were necessary.
01-20-2004, 02:50 AM#10
dataangel
Tested, works on bnet =)
01-23-2004, 10:13 PM#11
weaaddar
More testing:

If you save a game using this cache in multiplayer and singlplayer it will retain the cache in the save. Cool++!
01-24-2004, 07:13 AM#12
PitzerMike
Weaddar, do you have to save the cache so a w3v file is created

or does it always include your data in the savegame even if you didn't ever save the cache?
01-24-2004, 09:54 AM#13
AIAndy
Since the game can be saved at any time it has to keep an unsaved gamecache too of course.

And since the post disappeared:
I have done some speed tests with the gamecache. It seems to be a pretty efficient implementation. Using the gamecache to store an array is about 10 times slower than using a real array but that is mostly due to the I2S function. The gamecache access itself is about 3-4 times slower than accessing an array. That means that there is no need to avoid the gamecache and it is definitely kept in memory while unsaved.
01-24-2004, 07:23 PM#14
dataangel
How much slower is it with a return bug implementation of I2S?
01-24-2004, 08:24 PM#15
weaaddar
From my testing DA as I said storing integers in string using the return bug doesn't work.


But you can return bug strings to integers and then return bug that integer to string...