Efficient data manipulation

Started by Ryex, January 14, 2011, 03:34:58 am

Previous topic - Next topic

Ryex

January 14, 2011, 03:34:58 am Last Edit: January 14, 2011, 03:36:55 am by Ryex
lets say I have a grid of numbers the grid is the size of a map and each number identifies a tile id to make the map
now lets assume that I have another grid that represents a brush with the same type of data layout this brush grid dose not have to be the same size as the map grid

I want to transfer the data in the brush grid to the map grid with a given x, y offset

if a way to do this other than iterating through the brush grid and setting the points one by one?

also

rmxp data for the maps is layed out in a single array
where the data at index (x + self.xsize * (y + self.ysize * z))
the sizes refers to the max size of the map

is this a efficient way to lay out the data if I'm going to be modifying it?

basically I'm asking all this because I want to lay out the tiles to be added to the map before they are commited to the map data instead o
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Blizzard

Nope and nope. You can alternatively use a multidimensional array (instead of a one-dimensional array), but you will have to set the data one by one.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Ryex

ah darn. I was hoping that might be some sort of matrix like operation to do it. no matter iteration will work just fine.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />

Blizzard

Even if you used some sort of matrix operation, your CPU will still treat it as a sequence of normal operations.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.