1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Rise of U.S.S.R sub mod development thread

Discussion in 'Civ4Col - Medieval: Conquests' started by Fullerene, Mar 2, 2014.

  1. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,708
    Location:
    UK
    Hmmm I wonder if, on the criminal line, you could do a gulag(spelling?) style penal town, that gives special uildings that boost criminals productivity in certain 'harsh' environments or with certain yields, but the town is rubbish for 'normals' so you send all your criminals to the siberian mines and work camps...
     
  2. Fullerene

    Fullerene Warlord

    Joined:
    Aug 26, 2009
    Messages:
    228
    Gender:
    Male
    I was thinking something like that. You can't build new cities (it's only 25 year timeline), but you could build prison camps (gulags), where you can send criminals, prisoners of war and maybe other units too. These prison camps would mostly produce raw materials.
     
  3. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,708
    Location:
    UK
  4. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,095
    Location:
    Marooned, Y'isrumgone
    There could be a new feature added where as long as you have 1 weapon you can create the Unit Military Profession, but the unit has less hitpoints based on the percent less of the required amount. So at 49 weapons, they only have 98% hitpoints.

    I had an idea for Crews, Drivers, Teamsters, Pilots, and such in that when you create a Vehicle Unit it isn't actually added to the map, but is put in a Travel State, like TRAVEL_STATE_AWAITING_CREW, just like when your unit is Learning From Natives or is in Europe. And then for each unit in that travel state you have Icons with the number of available Units there in each city. So, you'll know how many of such units you can command. Then your People units can change profession to Drive the waiting units.

    Then in your Military Advisor it will list those available units as well so you can keep track of them.
     
  5. orlanth

    orlanth Storm God. Yarr!

    Joined:
    Nov 17, 2001
    Messages:
    1,776
    The Profession system is already designed for your human units taking charge of horses or vehicles as a military profession (your people can act as Crews, Riders, or Pilots etc by taking that Profession using the vehicle/equipment yields you specify). If you really don't like that you could implement these as Units that sit around empty when no one uses them, and create a separate system for being a passenger in a "container" unit rather than controlling as usual with professions, but is this really much different or adds a new source of significant gameplay interest? I guess I don't see what the real benefit is of abandoning the normally working system, it seems not worth adding complexity and AI problems for the same essential game effect. :confused:

    Yes I agree :scan: I'm hoping for a Purge Civic as well :devil:
     
  6. Fullerene

    Fullerene Warlord

    Joined:
    Aug 26, 2009
    Messages:
    228
    Gender:
    Male
    Not sure I like this idea. I would like to be able to capture tanks too.

    AI being able to use the existing profession system is very valid point for using tanks as yields.I think I switched my mind again for this.

    I like this. If tank profession could be made to have any number of tanks (1-50), you could also make it so that some tanks might get destroyed at the battle, not necessary all at once. Tank unit could also try to withdraw from battle if losing.

    But there is still the problem that comes with different tank models: you need many yields. I have graphics for many vehicles and would like to use them all in the mod. I think I need easily at least 30-40 yields for different vehicles! At least.
    Spoiler :
    And then, if some day, someone wants to build global WW2 scenario based on this mod the need for yields is even higher...;)


    ---
    There will be purges in some form. Maybe as event, maybe as civic ,maybe as something else. But I want to represent Stalin's terror in some way.
     
  7. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,708
    Location:
    UK
    Well, if you take my approach to vehicles and yields,you don't need lots of yields, just infinite combinations of the basic yields (Weapons, Armour, Engines, Automatic weapons).

    If you also use the hunter code (with some tweaking) you could have certain professions like tanks or infantry able to 'capture' yields from dead tanks or vehicles and take them back to then 'build' (or refit) another tank unit, along with capturing a POW! :D
    Or
    if you really want 'captured tanks' pressed back into service you could just make another three yields of 'Foreign Weapons, Armour, Engines' that are used in combos to make german tank models and variants.
     
  8. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,095
    Location:
    Marooned, Y'isrumgone
    Well, we'll have to agree to disagree:D I like the idea of Manufacturing Military Units, plus it will better solve the issue of having a multitude of Yields, which I don't like, and make obsoleting units much easier. I'm not sure if I would like "pilots", but it does sound interesting enough to try out and it seems like it would fit.

    My dad was in a tank division in World War II. When he was tested for driving a tank he was one of the few in his group that actually passed. He contributes this to growing up on a farm and driving tractors through the mud as in the test he navigated his tank really well through the mud and rough terrain. This gives me the idea of having Expert Tank pilots and such, and how it would defiantly fit.

    I see no issues with the AI that can not be solved with my idea. Like I have mentioned I have worked with the Unit AI enough that I have a good enough understanding of what is going on. When the AI needs an Offensive Unit it looks for a unit to give the best profession to with the canHaveProfession() function. All you would need to do is put the tank units in that function to let the AI know it can have the Tank Pilot profession. Then when it chooses that Profession, the code will make the Tank drivable(there is several ways to do this all of which does not effect the AI), thus giving it an UNITAI, once it has a UNITAI, the work is done as the AI will take over. Like, if a tank has UNITAI_OFFENSIVE, then it will use that already built in AI. AI checks all unit's AI type and runs the code associated with it. If tanks require a pilot then you would have "If no pilot, unit can not move or attack, skip to next unit".

    Could someone explain this "purge" as I am unfamiliar with it.
     
  9. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,708
    Location:
    UK
    Purge was a stalinist, communist action.

    Basically when Stalin and the communists came to power they 'Purged' the population of anyone who was not 'conducive' to the Communist Party Vision, Including anyone of the old nobility and Tzarist Allegiance, and a good chunk of Academics and such types as well.

    This led to a massive skill and knowledge deficit in early soviet russia, most of the military experts and commanders were part of the Old Tzarist council and so were 'removed' from state affairs.

    Many were shipped off to Syberia to various 'unpleasant work details', such as uranium mining..

    The rest were killed.

    Purges became increasingly mad and far reaching as Stalin became more maniacal and paranoid, basically anyone that gave the slightest whiff of disagreement with Stalin or his policies was purged.

    I once heard a story of a standing ovation for Stalin going on for ages because no one dared be the first to stop...
     
  10. Fullerene

    Fullerene Warlord

    Joined:
    Aug 26, 2009
    Messages:
    228
    Gender:
    Male
    I'm not sure I understand this idea correctly... at least it doesn't seem to fit for dozens of different tank models. It would be like playing with legos, don't you think?:)
    I mean tanks generally aren't just assembled and disassembled like that, at least I would imagine.

    I think I changed my mind once again:lol: I don't really want dozens of vehicle yields either.

    For this mod the AI code isn't even necessity, but if you can manage it then it would be great.

    If there will be AI code for tank crew, airplanes and unit supply system, then there will eventually be global WWII scenario...:D

    But first have to concentrate on this one, still so much work to do.
     
  11. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,708
    Location:
    UK
    Well, in terms of game mechanics it is like lego, but in 'real' terms it is the transportation of components and ready assembled chasisses and turrets, guns etc.

    We could even make it so that a newly 'built' profession cannot move the turn it is made, representing even more assembly time.

    It is basically just a unit of measurement, so for example 30 weapons would not literally be 30 bits of a gun, but like a gun for a 30 ton tank or whatever.

    So if you capture a 50 ton tank, you get fifty weapons, armour and engines.

    It is a way to make infinite variations without infinate yields and having the ability to 'transfer' crews and have Veterans for different kinds of roles, there can then be as many specialist military professions as you like, including variants and crew types.

    I have also started talking with Kail about the idea of needing buildings to make certain professions, so you could have various level of tank factory, so that you can only pick a heavy tank profession in an advanced city or whatever.

    It is a way to achieve the end goal, without having to code an entirely new system or a million yields!

    Just like 100 guns only graphically generates a single musketman.

    Or it taking several years for that 1 man to walk 3 squares... :D
     
  12. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,095
    Location:
    Marooned, Y'isrumgone
    Any of the systems mentioned here would work, so it boils down to a matter of playstyle. All the systems has advantages and disadvantages. If you don't have a ton of different Units to manufacture then you'd have a bunch of Professions. But, one idea is like when you assign a great general to a unit, a list of possible units pops up. So, in similar fashion if you have several different Tank units, like a Sherman, three Churchills, and two Panzers you could click the "Pilot Tank" command and you would have a popup list of those tanks. Going this route you wouldn't have lots of professions or yields.

    Edit: Hmm, I am thinking that if I went this route what would be the best mod friendly way to do it. I have already discovered that I can build commands on the fly with the Trade Screen commands, which by passes the whole hard coded unit command system.

    There could be a new attribute to units called "requirespilot" and then create and assign different pilots to each UnitCombatType, such as UNITCOMBAT_TANK or UNITCOMBAT_BOMBER. Then, we could write python code that cycles available units checking if the selected Pilot unit can Pilot any of the vehicles, if so it then spawns a Command Icon for each UNITCOMBAT type. Just like it spawns a command for each Trade Screen.
     
  13. Lib.Spi't

    Lib.Spi't Overlord of the Wasteland

    Joined:
    Feb 12, 2009
    Messages:
    3,708
    Location:
    UK
    My system just requires no new mechanics though. :)

    This system still requires multiple 'buildings' and new mechanics code.

    If you want to build a new system, that is cool. It's just my system doesn't need you to. :D
     
  14. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,360
    I disagree that it should be done in python. If we add two functions to the DLL (python exposed), then we could do:
    bool CyUnit::showButton(int UnitCombatClass)
    void CyUnit::clickButton(int UnitCombatClass)
    (we need better function names :p)

    This approach will put the essential code inside the DLL, which mean:
    1. can use debugger and asserts
    2. can share code with other pilot related functions
    3. much faster at runtime (smoother GUI)
    1-2 can be very important for bug hunting.
    3 is nice to have, but it's more like a bonus than the goal itself as we will likely not be able to tell a major difference. The only reason I add this is because it starts to matter if we do the same for the next new addition and the next etc. Eventually the combined slowdown will make the GUI become slow like the city screen was before I added the invention cache.

    I came up with an idea regarding the AI. We can then cheat and make a "free colonist" inside the vehicle on creation if player is AI. Because the AI doesn't know how to pull units out of vehicles, they will have permanent pilots. It would be best to teach it to put units into vehicles, but a cheat like this is better than nothing.

    I haven't considered if I think UNITCOMBAT is the best place to store this, but it might be. I think each UNITCOMBAT type should have a pilot profession because tank pilot shouldn't access the same promotions as bomber pilot.
     
  15. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,095
    Location:
    Marooned, Y'isrumgone
    I'm just trying to think through all the ideas so far. Sometimes things seem better on paper than they are in reality, anyway when Fullerene gets to this part in his mod I'll be happy to add code to help test out the best solutions.


    I agree here too. Did you ever look at my Trade Screen command button code in Python? It cycles through all the EuropeTypes calling dll functions to determine if the Unit can use the button. I am not familiar with any way to add buttons with dll code? All the current command buttons use python to display them. There obviously has to be some python code added, sense the GUI is python, but definitely the bare minimum.

    I don't understand this idea, or why the need for a "free colonist inside the vehicle". The AI can already build Units, such as Cannons and Ships, and use them just fine. If you add new Vehicles you would just need give them UNITAIs and they would work fine also. To simplify things for the AI to start with, you could make Pilots only for Human players and the AI able to use their Vehicles without pilots. Graphically the player will never know if the Tank has a pilot or not. Done this way however, the AI will have an advantage in that it gets to keep it Pilots back home working in cities, but the AI is none to bright anyway, so this advantage is probably minimum.

    For some reason, I've noticed, the AI never takes advantage of all it's units anyhow. It usually garrisons several military units, even in times of peace. I never understood why it does this as it would make sense to use those units in the cities, but maybe it knows something we don't:scan:

    Edit: Actually I probably do know why, the AI determines how many "defenders" it needs for each city and works to accumulate that many, stationing them on guard. The AI could be reworked to actually take advantage of their production but I am not sure how advantaged or disadvantaged the AI is at the moment under Vanilla rules.
     
  16. Fullerene

    Fullerene Warlord

    Joined:
    Aug 26, 2009
    Messages:
    228
    Gender:
    Male
    Hmmm, what if we code a profession to require a vehicle. You could only create tank profession if you have a required tank unit in the same plot. It's almost same idea that you have, but maybe it can take use for existing AI code for professions? I haven't studied any code regarding to this though... But, just came to my mind.

    Downside is of course that you still need many different professions plus different units... Maybe not so bright idea after all... but at least the yield flood would be gone.
     
  17. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,360
    Lets think for a moment on how it would work with professions.

    We make one tank unit, which works kind of like a treasure unit, except it can't move. It can only be transported by other units, such as drivers and trains. It might be possible to capture it, but we should forget about capturing units for now.

    Next we have a tank driver profession. It has one cargo slot and once assigning the profession, it picks up a tank unit and places it in that cargo slot. This will solve the problem of linking driver and vehicle units into one.

    When unit changes profession, the tank unit reappears on the map.

    Health:
    When picking up the tank, the unit gets the same health as the tank (percentage of full health)
    When dropping the tank, the tank gains the same health as the driver (still percentage)

    This will ensure that you can't cheat and make a heavily damaged driver drop the tank and an unharmed driver takes over.


    Linking units:
    I wonder if we could make a new cargo hold just for the vehicle unit. This one will not be visible in a city and stuff like that. That will allow a vehicle with driver and normal cargo hold. The normal cargo hold can then be used for fuel and ammo and whatever. It should also allow us to extend this system to (cargo) ships.

    We can then alter certain functions to work like:
    Code:
    int CvUnit::getMove()
    {
        if (vehicle_slot != NULL)
        {
            return vehicle_slot->getMove();
        }
        return m_moves;
    }
    This is example code, not copied from the real code. In fact I think it reads from UnitInfo rather than the unit itself. This could make it even easier to implement. We just have two pointers to UnitInfo, both pointing to the same location and it will not matter which one we use. When we have a vehicle, we just change that pointer and automatically everything using that pointer will be updated. This mean instead of checking for carrying a vehicle at runtime, we just at compiletime sets which of the two pointers it uses. That way we can keep the code simple (less bugs) and not losing any performance at all from linking units like that.

    This will allow a single driver profession to gain different abilities from different tanks and the power, graphics and such will be set in the tank unit. We will likely need some "is vehicle" bool in the tank info to give it moves, yet being unable to move.
     
  18. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,095
    Location:
    Marooned, Y'isrumgone
    Yeah, I mentioned this already a few posts back. I see no problem with this from an AI point of view. The AI would naturally build the Unit, but we would put the unit in stasis. Then when the AI needs a military unit profession, it naturally looks for the best one, and if Tank Pilot is the best and there is an available tank then it would take on that profession. The tank could actually remain in stasis, or better yet, instead of creating an actual Unit that takes up memory, like I mentioned before you could simply create variables that keeps up with the number of tank units built at a city, and the Profession checks that number to see if it can have the Profession. When it takes on the Profession the number is -1, then when it returns to the city the number is +1.

    Anyway, these "numbers" could be an Array based on Vehicle UnitCombats and the city keeps a total of these.

    Either way, you would want the Tank Pilot to be the one earning the Promotions and such just like they do now. If you have a Cavalry promotion it doesn't show up unless the Unit is a Cavalry, so we want to keep that system intact.

    It may be better to actually create the Tank unit though, that way those Units could be captured. Actually, though it would be easy to simulate Capturing them just by the number in the city array. Basically, however we want to do it we can do it:p

    How much longer do we have to have this little santa hat guys :cool:

    Edit: I posted this before knowing about Nightinggale's above post, which I haven't fully reviewed just yet.
     
  19. Kailric

    Kailric Jack of All Trades

    Joined:
    Mar 25, 2008
    Messages:
    3,095
    Location:
    Marooned, Y'isrumgone
    Well, after reading this I think vehicles should actually be Units that we can transport around, maybe:D But I still think it would be more simple to just make Vehicles a requirement for Professions, that way we can keep the same Promotion system going. The Pilot is the one who is gaining experience not the lifeless mechanical tank. Tanks would be the weapon the Unit is using at that moment, but it is still up to the skill of the Driver or Crew to manipulate his vehicle to the best of its abilities.

    There would be an issue with this though, or any method that uses actual Vehicles, and that is how to differentiate between a Piloted Tank and a none Piloted one. When selecting a stack of units you would have to manually skip the none piloted ones. And it could be confusing as to what cities are actually defended by a Piloted Tank. If none piloted tanks are on the map there would need to be a graphical difference, so maybe they could be half the size of a Piloted tank and none selectable in the unit cycle...
     
  20. Nightinggale

    Nightinggale Deity

    Joined:
    Feb 2, 2009
    Messages:
    4,360
    They are long gone, but they are stuck in your browser cache. Try another browser/computer and they are gone. Clearing the browser's image cache should also do the trick. Alternatively they are stuck in a cache on a proxy server somewhere, but then again it will be a problem in your end, not the server.

    Don't worry. I haven't fully reviewed it either. I wrote and the ideas came to me while writing and I modified a few times before posting as the concept matured. It's a concept draft, not a solution, though it has the potential to mature into a solution.
     

Share This Page