Now I embark upon the long journey of trying to implement what gap and I discussed here publicly. I will take a baby step approach to this. First order of business is modifying my unit spawner code so that I can specify minimum and maximum spawn ranges (I already have the maximum range coded in just have to add the minimum range). After that I have to figure out how the game keeps track of all units in game (when spawned where are they added to, specifically which function is called that adds them and when despawned what function is called to handle this).
The current version of the patcher allowed for 3 extra words in memory per spawned sub that are currently free and can be used for whatever. One of those words will hold the pointer to the spawned sub when I update the code (this way I can get information from it - depth, speed, number of waypoints, etc.). The other two words are for future use which I currently have no plans for.
After storing the pointer to the spawned sub I should be able to spawn the subs very far out (>=50km maybe even 100km away) and force the player to send status reports frequently which will update the spawned sub's waypoint so they continue heading on the correct course. This all depends on how the game handles waypoints which I'm not well versed in yet (for example when a unit attains a waypoint is that waypoint deleted from memory or is there a pointer that points to the current waypoint and is just updated to point to the next waypoint?) This, ultimately, will decide if I can implement gap's idea. I also have to figure out how to update a unit's waypoint for I will need that for this patch and for some ideas I have for the future.
I also have to figure out how to send the radio messages (the official ones) the game has so I can remove the messagebox one. This is needed again for this patch and for some crazy ideas I have for the future