Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
parse description bug
Dec 15, 2017, 10:08 pm
By Remcon
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
Bug in will_fall( )
Oct 23, 2017, 1:35 am
By GatewaySysop
Bug in do_zap( ), do_brandish( )
Oct 18, 2017, 1:52 pm
By GatewaySysop
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Memwatch
Author: Johan Lindh
Submitted by: Vladaar
Users Online
CommonCrawl, Google, Yahoo!

Members: 0
Guests: 6
Stats
Files
Topics
Posts
Members
Newest Member
477
3,706
19,240
608
LAntorcha
Today's Birthdays
There are no member birthdays today.
Related Links
» SmaugMuds.org » Codebases » AFKMud Support & Development » Adding Continents to afkmud
Forum Rules | Mark all | Recent Posts

Adding Continents to afkmud
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Feb 27, 2008, 6:38 am   Last edited Feb 27, 2008, 6:39 am by tphegley
Go to the top of the page
Go to the bottom of the page

tphegley
Magician
GroupMembers
Posts176
JoinedMay 21, 2006

I've been playing around with afkmud just to check out the features and overland. I've read through the areadocs and such on putting in a new continent and I'm still confused on a couple things.

1. Can I only use one map? I see the MAX_X and MAX_Y coordinates and I think that I could only use one map. Does one map mean one continent or are you supposed to put however many continents within one map. I believe I'm confused on this part.

2. I modified one.png a little bit keeping the city colors in the same place. Loaded it and it worked fine but now I want to add a area file to one of those city colors. It's like 499, 498. When I put those coords and continent name into the area file nothing really happens. Am I supposed to modify the area file more? Do I need to make the exits from the area to the map? When I went to them on my admin he would just walk over the # and not go into the area. It wasn't clear from what I read in the docs. Maybe I read them wrong.

I guess just a little help on this will be great. I have always steered away from afkmud because I could never get it compiled correctly but now I can so I'm testing it out. I think it's pretty cool so far but I haven't really delved deep into it yet.
       
Post is unread #2 Feb 27, 2008, 8:26 am
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

1. When you go to add another continent and you get to the part where it asks to modify this:
enum map_types
{
   MAP_ONE, MAP_MAX
};


you insert something like MAP_TWO in between MAP_ONE and MAP_MAX, this increases the continent count. I've got plans to rework how continents are dealt with so that they can be of varrying map sizes. Right now they're all the same size because of how the array is set up. But that won't happen for awhile.

2. In order to make the exit from the map go to a zone, you need to use the setexit command. http://www.smaugmuds.org/index.php?a=afk_helps&s=view&id=932 should help explain it in detail, but the short answer is "setexit <vnum>" to point the exit to a regular room number. Once that's done then walking over it will send you there.
       
Post is unread #3 Feb 27, 2008, 9:07 am   Last edited Feb 27, 2008, 9:29 am by tphegley
Go to the top of the page
Go to the bottom of the page

tphegley
Magician
GroupMembers
Posts176
JoinedMay 21, 2006

Samson said:

you insert something like MAP_TWO in between MAP_ONE and MAP_MAX, this increases the continent count. I've got plans to rework how continents are dealt with so that they can be of varrying map sizes. Right now they're all the same size because of how the array is set up. But that won't happen for awhile.


So right now, they all have to be 1000x1000?

Samson said:

2. In order to make the exit from the map go to a zone, you need to use the setexit command. http://www.smaugmuds.org/index.php?a=afk_helps&s=view&id=932 should help explain it in detail, but the short answer is "setexit <vnum>" to point the exit to a regular room number. Once that's done then walking over it will send you there.


I found the setexit after I had posted and got it to where I could go into the area. How do I get out of an area back onto the map? I tried the excoord up x y in redit but I must have done something wrong as it didn't work. I'll keep fiddling with it when I get free time.

***EDIT***
What I forgot to do was set the exflag to overland before doing the excoord. So for future reference to anyone that has any problems for setting maps to areas and areas to maps:

Map to area:
setexit 'vnum of area'


Area to map:
Create an exit you wish to have go to Overland
exflag <dir> overland
excoord <dir> x y where x and y is the coords of where you want your player to pop out on the map. 


       
Post is unread #4 Feb 27, 2008, 12:36 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

They don't have to all be 1000x1000, you can set those smaller or larger, but right now whatever size you do select will affect every map in the game.
       
Post is unread #5 Feb 27, 2008, 1:32 pm
Go to the top of the page
Go to the bottom of the page

eldhamud
Fledgling
GroupMembers
Posts45
JoinedFeb 16, 2006


So right now, they all have to be 1000x1000?


In Eldhamud, we currently have 14 maps, each map is 150x150 rooms. I have thought about making maps of different sizes and dimensions and changing the code acordingly, i might have a play with that today while i have time between classes to see what i can come up with.
       
Post is unread #6 Feb 29, 2008, 9:37 am   Last edited Feb 29, 2008, 9:50 am by tphegley
Go to the top of the page
Go to the bottom of the page

tphegley
Magician
GroupMembers
Posts176
JoinedMay 21, 2006

I have one last question concerning areas and continents I believe. When creating an exit from an area to the map is there a proper way to create the exit? As it is you have to randomly place a vnum in the exit to create it first before beign able to set the overland flag and excoords. It kinda messes up the way the character automap looks like.

[Exits: North->(Overland) South]
+-----------+ A pebbled pathway to a small town spans four feet across the
|           | path.
|           |
|     O-:   |
|     |     |
|     @     |
|     |     |
|   O-O-O   |
|     |     |
|     O     |
+-----------+


The place I'm standing in is the exit to overland so the north exit should be the : instead of an O
I guess I"m doing something wrong here.

****EDIT****

After messing around a little bit, I guess you just have a room that's flagged as map and use that as your exit room all the time? I just made a room in entry.are set as map and then used my exit from my new area to go to that vnum and it came up as a # on my screen when in my new area. Guess this is how you do it.
       
Post is unread #7 Feb 29, 2008, 10:44 am
Go to the top of the page
Go to the bottom of the page

Quixadhal
Conjurer
GroupMembers
Posts398
JoinedMar 8, 2005

An interesting way to extend things a bit, perhaps. Let's assume whatever changes (if any!) needed to allow different sized maps are done and working.

Let's say you have a map that's 200x200 as your initial starting island. You create a continent for your mainland that's 1000x1000. Right now, to travel from the starting island to the continent, you would need to create an exit on one map, and an entrance on the other map. I think you also have to have a room in between, but I might be mistaken on that (haven't messed with it in a while).

Suppose, instead, you extend the map interface to allow you to specify adjacent maps, with linkage points for the edges? What I mean by that is you allow the map system to "pin" one map against another, specifying which edges are adjacent, and at what coordinates they intersect. In the above example, you could pin the north edge of the starting island map to the south edge of the continent map at coordinate 400. Once that's done, the loader would create exits for every room on the island map's north edge linking to the corresponding rooms (400,1000) .. (600,1000) on the continent, and likewise for the reverse directions.

That way, you get a virtual overland that can grow as needed, and be any (overall) arbitrary size and shape, but you get to work with smaller, more manageable, graphic files.
       
Post is unread #8 Feb 29, 2008, 10:08 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Yeah, it's a crude method, but it does work, and for the most part hasn't caused us any problems.

For the record, a brief rundown on how rooms connect to the overland:

redit exflags <direction> overland, to tell the code it should send players to the wilderness map.
redit excoords <direction> <x> <y>, where the direction is one of the usable ones in the code, x and y are coordinates on the wilderness map which represents the continent the area belongs to.

To make one from the overland to a normal zone:

setexit create ( if one does not exist at the coordinates the imm is standing on )
setexit <vnum>, where vnum is a standard room in an area. This doesn't have to be on the same continent, which can lead to some interesting travel setups, intentional or otherwise.

Quixadhal, I like what you've got in mind and I definitely do plan on making each map sizable independently from the others. Ideally what I'd like to have happen is a seamless connection from one map to another in what you describe. It would look tacky with a string of exit sectors once you got close to an edge. I'm just not sure how the code would be written to pull that off without having a bunch of ridiculous ifchecks or something.
       
Post is unread #9 Mar 1, 2008, 6:57 pm
Go to the top of the page
Go to the bottom of the page

Darwin
Fledgling
GroupMembers
Posts37
JoinedOct 10, 2007

Why not create, if one doesn't already exist, a flag that tells it that the connection is to an adjacent map and to display the terrain character instead of a connector character?
       
Post is unread #10 Mar 2, 2008, 12:42 pm
Go to the top of the page
Go to the bottom of the page

Quixadhal
Conjurer
GroupMembers
Posts398
JoinedMar 8, 2005

If the overland is still implemented as a single room with internal coordinates, you could simply track when you reach an edge (since you can know the overall map size). I don't remember which direction the coordinates go in, but let's pretend 0,0 is bottom left (or SW).

If you're at 0,62 and you enter a "west" command, instead of giving an error message (I assume that happens now?), you'd look to see if the adjacent map on the western edge touches this map at that point. Again, blue-sky mode:

//Somewhere global...
struct s_adjacent_maps {
  int edge[4];
  int edge_low[4];
  int edge_high[4];
} *adjacent_maps;

adjacent_maps = magical_load_map_link_data_routine();

// Let's imagine it loaded up data for map 0 and map 1.
adjacent_maps[0].edge[0] = -1; // Nothing on the north edge.
adjacent_maps[0].edge[1] = -1; // Nothing on the east edge.
adjacent_maps[0].edge[2] = -1; // Nothing on the south edge.
adjacent_maps[0].edge[3] = 1; // West edge points to map #1
adjacent_maps[1].edge[0] = -1; // Nothing on the north edge.
adjacent_maps[1].edge[1] = 0; // East edge points to map #0
adjacent_maps[1].edge[2] = -1; // Nothing on the south edge.
adjacent_maps[1].edge[3] = -1; // Nothing on the west edge.

// Assume everything else is -1...
adjacent_maps[0].edge_low[3] = 50;
adjacent_maps[0].edge_high[3] = 100;
adjacent_maps[1].edge_low[1] = 300;
adjacent_maps[1].edge_high[1] = 350;
// Sizes must be the same, or space and time are warped and the computer will be unhappy.

// In the local routine, you could....
// Assuming you already did checks for moving west and being at the edge to get here...

if(adjacent_maps[this_map].edge[WEST] >= 0) &&
   current_y >= adjacent_maps[this_map].edge_low[WEST] &&
   current_y <= adjacent_maps[this_map].edge_high[WEST])
{
  extract player from this room;
  move player to the other overland map room (map 1);
  current_x = map[1].width; // set their x coordinate to be on the eastern edge.
  current_y -= adjacent_maps[old_map].edge_low[WEST];
  current_y += adjacent_maps[new_map].edge_low[EAST];
  // Those two lines would place you at the y coordinate the same distance above the bottom edge of the linkage as you were on the old map.
}

// repeat for the other 3 directions.


Obviously there's lots of hand waving there, but that wouldn't require you to actually specify any exits at all... if an adjacent map exists and there are borders defiend on both sides, you'd just seamlessly cross from one to the other.

There also might be MUCH better ways to hold the data than the putzy arrays I used for examples.. but you know how your code is laid out much better than I do and am probably already thinking of a different structure.

It also would be fairly trivial to extend this to 3 dimensions, however I doubt most people will really want the memory it would take to make that useful. For the rare occasions climbing up or down between layers of overland would be cool, putting regular exits is probably much less messy.
       
Post is unread #11 Mar 4, 2008, 9:35 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

So if I read your code right here, the hypothetical maps you've defined here have a 50 space border shared between them out of their total edge distance? That would solve the walking from one to the other problem easily enough. It doesn't address the line of sight issue though. One would presume you'd be able to see over the border into the other map. Accounting for that could become quite tricky I think.
       
Post is unread #12 Mar 5, 2008, 8:44 pm
Go to the top of the page
Go to the bottom of the page

Quixadhal
Conjurer
GroupMembers
Posts398
JoinedMar 8, 2005

True. To do LOS, you would probably need to have some kind of shared "meta-coordinate" system, even if it's only an internal thing.

In other words, C1 has coordinates (0,0)..(500,500) and C2 has coordinates (0,0)..(200,200). If C1 is west of C2, and the intersection maps such that 500,0 on C1 would end up being 0,-100 on C2 (in other words, C2's top is higher than C1's top), you'd need to have a coordinate set from (0,-100) to (700,600) for your LOS calculations.

Of course, you could also just as easily "pin" the maps down on a global coordinate system, with the first one being 0,0 and let them become negative. Nothing wrong with negative numbers. Nothing wrong with more than one map pair per edge either (although the psudo-code I put up would need tweaking). Just make sure there's no overlap, or there will be pain and suffering.

Communication (and other "room-like" things) would be slightly trickier though. For that to work, you'd need to have a way to propogate events from one room to another.... or just recode all the functions to call "overland_say()" if you're on the overland.
       
Pages:<< prev 1 next >>