SDK design documentation

pirke

Prince
Joined
Apr 15, 2004
Messages
455
Location
Netherlands
I have some ideas which I want to translate into a Civ4 mod. Some extensive rework of the SDK is necessary (multiple map support and customizable unit system to name a few). Is there some existing design documentation (UML class diagrams, sequence diagrams, etc) or do I have to reverse engineer all the code to see how everything is related? I searched a little bit, but couldn't find it. If anybody has this available I'd be very grateful!

This is going to be my first mod, I've got a compiling and working dll, but I suspect my modifications will have a big impact and I'm sure I will forget something without proper documentation :)
 
I wish you good luck with this project. But you should be aware of one possible obstacle. While it is great that Firaxis has given us complete source code for the SDK, a lot of the work is done by an engine which we cannot modify. I would be pleasantly surprised if you could support "multiple maps" without changing the engine.

I highly recommend you start "small". Pick one small feature which would be interesting, make a playable game, and release it. That will get you feedback, and it will hopefully attract playtesters. There are lots of mods which start with a huge spreadsheet of interesting units, but never get any further.

I'm not aware of any documentation of the type you describe for the SDK. There is a python class reference, but this just lists the available functions. In the limited poking around I have done in the SDK, I have just used the C++ header files to see the organization.
 
Thanks for the advice and warning. I have enough experience in programming (I do it for a living), but you are right that the engine must cooperate. I will try some experiments in changing the game map while the game is running. If I can get that to work, then my idea's can become a reality.
 
From what I understand, making multiple maps isn't quite so difficult (you can just define a bunch of extra Plots and seperate the links to the "base set"), the main thing which has kept people from doing it thus far has been making the AI understand how to utilize the connection points between each map and make plans appropriately for the extra space.
 
Recalling back to Civilization II: Test of Time the AI didn't know how to interact properly with the extra map, either, but that didn't stop Micropose from making dual maps. <.<

My theory is that if dual maps come into existence everything else will be made to fill the need. >.>
 
Can't it be possible to have some list of map pointers and switch the m_map pointer in CvGlobals accordingly (and perhaps perform some updates here and there)? I'm not sure how the engine would react and what the engine expects... but that sounds as the most simple solution. Generate a few maps and switch them when needed.

[EDIT]

Im not worried about the AI, I will find a solution for that when that becomes a problem. First I need the engine to support it, the rest is a matter of die hard sweat and perhaps a modified A* search algorithm ;)
 
I think you are describing basically the approach I was thinking to use. You just introduce an array to the getX & getY functions and a CyGame call which dictates the currently active map. Then all responses to calls from the get functions will first check which map is active and use those X & Y values. In some places you'll probably need to add a call for getMapLevel or somesuch before the getX/getY setup.
 
"Im not worried about the AI, I will find a solution for that when that becomes a problem. First I need the engine to support it, the rest is a matter of die hard sweat and perhaps a modified A* search algorithm"

I love you already. ;.;
 
Can you describe a use case for this? I'm not quite sure if you want to have extra "dungeon" maps that units can enter from the surface (normal) map, in a sense extending the single map, or if you want to swap out the entire map and have all units remain where they are with new terrain under them.

If you are talking about the first case, I imagine you can use a single map with special jump points between specified plots (e.g. caves or stairs). It seems with this, you'd just need an enhanced A* search that knows how to handle jumping.

The engine would like draw the whole map in the minimap with the extra areas off to one side or the other depending on how you generate/design the map. It would obviously be one single, large map to the user. This seems like the easiest and most workable approach.

If you are considering the second case (I can't think of a use for it), be aware that when I was playing around with altering terrain (winter freezing), the time it took to rebuild the graphics for even 20 or so plots was noticeable. Swapping out the terrain for an entire map would take minutes.

The problem is that each plot's graphics (and those next to it since terrain blends) must be rebuilt individually, effectively rebuilding the full map 9 times. There is no way to hold off updating until all terrain changes are done. Of course, I didn't attempt to alter the DLL. I assumed it was an engine issue.
 
I love you already. ;.;

Heh, it's nice to have fans. Do you happen to be an 18 year old beautiful female one? :king:



My use case is the idea I've been walking around with for over a year. I want a user to start on a regular world after his colony ship has crashed. Multiple players are other colony ships from the same fleet that crashed due to some spacial anomaly.

After they battle on the planets surface, trying to establish a good hold, they reinvent space flight to enter the solar system map. One such solar system map holds several planets (where other players might have landed too). If you leave the solar system you'll get to the galaxy map where you can go to other solar systems. In space the maps will be mostly empty, but the planet maps are regular x-wrapped maps (size tiny or small). I really think this would be a new dimension to space exploration games as we know it, and you really have to conquer each planet (or just bomb them from orbit).

If this is too much, I'll skip the galaxy map and just have a big map with some planets on it, but those are details I'm not worried about now, for a start I just want to be able to switch a map while the game is running. I don't think that one map with several off-map-spots will do the trick...
 
I have to agree with xienwolf, this should be doable. I wish you luck, this could be used for lots of different mods.
 
"Do you happen to be an 18 year old beautiful female one?"

I could be, for you. <( ^_^)>

As for the rest of your post, it sounds very similar to the Science-Fiction Campaign from Civilization II: Test of Time. In fact, it too used the same basic concept...crash landing, regaining ability to go into space, then finding other planets.

If you manage to successfully have multiple maps in Civ IV, the Extended Original from ToT could be revived...basically, you send your ship to Alpha Centauri, and instead of the game ending upon landing, you start up a colony and keep playing. The wonderful possibilities...though, of course, you're the programmer here. You'll figure out if even part of what you want is doable...all I can do is hope all of it is.
 
Top Bottom