Thread:LOTRMod/@comment-26767096-20170228190157/@comment-25101089-20170301003135

Hmm. Well, both of those things encompass quite a lot of sub-features, so that question deserves a long answer.

For the faction system, once I had the original Good/Evil alignment setup, adding 'factions' was not too difficult. I just created a list of the different factions, with their names and enemy-lists and other properties, and modified the player data to store one alignment value for each faction rather than a single value.

Then, going through the mod code and finding all references to alignment, I had to rewrite each one to account for faction alignment instead of the Good/Evil axis. For example, the conditions for using crafting tables: instead of checking  for Good factions and   for Evil, I assigned a   to each crafting table block, and then checked. There were about a hundred different places where the code had to be changed like this, but it was straightforward, despite being a little tedious.

For NPCs, it was again a fairly simple job, requiring that I define a faction for each NPC class and change their AI to target enemies of that faction instead of 'Good' or 'Evil'.

So, for the basics of the faction system - not too hard to code. But there are layers of more complex features which have come since.

For the map, again, there are lots of features within it. The original feature was simply generating biomes based on a map image. And, once I had the image created, that was easy to code. Just load the image into the game, convert from world-coordinates to map-pixel-coordinates, lookup the biome for the pixel colour at that point, and use that biome.

Then there was the ingame map menu, and that was also simple to code - just a GUI that displays the map image shifted relative to the player's position. Waypoints came after that, and they were a step up, but still not really difficult.

Things like roads and rivers were significantly harder to code, both in the world, and on the map screen. The relatively recent code for road labels took several days to get right. The change in Beta 29 where the river biome was removed and rivers became biome variants - the map having to replace blue pixels with nearby biomes based on an educated guess - that was incredibly complicated to get working. I gave up on it on my first try, and even now there are still some bugs.

All in all, the 'map' features that have come since were much harder work. Even the map screen in its current form represents a much greater amount of hard and difficult work than the actual system of generating biomes following a map.

But things like these are my favourite things to make, because they are either entirely, or almost entirely, separate from the Minecraft code itself, and thus are much more interesting creative exercises.