Modder's Guide to A New Dawn

Anyone knows if the AI is aware of the advantages of civic buildings? Does it take into account the bonuses of the civic building too when changing civic?
I think it should but I haven't checked that part of the code. One problem might be anyway that value assigned to those buildings might not be in scale with other buildings and units because lot of things have changed since that part of the code was written. So AI might end up not using them enough, not because it doesn't know how to use them, but because it gives priority to other units/buildings.
 
I have created a mini-mod for Civ5 whereby I am leaning on the Civ4 tech tree design. Being a long time player of AND, I was wondering if I could use / borrow some ideas from AND's tech tree / buildings. I would of course fully credit this mod as the source of a lot of my ideas should you be up for it.
Of course no problem for me.
 
45°38'N-13°47'E;14373749 said:
I think it should but I haven't checked that part of the code. One problem might be anyway that value assigned to those buildings might not be in scale with other buildings and units because lot of things have changed since that part of the code was written. So AI might end up not using them enough, not because it doesn't know how to use them, but because it gives priority to other units/buildings.

I asked because in my games AI seems to love Exploration civic too much. It had a big production bonus on some units - I think the AI values this too much.
Than I changed the civic significantly reducing its bonuses by moving those prod. bonuses to the civic building, which is needs nothing else, but the civic. But in my test games AI still prefers this civic instead of the better ones.
 
Maybe a silly question:
This mod modifies some files (filetype .cpp) in the folder of BTS vanilla which in sourceforge is described as Sources folder.If I want to play again BTS vanilla or another mod does it mean that I have to use again the original vanilla .cpp files?Does the uninstallation of the mod restore the original files?
 
Maybe a silly question:
This mod modifies some files (filetype .cpp) in the folder of BTS vanilla which in sourceforge is described as Sources folder.If I want to play again BTS vanilla or another mod does it mean that I have to use again the original vanilla .cpp files?Does the uninstallation of the mod restore the original files?
The mod doesn't alter those files in any way. And they have no influence in game because those are the files that are compiled into the dll.

Edit: wait, don't tell me you've overwritten those files copying the source folder from the mod! If so, you have to restore them from a clean installation if you really need them. But they're really only needed for dll modding and have no impact in game.
 
@45°38'N-13°47'E:
Maybe I misunderstand something or I don't get you.
Look,for example:
In sourceforge for REV 1028 it changes the file CvCity.cpp.Isn't it in the vanilla "bts" folder?
Sometimes I manually update between REVs by downloading and overwriting files.Why these .cpp files have no impact in game?So why they're changed?
 
@45°38'N-13°47'E:
Maybe I misunderstand something or I don't get you.
Look,for example:
In sourceforge for REV 1028 it changes the file CvCity.cpp.Isn't it in the vanilla "bts" folder?
Sometimes I manually update between REVs by downloading and overwriting files.Why these .cpp files have no impact in game?So why they're changed?
You don't need anything from SVN except what's inside Rise of Mankind - A New Dawn folder. Everything else is for developers only. You're not supposed to download cpp files, and you're not supposed to overwrite them to the original folder under BTS, which is called CvGameCoreDLL. Those files are meant to be compiled together by developers and they form CvGameCoreDLL.dll, which is the core of the game. There's a dll in main BTS folder but when you load the mod, the one in RAND folder is used. Anyway unless you are able to compile a dll, you have no use for those files as they don't have any impact on the game: they're just what the dll is made of.
 
45°38'N-13°47'E;14379826 said:
You don't need anything from SVN except what's inside Rise of Mankind - A New Dawn folder. Everything else is for developers only. You're not supposed to download cpp files, and you're not supposed to overwrite them to the original folder under BTS, which is called CvGameCoreDLL. Those files are meant to be compiled together by developers and they form CvGameCoreDLL.dll, which is the core of the game. There's a dll in main BTS folder but when you load the mod, the one in RAND folder is used. Anyway unless you are able to compile a dll, you have no use for those files as they don't have any impact on the game: they're just what the dll is made of.

Thanks for your thorough reply 45°38'N-13°47'E.When I return to my gaming PC,I'll have the chance to tidy things up.
 
Hi,

Been enjoying playing A New Dawn - still learning it.

I was wondering if it was possible to mod it such that you can get the data out of A New Dawn. Maybe as you hit Enter it could output a text file with Commerce, Beakers, Maintenance etc etc. Is this at all feasible, or even that Modders do this to fine tune their creations? My idea would then be to geek out and write some custom (historical) reports in Python using the text files.

Not gone under the hood yet with Modding.I would describe myself as a technically-incompetent-programmer as I work with programmers who are technically competent.
 
Hi,

Been enjoying playing A New Dawn - still learning it.

I was wondering if it was possible to mod it such that you can get the data out of A New Dawn. Maybe as you hit Enter it could output a text file with Commerce, Beakers, Maintenance etc etc. Is this at all feasible, or even that Modders do this to fine tune their creations? My idea would then be to geek out and write some custom (historical) reports in Python using the text files.

Not gone under the hood yet with Modding.I would describe myself as a technically-incompetent-programmer as I work with programmers who are technically competent.

There is plenty of logging already available, you can switch it on in CivilizationIV.ini and under BUG options, one of the last tabs IIRC. But as I didn't write that part of the code I can not offer more help, I'm afraid.
 
There is plenty of logging already available, you can switch it on in CivilizationIV.ini and under BUG options, one of the last tabs IIRC. But as I didn't write that part of the code I can not offer more help, I'm afraid.

Thank you for your speedy reply.

Right time to get to work (once I get back from work). But work on fun stuff!
 
What does bForceDelete do? It's there in BuildingsSchema, GameInfoSchema and TerrainSchema.

My guess is, that it should completely remove any item type. At least it would be very useful in modular modding if I could simply remove any un-wanted item.
But it doesn't seem to do anything.
 
This is my first time even touching python, so will someone please sanity check me?
Spoiler :

Code:
def onEndGameTurn(self, argsList):
     iNumUnits = gc.getNumUnits()
     NumDamagedPlots = int(round(iNumUnits / 10))
 
     for i in range(0, NumDamagedPlots):
          DamagedPlot = random.randint(0, map.numPlots())
          plot = map.plotByIndex(DamagedPlot)
          if (plot.getRouteType() == gc.getInfoTypeForString("ROUTE_ROAD")):
                plot.setRouteType(gc.getInfoTypeForString("ROUTE_TRACK"))
          elif (plot.getRouteType() == gc.getInfoTypeForString("ROUTE_PAVED")):
                plot.setRouteType(gc.getInfoTypeForString("ROUTE_ROAD"))
          elif (plot.getRouteType() == gc.getInfoTypeForString("ROUTE_MODERN_ROAD")):
                plot.setRouteType(gc.getInfoTypeForString("ROUTE_PAVED"))
          elif (plot.getRouteType() == gc.getInfoTypeForString("ROUTE_RAILROAD")):
                plot.setRouteType(gc.getInfoTypeForString("ROUTE_PAVED"))
          elif (plot.getRouteType() == gc.getInfoTypeForString("ROUTE_RAILROAD_ELECTRIC")):
                plot.setRouteType(gc.getInfoTypeForString("ROUTE_MODERN_ROAD"))
          elif (plot.getRouteType() == gc.getInfoTypeForString("ROUTE_GRAVTUBE")):
                plot.setRouteType(gc.getInfoTypeForString("ROUTE_MODERN_ROAD"))
          elif (plot.getRouteType() == gc.getInfoTypeForString("ROUTE_JUMPLANE")):
                plot.setRouteType(gc.getInfoTypeForString("ROUTE_MODERN_ROAD"))

This is supposed to, on the end of every game turn,
1. check the total number of units on the map
2. choose an integer number of random map plots based on the number of units on the map
3. if any randomly chosen map plot has a designated route type on it, downgrade the route

Did I do a dumb?
 
Last edited:
First of all, it's really recommended to use gc.getGame().getSorenRandNum() to generate random numbers. Otherwise it generates OOS errors in multiplayer.

The other thing you can do is use CyInterface().addMessage to test if your code works. Put a message wherever you want to test and if a message does pop up, the code got to that point without failing. I've used that a lot.
 
Top Bottom