Hedgerow Hall

by Hedgemistress
Hedgerow Hall
Serious role-playing-oriented game world, with animals.
ID:2079907
 
I've been pretty much AFK since last Thursday due to family circumstances. While I was away, I outlined a set of HrH development priorities for myself to see to when I got back.

Top on the list was making use of instancing to swap out map layers. The game (like the old school version) uses relatively small (and thus quick to save) discrete z layers to represent map regions or burrows. The map generator as I wrote it last week generated an abstract map of the overworld whose dimensions were based on BYOND's limitations. Even though individual map segments were not loaded or generated until needed, there was no process for unloading them. Thus, the maximum "safe" size of the world map had to be based on the assumption that every region of the map might be active at the same time.

However, for it to be truly necessary for every map segment to be present in the world at once, it would require 14,000+ players all hanging out doing their own thing in an otherwise empty region.

I've long thought that swapping maps is often more trouble than it's worth, especially when having a "literal world" makes distance and direction calculation easier, but HrH has never used a literal world. Individual map segments don't exist in BYOND's built-in x,y space relative to each other. There's no gains to keeping old maps around except for some "gains" in terms of not having to code things, but the effort saved by that recedes towards nothing over time compared to the myriad gains of embracing the abstractness.

So priority number 1 is to revamp the map handling before I go any further to allow it to re-use abandoned z layers and change the map limit parameters from arbitrary numbers I explicitly set to variables.

This is priority 1 because it's non-trivial but relatively simple to implement, and I have to imagine that the longer I go without incorporating it, the more likely it is to break something in a weird way when I do. Already in my first attempt I'm running into some problems that no doubt stem from the fact that I made the map handling procs last week and then didn't touch the code for about 6 days.

Getting this in and getting it right is key to a lot of things I want the game to have: an overworld large enough to get lost in (though with an easily navigable central area where people can be social), an underworld with multiple layers, the possibility of pocket dimensions and other planes of existence, etc. With the game only requiring at most an allocation of turfs equal to 2,025 times (players plus 1) at any given time, there's little reason the game couldn't have a Minecraft-style nigh-infinite world.

(Though a few fairly good reasons it shouldn't.)

Note on that 2,025 figure: While the dimensions of the world/continent will ultimately be a host-changeable setting, I've decided that the dimensions of each individual region will need to be hard coded in. Too many elements of game balance depend on it, and adding flexibility to the dimensions of preset/prefab locations would be prohibitively difficult. After playing around with multiple region sizes, I'm going with 45x45... somewhat larger than the old school version, but not too large to quickly save or load. It also has the advantage of being an odd number with a lot of factors (1, 3, 5, 9, 15, an 45). The odd number means there's a center square. The factors gives six possible settings for "lot size" (the dimensions of the squares you can claim). The fact that all the factors are odd simplifies the initial placement of the exit on your burrow map (since your burrow will be another 45x45 map corresponding to the area you claimed, regardless of its size.)

So that's what I'm working on right now. I'm making this post mostly to give myself a break from looking at code that's not working for reasons I'm not 100% sure of. I'll update this thread when the map swapping is solved, and then make a post explaining (and charting my progress) on my second priority.
Okay, I figured out what was happening. There was a hitch between how the map swapping proc worked and how the pre-set map regions such as the hall were handled. So that's fixed, and map swapping seems to be done.

I've also changed from the 32x32 map pieces I was testing with to the 45x45 ones I'll be using. This makes the random turf populator's results even uglier than they were already, because it was calibrated around a specific volume of turfs, but eh. It was always something of a placeholder.