03-11-2019, 12:54 AM | #141 |
Join Date: May 2012
|
Re: TFT Map Maker
Pfft! New Orleans is totally unrealistic! https://twitter.com/jameslsutter/sta...ntasy-world%2F
|
03-11-2019, 07:24 AM | #142 | |
Join Date: Aug 2018
Location: Aerlith
|
Re: TFT Map Maker
Quote:
The three values are essentially the three axes along which the megahexes can be positioned. The first value is the X value, or column; the second value is the Y value, or row; and the third value is the shift value, or offset. The overlayMegahexes() function in the code uses these three values to determine where to begin drawing the first megahex, with all other megahexes positioned organically after that one. |
|
03-11-2019, 07:40 AM | #143 | |
Join Date: Nov 2005
Location: Buenos Aires, Argentina
|
Re: TFT Map Maker
Quote:
__________________
MapForge battlemap creation software for RPGs Battlegrounds: RPG Edition is virtual tabletop software that allows you to play any RPG online or offline. It's very easy to use and feature-rich. |
|
03-11-2019, 09:19 AM | #144 | |
Join Date: Aug 2018
Location: Aerlith
|
Re: TFT Map Maker
Quote:
There are two functions, one of which draws a contiguous "row" of megahexes, and the other which fills the map with such rows. I realise now that I should probably also include the ability to change the "grain" of those rows. Currently each subsequent megahex is placed to the upper-right of the previous megahex, but an equally valid grain is the next megahex to the lower-right. This should be fairly trivial to add in the next release. Code:
drawMegahexes(initX, initY, initOffset) { x = initX; y = initY; offset = initOffset; while(y < mapheight + 6) { drawMegahexRow(x, y, offset); if(x == -1) { x = 1; y += 2; offset = 0; } else if(x == 1) { x = 0; y += 3; offset = 1; } else if(x == 0) { x = -1; y += 2; offset = 0; } } } drawMegahexRow(x, y, offset) { step = 0; stepBias = offset; loopRise = 0; shiftv = 0; while(x < mapwidth + 2) { drawMegahex(x, y - (step + stepBias >= 6 ? 3 : (step + stepBias >= 4 ? 2 : (step + stepBias >= 2 ? 1 : 0))) + loopRise, shiftv); drawMegahex(x, y - (step + stepBias >= 6 ? 3 : (step + stepBias >= 4 ? 2 : (step + stepBias >= 2 ? 1 : 0))) + loopRise, shiftv); x += 3; step++; if(step > 5) { step = 0; x--; stepBias = Math.abs(stepBias - 1); shiftv = -stepBias; if(stepBias == 0) { loopRise--; } } else { shiftv = Math.abs(shiftv) - 1; } } } |
|
03-11-2019, 09:23 AM | #145 |
Join Date: Nov 2005
Location: Buenos Aires, Argentina
|
Re: TFT Map Maker
Thanks a lot, Shadekeep! I'll let you know how it works out.
__________________
MapForge battlemap creation software for RPGs Battlegrounds: RPG Edition is virtual tabletop software that allows you to play any RPG online or offline. It's very easy to use and feature-rich. |
03-11-2019, 09:25 AM | #146 |
Join Date: Aug 2018
Location: Aerlith
|
Re: TFT Map Maker
Ha, and just looking at the code I posted, I already see one simplification. This chained ternary:
(step + stepBias >= 6 ? 3 : (step + stepBias >= 4 ? 2 : (step + stepBias >= 2 ? 1 : 0)) Could be rewritten: Math.floor((step + stepBias) / 2) As long as (step + stepBias) never goes above 6 or goes negative, that logic should be sound. And I'm pretty sure both cases are true. I'll test it out. |
03-11-2019, 09:29 AM | #147 |
Join Date: Aug 2018
Location: Aerlith
|
Re: TFT Map Maker
Yep, I can confirm that the Math.floor() version works fine. Also, for some reason the drawMegahex function appears twice in the pseudocode. It should only be there once. Here's the updated and corrected drawMegahexRow code:
Code:
drawMegahexRow(x, y, offset) { step = 0; stepBias = offset; loopRise = 0; shiftv = 0; while(x < mapwidth + 2) { drawMegahex(x, y - Math.floor((step + stepBias) / 2) + loopRise, shiftv); x += 3; step++; if(step > 5) { step = 0; x--; stepBias = Math.abs(stepBias - 1); shiftv = -stepBias; if(stepBias == 0) { loopRise--; } } else { shiftv = Math.abs(shiftv) - 1; } } } |
03-19-2019, 06:17 PM | #148 |
Join Date: Jun 2018
Location: Cidri
|
Re: TFT Map Maker
Thank you. Thank you. Thank you!
__________________
Yes, I know Tollenkar is misspelled. I did it on purpose. Apparently, I purposefully misspell words all the time... |
03-26-2019, 08:42 AM | #149 |
Join Date: Aug 2018
Location: Aerlith
|
Re: TFT Map Maker
Finally got the Shadekeep site ready for its debut. You can get the latest version of Shamat from there, as well as download the standalone version. Here's a direct link to the home page for Shamat:
http://shadekeep.com/shamat.html I'll be working on the usage documentation next, but most of you here are already familiar enough with the program's operation. Thanks for all the feedback so far! |
03-26-2019, 08:59 AM | #150 |
Join Date: Nov 2005
Location: Buenos Aires, Argentina
|
Re: TFT Map Maker
Excellent, congrats on the site and the release!
__________________
MapForge battlemap creation software for RPGs Battlegrounds: RPG Edition is virtual tabletop software that allows you to play any RPG online or offline. It's very easy to use and feature-rich. |
Thread Tools | |
Display Modes | |
|
|