August 30, 2010 - Editor Discussion

Mycal

Staff member
One thing I have been trying very hard to do in comparison to a few free ORPGs, is to separate the actual game from the game editors. The world editor was my effort to do this and so far, it's great in idea, but not in functionality.

The big problem is storage of player created objects. Let's focus on maps in general, but this does apply to pretty much every aspect of the world editor. When a map is created, you give it a name, size, and then fill in the rest of the information as you go. When you are done creating a map, you save it. Here lies the problem. For accessibility, I've made the main method of storing maps as XML files. I also allow binary maps and a local database (using sqlite3) format. XML files are very easy to examine and fork into a new editor if necessary, while binary maps are very small and read and write very fast. Either method is relatively fast and the difference in sizes isn't really enough to make a huge difference. But this is done simply to share maps with other developers easily as well as easily editing of incomplete maps in the absence of an internet connection.

Now the real problem is connecting maps to one another. In the past, we used a simple number from 1-5000 to store and link the map. This isn't ideal since you have to first lookup a free map number and ensure that no one is currently working on said map, etc. So when I ported the code, I chose to use the map name as a means of linking, but here lies another problem. No matter how much I may urge, I can see developers naming maps exactly the same. So I added an optional variable that adds an area name for maps that belong together. However, again, there may be some reason for which you don't want to name a map at all. So then I decided on the filename of the map, but now we run into the issue of how to use this in the final database of maps? What if someone inadvertently names the map the same thing?

So now I have one more idea, but perhaps I should also poll the (currently inactive) developers. I am now going to generate a unique GUID for each map upon creation. This will be used to link maps in the final database. Of course while in development, we can't assume that you'll have to find, copy, paste, etc the GUID, so the world editor will work like this for now. When linking a map, you select the file in which you want to link, then the worldeditor automatically fills in the GUID for you. Does this sound acceptable to all developers?

This will make, both map names and area names as completely optional. Areas will eventually be compiled together in a single file for ease of access, so it is still recommended to use areas.
 

Mycal

Staff member
Yet another issue! This one is slightly more serious than the last though. Dynamic size maps create a new problem. When a player leaves a map in a particular direction, they enter the specified map at the same location that the left the current map on. However how do we handle entering smaller maps?

Here is an example. Say you are currently on a map that is 20x20. You walk downwards from tile (18,19) to the next map which is only of size 10x15. Where do you end up? We can handle this in one of two ways (at least as far as I can think of).

The first way is to look at the map connecting to the right of the map we are walking onto. If there is a map, we send the player to that map at the translated coordinate. If there is no map, we simply do not allow them to walk downwards. The second way is to do away with our current system for exiting maps and introduce a new system in which you specify where the player should go on a per tile basis.

The second way is much easier to implement, but requires ALOT more work on the devleopers end. The first way seems a little more complicated but doable. Opinions?

For the time being, I'm going to attempt the 1st solution and just see how it works.
 

Mycal

Staff member
OK, simple solution for this leaving map problem since I don't feel like doing anything more complex right now. Pretend maps are matricies and you are multiplying them when you are creating them. There problem solved. If the height of the map to the left or right of the current map are not equal to the height of the current map, you can't connect them. If the width of the maps above and below the current map are not equal to the width of the current map, you can't connect them. I'll make the editor make this check and if for some reason maps get around this check, the client will also have a check that marks a flag as needing review and simply ignores the connection.

Again, as I said before, problem solved with a nice easy solution. Don't know why I didn't think of it before...
 

steven

Administrator
For the whole map names and id issue, I think you should just pick a way and go with it, everyone will adapt. I think each map should have a primary ID that is completely unique compared to every other map, but why not do that and on top of that due the "area" name inside a group of maps, some maps will need to be the same name inside a group of maps, but outside the "area" names will make all maps different and inside the map ID's will differentiate, and maybe add a Note to self sort of variable that the map builder can use, that only can be seen in the editor, so if making some long hallway 4 maps long that all need the same name, you could put in the memo "left most" "2nd from left" or something of the sorts...just thinking out loud.
 

krum

New Member
how about this solution.

when you leave a map that is larger or smaller it will do this math:

lets assume we are leaving to the right and entering on the left!

20x20 -> 10x10

in the editor we simply allow a user to pull and drag a "link block" around the edges of a map, then they do the same on the other map.

I envision this working all with mouse clicks as well, so you drag the link blocks on one edge, then it asks you for the map to link it to, you select it, then drag it on that edge, and it is connected.

this will take care of the issue of a map connected to multiple maps in one direction. It will basically say, line "this" area up with "this map"

alternatively if it is a smaller map, we could require the entrance and exit "area" to be the same size so it lines up, that way they don't walk off one area into a blocked area on the next. I don't see an issue with multiple map sizes as long as the exit and entrance area where you walk off match.
 
Top