Map Editor

07/12/2012 15:05 funhacker#16
Quote:
Originally Posted by CptSky View Post
You don't want to store 400kk structures in memory. If you really want, you should do the same thing that the swap memory. Write a "memory" block to the disk. In Photoshop, you can easily edit a picture with a working space of several Mo. A little image will take at least 20 Mo. Photoshop is rendering the part you're viewing.

Just create a temp file that will be purged when closing the app (GetTempPath?) and write the unsaved part there. With memory for actual view, temp memory for unsaved change and the source file for the saved but unviewed parts, you'll have a low memory utilization. And, a map shouldn't be 1 Go based on what I saw in CO2. So, the disk speed will not be a big problem for reactivity of the program.
I'm not drawing an entire map. My camera class only allows for the drawing of what's visible and then a little extra.

Visual Tiles are just "ushorts"
Data Tiles are the real memory whores... Data Tile is a class
07/12/2012 16:13 CptSky#17
Quote:
Originally Posted by funhacker View Post
I'm not drawing an entire map. My camera class only allows for the drawing of what's visible and then a little extra.

Visual Tiles are just "ushorts"
Data Tiles are the real memory whores... Data Tile is a class
Visual Tiles are just 16 bits integer. But eh, they take 625 Mo as you have 300kk of UInt16. Why do you need to store all the Visual Tiles and all the Data Tiles in memory? Data Tiles could be serialized and wrote to a temp file. I'm sure you don't need all these tiles when editing a map.
07/12/2012 17:27 funhacker#18
Quote:
Originally Posted by CptSky View Post
Visual Tiles are just 16 bits integer. But eh, they take 625 Mo as you have 300kk of UInt16. Why do you need to store all the Visual Tiles and all the Data Tiles in memory? Data Tiles could be serialized and wrote to a temp file. I'm sure you don't need all these tiles when editing a map.
keep in mind that's a ridiculously large map. For a 3,000x3,000 map a single visual layer would be about 20mb of memory, no biggy really even if you had 5 visual layers which again is pretty over kill.
But I'm not saying I shouldn't I will definitely look into doing it once I have other stuff sorted on it as it will allow for stupid sized maps like 65535 x 65535, although I will have to remove my size limiter as I didn't want a stack overflow from increasing the width/height too much
07/13/2012 18:41 funhacker#19
Editing is on its way now, still got a few bugs to iron out and obviously manage performance (cpu/memory) once complete.
However it's looking as though I may need to do a complete re-write as I'm having to add new stuff to the CustomMapCore.dll to allow for a more generic way of doing things as I go. However work will be slow on this now as I'm a little backed up with other work, but here's the source for anyone wishing to see how to use xna in a form, and use a transformation matrix, along with only drawing the visible items.
07/13/2012 19:37 IAmHawtness#20
Why are all your screenshots like 20x20 pixels? Really bugs me. I would like to say it's looking nice, but I can't really tell :(
07/13/2012 20:13 funhacker#21
sorry blame epvp for that :p and my utter lazyness

[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
[Only registered and activated users can see links. Click Here To Register...]
07/13/2012 22:14 Zeroxelli#22
Hey, that's really nice :) Certainly more progress than I had, and I like the way you laid out yours better. Also, an option I had was for the layers (I never completed it, but hey.) if you checked off an option it would display a small number on each tile corresponding the the layer that it resides on. I.e. Base layer was 0 (or 1 if you want) next one was 1 (or 2), etc. Also, when you selected a tile, it tinted it slightly red instead of drawing a square around it. That was just easier for me since it worked with the tile itself and not drawing a new object.

Anyway, really nice progress. I look forward to seeing some nice maps created with this :)


Edit: Also, your idea to convert the maps to your own format for editing is what I had in mind also. It would be a lot faster because you could make use of a better format than TQ's and probably keep it all in one file per map if you wanted to.
07/14/2012 00:23 funhacker#23
Quote:
Originally Posted by Zeroxelli View Post
Hey, that's really nice :) Certainly more progress than I had, and I like the way you laid out yours better. Also, an option I had was for the layers (I never completed it, but hey.) if you checked off an option it would display a small number on each tile corresponding the the layer that it resides on. I.e. Base layer was 0 (or 1 if you want) next one was 1 (or 2), etc. Also, when you selected a tile, it tinted it slightly red instead of drawing a square around it. That was just easier for me since it worked with the tile itself and not drawing a new object.

Anyway, really nice progress. I look forward to seeing some nice maps created with this :)


Edit: Also, your idea to convert the maps to your own format for editing is what I had in mind also. It would be a lot faster because you could make use of a better format than TQ's and probably keep it all in one file per map if you wanted to.
thanks for the encouragement, however if you look at the code the form code has gotten messy and uses some obsolete methods/algorithms
I'm seriously contemplating redesigning it to use cursor types, like "pan"/"brush"/"fill"/"rectangle"

along with allowing to select more than one tile at a time.

Just my camera pan and brush are done via boolean flags in the mousedown/up events of the boxes as sadly xna picture boxes do not allow for input processing :/

I may even contemplate having dynamic layers which will allow for you to just add little areas that have more than one layer, this should save memory and disk space.

well I'm off to bed, any ideas are welcome :)
07/08/2022 05:57 losfoxis24#24
Quote:
Originally Posted by funhacker View Post
Editing is on its way now, still got a few bugs to iron out and obviously manage performance (cpu/memory) once complete.
However it's looking as though I may need to do a complete re-write as I'm having to add new stuff to the CustomMapCore.dll to allow for a more generic way of doing things as I go. However work will be slow on this now as I'm a little backed up with other work, but here's the source for anyone wishing to see how to use xna in a form, and use a transformation matrix, along with only drawing the visible items.
Is there a similar tool that currently works? Since I downloaded that tool and it doesn't work for me, I would love to view EO maps.