Hi ,
I am working in Eye of the Beholder 4 and I have one problem.
In fact , I tried to solve this problem with other way.
As all you know the Game Eye of the Beholder , I want to create one routine which , I have one map , 32x32 let's say I have one array:
Dim Level01(32,32) , 32x32 are my horizontal and vertical squares of my big empty map.
In fact , I have one dimension with variable name Level01(32,32,4) three dimesional array.
This means , I have one level with horizontal size by 32 square , vertical size by 32 and I have one more dimension with 4 , this means the direction of wall (north , east , south , west)
This is so far correct for now and working.
Now , I have one other Dimension array with name:
Dim Floor_items01(32,32,4) this array is the same as the above.
But there is a little bit difference. Each square stores one item
but the third dimension means , this Item , faces in four sub squares. (Each main square stores 4 items in 4 sub-squares).
The image shows what I try to mean.
-----------
-----------
Now , I try to make this Idea , I want to put infinity items in each sub-square , this stored in the main square.
I thing you understood what I try to explain.
I use one classic method , to create one huge array to store my items with this kind of dimension like :
Floor_Items(map_x,map_y,subsquare,max_items)
With this way , I need to pre-allocate whole this memory and program will not run if I create many Floor_Item arrays.
Floor_Items01(map_x,map_y,subsquare,max_items)
Floor_Items02(map_x,map_y,subsquare,max_items)
Floor_Items03(map_x,map_y,subsquare,max_items)
Floor_Items04(map_x,map_y,subsquare,max_items)
Floor_Items05(map_x,map_y,subsquare,max_items)
I eat huge amounts of memory to make nothing , or make the same thing for all of my 100 levels oooops....
If I want to put on one sub-square one key
and on this key , I will through one more item on the key , I drop one helmet in the same sub-square , and then , I drop one healing potion in the same sub-square so I have these items in this sub-square.
1)Key
2)Helmet
3)Healing potion
If I want to pickup the Helmet which is second in the order of this sub-square the new list will be like this:
1)Key
2)Empty
3)Healing potion
But the second position of this sub-square needs to be deleted and resorted , so the new order will be.
1)Key
2)Healing potion.
So if I want to put too many items in a big map , with too many main squares , with 4 sub-squares in each main-square , with to many levels , then it will be a huge chaos to control all of this mess.
Could you have one Idea how to create one smart code that , can I put a lots of Items (Infinity and each sub-square which contains each main square on my level).
Thank you vey much..
http://i-access.gr/future/Banner.jpg
You are an elite hacker and try to save the cyberspace.