Wee Spring - Page 6

Wee Spring

Various things about Spring that do not fit in any of the other forums listed below, including forum rules.

Moderators: Moderators, Moderators

User avatar
Buggi
Posts: 875
Joined: 29 Apr 2005, 07:46

Post by Buggi »

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
0 x

Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Post by Warlord Zsinj »

I'm sorry, Buggy, I don't understand what you did and why you did it.

You redid MiniSpring in order to fix a number of errors?
If so, good on you!
Do you have a changelog, so I can see what you've changed (as I'm pretty confused)?
0 x

Gnomre
Imperial Winter Developer
Posts: 1754
Joined: 06 Feb 2005, 13:42

Post by Gnomre »

Me too.

No complaints about messing with this, I'd just like to see what you did :)
0 x

User avatar
Buggi
Posts: 875
Joined: 29 Apr 2005, 07:46

Post by Buggi »

Below is my somewhat lengthly patch file.

And I just spotted that my "fix" for unit build menus is included. :oops:

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"
-Buggi
0 x

User avatar
SinbadEV
Posts: 6475
Joined: 02 May 2005, 03:56

Post by SinbadEV »

I know this is a dumb thing to say at this point, but couldn't you just read an render the map 4 times as big as it's designed and get the same scaling and not have to muck about with any weapons or build yards or anything... I mean, it makes a lot more sens to scale 1 thing then 2000
0 x

User avatar
BlackLiger
Posts: 1371
Joined: 05 Oct 2004, 21:58

Post by BlackLiger »

No. Current map sizes in HDD space make em annoyin to download already. If you then x4 the maps, u x4 the downloads.

However, Bug alert

Dunno if its the map or minispring....

Can someone test that idea for me...

Try building dragons teeth to bar the entry to your base on Core Prime industrial...
0 x

User avatar
SinbadEV
Posts: 6475
Joined: 02 May 2005, 03:56

Post by SinbadEV »

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
0 x

Gnomre
Imperial Winter Developer
Posts: 1754
Joined: 06 Feb 2005, 13:42

Post by Gnomre »

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...
0 x

User avatar
Buggi
Posts: 875
Joined: 29 Apr 2005, 07:46

Post by Buggi »

Actually halfing the sizes of the units brings them to exactly TA sizes.

Spring doubled everything by default. So with this smaller version of spring, a 6x6 is really a 6x6.

I think I built every single unit and building and didn't hit a crash, that's why I released it. @@;;

-Buggi
0 x

Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Post by Warlord Zsinj »

Buggi, care to explain to us your changes in english, and how they improve over Gnome's pack for us coding-challenged?
0 x

User avatar
Buggi
Posts: 875
Joined: 29 Apr 2005, 07:46

Post by Buggi »

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
0 x

Gnomre
Imperial Winter Developer
Posts: 1754
Joined: 06 Feb 2005, 13:42

Post by Gnomre »

Hehe, I never claimed to be an expert programmer. Never hurts to have someone do the changes more efficiently ;)
0 x

Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Post by Warlord Zsinj »

:(

Buggi has a nasty side.
0 x

User avatar
Zoombie
Posts: 6149
Joined: 15 Mar 2005, 07:08

Post by Zoombie »

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!
0 x

Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Post by Warlord Zsinj »

Well, I tried it. Its much more functional (great work, buggi. Yardmap hack improves gameplay if anything), but I find it odd that you notice how it changes everything now, and not before, Zoombie :P
0 x

shnorb
Posts: 147
Joined: 04 Jun 2005, 07:25

Post by shnorb »

someone want to start a minispring poll topic? i would like to see the results...
0 x

Kixxe
Posts: 1547
Joined: 14 May 2005, 10:02

Post by Kixxe »

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.
0 x

Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Post by Warlord Zsinj »

Uh... Zoom in?

I think the ability to see more of the battlefield is advantage. I get to control twice as much of the battlefield at the maximum zoomed out level.
If you think it is too small, zoom in. J doubles as a middle mouse key, btw.
0 x

Gnomre
Imperial Winter Developer
Posts: 1754
Joined: 06 Feb 2005, 13:42

Post by Gnomre »

Yeah, you zoom with the scroll wheel, but I can see how that'd be a problem for those without it... surely the SYs have already put in an alternate method for zooming?
0 x

Torrasque
Posts: 1022
Joined: 05 Oct 2004, 23:55

Post by Torrasque »

Gnome wrote:Yeah, you zoom with the scroll wheel, but I can see how that'd be a problem for those without it... surely the SYs have already put in an alternate method for zooming?
it's page up/down
0 x

Post Reply

Return to “General Discussion”