[SDK] Sub-Map: “Zoom-In” on Tiles for Tactical Combat Map, Simcity-ish Building, RPG

chrusion

Chieftain
Joined
May 5, 2006
Messages
36
Location
Seattle, WA
Sub-Map functionality can open a huge range of options for modding CivIV.
Some options come to mind:

Tactical Combat can make or break a strategic decision in reality.

Building placement can greatly affect the efficiency of a building.

RPG can add “insider” elements to turn the tide of strategy.

Of course the options don’t end there. Game play modifications that are enabled by Sub-Map functionality are only limited by the imagination!


Please comment on your ideas for the use of this mod and what sort of functionality it should have.

This is an SDK project.
Please bring to the table ideas of the best, safest, and most useful ways to implement this code.

ANY IDEA IS A GOOD START

Don’t be ashamed of what a flaming wolf might say.
 
SDK analysis leads me to believe that deriving from the CivGlobals class is the best place to start. The objects of the derived class will each represent a Sub-Map. Only persistant changes need to be stored. All other data can be shared.

CivGlobals is a Singleton but a derived class could have a dynamic datastructure to hold multiple object instances of the class and still maintain a pseudo-Singleton appearance.
I have designed a datastructure that may be perfect for this implementation.

The Sub-Map acts like its own mini Civ game with appropriately scaled unit and terrain statistics and abilities.

Are there any ideas on what data elements of CivGlobals would possibly have Sub-Map counterparts and what data could be shared data?

For the sake of completeness any obvious and not so obvious suggestions would be appreciated.

I am also willing to work with someone that wants to partner in this.
 
Question:

How to propose to graphical show your map? We don't have access to the gamebryo routines in the .exe, so I'm very interested to know.

Dale
 
Actually I haven't tried this specifically. I have pondered it a bit, and I'm not sure how it could be done, but I haven't had a serious go at it.

I have a few vague ideas involving changing the terrain graphics to make an overlay visible (or not).
My current idea involvs a graphical hack. Basically, you would convert all the terrain files to .nif files offset so that they would appear higher than normal. Then, you simply add them as features, and they would overlay the current map at a different height, and remove the "features" when you're done with your sub-map.

The slight trouble with this is that you'd have to offset all the unit positions by the same amount to fit them on the grid, as well as getting them to react to hight changes (you'd have to temperarily convert all the actual plots that they are on to the plots you want it to be - then the height changes would work). You'd probably have to create a whole new set of unit .nifs with the same offset as the terrain, as I don't think you can change the z co-ordinate of units dynamically.

You'd also have to fiddle with the 3D camera controls so that you couldn't do weird things with it.

Very very hackish, but I'm pretty certain it would work... unless the graphics engine has a maximum Z value. It would also be pretty tought to integrate with any mod change the terrain, or the units.

On a similar note this method would work excellently for overlayed maps with spaceships and suchlike - like CTP. You'd make the features a semi-transparent, and all your units which could go into space would have a good hefty z-shift so that they appeared right. A few SDK tweaks and all would be awsome.
 
Please do this, as in a submaps mod, yes. It absolutely will be used. Also please make it, or a version of it, as simple, versatile, and small as possible so it can easily be plugged into mods. As opposed to a big monster with bells and whistles.
 
How about this:
When the sub-map is opened, an area of the main map (or even the whole map) is "cleared", i.e. whatever is present there - terrain types, improvements, cities, units, etc, is copied to memory, but graphically everything is cleared (ie "deleted"), and then the data for the submap is loaded onto these tiles (i.e. units, improvements "created"). When quitting the the submap, the submap data is stored, and the original map data is restored, with necessary adjustments resulting from action on the sub map.

Of course this way is very messy and rather "brute-force", but possibly it could work within the limits of what SDK allows as it uses existing graphics procedures.

This also ties in with chrusion's idea that the sub-map acts like a mini Civ4 game.

What do people think? Is this reasonable or far too messy?
 
I had considered it, but I'm pretty sure there will be some quite noticeable delay caused by wiping the original map every time.
 
How about having a strip of "battlemaps" up above the North Pole, where this is done without erasing the actual game? One for each type of tile, ie a submap for battles in forest, a submap for battles on grassland, etc.... When stacks collide, all units are teleported to the pertinent battlemap (or maybe are broken down into subunits, like a Tank division on the main map becomes 3 tank brigades on the battlemap, one per health point) and when the battle is over all survivors teleport back. Upgrades would have to be reflected also, such as first strike etc...
 
As mentioned above this would mess with the globe view. You'd only really need one battle map, as you could quickly generate the terrain each time.

Although this might be possible using more SDK orientated tweaking rather than graphics orientated tweaking like I was suggesting.
 
sgrig said:
How about this:
When the sub-map is opened, an area of the main map (or even the whole map) is "cleared", i.e. whatever is present there - terrain types, improvements, cities, units, etc, is copied to memory, but graphically everything is cleared (ie "deleted"), and then the data for the submap is loaded onto these tiles (i.e. units, improvements "created"). When quitting the the submap, the submap data is stored, and the original map data is restored, with necessary adjustments resulting from action on the sub map.

Of course this way is very messy and rather "brute-force", but possibly it could work within the limits of what SDK allows as it uses existing graphics procedures.

This also ties in with chrusion's idea that the sub-map acts like a mini Civ4 game.

What do people think? Is this reasonable or far too messy?

I am considering something that is similar to this approach.

The game data is all stored in a CivGlobals object. (If I have missed something please let me know)
All I have to do is create a new CivGlobals object derivative (inheritance in C++) that is not a Singleton (can have more than one instance of itself) called CivGlobalsSubMaps.
I won't mess with the main game data in CivGlobals (except to update with Sub-Map results).
Each Sub-Map will be an object instance of CivGlobalsSubMaps.

Tholish said:
How about having a strip of "battlemaps"

I will minimize Sub-Map creation time by having several default base maps.
These maps are unknown to the Main CivIV game so will not be involved with Global View.
I will look at disabiling Global View while in a Sub-Map.

Switching to a Sub-Map then becomes as easy as swapping a 32-bit pointer!
When the pointer is swapped the CivIV game engine will continue along its merry way with the next game loop as if nothing had happened. Only now the game is the Sub-Map. I may need to do some Load Game functionality to get the proper initialization.

Sub-Maps will also be small so will not take much time to generate.
The problem may be memory but I will use as much shared data as possible to alleviate this.
 
chrusion said:
The game data is all stored in a CivGlobals object. (If I have missed something please let me know)
All I have to do is create a new CivGlobals object derivative (inheritance in C++) that is not a Singleton (can have more than one instance of itself) called CivGlobalsSubMaps.
I won't mess with the main game data in CivGlobals (except to update with Sub-Map results).
Each Sub-Map will be an object instance of CivGlobalsSubMaps.

In this approach would it be possible then to have a separate set of XML files for each submap? Since tactical level maps would have to have different rules from the main map.
 
Yes,
This is a later goal in the project, another step in complexity. Each step in complexity means more classes need to be derived for the special cases. I am being careful to work with the Main CivIV functionality and not fight against it; I want to use CivIV's strengths to do this, not wrestle with it or force an ugly hack.

XML Initialization happens during Load Game, so the Sub-Map could have a whole set of different support files. This is a common way of detailing RPG scenarios in an RPG world.


 
How are you planning on getting this working in multiplayer?

Are you planning on getting this working in multiplayer?

Will it work in multiplayer without you having to do anything?
 
My use for it would be a space mod. The main map would be the space terrain with planets and spaceships in between. Submaps would represent planets.

I can also see it being used to represent the greater pace at which wars progress relative to growth and research. Most wars just last a few years, but wars between empires in civ will last dozens of turns, each representing at least a year, . I know its just a game, but making it a better simulation improves the game experience. You know that like any lens, some of its distorted but SOME parts of it are in pure focus.

What I'd like to see is maybe a ten to one step down during wars involving the human player. After each growth and research turn, regular turns like now, there are ten tactical movement turns in which units can move and fight but no research, growth or economic activity occurs. Except special kinds in the realm of military supply and engineers. Using the same board. Once two stacks enter battle, then they go to a battle map, maybe 16 by 16, representing all the features of the two squares (that of the defender and that of the attacker), but each unit becomes multiple units there, one per hit point. All units of a player start in the center of his side of the board in one big stack. After ten turns the battle is over and the campaign speed main board is returned to with battle results reflected. After ten turns on the campaign board, the eleventh turn has regular civ function enabled again, with the next turn of research and population growth and worker actions and city production and yield calculations and so forth.
 
Tholish said:
What I'd like to see is maybe a ten to one step down during wars involving the human player. After each growth and research turn, regular turns like now, there are ten tactical movement turns in which units can move and fight but no research, growth or economic activity occurs. Except special kinds in the realm of military supply and engineers. Using the same board. Once two stacks enter battle, then they go to a battle map, maybe 16 by 16, representing all the features of the two squares (that of the defender and that of the attacker), but each unit becomes multiple units there, one per hit point. All units of a player start in the center of his side of the board in one big stack. After ten turns the battle is over and the campaign speed main board is returned to with battle results reflected. After ten turns on the campaign board, the eleventh turn has regular civ function enabled again, with the next turn of research and population growth and worker actions and city production and yield calculations and so forth.

Hmm... its an interesting idea... games would go on much longer with a system like that. For some people, that wouldn't be much fun, but other people... like myself... treat civ like a fine wine that I like to savor. That said, I'm not sure how possible it will be to pull it off.

It will also probably require a reworking of the combat system since you'll go 10 turns without any hope of reinforcements.

Of course, that's assuming that it's possible.
 
sgrig said:
Why wouldn't it work in multiplayer? (assuming it works for single player?)
Thinking about it, it depends on what you are using it for. If you are using it for combats, then it would probably take up quite a bit of time, and would do really nasty things to PBEM. This is avoidable by just disabling it in multiplayer I supose.
 
God, if you can here me, please bless this project....

The uses for this utility are endless. Good luck, I really hope you can get it to fly.

tactical battlefields
simcity-ish city building & organization
multiple world space mods
Underground sub maps
& on & on

This would take Civilization to a new level. I've been hoping for this since I started playing civ (CivII). Maybe you can talk to the people at Firaxis? Maybe they can point you in the right direction? I know Kael was hoping somebody would do this...and he knows people...maybe PM him, and maybe he could give you a contact?

May the force be with you.
 
Starship said:
God, if you can here me, please bless this project....

The uses for this utility are endless. Good luck, I really hope you can get it to fly.

tactical battlefields
simcity-ish city building & organization
multiple world space mods
Underground sub maps
& on & on

This would take Civilization to a new level. I've been hoping for this since I started playing civ (CivII). Maybe you can talk to the people at Firaxis? Maybe they can point you in the right direction? I know Kael was hoping somebody would do this...and he knows people...maybe PM him, and maybe he could give you a contact?

May the force be with you.
I will check on the contacts...

Multiplayer would be more difficult to balance playtime with. I have seen a game that had a multiplayer solution for tactical battles between two of the eight strategic players (all players got a part) but I cannot remember the name or the solution.
However, this would be just one specific mod and I am making a general mod for you modders to play around with.


Some “specific mod” implementations of this general mod:
If tactical battles are put on a very small map, they can be quickly played out and no one will have to wait very long.
The non-involved players do not have to see the battle but an “observer” option should be easy to implement from the same code that the Sub-Map is generated from.
Allied or even last man standing tactical battles could be played out between several players who meet in the same tile during simultaneous play.
The option to buy units (temporary or permanent) during tactical battles could be written in to the mod, maybe even allowing allies to buy units to be a part of the battle.

These ideas are rough brainstorms for future implementations of this mod and are not likely be coded into this mod.
My first build-ons to this mod will be towards making the RPG conversion. Any general mods will be released as a part of the SDK Community enhancement project
 
Back
Top Bottom