Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Save system in a matrix editor (recommendations please)

Author
Message
MikeS
Retired Moderator
23
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 9th Jul 2003 02:47
Currently after about one day(6hours) I have been making my own matrix editor.So far it's fairly decent
(though mat-edit, and even magic world make it look bad),
but there is one problem I am having.

How would you recommend doing a saving system in a matrix editor?
I guess I could use an array to store the data and the cooridants and stuff, but there's got to be some simplier or more efficent way.

Note:This is my first matrix editor.

Thanks for your time.

2D Fighting game in Progress
AzureZeal
23
Years of Service
User Offline
Joined: 10th May 2003
Location:
Posted: 9th Jul 2003 04:20
Nope, a array that holds each coord height is the simplest way. Dim a array like this

matrixheight(xtiles,ztiles)

Then to record the data...

for a = 0 to xtiles
for b = 0 to ztiles
matrixheight(a,b) = get matrix height(1,a,b)
next b
next a

Do the same thing to record tile textures, ect.

MikeS
Retired Moderator
23
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 9th Jul 2003 04:47
Thanks AzureZeal, I guess an array is the way to go.
I've been killing myself all day with this question.(lol)

+1 kudos



Yellow:Wanna publish my game microsoft, cuz i no u rich so...Can I have my bag of money now?
Microsoft: *snicker* Tip of the month-Microsoft will never(probebly) publish your game.
andrew11
23
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 9th Jul 2003 05:07
@Yellow

Is your map editor going to be using built-in matricies, or memblock ones? There's not too many around and might be a good idea. I started one myself today, but I probably won't finish.

"All programmers are playwrites and all computers are lousy actors" -Anon
MikeS
Retired Moderator
23
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 9th Jul 2003 05:12
It's using built-in matricies, but It's probebly not to late to change it around to memblocks, sinces I'm not that far into it.Although I'm not very familiar with memblocks, and havn't used them much(though maybe I should start using them, eh?)

For Now I'm just trying to keep it simple, and maybe in the future will see one with memblocks.



Yellow:Wanna publish my game microsoft, cuz i no u rich so...Can I have my bag of money now?
Microsoft: *snicker* Tip of the month-Microsoft will never(probebly) publish your game.
andrew11
23
Years of Service
User Offline
Joined: 23rd Feb 2003
Location: United States
Posted: 9th Jul 2003 05:14
Ok... off to work on mine... lol

"All programmers are playwrites and all computers are lousy actors" -Anon
MikeS
Retired Moderator
23
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 9th Jul 2003 05:16 Edited at: 9th Jul 2003 05:16
heheh, lots of matrix editor building going on around here recently.

edit: or memblock editors ya know what I mean.



Yellow:Wanna publish my game microsoft, cuz i no u rich so...Can I have my bag of money now?
Microsoft: *snicker* Tip of the month-Microsoft will never(probebly) publish your game.
The Wendigo
23
Years of Service
User Offline
Joined: 13th Sep 2002
Location: A hole near the base of a tree in the US
Posted: 9th Jul 2003 05:22
are you talking about saving your matrix? If you want an efficient way to save it I would go with RLE encoding. This works wonders at times and for flat land all set to 0, it would take up much less bytes.

00000000000145
00000000002343
...

Imagine the first line just for now and that all numbers are bytes. We have a lot of zeros. this would probably be 2 bytes per zero. Best way around this is to use a byte that flags a "run" (say 255 though that isn't a good idea in real life as there might be a lot of 255's). Then a byte to say how many which in this case is 11 0's, and then the byte representing the character - 0.

RLE would make it look like this (everything in parenths is a byte)-

(255)(11)(0)(1)(4)(5). Instead of 14 bytes, the first row only takes 6 bytes now (less than half!). my matrix editor doesn't support this yet and I'm not totally sure if it really ever will, but I feel it is a good idea (I'm just not bright enough rightnow to use it myself I guess )!

Current Projects: Game Spawn 85%, mini BSP maker 50%, Height Mapper with many features 75%, Space Tactical (Like BC300AD) 15%.
MikeS
Retired Moderator
23
Years of Service
User Offline
Joined: 2nd Dec 2002
Location: United States
Posted: 9th Jul 2003 05:44
Hmmm, I think right now I'm more comfortable with arrays, but I shall further investigate the RLE encoding.That really does save a lot of space, so it's worth a shot in the future.



Yellow:Wanna publish my game microsoft, cuz i no u rich so...Can I have my bag of money now?
Microsoft: *snicker* Tip of the month-Microsoft will never(probebly) publish your game.
AzureZeal
23
Years of Service
User Offline
Joined: 10th May 2003
Location:
Posted: 9th Jul 2003 12:02
HMmm what do you mean by "memblock" matrixes? You mean a matrix with height data stored in a memblock? Guh?

Login to post a reply

Server time is: 2026-07-18 07:30:53
Your offset time is: 2026-07-18 07:30:53