primem0ver
Emperor
I don't know if this is already in the works (as I am new to this forum) but I am going to suggest (or emphasize) it anyway. I do not own Civ4 (yet) but I feel this really needs to be said considering the fact that the source code is available for modification. People (especially mod makers who are not yet familiar with programming) need to be aware of some major problems that can result from the source code being available.
This thread focuses on an important need if people want to avoid countless hassles a mod involving a dll change can create. This may be asking too much, but it will be necessary if people are going to make significant changes to the main dll, especially as part of a mod.
Even with regular (albeit large) mods, the people who developed CTP2 mods found a mod/plugin manager important even (years) before it was possible to change the source code. With the SDK available and mods possibly involving changes in source code, IMO it is even more essential to have such a feature. The problem is that the by changing the dll, you change the way the program runs and quite probably in the long run making your mod incapable of working with other mods with a different version of the dll and even some non-dll mods.
To prevent this from happening, it would be best to have a team develop a managed, all purpose main dll with a plugin interface allowing any future source code additions/changes to be done through a separate plugin dll. Plugin features and access to main program functionality should be documented and any additional features/access desired by mod makers should be suggested to the team that develops the dll.
The main purpose the plugin interface would be to try and enforce a standardized system so that dll changes can work together instead of against each other and that all changes made programmatically to the source code (particularly those that ship as part of a mod) can ship (be downloaded) as a separate dll. This will allow changes to the source code to literally be modular (i.e. available by of the plugin interface) and the central executable will be the same for everyone no matter what mods you download (as long as you download the plugin version of the main dll. A control panel applet (or just a central managing program) can also control which plugins you want to use during runtime, allowing you to configure the mods you want to use (be active) during a certain run of the game. The dll can be updated regularly or however the team sees fit.
My suggestion for how this should be done? If anyone is familiar with Windows shell programming, a feature provided through the Windows32 API is IMO the best paradigm to follow for this “plugin” managing main dll: Windows Hooks. Essentially what this means is that you can create “hooks” so that any time a certain event is triggered within windows, your “hook” allows your program to “intercept” the event before it is passed to other windows (or even windows itself. An example of this is a cd-player application “hooking” (intercepting) the “new cd inserted” windows event, allowing the cd-player to check the cd before windows does. This way, if it is a music cd, the cd-player can start playing it automatically and prevent windows xp and other versions from popping up that “what do you want to do?” dialog or “autoplaying” the cd. Many real life cd-playing applications do this.)
A Civ “hook” example (assuming Civ4 works like most other civ games): Lets say you completely change the way a map is created (lets say you want to add a special type of tile to the map (or change the way Civ does it’s tile system completely). This mod will hook the “map creation” event and the “tile improvement” event so that your plugin can handle map creation completely on its own and then check the “tile improvement” event to see if the improvement being made is to one of your special kind of tiles. If so, it can handle the event. If not, it passes the event along through the normal Civ code. This kind of mod might also want to hook the “settle” and “movement” events to handle such events appropriately depending the kind of tile you are adding.
That being said, I need to mention one other thing here: I am a fairly busy person and while I may (if I decide to actually buy Civ 4) participate on this team, I am very limited in the time I can contribute since I am a high school teacher who also happens to also be working on starting an educational software business.
-primem0ver
This thread focuses on an important need if people want to avoid countless hassles a mod involving a dll change can create. This may be asking too much, but it will be necessary if people are going to make significant changes to the main dll, especially as part of a mod.
Even with regular (albeit large) mods, the people who developed CTP2 mods found a mod/plugin manager important even (years) before it was possible to change the source code. With the SDK available and mods possibly involving changes in source code, IMO it is even more essential to have such a feature. The problem is that the by changing the dll, you change the way the program runs and quite probably in the long run making your mod incapable of working with other mods with a different version of the dll and even some non-dll mods.
To prevent this from happening, it would be best to have a team develop a managed, all purpose main dll with a plugin interface allowing any future source code additions/changes to be done through a separate plugin dll. Plugin features and access to main program functionality should be documented and any additional features/access desired by mod makers should be suggested to the team that develops the dll.
The main purpose the plugin interface would be to try and enforce a standardized system so that dll changes can work together instead of against each other and that all changes made programmatically to the source code (particularly those that ship as part of a mod) can ship (be downloaded) as a separate dll. This will allow changes to the source code to literally be modular (i.e. available by of the plugin interface) and the central executable will be the same for everyone no matter what mods you download (as long as you download the plugin version of the main dll. A control panel applet (or just a central managing program) can also control which plugins you want to use during runtime, allowing you to configure the mods you want to use (be active) during a certain run of the game. The dll can be updated regularly or however the team sees fit.
My suggestion for how this should be done? If anyone is familiar with Windows shell programming, a feature provided through the Windows32 API is IMO the best paradigm to follow for this “plugin” managing main dll: Windows Hooks. Essentially what this means is that you can create “hooks” so that any time a certain event is triggered within windows, your “hook” allows your program to “intercept” the event before it is passed to other windows (or even windows itself. An example of this is a cd-player application “hooking” (intercepting) the “new cd inserted” windows event, allowing the cd-player to check the cd before windows does. This way, if it is a music cd, the cd-player can start playing it automatically and prevent windows xp and other versions from popping up that “what do you want to do?” dialog or “autoplaying” the cd. Many real life cd-playing applications do this.)
A Civ “hook” example (assuming Civ4 works like most other civ games): Lets say you completely change the way a map is created (lets say you want to add a special type of tile to the map (or change the way Civ does it’s tile system completely). This mod will hook the “map creation” event and the “tile improvement” event so that your plugin can handle map creation completely on its own and then check the “tile improvement” event to see if the improvement being made is to one of your special kind of tiles. If so, it can handle the event. If not, it passes the event along through the normal Civ code. This kind of mod might also want to hook the “settle” and “movement” events to handle such events appropriately depending the kind of tile you are adding.
That being said, I need to mention one other thing here: I am a fairly busy person and while I may (if I decide to actually buy Civ 4) participate on this team, I am very limited in the time I can contribute since I am a high school teacher who also happens to also be working on starting an educational software business.
-primem0ver