Jump to content

deanolium

Member
  • Content Count

    36
  • Joined

  • Last visited

  • Medals

Everything posted by deanolium

  1. ***PLEASE NOTE: This is currently only working on the Steam version. As soon as we figure out how to make it work on non-steam versions, I'll update this with the instructions. Sorry for everyone whose not running the Steam version!*** Hi there, Here's my first mod for Carrier Command's strategy mode; the main thing is does is allow you to set the number of islands in Strategy mode which are taken over by each side, from 3 to15 islands each (with the rest being neutral). You can select the number of islands by the top slider when you start Strategy mode (the number of islands conquered or something like that) -- This isn't a new slider, but basically me hijacking the top slider that's already there. Be warned that selecting 3 islands can lead to a long game. This version also has a manual time warp, which is switched on and off by the 'k' key. Note however that mantas and walruses won't speed up, and pressing the button turns their AI off. So if they're on a programmed route, then they will just go into a straight line until they hit stuff. So only use it when you have all your vehicles inside your carrier. There's also a quick fix for the vehicles. In the original, if you give a vehicle a program and control it; when you change control to another vehicle, the original one resumes its program. This really annoyed me, so I've made it so it won't go back onto its program until you explicitly 'enable' it (via the 'e' key). If people are interested, I could put in a keyboard control so you can go switch between the two behaviours - just let me know if so. Enjoy! https://dl.dropbox.com/u/101876491/islandMod_v2.zip To Use: Just unzip this into your carrier command folder and run the game. To deactivate the mod, just rename the 'scripts' directory to something else like 'scripts_x'. Of course, use at your own risk -- to be safe start a strategy game from new; and I have no idea if this will affect the campaign game (so rename the directory if you want to play that to be safe). Feel free to put feedback etc below. //deano ********* Thanks to SirAvenger, here are some instructions on getting this working for the Sprocket version:
  2. Since Thygrrr released his cc unpacker tool and thus exposed the moddable scripts, the next step for the community is probably to put down our findings of playing with the code. Here's my current findings - feel free to add your own to this list. Also please note that there may (and probably will be) errors in this list as it's just based on reading the code and some observations. If you find any mistakes, list them below and we can try and keep this updated: 1 - TimeWarp. This is controlled by g_Game.TimeWarp - a function which takes 'true' to turn it on, and 'false' to turn it off. However, there is a few problems with this. At the start of the game, this function can be freely turned on and off (for a 12x acceleration). But once you do something which normally turns timewarp off (either hitting 'v' to stop the carrier; setting sail to an island and it arrives; or hit cancel on TimeWarp) then whenever you call the TimeWarp function to turn it on it just goes directly to "Leaving TimeWarp 3....2....1....". There's no apparent function to control this behaviour - so manual timewarp will be difficult to set up. A possible work around is to have a variable holding whether manual timewarp is on or not; and if it is then every cycle it calls g_Game.TimeWarp(true), which should either keep Leaving TimeWarp set on '3', or will make it do the countdown again and again. Pretty kludgy though. I've played around with TimeWarp more, and making it call the TimeWarp function each cycle when you press a button works. However, timewarp has some strange effects. Vehicle speed (except for Carrier and Barque) isn't increased during TimeWarp. So it won't speed up Mantas or Walruses. Also it turns off the PathFinding AI, so any vehicle moving will just go in a straight line regardless of anything. I'm not sure if it speeds up command center building (need to time it manually with and without I guess), but resource gain and production are increased. 2 - AI Pathfinding. This doesn't appear to be exposed. The functions which seem to handle this are: CreateMovementAction, CreateRouteFollowAction, FindClosestWaypoint, FindClosestReachable - all of these appear to be in the executable itself. 3 - AI Tactics. This looks like it is exposed to us, though the AI itself is pretty basic - especially for carrier attack/defense AI. For the carrier this appears totally unfinished, which explains the easy time people have been having against the enemy carrier. It simply sends out it's vehicles to attack the first enemy it finds in it's list. Also, it appears that it might only send out as many vehicles as there are attackers. All of which will just attack that first enemy. From it's EstimateUnitNeed function (which is meant to take in a type of vehicle, and it then says how many of which it needs), it doesn't care about what type of vehicle is needed. However, it does look like it will spit out Mantas before spitting out Walrus's. This is really sorely lacking and could easily be fixed up to make the carrier AI more formidable. 4 - Unit Control Behaviour - By this I mean how the game decides which units should be selected to assist the current unit; and when to suspend/enable plotted routes. This is all controlled by telecontrol.h. The DetermineX set of functions appear to be called in a big loop (which goes through each vehicle you have) for each vehicle, and return 0 if that vehicle shouldn't be selected for that command, and 1 if it should. That is, when you put, say, the reticle on an enemy then use the radial menu to select attack, which units are then eligable. There's also a set of OnX functions which are called when certain events happen. For instance, OnMap appears to be called when the player moves onto or out of the map. For people who have an issue with the AI resuming plans when you leave a unit, this is the place to go. That's the first set of findings. I hope it helps other modders, and it'll be interesting to see what things we can actually do with this! ---------- Post added at 11:49 ---------- Previous post was at 11:45 ---------- 5 - Messages. To add a message on screen, use g_Game.AddMessage(message, color, type). I've not explored this too much, but am using it like g_Game.AddMessage("Test Message", COLOR_GREEN, LMF_EMPIRE) for testing.
  3. deanolium

    Mod Script Findings

    Then it's caught by the else block, and thus sets the health to zero, destroying it. So not a bug, just misreading the code.
  4. deanolium

    Mod Script Findings

    It more looks like: If health (of each section) is >70% then set the health of that bit to 0%. If instead the health of that bit is <=70% then set health to 0% (ie, destroy it). Which basically means two hits will kill the carrier. Massively overpowered if I'm reading the code right and just plain weird anyway.
  5. deanolium

    [MOD] Island Mod

    Species: Yeah, it does mean the beginning can be somewhat monotonous, but it does mean you pick which islands you want along with deciding what they should be. It's more like the original game. The main reason I did it was also because I don't like/trust the roles it picks the preowned islands as having when you start a game. For me that's a part of the strategy and fun. But horses for courses, and everyone has a different play style. To be honest, it would be more fun when mixed with a better enemy carrier AI - one where if you are as powerful as him, it'd still be difficult (and thus suicide if you're weaker). Thus making you need to not only make a powerful chain of islands for yourself, but also eventually weaken his chain (whilst avoiding him) until you can overpower him. I'm sure we'll get that part of the game down eventually, it's just not there yet. However, if you want just the program-resume removed, this is very easily done. (The following instructions are for the steam version; though you can use the instructions above to pack it for other versions.) Just go to the Scripts directory and delete all the files except for telecontrol.h (which is the file with the mod remove the automatic program resume). And there you go. I hope that helps!
  6. deanolium

    [MOD] Island Mod

    Thanks SirAvenger - I'll put these instructions up onto the original post
  7. deanolium

    [MOD] Island Mod

    Awesome Foxhound -- Once this week is over, I'll get onto making a more friendly version and better/less confusing documentation ;) Hopefully there will soon be a way to make it work on every version in a universal way too.
  8. deanolium

    Mod Script Findings

    To be more exact, you can get away with #define DEVELOPER to turn on the developer features. The logging does indeed happen in that directory you mentioned, in the Campaigns.log. Something else that's useful is the SLog function. This is used in the AI Advisor files (which despite the file names are for both the human player and the AI player), and is defined in uec_empireadvisor.h By default this is set to just Print (which obviously just goes nowhere for us), but I then added the following lines to the end of that function: stratAI = "AI: " + stratAI; g_Game.AddMessage(stratAI, COLOR_RED, LMF_EMPIRE); This then causes the AI log messages to output to screen. I then went further and replaced print statements with SLog to further probe what was happening.
  9. Here's something to try; put the following code in functions that you want to know is being run: g_Game.AddMessage("REACHED CODE POINT A", COLOR_RED, LMF_EMPIRE); This will then pop a message on screen (and in the message log) whenever it reaches that point in code. If it appears, then you know that function is being called. If not, then it's a junk function that's just left over.
  10. deanolium

    Mod Script Findings

    That's not a bad idea; I'm going to be pretty busy over the next couple of weeks, but if someone wants to set one up, that could be a good way to organise this information. ---------- Post added at 23:50 ---------- Previous post was at 23:46 ---------- Military Advisor is definitely being run. I used a function to display text on the screen whenever parts of Military Advisor was run; along with some data values (which is how I figured out what's going on with island invasions/assaults) and it's showing that the functions are called. I haven't done more than a very quick glance at the bad island code, but it's interesting that it looks bugged. Definitely be a good thing to fix.
  11. deanolium

    [MOD] Island Mod

    Very weird, I'll look into it tomorrow when I'm back. Has anyone had any luck with it at all? Another thing to try is the earlier version in case something's up with the zip file: https://dl.dropbox.com/u/101876491/island_mod_v1.zip
  12. deanolium

    [MOD] Island Mod

    Unfortunately I'm away until tomorrow - but if you could maybe put up a picture of your carrier command directory, that might be useful in figuring out why it's not working. Hopefully we'll be able to figure this out -- it'll be great when the next patch comes out to unify the different versions.
  13. deanolium

    [MOD] Island Mod

    Just checked, and it's definitely working here, and that's going back to the original install. Here's a screen shot of my directory: https://dl.dropbox.com/u/101876491/carrier_mod_shot.gif (142 kB) I'm using the Steam version (as noted), and as Thygrrr has stated, it's configured by default to use the seperate files if they're in the right place. You can check this by finding your saves directory (for steam it's ...\Steam\userdata\41771232\65740\local) and open the ccsettings.xml. You should then see the following in the file: <filesystem> <path directory="./"/> <path directory="data00.cc"/> <path directory="data01.cc"/> <path directory="data02.cc"/> </filesystem> Which is what does the magic. If you're using a non-steam version and it doesn't have this in the ccsettigns.xml file, let us know. I hope this helps!
  14. deanolium

    [MOD] Island Mod

    Weird, I'll check again to see what going wrong, as that's sounding like the default behavior.
  15. deanolium

    [MOD] Island Mod

    Hmmm - will check the slider, but it should work. It's the topmost one in the strategy game generation screen entitled Captured Islands Count. The variable is in /scripts/Campaign/classic_campaign.h -- look for the iUEC and iAPA variables; these are how many islands each side starts with. ---------- Post added at 19:44 ---------- Previous post was at 19:42 ---------- I should note - that by extract the zip file, it should create a folder called scripts in the carrier command directory. If it creates a directory called islandMod_v2 then move everything from that directory into the program folder. I've checked the slider, and it does work. So check the folder is right, and maybe check the 'k' timewarp key works as a check that the mod is working.
  16. deanolium

    Mod Script Findings

    Something interesting I've just found. The AI takes literally no time (well one cycle) to take over a neutral island. This means it can rapidly take them over far faster than the player. This is controlled in scripts/advisors/assault.h and I'm not sure whether it's a bug or not. It does make it unfair and probably should be tweaked to take some time for the AI to do so.
  17. deanolium

    [MOD] Island Mod

    Well, you can easily just hit 'e' before you change vehicle ;) I could easily use a button to switch between the two behaviours, and will probably be my next change for this. For now, if you want it in the old style, just delete/rename the file /scripts/campaign/telecontrol.h as that's where I put that change in.
  18. I've now made a thread for that mod: http://forums.bistudio.com/showthread.php?141138-MOD-Island-Mod I'm assuming the moderators are ok for this; if not I'm sure they'll let me know.
  19. By saying pathfinding isn't difficult, I mean if you had infinite resources and cpu-power. In games, you almost never have that kind of ideal situation; especially with 3d terrain. So you have be really clever to get pathfinding which works in the much-less-than-ideal conditions you have - and that's where the difficulty quickly builds up.
  20. The problem of him getting stronger after death is that it removes any point to killing him. The clever player would then just hit him until he's hurt and then leave him be. He won't then be able to attack islands successfully and you can then clear up the map. If you killed him, then the game becomes harder, and harder until you get into an almost stalemate with him having a couple of islands, but he's too strong to kill. Though he could come back fully equipped (which is how he starts the game pretty much) so he can retaliate immediately on respawning.
  21. deanolium

    Boring enemy Carrier AI

    Definitely; and I think a mixture of % rolls with a state based system is probably the nice way to make an intelligent AI which has variability. Right now, there's plenty of scope of messing around with the strategy AI, and if they expose any more in future patches then it'll be really exciting times!
  22. As long as Bohemia works on this (it's annoying more of the path finding isn't exposed to us as I really want to know if widening the completion radius helps) then it's definitely worthwhile. So convince him as much as possible. Unfortunately this is going to hurt sales and the public at large are hearing about it. The history of games shows that notorious buggy releases tend to have low sales even if they get fixed later. This is a fun game, and there's a much better game in there - it's just this is a very visible issue that most people will pick up on. The big issue is that the AI pathfinding is actually pretty good in this (!?!). It does seem to handle bridges, and does a pretty good job at devising the route it needs. The thing is that it has several flaws which makes it all fall down. As soon as they are fixed then the system will be fantastic. Pathfinding really isn't that difficult (A* is a very simple algorithm really) but as TonTow said the hard part is doing it fast and on low ram. The XBox release isn't helping as they have a tiny amount of ram in comparison to the pc and it doesn't look like there's much difference in the code between the two versions. The pathfinding with that taken into account works nicely; it just has issues with recognizing when it's hit a waypoint and with dynamically generating new ones in wrong places. These should be fixable, though that could cause other issues to bubble up.
  23. Gnrl_Grad: Yes, you can edit carrier and unit AI; just not path finding (right now). There's actually several layers of carrier AI (how it reacts on a strategy level, and how it deals with attacking you) that can be edited. For carrier respawn; I think you'll be able to though don't quote me on that. But from what I've found in the code, it's doable. If you can then you should be able to make it respawn after a set time as a kind of penalty.
  24. Yep, the game designates what kind of defense mission each island has at the start -- some have none, some have firewalls, etc. It does take a little while for your islands to build these it seems but they do happen. Something like 8 islands have no mission, the rest will have some kind.
  25. deanolium

    Mod Script Findings

    Interesting -- definitely something to play with. I just wish that the code for these functions were exposed. Or at least what interactions it has so we could make our own versions. I really do think that there's pretty interesting path finding code in there, it just has a couple of flaws which cause the whole system to break down.
×