Wee Spring
Moderator: Moderators
http://www.epicedit.com/MiniSpring.zip
Just unzip it next to your regular Spring.exe and have at it.
The only "hackish" thing that has to be done is with the yardmaps of factories. They can't exist basically.
A Spring unit of measure is twice that of TA. So a 2x2 object in TA is exactly one "square" in Spring. This is why Dragons teeth take an entire square. This is also why a windmill will take 3, as spring sees 3 and blocks three squares eventhough it's really 1.5. When you place a building this becomes more and more obvious. A tile consumes one square. So 32 x 32 pixels is 2x2 now.
Well with Factory yardmaps it's a different story. Some parts are blocked some are not. In regular Spring, they double the size thus doubling the yardmap and in doing so make "room" for the unit to manuver. With the sizes halved, you no longer have the expansive space afforded to you with large sizes. So I had to ax the yardmaps. When the building is closed, it functions normally, blocks normally, and is normal, when building a unit, all is non-blocking. Check it out with .cheat and F2
Trust me when I say I tried everything to get it to work right.
Other than that, I made some corrections in the logic made by earlier changes and changed addional areas that needed changing. (Speed, decloak distances, turn radii...for example). One thing I did NOT do was decrease LOS. With so much talk about getting units to SEE wtf their doing I thought it prudent they do so, this is their chance. Radar etc get halved as usual.
I officially like the scale of MiniSpring over regular Spring. It gives a MUCH greater sense of "world" and overall improves gameplay.
-Buggi
Just unzip it next to your regular Spring.exe and have at it.
The only "hackish" thing that has to be done is with the yardmaps of factories. They can't exist basically.
A Spring unit of measure is twice that of TA. So a 2x2 object in TA is exactly one "square" in Spring. This is why Dragons teeth take an entire square. This is also why a windmill will take 3, as spring sees 3 and blocks three squares eventhough it's really 1.5. When you place a building this becomes more and more obvious. A tile consumes one square. So 32 x 32 pixels is 2x2 now.
Well with Factory yardmaps it's a different story. Some parts are blocked some are not. In regular Spring, they double the size thus doubling the yardmap and in doing so make "room" for the unit to manuver. With the sizes halved, you no longer have the expansive space afforded to you with large sizes. So I had to ax the yardmaps. When the building is closed, it functions normally, blocks normally, and is normal, when building a unit, all is non-blocking. Check it out with .cheat and F2
Trust me when I say I tried everything to get it to work right.
Other than that, I made some corrections in the logic made by earlier changes and changed addional areas that needed changing. (Speed, decloak distances, turn radii...for example). One thing I did NOT do was decrease LOS. With so much talk about getting units to SEE wtf their doing I thought it prudent they do so, this is their chance. Radar etc get halved as usual.
I officially like the scale of MiniSpring over regular Spring. It gives a MUCH greater sense of "world" and overall improves gameplay.
-Buggi
-
- Imperial Winter Developer
- Posts: 3742
- Joined: 24 Aug 2004, 08:59
Below is my somewhat lengthly patch file.
And I just spotted that my "fix" for unit build menus is included.
Also, keep note of what is commented ( // ) and what is block commented ( /* */ ). As I try not to remove SY code, just tweak it a bit :)
-Buggi
And I just spotted that my "fix" for unit build menus is included.
Also, keep note of what is commented ( // ) and what is block commented ( /* */ ). As I try not to remove SY code, just tweak it a bit :)
Code: Select all
? rts/Release
? rts/lesson2.ncb
? rts/lesson2.suo
? rts/bagge/MiniSpring.map
Index: rts/3DOParser.cpp
===================================================================
RCS file: /cvsroot/springrts/taspring/rts/3DOParser.cpp,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 3DOParser.cpp
--- rts/3DOParser.cpp 5 May 2005 19:18:39 -0000 1.1.1.1
+++ rts/3DOParser.cpp 9 Jun 2005 22:06:38 -0000
@@ -97,6 +97,7 @@
name+=".3do";
scaleFactor=1/(65536.0f);
+ scaleFactor /= 2.0f; // ~nick~
string sideName(name);
hpiHandler->MakeLower(sideName);
Index: rts/CobInstance.cpp
===================================================================
RCS file: /cvsroot/springrts/taspring/rts/CobInstance.cpp,v
retrieving revision 1.3
diff -u -r1.3 CobInstance.cpp
--- rts/CobInstance.cpp 30 May 2005 17:19:35 -0000 1.3
+++ rts/CobInstance.cpp 9 Jun 2005 22:00:08 -0000
@@ -478,12 +478,14 @@
void CCobInstance::Move(int piece, int axis, int speed, int destination, bool interpolated)
{
- AddAnim(AMove, piece, axis, speed, destination, 0, interpolated);
+ AddAnim(AMove, piece, axis, speed, destination/2, 0, interpolated);
+//~nick~ AddAnim(AMove, piece, axis, speed, destination, 0, interpolated);
}
void CCobInstance::MoveNow(int piece, int axis, int destination)
{
- pieces[piece].coords[axis] = destination;
+//~nick~ pieces[piece].coords[axis] = destination;
+ pieces[piece].coords[axis] = destination/2;
pieces[piece].updated = true;
}
@@ -890,7 +892,8 @@
}
int cur = pieces[piece].coords[axis];
- int dist = abs(destination - cur);
+//~nick~ int dist = abs(destination - cur);
+ int dist = abs((destination - cur)/2);
int timeFactor = (1000 * 1000) / (deltaTime * deltaTime);
int speed = (dist * timeFactor) / delta;
Index: rts/UnitDefHandler.cpp
===================================================================
RCS file: /cvsroot/springrts/taspring/rts/UnitDefHandler.cpp,v
retrieving revision 1.5
diff -u -r1.5 UnitDefHandler.cpp
--- rts/UnitDefHandler.cpp 6 Jun 2005 19:38:41 -0000 1.5
+++ rts/UnitDefHandler.cpp 10 Jun 2005 06:54:08 -0000
@@ -94,6 +94,8 @@
void CUnitDefHandler::FindTABuildOpt()
{
+ int _nicksMenu = 0; // ~nick~
+
CSunParser sunparser;
sunparser.LoadFile("gamedata\\sidedata.tdf");
@@ -118,7 +120,8 @@
if(unitID.find(it->second)!= unitID.end()){
int num=atoi(it->first.substr(8).c_str());
- builder->buildOptions[num]=it->second;
+//~nick~ builder->buildOptions[num]=it->second;
+ builder->buildOptions[_nicksMenu++]=it->second;
}
}
}
@@ -148,10 +151,11 @@
std::transform(un2.begin(), un2.end(), un2.begin(), (int (*)(int))std::tolower);
if(unitID.find(un2)!= unitID.end()){
- int menu=atoi(dparser.SGetValueDef("", sectionlist[j] + "\\MENU").c_str());
- int button=atoi(dparser.SGetValueDef("", sectionlist[j] + "\\BUTTON").c_str());
- int num=(menu-2)*6+button+1;
- builder->buildOptions[num]=un2;
+// int menu=atoi(dparser.SGetValueDef("", sectionlist[j] + "\\MENU").c_str());
+// int button=atoi(dparser.SGetValueDef("", sectionlist[j] + "\\BUTTON").c_str());
+// int num=(menu-2)*6+button+1;
+//~nick~ builder->buildOptions[num]=un2;
+ builder->buildOptions[_nicksMenu++]=un2;
} else {
info->AddLine("couldnt find %s",un2.c_str());
}
@@ -221,7 +225,9 @@
ud.turnRate=atof(sunparser.SGetValueDef("0", "UNITINFO\\TurnRate").c_str());
ud.buildSpeed=atof(sunparser.SGetValueDef("0", "UNITINFO\\WorkerTime").c_str());
ud.buildDistance=atof(sunparser.SGetValueDef("64", "UNITINFO\\Builddistance").c_str());
- ud.buildDistance=max(128,ud.buildDistance);
+//~nick~ ud.buildDistance=max(128,ud.buildDistance);
+ ud.buildDistance=max(64,ud.buildDistance/2);
+
ud.armoredMultiple=atof(sunparser.SGetValueDef("1", "UNITINFO\\DamageModifier").c_str());
ud.armorType=damageArrayHandler->GetTypeFromName(ud.name);
// info->AddLine("unit %s has armor %i",ud.name.c_str(),ud.armorType);
@@ -229,6 +235,12 @@
ud.radarRadius=atoi(sunparser.SGetValueDef("0", "UNITINFO\\RadarDistance").c_str());
ud.sonarRadius=atoi(sunparser.SGetValueDef("0", "UNITINFO\\SonarDistance").c_str());
ud.jammerRadius=atoi(sunparser.SGetValueDef("0", "UNITINFO\\RadarDistanceJam").c_str());
+
+//~nick~
+ ud.radarRadius /= 2;
+ ud.sonarRadius /= 2;
+ ud.jammerRadius /= 2;
+
ud.stealth=!!atoi(sunparser.SGetValueDef("0", "UNITINFO\\Stealth").c_str());
ud.targfac=!!atoi(sunparser.SGetValueDef("0", "UNITINFO\\istargetingupgrade").c_str());
ud.isFeature=!!atoi(sunparser.SGetValueDef("0", "UNITINFO\\IsFeature").c_str());
@@ -247,6 +259,13 @@
ud.canKamikaze=!!atoi(sunparser.SGetValueDef("0", "UNITINFO\\kamikaze").c_str());
ud.kamikazeDist=atof(sunparser.SGetValueDef("-25", "UNITINFO\\kamikazedistance").c_str())+25; //we count 3d distance while ta count 2d distance so increase slightly
+// ~nick~
+ ud.decloakDistance /= 2.0f;
+ ud.kamikazeDist /= 2.0f;
+ ud.turnRadius /= 2.0f;
+ ud.speed /= 2.0f;
+
+
sunparser.GetDef(ud.canfly, "0", "UNITINFO\\canfly");
sunparser.GetDef(ud.canmove, "0", "UNITINFO\\canmove");
sunparser.GetDef(ud.canhover, "0", "UNITINFO\\canhover");
@@ -369,11 +388,14 @@
}
else if(ud.canfly)
{
- if(!ud.weapons.empty() && ud.weapons[0]!=0 && (ud.weapons[0]->type=="AircraftBomb" || ud.weapons[0]->type=="TorpedoLauncher")){
+ if(!ud.weapons.empty() && ud.weapons[0]!=0 && (ud.weapons[0]->type=="AircraftBomb" || ud.weapons[0]->type=="TorpedoLauncher"))
+ {
ud.type = "Bomber";
ud.turnRadius=800; //hint to the ai about how large turn radius this plane needs
-
- } else {
+ ud.turnRadius /= 2.0f;
+ }
+ else
+ {
ud.type = "Fighter";
}
ud.maxAcc=max(ud.maxAcc*0.6,0.065);
@@ -429,8 +451,17 @@
sunparser.GetDef(ud.activateWhenBuilt, "0", "UNITINFO\\ActivateWhenBuilt");
- ud.xsize=atoi(sunparser.SGetValueDef("1", "UNITINFO\\FootprintX").c_str())*2;//ta has only half our res so multiply size with 2
- ud.ysize=atoi(sunparser.SGetValueDef("1", "UNITINFO\\FootprintZ").c_str())*2;
+// ud.xsize=atoi(sunparser.SGetValueDef("1", "UNITINFO\\FootprintX").c_str())*2;//ta has only half our res so multiply size with 2
+// ud.ysize=atoi(sunparser.SGetValueDef("1", "UNITINFO\\FootprintZ").c_str())*2;
+//~nick~
+ ud.xsize=atoi(sunparser.SGetValueDef("1", "UNITINFO\\FootprintX").c_str());
+ ud.ysize=atoi(sunparser.SGetValueDef("1", "UNITINFO\\FootprintZ").c_str());
ud.needGeo=false;
if(ud.type=="Building" || ud.type=="Factory"){
@@ -572,26 +603,43 @@
Creates a open ground blocking map, called yardmap.
When sat != 0, is used instead of normal all-over-blocking.
*/
-void CUnitDefHandler::CreateYardMap(UnitDef *def, std::string yardmapStr) {
+void CUnitDefHandler::CreateYardMap(UnitDef *def, std::string yardmapStr)
+{
//Force string to lower case.
std::transform(yardmapStr.begin(), yardmapStr.end(), yardmapStr.begin(), (int(*)(int))std::tolower);
//Creates the map.
def->yardmap = new unsigned char[def->xsize * def->ysize];
- memset(def->yardmap, 1, def->xsize * def->ysize); //Q: Needed?
-
- unsigned char *originalMap = new unsigned char[def->xsize * def->ysize / 4]; //TAS resolution is double of TA resolution.
- memset(originalMap, 1, def->xsize * def->ysize / 4);
+ if (def->type == "Factory")
+ memset(def->yardmap, 0, def->xsize * def->ysize); //Q: Needed?
+ else
+ memset(def->yardmap, 1, def->xsize * def->ysize);
+
+ // special geovent section :/
+ if (!yardmapStr.empty())
+ {
+ if (yardmapStr.find_first_of("g", 0) != std::string.npos)
+ {
+ def->needGeo = true;
+ memset(def->yardmap, 1, def->xsize * def->ysize);
+ }
+ }
+/*
+ unsigned char *bigMap = new unsigned char[def->xsize * def->ysize * 4]; //TAS resolution is double of TA resolution.
+ memset(bigMap, 1, def->xsize * def->ysize * 4);
if(!yardmapStr.empty()){
std::string::iterator si = yardmapStr.begin();
int x, y;
- for(y = 0; y < def->ysize / 2; y++) {
- for(x = 0; x < def->xsize / 2; x++) {
+ for(y = 0; y < def->ysize; y++) {
+ for(x = 0; x < def->xsize; x++) {
if(*si == 'g')
def->needGeo=true;
if(*si == YARDMAP_CHAR)
- originalMap[x + y*def->xsize/2] = 0;
+ {
+ bigMap[(x + y*def->xsize*2)+0] = 0;
+ bigMap[(x + y*def->xsize*2)+1] = 0;
+ }
do {
si++;
} while(si != yardmapStr.end() && *si == ' ');
@@ -604,7 +652,7 @@
}
for(int y = 0; y < def->ysize; y++)
for(int x = 0; x < def->xsize; x++)
- def->yardmap[x + y*def->xsize] = originalMap[x/2 + y/2*def->xsize/2];
+ def->yardmap[x + y*def->xsize] = bigMap[(x*2)+y*def->xsize*2+(y*2+y*def->ysize*2)];
- delete[] originalMap;
+ delete[] bigMap; */
}
\ No newline at end of file
Index: rts/WeaponDefHandler.cpp
===================================================================
RCS file: /cvsroot/springrts/taspring/rts/WeaponDefHandler.cpp,v
retrieving revision 1.2
diff -u -r1.2 WeaponDefHandler.cpp
--- rts/WeaponDefHandler.cpp 18 May 2005 19:16:43 -0000 1.2
+++ rts/WeaponDefHandler.cpp 9 Jun 2005 22:45:25 -0000
@@ -193,6 +193,11 @@
sunparser->GetDef(weaponDefs[id].repulseRange, "0", weaponname + "\\repulserange");
sunparser->GetDef(weaponDefs[id].repulseSpeed, "0", weaponname + "\\repulsespeed");
+//~nick~
+ weaponDefs[id].areaOfEffect /= 2.0f;
+ weaponDefs[id].range /= 2.0f;
+ weaponDefs[id].repulseRange /= 2.0f;
+ weaponDefs[id].coverageRange /= 2.0f;
weaponDefs[id].noAutoTarget= (weaponDefs[id].manualfire || weaponDefs[id].interceptor || weaponDefs[id].isPlasmaRepulser);
Index: rts/lesson2.vcproj
===================================================================
RCS file: /cvsroot/springrts/taspring/rts/lesson2.vcproj,v
retrieving revision 1.8
diff -u -r1.8 lesson2.vcproj
--- rts/lesson2.vcproj 3 Jun 2005 09:55:23 -0000 1.8
+++ rts/lesson2.vcproj 9 Jun 2005 23:22:11 -0000
@@ -54,7 +54,7 @@
Name="VCLinkerTool"
AdditionalOptions="/MACHINE:I386"
AdditionalDependencies="dsound.lib Dxguid.lib winmm.lib dinput.lib opengl32.lib glu32.lib glaux.lib odbc32.lib odbccp32.lib ws2_32.lib jpeg.lib freetype219ST.lib glew32.lib"
- OutputFile="bagge/spring.exe"
+ OutputFile="bagge/MiniSpring.exe"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
GenerateDebugInformation="TRUE"
- BlackLiger
- Posts: 1371
- Joined: 05 Oct 2004, 21:58
no no no... you misunderstand...
you wouldn't have a 4 times bigger map on your HDD you would just scale it up in the redering software... same as the trees and grass... map files stay the same size, game makes them bigger then intended, just like you are doing with the units now but less problematic in coding
you wouldn't have a 4 times bigger map on your HDD you would just scale it up in the redering software... same as the trees and grass... map files stay the same size, game makes them bigger then intended, just like you are doing with the units now but less problematic in coding
BL: and like I said on the last page, I tried it and it worked fine. Are you using my version or Buggi's version of the exe?
Sinbad: Yes... stretch the map size... that way you get nice stretched pixellated textures, blocky heightmaps, metal spots that are 16 times larger than they're supposed to be... it really is easier to scale down the units instead. This way the maps can also be made smaller (a 6x6 map in normal spring terms is 3072 pixels square, but in minispring terms, it's only 1536 square). This will save hard drive space, it will save bandwidth, it will make maps easier to make, and it will be less resource intensive overall...
Sinbad: Yes... stretch the map size... that way you get nice stretched pixellated textures, blocky heightmaps, metal spots that are 16 times larger than they're supposed to be... it really is easier to scale down the units instead. This way the maps can also be made smaller (a 6x6 map in normal spring terms is 3072 pixels square, but in minispring terms, it's only 1536 square). This will save hard drive space, it will save bandwidth, it will make maps easier to make, and it will be less resource intensive overall...
-
- Imperial Winter Developer
- Posts: 3742
- Joined: 24 Aug 2004, 08:59
Doe it matter? English or not english, would you understand?
Know that I use the most up-to-date source available and I am a coder.
Also, know that the way gnome managed the yardmaps is 100% wrong, from a programming point of view.
This is a version done BY a coder. Not to dis gnome's effort, he got the ball started, and got me interested in the concept. I just took it a step further.
The only area I was puzzled by was the handling of the COB scripts. Oy! What a mess. So far, everything is working excellent, I haven't run into a single bug yet.
-Buggi
Know that I use the most up-to-date source available and I am a coder.
Also, know that the way gnome managed the yardmaps is 100% wrong, from a programming point of view.
This is a version done BY a coder. Not to dis gnome's effort, he got the ball started, and got me interested in the concept. I just took it a step further.
The only area I was puzzled by was the handling of the COB scripts. Oy! What a mess. So far, everything is working excellent, I haven't run into a single bug yet.
-Buggi
-
- Imperial Winter Developer
- Posts: 3742
- Joined: 24 Aug 2004, 08:59
I tried Buggi's wiggy. It was cool!!! Like totally cool. Like the most total cool and awesome and cool thing ever! I didn├óÔé¼Ôäót see anything wrong with it! Territory suddenly expands, so i had to build more defenses to defend the same space ! Also the units still looked cool, in a smaller way!
Also suddenly when I look at my radar network spread over the mountain range's near my base I├óÔé¼Ôäóm reminded of the Third Lord of the Ring's movie where you see the beacons of Gondor being lit on the mountains. You know the one I mean! IT LOOKED COOL DAMN IT!
Also suddenly when I look at my radar network spread over the mountain range's near my base I├óÔé¼Ôäóm reminded of the Third Lord of the Ring's movie where you see the beacons of Gondor being lit on the mountains. You know the one I mean! IT LOOKED COOL DAMN IT!
-
- Imperial Winter Developer
- Posts: 3742
- Joined: 24 Aug 2004, 08:59
Id like to whitdraw some of my previous statement. I sure would like minispring to be the defult cuz of the hig mountins/large oncens/big vallys/big trees (or whatever)....
BUT i dont like being so zoomed out. It's hard to do build something. (for me) when the units are smaller. Plus the units look small to, the goliath is just bigger then your avagre tank. So if we make it defult, u must be able to zoom in whit the OTA camera. And if i missed something, it sohuld be added for plp whitout a middle mouse button.
BUT i dont like being so zoomed out. It's hard to do build something. (for me) when the units are smaller. Plus the units look small to, the goliath is just bigger then your avagre tank. So if we make it defult, u must be able to zoom in whit the OTA camera. And if i missed something, it sohuld be added for plp whitout a middle mouse button.
-
- Imperial Winter Developer
- Posts: 3742
- Joined: 24 Aug 2004, 08:59