Vincentz Infinite Projects [VIP MOD]

Hey Vincentz! Long time no see my friend. Hope you and family are doing great. :grouphug:
 
Its great to see so many familiar faces that are still here. I was scared to be all alone :)
Since I was last here, I finished a programming education, and afterwards became a programming teacher/educator.
But while I enjoy the teaching part, the product becomes the students and not the code, so thought I'd spin up the old VIP mod, and had a lot of fun playing it.
And once you are hooked on 'one more turn', well, then comes the modding ;).

Its really funny how, when I started with the SDK many years ago, it was all trial and error, and I had no clue what I was doing.
Now that I actually teach OOP and Debugging, it is completely different code to look at.
Some of the stuff... well, it was written a long time ago. I guess it was a different time back then :scan:
 
I'm the oldest modder now on the Caveman2Cosmos Team. :p I work slowly on the Civics. ;)

So... will you be doing any debugging for VIP? Not that any may be need as I recall. :D

And can you play VIP in multiplayer?
 
Civ5 does this too: strategic resources are used as upkeep for higher-end units, so you can only have _x cavalry at a time.

That might actually be the easy solution for the Iron/Bronze/Horses/Ivory etc.
Still wanna try with oil/fuel as a depot that diminished for every move. ;)

I'm the oldest modder now on the Caveman2Cosmos Team. :p I work slowly on the Civics. ;)

So... will you be doing any debugging for VIP? Not that any may be need as I recall. :D

And can you play VIP in multiplayer?

The debugging is a nice tool. Being able to run through the code and inspect the values as it plays, gives me a better understanding. Especially when fixing bugs.
Before I had to test it visually. Now I can pinpoint the exact variable/function where things go south. Speeds things up x100 (literally).
Civ 4 have, what I best can describe as spaghetti code. Some of the stuff is just plain terrible. Atleast now I can follow the spaghetti strings to the meatballs ;)

I dont know if VIP runs multiplayer. My son (now 10) watched me play, and wanted to try it. I was reluctant. I thought about suggesting him heroin instead. Its less addictive :nono:
 
Also, regarding to the pollution: By being able to manipulate features through the DLL, it opens up for giving the biological missiles some more meaning, as well as a couple of the promotions I have. Maybe even a spy mission that pollutes a tile.
I'm sure Ghandi will be salivating over that. He's always evil in my games.
 
I dont know if VIP runs multiplayer. My son (now 10) watched me play, and wanted to try it. I was reluctant. I thought about suggesting him heroin instead. Its less addictive :nono:
Heh, wife tried assorted home made baked goods when the boys were younger. The amount of haggling of Civ vs baked goods would have made a U.N. Diplomat green with envy. I got glared at rather viciously when the oldest and I offered to teach the grandson Civ.. I really don't see how it's my fault :mischief:
 
Oil
This one is bit ambitious, but could theoretically be fun (I think).
Oil (or fuel) would collect like gold, but be used for every move of modern ship/vehicles/air.
No oil? no go!
In general there are a lot of resources that should be limited. You have 1 iron, you can build 50 tanks and battleships at the same time. A storm takes down the mine, and you can build nil.
Well, that would be rather awesome if resources could pile up and get used in different ways:
  • As "fuel": Like Oil and such gets consumed by units when they move, just as you described.
  • As requirements: E.g. a Knight could require 5 Horse and 5 Iron to be trained and a Tank would require let's say 20 Iron.
  • As convertibles: E.g: Market converts 1 Silk into +1:) and +3 :commerce: in the city.
  • As production boosters: E.g: When building the Stonehenge it consumes 10 units of Stone / turn to double its production.
Ahh, would be nice :love:
 
its no so hard to make the resources to compile to an accumulative total.
i tried that once.
you need to wrap it with lots of other code, UI display, stuff that deduct from it , safety stuff below 0...etc
the hardest is to teach the ai how to spend it with care, to priorities its expenses and such.
its a big job.

also there is some fuel mod somewhere on this site that worked many of these. aside from good ai code.
 
Yeah, did the accumulation. It also saves it with savegames. Now to retracting it when moving a (Mechanical) unit. Then AI stuff... ;)

Oil.JPG


Edit...

Oh boy, this took a lot longer than anticipated.... Me and Python are not good friends....
Sometimes the simple things are hard, and the hard is simple when it comes to coding.
Any mechanical unit now uses 1 oil per move. Thinking planes should cost 2.
And perhaps each oil should add 10 oils to the reserve. Otherwise they run out of fuel faster than a Russian caravan in Ukraine.

Oil2.JPG
 
Last edited:
It now works on the following:

CHECK
bool CvUnit::canMove() const
bool CvUnit::canAirlift(const CvPlot* pPlot) const
bool CvUnit::canParadrop(const CvPlot* pPlot) const


USE FUEL
void CvUnit::move(CvPlot* pPlot, bool bShow)
bool CvUnit::airlift(int iX, int iY)
bool CvUnit::paradrop(int iX, int iY)
bool CvUnit::recon(int iX, int iY)
bool CvUnit::airBomb(int iX, int iY)
bool CvUnit::airStrike(CvPlot* pPlot)

It DOESNT use fuel on Attacks. But will use fuel if attacks and moves into tile.
Should it use fuel on attacks? And am I missing someplace that needs to use fuel?

I also changed name to Fuel, and it consists of Oil x 10* + Fuel (From refinery built by Great person).

*Modifier can be changed in GlobalDefines (<DefineName>FUEL_PER_OIL</DefineName>)

Now all I need is testing. Anyone out there who wanna try it?

edit: Lol, the paradrop function is a cheeky bastard :)
 
Yeah, if there is no fuel, units turn red (including planes), but still have moves, just cant move. Maybe someway to buy fuel (mostly for the AI).
I'll have a look at the AI. Got some ideas. Especially the AIs that are patrolling could be an issue.

I need to use the fuel icon from my gamefont, for the CvMainInterface.py instead of text, but I dont want to fight python again right now....

Huh you are very fast...
If it wasn't for the damn python, things would have gotten even faster. ;)
 
I dunno,could be tricky,
Think about a situation where ai has units in danger, but he wasted his oil on othe not in danger units.
Youll need to consider it .

Ii would make the oil, to allow 1,2,3 extra movements, unit defined , when oil is down,units still can move but , 1 move.
Or play with the perks of oil, sone more battle bonus for some units.

Stopping them completely,will give you a hell of a lot more work.

Yeah python ui...well, most of my code is in sdk, faster.
 
I dunno,could be tricky,
Think about a situation where ai has units in danger, but he wasted his oil on othe not in danger units.
Youll need to consider it .

Ii would make the oil, to allow 1,2,3 extra movements, unit defined , when oil is down,units still can move but , 1 move.
Or play with the perks of oil, sone more battle bonus for some units.

Stopping them completely,will give you a hell of a lot more work.

Yeah python ui...well, most of my code is in sdk, faster.

For now the formula is
Code:
int CvPlayer::getOilPerTurn() const
{
    int totalFuel = GC.getDefineINT("FUEL_PER_OIL") * (
        getNumAvailableBonuses((BonusTypes)GC.getDefineINT("FUEL_BONUS")) +
        getNumAvailableBonuses((BonusTypes)GC.getDefineINT("OIL_BONUS")) +
        GC.getHandicapInfo(GC.getGameINLINE().getHandicapType()).getFreeUnits());
    return totalFuel;
}

"FUEL_PER_OIL" is defined in Global Defines (10)
"FUEL_BONUS" is how many fuel resources from Refinery (Great Person build)
"OIL_BONUS" is how many oil resources
getFreeUnits is modifier from difficulty (8 at noble, 3 at Emp, 1 at Diety).

So if AI have 1 well = 10 * (0 + 2 + 8) = 100 oil/turn.
They do have a tendency to build refineries, so it quickly adds up.

A player at Emp trading a single oil = 10 * (0 + 1 + 3) = 40 oil/turn.

Gotta make some tests to see how it goes.

Btw. I forgot to turn the pollution down on an AIAutoplay. Have adjusted it and modified for difficulty (Noble 1 in 300, Prince 1 in 200, later 1 in 100) per :yuck:
oops.JPG
 
About multiplayer: I have a VPS in Germany that I used for my final exam, and haven't really used since. I just installed Civ4 on it, so I could do some AI autoplays, and it seems like it have a pretty powerful single core processor and a fast internet connection, so it might also be ideal for MP. Especially because its a static IP, and easy to access. Gonna play around and find out ;)


Edit: I played around and found out: It works. I managed to setup a MP game through Direct IP connection :)
 
Last edited:
Formula 1 was faulty. It gave ton of fuel from 10.000BC.
Formula 2 is now in play.

Code:
int CvPlayer::getOilPerTurn() const
{
    return (GC.getDefineINT("FUEL_PER_OIL") +
        GC.getHandicapInfo(GC.getGameINLINE().getHandicapType()).getFreeUnits()) *
        (getNumAvailableBonuses((BonusTypes)GC.getDefineINT("OIL_BONUS")) +
            getNumAvailableBonuses((BonusTypes)GC.getDefineINT("FUEL_BONUS")));
}

AI got a well and refinery = (10 + 8) * (2 + 3) = 90/turn

Emp. Player got 1 oil = (10 + 3) * (1 + 0) = 13/turn
Settler Player got 2 wells, 3 refineries = (10 + 24) * (4 + 9) = 442/turn
Diety Player got 2 wells, 3 refineries = (10 + 1) * (4 + 9) = 143/turn

Should Oil be storable (max amount), buyable and steal-able?
 
Thank you very much. I was learning a little bit about the code, hoping to create a full-fledged model of the military economy, but…
With your permission, I will describe my concept a little later and below.


It DOESNT use fuel on Attacks. But will use fuel if attacks and moves into tile.
Should it use fuel on attacks? And am I missing someplace that needs to use fuel?


Сombat involves disproportionately high fuel consumption, both for air and ground, and for naval units.
For example, the maximum speed of ships, which has been used for a long time within a few hours, is much more expensive than "normal"/economic.


Any mechanical unit now uses 1 oil per move. Thinking planes should cost 2.

The nuance is that in reality there is a difference of two times between... two different types of modern tanks of similar weight. The "Leopard-2" spends half as much fuel as the "Abrams" and the French Leclerc. Wikipedia does not agree with this – this is data on tests in Sweden in 1993. This is also why "Leopard" is so popular on the market.

The difference between the fuel consumption of a wheeled APC and a tank is already 6 times or more (T-90/BTR-80). At the same time, the difference in the weight of cars is about 3.5 times. This is partly why quartermasters and peacetime military ministers are so fond of wheels.

The fuel consumption of a light fighter (F-16) per 100 km of combat radius is approximately equal to a Leopard on very rough terrain, but the fighter moves much further per turn.

In other words, a tank is an extremely voracious thing, aviation is incredibly voracious. But even irregulars can afford the "Toyota war", and light brigades can be more or less successfully used as expeditionary forces.
 
Should Oil be storable (max amount), buyable and steal-able?
Hm... How would you like to set an accumulation limit, mainly proportional to the number of improvements on the tile (oil storage)? Their "option" is that they can be destroyed by aircraft, missiles, etc.
 
Top Bottom