<img src="style_emoticons/<#EMO_DIR#>/hi.gif" style="vertical-align:middle" emoid=":gday" border="0" alt="hi.gif" />
When you log in an island, coastraiders and directencounters (if you used directsail mod), have initial tasks when they are logged and it seems those tasks not change according to the situation around the island.
As i was specially tired of those enemy ships (pirates or war) who systematically attack me even if they were far behind the island or if there were other targets close to them than me. I was also fed up with enemy ships who can detect and attack me through a "london fog" where they shouldn't see me normaly. So i wrote some functions to improve the Sea Ai around islands and update it frequently.
First, i introduced a new notion which is the visiblity range. In this mod, other ships have a visibility range. They can't see ships who are out of their visibility range. Basically, the visiblilty range is a beam of 3000 yards around the ship but in facts it is less because it decrease with the fog density. More the fog is dense, less the visibility range is and by night, it is divide by 2.
As hook did with the DirectsailCheckFrequency, i used the procUpdateTime function in LogInterface.c to update the Ai with a regular frequency (every 5 minutes but it is adjustable in the buildsettings). I also puted a toggle to active/disactive the mod in buildsettings.
So each time the mod is called, groups of coastraiders and directencounters analyse all the enemy ships (who can be player too) they have in their visibilty range and update their task according to their own and enemy types (pirate, war or trade) and power. If they have no enemy ships in their visibility range, task of the war or pirate ships is to really patrol around the island to find a target and the trade ships keep their initial task (moving or anchoring).
I wrote the mod and tested it and it works perfectly on my computer which is not very old but i don't know how it could work on an older pc. If someone want to test it, i have puted it on the ftp. It is made for alpha 9.5 and as i said before, i puted a toggle in buildsettings and frequency of the timer is also adjustable.
The Island environment is much improved where we can see interesting battles between NPCs. Player can also be a prey and hunted like the other ships but no more and no less. The mod could be more improve so comments and suggestions are welcome <img src="style_emoticons/<#EMO_DIR#>/rolleyes.gif" style="vertical-align:middle" emoid="" border="0" alt="rolleyes.gif" />
When you log in an island, coastraiders and directencounters (if you used directsail mod), have initial tasks when they are logged and it seems those tasks not change according to the situation around the island.
As i was specially tired of those enemy ships (pirates or war) who systematically attack me even if they were far behind the island or if there were other targets close to them than me. I was also fed up with enemy ships who can detect and attack me through a "london fog" where they shouldn't see me normaly. So i wrote some functions to improve the Sea Ai around islands and update it frequently.
First, i introduced a new notion which is the visiblity range. In this mod, other ships have a visibility range. They can't see ships who are out of their visibility range. Basically, the visiblilty range is a beam of 3000 yards around the ship but in facts it is less because it decrease with the fog density. More the fog is dense, less the visibility range is and by night, it is divide by 2.
As hook did with the DirectsailCheckFrequency, i used the procUpdateTime function in LogInterface.c to update the Ai with a regular frequency (every 5 minutes but it is adjustable in the buildsettings). I also puted a toggle to active/disactive the mod in buildsettings.
So each time the mod is called, groups of coastraiders and directencounters analyse all the enemy ships (who can be player too) they have in their visibilty range and update their task according to their own and enemy types (pirate, war or trade) and power. If they have no enemy ships in their visibility range, task of the war or pirate ships is to really patrol around the island to find a target and the trade ships keep their initial task (moving or anchoring).
I wrote the mod and tested it and it works perfectly on my computer which is not very old but i don't know how it could work on an older pc. If someone want to test it, i have puted it on the ftp. It is made for alpha 9.5 and as i said before, i puted a toggle in buildsettings and frequency of the timer is also adjustable.
The Island environment is much improved where we can see interesting battles between NPCs. Player can also be a prey and hunted like the other ships but no more and no less. The mod could be more improve so comments and suggestions are welcome <img src="style_emoticons/<#EMO_DIR#>/rolleyes.gif" style="vertical-align:middle" emoid="" border="0" alt="rolleyes.gif" />