Civilization Tactical Combat Development Thread (Input/Suggestions Wanted)

This will be the best mod I have ever seen when its done.
This looks awesomely gorgeous, my huge mental support for that. big time!!!:worship:

Thanks! :)

When do you hope it will be out? A year, 6 months?
No rush, just curious!

I'm not sure that I want to put an estimate out there, since the estimate on my last mod was way off the mark (considering I didn't even finish it, if you remember :lol: ). I f I had to guess, I would say that it will be done sometime between six months and a year from now.
 
A debugging update:

I tried setting the four engine dirty bits and the interface GlobeLayer_DIRTY_BIT to false before switching the maps, and then resetting them afterwards, but it had no apparent effect. I also called markPlotTextureAsDirty() on all the plots after switching the maps, but this didn't do anything either. The whole thing looks like this:

Code:
gDLL->getInterfaceIFace()->SetDirty(GlobeLayer_DIRTY_BIT, false);
gDLL->getEngineIFace()->SetDirty(GlobeTexture_DIRTY_BIT, false);
gDLL->getEngineIFace()->SetDirty(CultureBorders_DIRTY_BIT, false);
gDLL->getEngineIFace()->SetDirty(GlobePartialTexture_DIRTY_BIT, false);
gDLL->getEngineIFace()->SetDirty(MinimapTexture_DIRTY_BIT, false);

CvMap* tempMap = m_map;
m_map = m_altMap;
m_altMap = tempMap;

GC.getMapINLINE().rebuild(15, 15, 45, -45, false, false, (WorldSizeTypes)0, (ClimateTypes)0, (SeaLevelTypes)0, 0, NULL);
for (i = 0; i < GC.getMapINLINE().numPlots(); i++)
{
      GC.getMapINLINE().plotByIndex(i)->setTerrainType((TerrainTypes)GC.getInfoTypeForString("TERRAIN_GRASS"), false, false);
      gDLL->getEngineIFace()->MarkPlotTextureAsDirty(GC.getMapINLINE().plotByIndex(i)->getX(), GC.getMapINLINE().plotByIndex(i)->getY());
}
gDLL->getEngineIFace()->RebuildAllPlots();
GC.getMapINLINE().setupGraphical();

gDLL->getInterfaceIFace()->SetDirty(GlobeLayer_DIRTY_BIT, true);
gDLL->getEngineIFace()->SetDirty(GlobeTexture_DIRTY_BIT, true);
gDLL->getEngineIFace()->SetDirty(CultureBorders_DIRTY_BIT, true);
gDLL->getEngineIFace()->SetDirty(GlobePartialTexture_DIRTY_BIT, true);
gDLL->getEngineIFace()->SetDirty(MinimapTexture_DIRTY_BIT, true);

Is this how I should be calling SetDirty()? Is there anything else I should try?
 
A debugging update:

I tried setting the four engine dirty bits and the interface GlobeLayer_DIRTY_BIT to false before switching the maps, and then resetting them afterwards, but it had no apparent effect. I also called markPlotTextureAsDirty() on all the plots after switching the maps, but this didn't do anything either. The whole thing looks like this:

Code:
gDLL->getInterfaceIFace()->SetDirty(GlobeLayer_DIRTY_BIT, false);
gDLL->getEngineIFace()->SetDirty(GlobeTexture_DIRTY_BIT, false);
gDLL->getEngineIFace()->SetDirty(CultureBorders_DIRTY_BIT, false);
gDLL->getEngineIFace()->SetDirty(GlobePartialTexture_DIRTY_BIT, false);
gDLL->getEngineIFace()->SetDirty(MinimapTexture_DIRTY_BIT, false);

CvMap* tempMap = m_map;
m_map = m_altMap;
m_altMap = tempMap;

GC.getMapINLINE().rebuild(15, 15, 45, -45, false, false, (WorldSizeTypes)0, (ClimateTypes)0, (SeaLevelTypes)0, 0, NULL);
for (i = 0; i < GC.getMapINLINE().numPlots(); i++)
{
      GC.getMapINLINE().plotByIndex(i)->setTerrainType((TerrainTypes)GC.getInfoTypeForString("TERRAIN_GRASS"), false, false);
      gDLL->getEngineIFace()->MarkPlotTextureAsDirty(GC.getMapINLINE().plotByIndex(i)->getX(), GC.getMapINLINE().plotByIndex(i)->getY());
}
gDLL->getEngineIFace()->RebuildAllPlots();
GC.getMapINLINE().setupGraphical();

gDLL->getInterfaceIFace()->SetDirty(GlobeLayer_DIRTY_BIT, true);
gDLL->getEngineIFace()->SetDirty(GlobeTexture_DIRTY_BIT, true);
gDLL->getEngineIFace()->SetDirty(CultureBorders_DIRTY_BIT, true);
gDLL->getEngineIFace()->SetDirty(GlobePartialTexture_DIRTY_BIT, true);
gDLL->getEngineIFace()->SetDirty(MinimapTexture_DIRTY_BIT, true);

Is this how I should be calling SetDirty()? Is there anything else I should try?
Setting the dirty bits to false will not be needed. Usually you only set them to true and it is the job of the engine to set them to false once it has redone the work associated with it.

One thing I noticed in this sequence: The textures of the plots that are not in the new map are not set to be dirty. It might be worth a try to move that to before switching the map.
 
Setting the dirty bits to false will not be needed. Usually you only set them to true and it is the job of the engine to set them to false once it has redone the work associated with it.

One thing I noticed in this sequence: The textures of the plots that are not in the new map are not set to be dirty. It might be worth a try to move that to before switching the map.

I tried this and it didn't make a difference.

I haven't had a chance to do much modding lately and I'm on a different computer right now so I don't remember exactly what I did, but essentially I went through the CvDLLEntityIFaceBase, CvDLLInterfaceIFaceBase, and CvDLLUtilityIFaceBase classes and called every function that looked like it could possibly be relevant. I set all the interface dirty bits to true. Nothing works. The only function I saw that I didn't call was gDLL->setDone(), but from what I've gathered this shuts down the game. I also thought InitGraphics() might do something, but when I call this the game crashes.

I'm wondering if there's something in python that would rebuild the map's graphics. I know loading worldbuilder saves is handled there, so when I get a chance I'll have a look at that and see if I can find anything, since nothing else appears to be working.
 
If you are interested in checking it out. My mod already has some of the features you are working on. My mod is currently in alpha mode (has been for quite some time). I'm not trying to replace your mod - I just thought that you might be able to save some time by looking at some of the things that I already finished. There is a link to the mod in my signature.

Some of the features include:
Multiple maps in one game - when you complete the objectives on the current map you can continue to the next one. The player is introduced to new objectives as they complete the old ones.

You start with all new units when you start a new map. With the exception of your generals - they continue from map to map.

There is a reinforcements screen where you can buy new units - (it's no longer possible to build units).

I've added airbases. Each airbase contains one or more air officers. The higher the air officer is ranked the more planes he can control. Planes no longer can land in cities.

Aircraft and artillery ranges have been greatly increased.

I created my own form of 1 UPT. The number of units that can fit on a tile is determined by the terrain type, features, and if a road exists. Most tiles hold 1 or 2 units. Roads allow one additional unit.

I added new AI code that allows some limited control by changing values in the XML files. I also added a feature that allows unit AI to be controlled by Python.

There is a massive number of new units so the mod is a little on the big side.

Like I said the mod is very alpha. It's not really ready to play as a game but it is far enough along that you can check out the features and decide if you like any of them. There are currently only two maps. The first one is over 50% completed and the second one is mostly blank. The first one shows most of the features available. The second one is just there as a test to show that the in game map switching works.

If you are not into checking it out no problem - I just thought that I would mention it.
 
@General Tso
Your mod definitely looks interesting, thanks for pointing it out to me. I may be able to build off of some of your features.

One quick question: how is the map switching done? Do you actually switch the map object itself, or do you load a new WB map? Is it done in the SDK or python?
 
It's been a long time since I looked at it so I just went back and checked. :lol:

The map is created in Python. It's done in PgMod.py look for the CreateMap method in the PgMod object.
 
Thanks for the info. I don't think I'll be able to use your method of switching maps exactly, since I want to actually switch the map object itself, but when I get a chance (as with everything :rolleyes:) I'll take a closer look at your code and see if there's any functions there that could help me.

In the meantime, I'm going to post a new thread addressing the issue of rebuilding the map's graphics and see if anyone has any ideas.
 
Sounds good. I probably should have mentioned that I manually add the the settings for each plot in Python. It might have saved you some time.
 
@LyTning94

How is this going? The C2C team is anxiously awaiting this mod so we can use the multi-map feature to use for Lunar, Mars and Galactic maps in our game. You can see more of our planning here. Thank you for doing this. It saves us a lot of time not having to invent the code ourselves.

Glad to see it's going to be of some use! :)

Currently I'm still trying to figure out a way to switch between maps of different sizes and have the graphics engine load them properly (see my other thread). As soon as I figure this out or deem it impossible, I'm going to release a modcomp with just the map-switching feature. If I can get different sized maps to work I'll include that functionality, otherwise all the maps will have to be the same size.
 
Sounds good. I probably should have mentioned that I manually add the the settings for each plot in Python. It might have saved you some time.

Thanks. One more question: Did this work with different sized maps, or were they all the same size?
 
They are all the same size. The map isn't changed - just the plot data. The WBS file is read in PgWBSReader.py and the plot data is set in PgWBSHandlers.py.

I tried to find a way to actually change maps within the game and failed. Since my mod consists of a series of controlled objectives for each map, I decided that resizing the map wasn't really needed. I just made the map size as large as the largest map in the mod. Smaller maps just have their objective spaced closer together with some parts of the map (usually around the edges) not being used. The unused parts of the map still contain land, sea, etc... There is just no reason for the player to go there. Especially on time based objectives.

Hopefully you will have better luck then me. Whenever I tried using the rebuild method in the Map object either nothing would happen or else the game would lock up.
 
I tried to find a way to actually change maps within the game and failed. Since my mod consists of a series of controlled objectives for each map, I decided that resizing the map wasn't really needed. I just made the map size as large as the largest map in the mod. Smaller maps just have their objective spaced closer together with some parts of the map (usually around the edges) not being used. The unused parts of the map still contain land, sea, etc... There is just no reason for the player to go there. Especially on time based objectives.

Thanks again for the info. It appears that I'm going to have to try something like this. My initial idea was to make all the unused plots impassible, but I'm not sure how the AI would respond to this. I guess I'll have to play around with it and find a suitable solution.
 
Thanks again for the info. It appears that I'm going to have to try something like this. My initial idea was to make all the unused plots impassible, but I'm not sure how the AI would respond to this. I guess I'll have to play around with it and find a suitable solution.
It should not be any problem for the AI. Oceans are already one big impassable area for land units (and there are peaks).
 
I don't recall ever trying this so I'm not sure what will happen. But you might want to try setting the unused plot's PlotType to NO_PLOT. Maybe it will just cause the plot to appear as a black space that isn't part of the map - just a guess on my part.
 
It should not be any problem for the AI. Oceans are already one big impassable area for land units (and there are peaks).

True, true.

I don't recall ever trying this so I'm not sure what will happen. But you might want to try setting the unused plot's PlotType to NO_PLOT. Maybe it will just cause the plot to appear as a black space that isn't part of the map - just a guess on my part.

Hmm... I'll have to try this out, but I wouldn't be surprised if it caused the game to crash.
 
Back
Top Bottom