Conquer Map Editor

11/15/2010 04:21 ChingChong23#31
Right now i can load up a map and then import my own image, it will scale the image and chop it up into 'chunks' and output them as dds.

[Only registered and activated users can see links. Click Here To Register...]

[Only registered and activated users can see links. Click Here To Register...]

(some random pokemon image i googled)

However having problems getting the client to read from them (as i can't add them to the .wdf archive, they don't want to read from my data file (data/map/puzzle/room/arena)

dds files for this are here if anyone wants to try: [Only registered and activated users can see links. Click Here To Register...]
11/15/2010 04:57 FuriousFang#32
What about exporting the image of the map puzzles together so you can easily edit them? I think that'd be a useful feature. =]
11/15/2010 08:44 pro4never#33
Quote:
Originally Posted by ChingChong23 View Post
Right now i can load up a map and then import my own image, it will scale the image and chop it up into 'chunks' and output them as dds.

[Only registered and activated users can see links. Click Here To Register...]

[Only registered and activated users can see links. Click Here To Register...]

(some random pokemon image i googled)

However having problems getting the client to read from them (as i can't add them to the .wdf archive, they don't want to read from my data file (data/map/puzzle/room/arena)

dds files for this are here if anyone wants to try: [Only registered and activated users can see links. Click Here To Register...]
Assuming the image specifications are correct, there shouldn't be any issue defaulting to the custom images... that's exactly how custom map edits already work :S

Ps: did you ever get the calculation for displaying dmap info working?
11/16/2010 04:38 CptSky#34
The client check in the current folder before searching in the WDF package. You don't have to edit the package.

Good job for the program :)
11/20/2010 16:44 unknownone#35
I'll give you a kick start on converting between screen and map locations if you need it. If you assume your screen is the size of an entire map graphic (eg, width and height of the puzzle) and to scale, then to obtain the location on screen where an in-game coordinate is, you use. (NB: map.Cells.Width/.Height are 64 and 32).

Code:
    public Point MapCoordinateToScreenPoint(Point mapCoordinate) {
        return new Point(
            (mapCoordinate.X - mapCoordinate.Y) * map.Cells.Height + (puzzle.Width / 2), 
            (mapCoordinate.X + mapCoordinate.Y - (map.Bounds.Height - 1)) * (map.Cells.Width / 2) + (puzzle.Height / 2)
        );
    }
Note that the point returned is actually outside the coordinate you want. The function returns a point which is the origin of a rectangle which surrounds the coordinate entirely (I'll refer to it as a "bounding rectangle" from here). Eg, in this image, the red dot is the location returned for each cell, so you would draw your tile relative to that location.

[Only registered and activated users can see links. Click Here To Register...]

Other way round, you want the coordinate for a given location on screen, it's a little trickier. You first want to find out which bounding rectangle that a given click was placed in. The bounding rectangles overlap eachother, so you need to eliminate those. To do this, we subtract x mod 64 and y mod 32 from the actual ordinates of of the click. (such that the results will always be an exact multiple of 64,32.)

Code:
    Point blockOrigin = new Point(offset.X - (offset.X % map.Cells.Width), offset.Y - (offset.Y % map.Cells.Height));
You can then use this to determine the in-game coordinate which is bounded by the rectangle.

Code:
    public Point ScreenPointToMapCoordinate(Point screenPoint) {
        return new Point(
            screenPoint.X / map.Cells.Width + screenPoint.Y / map.Cells.Height,
            screenPoint.Y / map.Cells.Height + (puzzle.Width - screenPoint.X) / map.Cells.Width
        );
    }
The dilemma here is that you have only the bounding rectangle and it contains the corners of other in-game coordinates, so a click within that bounding rectangle could be a click on any of 5 different cells. To find out which cell the click was in, the easiest way is to use a "rainbow tile".

[Only registered and activated users can see links. Click Here To Register...]

You subtract the actual click location from the bounding rectangle location, leaving a value where x is between 0 and 63, y is between 0 and 31. (Performing mod 64/32 will do the same thing here). You then look up the color of the pixel at this point within the rainbow tile (you only need 1 of them), and based on one of 5 colors, you can determine the actual coordinate.

Code:
    public class RainbowTile
    {
        private Bitmap bitmap;

        public RainbowTile(Size cellSize)
        {
            bitmap = new Bitmap(cellSize.Width, cellSize.Height);

            Point[] rainbowTrianglePoint1 = new Point[3] {
                new Point(0, 0),
                new Point(cellSize.Width / 2, 0),
                new Point(0, cellSize.Height / 2),
            };
            Point[] rainbowTrianglePoint2 = new Point[3] {
                new Point(cellSize.Width, 0),
                new Point(cellSize.Width / 2, 0),
                new Point(cellSize.Width, cellSize.Height / 2),
            };
            Point[] rainbowTrianglePoint3 = new Point[3] {
                new Point(0, cellSize.Height / 2),
                new Point(cellSize.Width / 2, cellSize.Height),
                new Point(0, cellSize.Height),
            };
            Point[] rainbowTrianglePoint4 = new Point[3] {
                new Point(cellSize.Width, cellSize.Height),
                new Point(cellSize.Width / 2, cellSize.Height),
                new Point(cellSize.Width, cellSize.Height / 2),
            };

            System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(bitmap);
            
            g.FillPolygon(Brushes.Green, rainbowTrianglePoint1);
            g.FillPolygon(Brushes.Red, rainbowTrianglePoint2);
            g.FillPolygon(Brushes.Blue, rainbowTrianglePoint3);
            g.FillPolygon(Brushes.Yellow, rainbowTrianglePoint4);
            g.Save();
        }

        public Point GetCell(Point coordinate, Point cellPoint)
        {
            Color col = _bitmap.GetPixel(Math.Max(0, cellPoint.X), Math.Max(0, cellPoint.Y));
            if (col.R == 0 && col.G != 0 && col.B == 0)
                coordinate.X--;
            else if (col.R != 0 && col.G == 0 && col.B == 0)
                coordinate.Y--;
            else if (col.R == 0 && col.G == 0 && col.B != 0)
                coordinate.Y++;
            else if (col.R != 0 && col.G >= 0 && col.B == 0)
                coordinate.X++;
            return coordinate;
        }
    }
The rainbow tile is there to make it easier to understand, but a simple array of 64x32 would suffice.
11/21/2010 04:37 pro4never#36
Quote:
Originally Posted by unknownone View Post
.
Holy god! So much useful info.

I think I just jizzed a bit O_O
03/06/2011 07:49 m7mdxlife#37
sorry i know this thread is kinda ancient but this is too much work to go for nothing xD
am wondering what happened with this project... its way too good to be forgotten :(
03/07/2011 22:52 hady#38
i think that too the where is the Project ???
03/07/2011 23:07 pro4never#39
He had been talking to me on msn about it at the time for a while but he really lost interest in it.

I doubt anything will come of it. He got a ton of it done though.. I should try to get the source for safe keeping at some pt incase I ever wanted to pick up the project next fall or something.
08/13/2013 11:56 ChingChong23#40
bump, i know this is extremely old, but has anyone since actually created a full on editor?
08/13/2013 12:50 hadeset#41
Quote:
Originally Posted by ChingChong23 View Post
bump, i know this is extremely old, but has anyone since actually created a full on editor?
Hey, tell me how far you actually got with it, and exactly what obstacle was so difficult or bothersome, you decided to quit?

I myself have made a custom Eudemons Online client, where you can jump around and stuff. I had a small problem with 3d map objects though. The rest seems to work.

[Only registered and activated users can see links. Click Here To Register...]
08/13/2013 13:08 ChingChong23#42
Quote:
Originally Posted by hadeset View Post
Hey, tell me how far you actually got with it, and exactly what obstacle was so difficult or bothersome, you decided to quit?

I myself have made a custom Eudemons Online client, where you can jump around and stuff. I had a small problem with 3d map objects though. The rest seems to work.

[Only registered and activated users can see links. Click Here To Register...]
It's been a long time, but i believe i just lost interest in it. i'm surprised nobody else has made one of these though. is the dmap/puzzle structures still the same for the latest clients?
08/13/2013 13:14 hadeset#43
Quote:
Originally Posted by ChingChong23 View Post
It's been a long time, but i believe i just lost interest in it. i'm surprised nobody else has made one of these though. is the dmap/puzzle structures still the same for the latest clients?
I don't know about Conquer, but in EO newer maps are in different format, which the old released EO client did not contain, so I couldn't implement those, but I imagine most CO maps would have the same structures as old EO.
So yeh, I don't think they will ever change the structures of the older maps, but only create newer ones with new structures.
08/13/2013 16:54 Korvacs#44
I got this far, which is to say, not that far. Makes for a nice viewer though.

[Only registered and activated users can see links. Click Here To Register...]
08/13/2013 18:06 hadeset#45
Here's an idea... How about making at least a map editor, that lets you put additional Scenes onto the map? That would make things a lot more interesting. Doesn't seem too hard either. I, myself don't have the time though, at the moment.