Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - Buttery_Mess

Pages: [1] 2
1
Thoughts on how best to map Dwarf Fortress’ square-based maps onto a sphere

With the map rewrite and myth and magic releases on the horizon, I thought I’d share my research on how best to map a square grid-based coordinate system onto a spherical surface.
The problem is that on a spherical surface, all straight lines converge and parallel lines are not straight. This has been a problem for cartographers for centuries, as it frustrates attempts to create maps on square pieces of paper and to implement rational grid-based coordinate systems.
I have made some progress into creating a sensible way of dicing up a spherical surface into a square-based grid for the purposes of games and simulations but ran into a wall as I’m not a mathematician.


 
The trick is to first divide the world into 8 octants, the anterior and posterior northeast, southeast, southwest and northwest octants. Each octant represents a spherical triangle wherein each interior angle is a right angle and each edge is a great circle; two of the corners rest upon the equator and one of the corners rests upon a pole.


 
Octants like these are used in conformal octahedral projections used in cartography, like this;


 
However, because each octant is a triangle, it can be distorted and folded in a particular way to make a square. Two triangles can be added together to form a square and four squares can be added together in this way to form a grid, like this;



 On Earth this would produce a distorted map that looks something like this;
 


Although this seems perfectly convenient at first, it does not preserve either areas or shapes correctly if directly converted into a square-based grid. Consider the most simple sub-division- what does this look like?


 
If we divide each octant into four equally sized triangular quadrants, what would this look like on a sphere?


 
It turns out, if we divide each octant into equally sized triangular quadrants, the dividing line separating each quadrant is neither a small circle centred upon one of the corners nor a great circle describing a straight line on a sphere, but a small circle centred upon a point farther outward from the centre of the octant than each of the three corners of the octant. I was, with difficulty, able to determine where this point lay although I’ve since lost the maths to describe it.
The area of a sphere is equal to S=4πr^2 and therefore the area of octant is one eighth of that; therefore a quarter of each octant is equal to one thirty-second of the area of the sphere, or πr2/8.



In this diagram the triangular quadrant is the known area. Note that this is on a spherical surface, so the straight lines are great circles and the lengths are angular, measured in radians or degrees.

Dividing one octant into four is not particularly confusing; however if one wishes to further subdivide each octant into smaller triangles, it became out of my depth to mathematically describe each one in such a way that each triangle had an equal area. Then I remembered that Tarn is a mathematician and could probably work such things out easier than me!

I’m not even sure if each octant can be indefinitely subdivided in such a way as to preserve each component triangle as having equal area, although it looks to me as though it can be. This is a consideration because if each octant is divided many times using straight lines, the innermost triangle has an area about three times greater than those at the corners! This is not so much of a problem in a simulation if these areas are known in advance and accounted for (if one were so inclined), however, it would be better to know that each triangle is of an equal area.

In fact, provided that it is known that each octant can be divided indefinitely into equal areas, and provided that one does not particularly care that each triangle represents a skewed and distorted shape, the actual specifics of how it is distorted does not matter. This happens to be the case for Dwarf Fortress.
In Dwarf Fortress, the simulation occurs within a square-based grid and everything within each square is perfectly abstracted, so internal map distortion is completely irrelevant. The only thing that matters is that area is preserved so that the simulation makes some kind of sense, and that the information can be rationally processed. That’s why this particular way of mapping a sphere onto a grind (or a grid onto a sphere, depending on which way you think of it) makes sense.


 
In this diagram I’ve divide each octant into sixteen equally sized triangles. This is what it looks like for each triangle when represented on a sphere;


 
Each triangle can be paired with the one next to it in order to form a rhombus; for the purposes of the simulation, this can be treated as square. (Think about the practical difference between Civilization and Civilization II; the former used squares, the latter rhombuses to give the impression of perspective, but there was no practical difference).
In this diagram, the triangles coloured in grey pair with triangles in the next octant, such that any two adjacent octants can be paired together to form a square grid that tessellates with other square grids.
The big advantage of dividing a spherical world into octants and skewing them this way is that the whole world can be represented as a single square grid and traversed in a rational way. Moving up-down, left-right or diagonally across the grid approximates travel across great circles, particularly between where the corners of each triangle meet. Just like in the real world, an individual travelling in a straight line across the spherical surface will find the compass bearing towards north will change, even though their direction does not. As long as one does not leave the square grid, the compass bearing to north can be calculated, but otherwise you don’t need to think about directionality or rotation of the grid you’re on when travelling from one octant to another- you can just leave it all on the x,y grid and it works itself out. This isn’t really possible on other projections, such as cubic or icosahedral (which have their own advantages otherwise).
When crossing the edges of the square, direction flips and translates in an easily comprehensible way.



Let x,y=0,0 represent the top left corner. When leaving the grid to the left, (x<0) let x=1 and y=(max_y)-y. When leaving to the up (y<0) let y=1 and x=(max_x-x). This is reversed on the opposite sides. Remember that the four corners of the square are colocational; they represent a point antipodal to the centre of the grid on the surface of the sphere.
This means that what lies beyond each edge of the grid can be directly plotted onto the screen provided one rotates the map when keeping the direction of the character the same. (I am thinking in adventure mode for this).

That’s my summary of my thoughts on the best way to rationalise a spherical surface onto a square grid for the purposes of Dwarf Fortress following the map rewrite. It’s as rational as I think is possible. The problem is that I struggle to mathematically describe the shape of the triangles that constitute the distorted quadrilaterals that constitute the squares on the grid. At the extreme corners of each octant, each of the subdivided triangles constituting the distorted quadrilaterals is composed of two straight lines (great circles) and one highly curved small circle. To preserve equal areas between the “triangles” the chain of adjacent triangles fanning out from those points also need to be curved with two (at the edges) or all three sides being composed of small circles. Figuring out how to describe these triangles or where the centre of the quadrilateral formed from two of them is for the purpose of determining the true bearing to north is a mathematically and computationally difficult task that is beyond my abilities so I was hoping that a better mathematician than myself could undertake this task and post the results here.
I couldn’t even make sense of the notation to describe the area of a small circle. This is because the surface area of sphere makes use of the radius of a sphere, but the surface area of an area on a sphere bounded by a small circle also makes use of the curved radius of the circle, which is an angular distance, and it wasn’t clear (looking through the google results for this topic) whether the area represented was in terms of ‘scalar area’ or ‘angular area’ (for want of better terms to describe them; I’m not a mathematician).
I hope that this was all comprehensible. Feedback is welcome!

2
I've been playing since it was released, and these are some of my most immediate thoughts;

1. Staircases! I'm sure it's been said but people aren't kicking up nearly as much of a stink about it as they should be. Removing the ability to dig or construct up, down, and up-and-down staircases makes it impossible to construct certain things, and is confusing and ultimately destructive. Being able to lay out a vertical column of staircase all in one go is great, but it's often the case that a careless ramp removal will, for instance, chop the middle out of a staircase and from then on it's basically impossible to dig up from that point. Not to mention, when you dig down to the caverns, it's a mess to try and seal off the bottom now, especially since hatches are no longer indestructable from below.

2. The replacement of the military screen omits a few important functions, most notably the ability to design a uniform before your first squad is created, and the ability to easily edit a uniform on the fly. This is a horrid oversight. I know some people don't like the old military screen present in .47 (a lot of people left DF when it was introduced) but it was perfectly functional, with keeping equipment, uniform, positions, schedules, provisions etc. apart. I don't even know how to set provisions now and uniforms are a hassle. Please give us back at least all the functionality of the old military screen! Additionally, having nested menus for material selection would be great- for instance, for some reason when selecting an iron shield, 'iron' is hidden somewhere between every kind of wood and a bunch of weird metals you'll likely never see. But, at least this is as functional as it was before!

3. Single right click to exit menu is really annoying. I can't tell you how many times I've spent ten minutes checking boxes in the trade screen before pushing the mouse up and having my hand touch a cup, inadvertently clicking the right mouse button and undoing all my effort. Very annoying. Switching it to a double right click to close, or adding a confirm exit window, or just changing it to a little X in the top right corner of the window would be greatly appreciated!

4. It's not possible to sort potential suspects on the justice screen, (although they are sorted by certain categories already) which means you have to manually go through the list to find a named individual, frustratingly with the name in their local language, when their surname is in English on the report screen. This is extremely tedious and fiddly. Being able to filter out dead people and animals would be a bonus, and also the ability to sort the list by name and residential status would be helpful, and being able to see their names in English and their native language would be helpful, too. Or at least this should be consistent across all windows.

5. Being able to click on categories in the trade and stock screens is nice, but the fact that you have to click on a category first and then use the search filter is a bit annoying, especially on the trade screen. This is because objects can be loose or stored; they can be stored in bins, chests, cabinets, barrels, and pots... it's not easy to see the contents of bins on the trade screen, so you end up not being able to tell your trade goods from your pre-finished goods, and your 'blank' crafts end up getting carted to the trade depot instead of your decorated ones... rather a nuisance really. Being able to inspect the interiors of containers on the trade good selection screen, and being able to search for items which may be in a container before selecting the category would be extremely helpful.

6. This is something of a carry on from previous versions, but I can't think of anywhere it's possible to see active Guild/Temple demands and agreements. This is a problem because you can have dozens of religions in a fortress! When you agree to upgrade The Communion of Lepers or whatever to a Grand Temple, it's something you idly click on and then it's so easy to forget which of the 27 shrines you've got on the go you were supposed to fix, especially when you're already trying to remember other agreements you've committed to at the same time.

7. Can't remember if this is an ongoing issue, but battle reports for a creature usually refer to opponents in vague terms, such as "the marksdwarf". This can be problematic when twenty dwarfs dogpile a werebeast and you're trying to work out which one might have gotten bit. It's not the end of the world but this is unnecessarily vague, especially since in the graphical version you could even have a tooltip when you hover over "the marksdwarf" or whatever and it could expand on the information to include a name.

---

Okay that's all I can think of for now, I guess I can always add more if something else pops up. Overall all though I'm really enjoying the new version.

3
DF Suggestions / Re: Boats and Moodable Pottery
« on: June 11, 2022, 05:36:11 am »
Moods for pottery would be nice.

Boats that work like minecarts would be pretty cool. You could have little ferries to take dwarves over rivers and such like also. As they're only little boats they're not multi-tile structures. I don't think it would be that hard to implement.

4


I've been up to this for a while now. Playing Dwarf Fortress, I grew envious of all the dwarfs' tasty looking wines. You can brew practically anything, after all. It's expensive and difficult to get hold of all the different fruit wines that are possible but extremely easy to do it yourself.

It was winter when I got my demijohns for Christmas so there wasn't a lot of wild fresh fruits available. However, you can easily source honey from supermarkets, which I just to make mead (currently brewing in the demijohns.) You can buy fresh fruits in the supermarket at any time of year, but it can be expensive. You can kind of cheat by brewing fruit juice, but you might need to top it up with sugar.

I decided to dilute some jams and brew them, since they're basically fruit juice and sugar to begin with. I've got some apricot wine, blueberry wine, and raspberry wine on the go here, and I can't wait to try them in a few weeks.

This summer going into autumn, I'll be able to forage wild fruits, and mash them up to make forage fruit wines and cider, just like dwarves do. I'll be able to make blackberry (bramble) wine, hawse wine, and crabapple cider- maybe even rosehip wine. I could even grow my own potatoes to make potato wine, if I wanted, or maybe even tomato wine?

I wouldn't have ever fallen into this rabbit hole without DF. It's something anyone can do.

5
General Discussion / Happy Birthday Toady! 40 Today!
« on: April 17, 2018, 06:25:35 am »
April 17th (so reddit tells me).

Happy Birthday!

6
DF Wiki Discussion / Job manager update
« on: May 25, 2016, 07:26:15 pm »
With the changes to the job manager in this version, can we have an update on how to use the conditions and details? I thought I had it figured out but now I'm not sure. Has anyone else figured it out for sure, yet?

7
DF Gameplay Questions / Tired Vampire
« on: October 01, 2014, 06:32:26 am »
Hey, I've got this vampire who worked up a sweat in combat practise, and now he's out of the militia, isolated from the rest of the fortress as a normal worker. He's still tired, though, and has been for months.

Is this is permanent side effect of being low on blood? He will do some work, but not, it seems, anything strenuous, like digging or pump operating. He's engraving (slowly), building things, and managing and bookkeeping fine though.

I've noticed similar uncooperative refusal to work from another vampire before, but that one was a legendary warrior, so I put it down to that.

Is there any way I can make him not tired?

8
DF Suggestions / Woodcrafting chains?
« on: May 17, 2013, 06:46:57 pm »
https://www.youtube.com/watch?v=iUK9VrBGsac

If humans can carve wooden chains, Dwarves oughta. Also... mechanisms?

9
DF Modding / username monsters
« on: December 23, 2012, 11:57:46 am »
In this thread, we invent monsters based on our username.

This is the Buttery Mess. It's basically a 're-skinned' mud man, because my mod-fu is poor, but it seems to work.

Code: [Select]
goes in any creature .txt file

[CREATURE:ELEMENTMAN_BUTTER]
[DESCRIPTION:A humanoid made of butter renowned for its greasy leavings.]
[NAME:buttery mess:buttery messes:buttery mess]
[CASTE_NAME:buttery mess:buttery messes:buttery mess]
[CREATURE_TILE:'B'][COLOR:14:0:0]
[LARGE_ROAMING]
[BIOME:BIOME:NOT_FREEZING]
[FREQUENCY:1]
[POPULATION_NUMBER:15:30]
[NOPAIN][EXTRAVISION][NOBREATHE][NOSTUN][NONAUSEA][NOEMOTION]
[NOTHOUGHT][NOEXERT]
[NO_DIZZINESS]
[NO_FEVERS]
[NO_DRINK][NO_EAT][NO_SLEEP]
[NOT_LIVING]
[CANOPENDOORS]
[NOT_BUTCHERABLE]
[NOFEAR]
[PREFSTRING:butteriness]
[PREFSTRING:messiness]
[NOBONES]
[BODY:HUMANOID_SIMPLE]
[NO_THOUGHT_CENTER_FOR_MOVEMENT]
[TISSUE:BUTTER]
[TISSUE_NAME:buttr:NP]
[TISSUE_MATERIAL:BUTTER]
[MUSCULAR]
[FUNCTIONAL]
[STRUCTURAL]
[RELATIVE_THICKNESS:1]
[CONNECTS]
[TISSUE_SHAPE:LAYER]
[TISSUE_LAYER:BY_CATEGORY:ALL:BUTTER]
[BODY_SIZE:0:0:70000]
[BODY_APPEARANCE_MODIFIER:HEIGHT:90:95:98:100:102:105:110]
[BODY_APPEARANCE_MODIFIER:BROADNESS:90:95:98:100:102:105:110]
[ATTACK:PUNCH:BODYPART:BY_TYPE:GRASP]
[ATTACK_SKILL:GRASP_STRIKE]
[ATTACK_VERB:punch:punches]
[ATTACK_CONTACT_PERC:100]
[ATTACK_FLAG_WITH]
[ATTACK_PRIORITY:MAIN]
[ATTACK:KICK:BODYPART:BY_TYPE:STANCE]
[ATTACK_SKILL:STANCE_STRIKE]
[ATTACK_VERB:kick:kicks]
[ATTACK_CONTACT_PERC:100]
[ATTACK_FLAG_WITH]
[ATTACK_PRIORITY:SECOND]
[ITEMCORPSE:GLOB:NO_SUBTYPE:BUTTER:NONE]
[ALL_ACTIVE]



Goes in material_template default.txt

[MATERIAL_TEMPLATE:CREATURE_BUTTER_TEMPLATE]
[STATE_COLOR:ALL_SOLID:YELLOW]
[STATE_NAME:ALL_SOLID:butter]
[STATE_ADJ:ALL_SOLID:buttery]
[STATE_COLOR:LIQUID:YELLOW]
[STATE_NAME:LIQUID:melted butter]
[STATE_ADJ:LIQUID:melted buttery]
[STATE_COLOR:GAS:YELLOW]
[STATE_NAME:GAS:n/a]
[STATE_ADJ:GAS:n/a]
[DISPLAY_COLOR:14:0:1]
[MATERIAL_VALUE:5]
[SPEC_HEAT:4181]
[IGNITE_POINT:10338]
[MELTING_POINT:10060]
[BOILING_POINT:NONE]
[HEATDAM_POINT:10250]
[COLDDAM_POINT:9900]
[MAT_FIXED_TEMP:NONE]
[SOLID_DENSITY:1200]
[LIQUID_DENSITY:1200]
[MOLAR_MASS:NONE]
[IMPACT_YIELD:10000]
[IMPACT_FRACTURE:10000]
[IMPACT_STRAIN_AT_YIELD:50000]
[COMPRESSIVE_YIELD:10000]
[COMPRESSIVE_FRACTURE:10000]
[COMPRESSIVE_STRAIN_AT_YIELD:50000]
[TENSILE_YIELD:10000]
[TENSILE_FRACTURE:10000]
[TENSILE_STRAIN_AT_YIELD:50000]
[TORSION_YIELD:10000]
[TORSION_FRACTURE:10000]
[TORSION_STRAIN_AT_YIELD:50000]
[SHEAR_YIELD:10000] no data
[SHEAR_FRACTURE:10000]
[SHEAR_STRAIN_AT_YIELD:50000]
[BENDING_YIELD:10000]
[BENDING_FRACTURE:10000]
[BENDING_STRAIN_AT_YIELD:50000]
[MAX_EDGE:0]
[ABSORPTION:100]
[REACTION_CLASS:BUTTER]
[BUTTER_CREATURE]
[EDIBLE_VERMIN]
[EDIBLE_RAW]
[EDIBLE_COOKED]
[ROTS]
[GENERATES_MIASMA]

10
I started to keep an adventure log of a particular dwarven adventurer. He styles himself as a demon hunter, and though he has slain many creatures of the night, never any actual demons. Yet.

His adventures are ongoing. Yes, judicious use was made of savescumming; I wanted his story to be a fairly long one. Caution is no fit defense in Adventure Mode.

It probably does not make for a particularly interesting read. It's long-winded and violent; it's not so much a story as an extended and verbose combat report that waxes laconic here and there.

[CAUTION! CONTAINS SOME SWEARING. FORGOT TO MENTION THIS BEFORE POSTING BECAUSE I DON'T MENTALLY REGISTER SWEARING AS ABNORMAL LANGUAGE NOR DO I SELF-CENSOR]

[Posted up to the end of Part 3, 14/11/2012. Is continuing into part 4... not really sure how it's going to end, if, or when.]

11
DF General Discussion / Ultimate Real World Embark Location(s)
« on: August 20, 2012, 05:49:46 pm »
http://en.wikipedia.org/wiki/Crater_Lake

Crater lake is a lake in a crater (duh) that was formed eight thousand years ago when a volcano exploded. The eruption is remembered in the folklore of the local Klamath natives, imagined as a great battle between Llao and the sky god, Skell. It has an island in the middle called Wizard Island.

I would totally embark here in Dwarf Fortress, and I don't mind saying that I'd also like to build a stone tower there irl and live in it. It would be the best thing ever. I would of course build an enormous statue comemorating the mythical battle.

Are there any other locations from the real world where you'd like to embark for thematic or pragmatic reasons? Antarctica, Iceland, the White Cliffs, or whatever?`

12
DF General Discussion / Just some lava videos
« on: August 10, 2012, 07:36:30 am »
http://www.youtube.com/watch?v=aAymSMrOlOQ&feature=related
http://www.youtube.com/watch?v=kq7DDk8eLs8&feature=related

Not really a topic of conversation, just wanted to share this with the DF community. Nice to remember what lava is really like when you're playing.

13
DF General Discussion / Real Life Dwarves (not dwarfs)
« on: December 17, 2011, 09:40:47 am »
I was just flicking through New Scientist when a named jumped out at me; a name, Marshall Urist, who happens to have been a bone doctor.

http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2772913/

Has anyone ever found any other names of people irl who could have been dwarves, due to their name and occupation? I haven't found any apart from Dr. Urist.

14
DF Dwarf Mode Discussion / How do you keep your soldiers happy?
« on: September 07, 2011, 07:50:06 am »
So yeah, as the title.

Fully armed and armoured dwarves shouldn't be the first to tantrum. I don't pander to them especially, I wonder how other players keep their military happy?

15
DF Dwarf Mode Discussion / Dwarf Geology
« on: August 19, 2011, 10:23:26 am »
So I'm sick of embarking onto maps with marble 40 z-levels down. I liked limestone, or chalk even. So I figured, hey, I could gen a map in 31.18, then gen a map with the same seed in .25, and look for limestone in 31.18, and then embark in the same place in .25! Should work, right? No, it doesn't. The mineral distribution is different in .25, so unfortunately you can't do this. Is there any other way of finding limestone, or any other surface embark mineral, other than actually looking in adventurer mode? (Btw I'm going to try looking in adventurer mode now.)

Pages: [1] 2