Is it Possible? Resolve Stack vs Stack combat on a Tactical Battle Map

I understand the concept, and it will probably be faster (at the cost of more memory required) than previous attempts.

Of course, the game graphics will still need to be updated when switching from map to map, which will take time.


I do still have that code. Well, more accurately, CFC still has it- it might not be on my computer any more.

The DA thread is here.
My post with the WB mapswitching stuff is here.
 
One thing I just thought of with this concept... should we have an automated system where the Non-player battles are taking place or would this mod require us to watch every single battle that takes place, whether we're involved or not, or even just wait endlessly between turns as the AI units duke it out? How would that be resolved?
 
One thing I just thought of with this concept... should we have an automated system where the Non-player battles are taking place or would this mod require us to watch every single battle that takes place, whether we're involved or not, or even just wait endlessly between turns as the AI units duke it out? How would that be resolved?

Go with normal stack attack for AI. :p
In Rome: Total War, they skip all battles except player battles!
 
I tried to create a second map object, but it doesn't seem like it is actually created, as when I try to switch to it, the game acts as if it's plots were null. I tried to use the init() function for it to see if that would solve the problem, but that also crashed the game, as if their plots were null.
 
@vincentz - nice!

I tried to create a second map object, but it doesn't seem like it is actually created, as when I try to switch to it, the game acts as if it's plots were null. I tried to use the init() function for it to see if that would solve the problem, but that also crashed the game, as if their plots were null.

I found one of the problems, but it's gonna be difficult to overcome (but maybe there's a simple solution that I'm just too tired to think about).

It's not that the map's plots are NULL, it's that different components access the map with illegal coordinates, since the map size has changed, and the returned plot is NULL.

One of the problems is that teams and players (and therefore - their cities) are not kept as part of the game object (which I also replaced along with the map) but with the CvAITeam and CvAIPlayer classes, respectively, as static members.
In turn, the city, when referring to its plot, accesses the map with the coordinates which might not be there since the map has changed...

I tried placing most of the Game's doTurn inside an if to prevent it from calling, but somehow (couldn't figure it out yet) illegal coords plots are still called.
I'll continue debugging another time.
 
I've been reading up on C++ programming lately and have a bit of a theory though I'm noob enough that it may have no application whatsoever and the consequences of using this theory would mean that every map introduced into the game might need to be adjusted to suit this mod. But here it is:

If we define the map(s) as an array, we can call to different tiles on different maps. This would take an extensive redesign of the program structure but will allow every map to have its own definitions that would require minor code adjustments when referencing the main map (map 0). Just a theory... does it make any sense?

A link to help put it in better clarity.
 
@vincentz - nice!



I found one of the problems, but it's gonna be difficult to overcome (but maybe there's a simple solution that I'm just too tired to think about).

It's not that the map's plots are NULL, it's that different components access the map with illegal coordinates, since the map size has changed, and the returned plot is NULL.

One of the problems is that teams and players (and therefore - their cities) are not kept as part of the game object (which I also replaced along with the map) but with the CvAITeam and CvAIPlayer classes, respectively, as static members.
In turn, the city, when referring to its plot, accesses the map with the coordinates which might not be there since the map has changed...

I tried placing most of the Game's doTurn inside an if to prevent it from calling, but somehow (couldn't figure it out yet) illegal coords plots are still called.
I'll continue debugging another time.

But if you simply create another map object, it should have the same size (in the map init it draws width and height from the same place as the normal map). So, I think illegal coordinates aren't the only problem. What code did you use to create the map object?

I've been reading up on C++ programming lately and have a bit of a theory though I'm noob enough that it may have no application whatsoever and the consequences of using this theory would mean that every map introduced into the game might need to be adjusted to suit this mod. But here it is:

If we define the map(s) as an array, we can call to different tiles on different maps. This would take an extensive redesign of the program structure but will allow every map to have its own definitions that would require minor code adjustments when referencing the main map (map 0). Just a theory... does it make any sense?

A link to help put it in better clarity.

What you said makes perfect sense, but as of now I don't think we would need an array, since it would be simply two or three maps (and we haven't even got to that point yet :p). But setting it as an array would be important to handle more than a few maps, yes, or to have a dynamic number of maps.
 
Thanks for validating my theory there :D

Having the ability to add more maps and purposes from this base template would be optimal of course. I'd love to take this to another level once the strategic element is down... aka... extra planet colonization as an added element.
 
But if you simply create another map object, it should have the same size (in the map init it draws width and height from the same place as the normal map). So, I think illegal coordinates aren't the only problem. What code did you use to create the map object?

Oh, I passed in my own instance of CvMapInitData to create a 20x20 map...
I guess there are other problems here then...

I've been reading up on C++ programming lately and have a bit of a theory though I'm noob enough that it may have no application whatsoever and the consequences of using this theory would mean that every map introduced into the game might need to be adjusted to suit this mod. But here it is:

If we define the map(s) as an array, we can call to different tiles on different maps. This would take an extensive redesign of the program structure but will allow every map to have its own definitions that would require minor code adjustments when referencing the main map (map 0). Just a theory... does it make any sense?

A link to help put it in better clarity.

What you said makes perfect sense, but as of now I don't think we would need an array, since it would be simply two or three maps (and we haven't even got to that point yet :p). But setting it as an array would be important to handle more than a few maps, yes, or to have a dynamic number of maps.

You're probably right in the sense that the best way to implement a map is using an array, and for a complete solution of the 'parallel worlds/map' concept we will probably also need an array.
The CvMap, as a matter of fact, already holds an array of plots (tiles).

One of the main problems we're facing here, though, is that we don't have access to all the game's code - only what Firaxis exposed for us in the DLL. That means that there is code which already uses the map, and on which we have no control (this code sits in the game's exe).
Currently the CvGlobals holds exactly one map, and the game accesses the map using this. So we can't just change it to an array of maps, because the game won't be able to use it. We need to somehow do it internally, while maintaining the same interface for the game to use.
I hope it made sense...
 
It does.

So it sounds like we need to establish an array of 'extra' maps, each with their own array of tiles, and to build the processing paths for accessing these sub-maps as popups of their own with their own user interfaces when in use.. what we're doing, in a sense, then, is making a game within a game that plugs into this one at defined junctures, such as when attacks are made on or from player stacks.

So we would interrupt the usual combat performs to perform the new manner in which the game will resolve combat (i.e. the new map and all its processes) and return to the main with appropriate alterations made to the information stored there (i.e., where units are now located, their statuses after the battle, etc...)

All along, as we're working in a 'popup' map and interface, the old map stays put in the background as this sub-program runs its course.
 
It does.

So it sounds like we need to establish an array of 'extra' maps, each with their own array of tiles, and to build the processing paths for accessing these sub-maps as popups of their own with their own user interfaces when in use.. what we're doing, in a sense, then, is making a game within a game that plugs into this one at defined junctures, such as when attacks are made on or from player stacks.

So we would interrupt the usual combat performs to perform the new manner in which the game will resolve combat (i.e. the new map and all its processes) and return to the main with appropriate alterations made to the information stored there (i.e., where units are now located, their statuses after the battle, etc...)

All along, as we're working in a 'popup' map and interface, the old map stays put in the background as this sub-program runs its course.

We're actually trying to 'deceive' the game by replacing the map (and a few other components), so when the game's exe accesses the map it will get the new map and not the original map. It will not know that something has changed, but the data it receives will be from the new map.
 
So... You guys basically think this is doable? :eek:
 
We're actually trying to 'deceive' the game by replacing the map (and a few other components), so when the game's exe accesses the map it will get the new map and not the original map. It will not know that something has changed, but the data it receives will be from the new map.

On the plot list issue. Can you create and load a new map of the same dimensions as the original, but only use a 20x20 section for the battle. Then whatever other functions are throwing errors may be satisfied there exists a plot?
 
On the plot list issue. Can you create and load a new map of the same dimensions as the original, but only use a 20x20 section for the battle. Then whatever other functions are throwing errors may be satisfied there exists a plot?

I think that Androrc created a map with the same dimensions, but still got errors, so I don't really know. It requires more research.
 
I think you are better of to create your own object CvMultipleMap or whatever you want to call it, that holds multiple maps(not Cvmaps, you would need to define your own) and then modify CvMap so that it passes the right values to the exe/dll by calling functions in your CvMultipleMap Object. So CvMap:: plot(x,y) would then call a Function in your CvMultipleMap object, that would look which is the active map currently and then pass a pointer of the plot(x,y) of that map.
 
I think you are better of to create your own object CvMultipleMap or whatever you want to call it, that holds multiple maps(not Cvmaps, you would need to define your own) and then modify CvMap so that it passes the right values to the exe/dll by calling functions in your CvMultipleMap Object. So CvMap:: plot(x,y) would then call a Function in your CvMultipleMap object, that would look which is the active map currently and then pass a pointer of the plot(x,y) of that map.

It might be the solution (a decorator ;)), but I don't think we're there yet.
One of the problems is that different entities (cities, units) hold their own coordinates, so we need to replace those as well according to the currently active map to make it work.
 
That's true. I once tried to add a function to move a city to different coordinates, but it caused graphic issues and I couldn't find any exe calls to force a redraw. But when a city is deleted it works fine.

Maybe it is just better to put multiple maps into one map and only make the current map visible? Then atleast you don't have to worry about coordinates.
 
(since I love this idea I'm giving it a bump...)

Is it fair to say, then, that we'd need to safedelete all information ON the map (storing it of course), 'decorate' the new map, run the tactical side of things, then wipe again and remove all decorators? Is this on the right track?
 
Is this idea still alive?? I'm sure many people (including me) would love to see this happen, so I hope someone is trying to make it work (that is if it's still possible)
 
Back
Top Bottom