Thread Tools
Old March 8, 2002, 22:40   #1
klesh
King
 
klesh's Avatar
 
Local Time: 17:29
Local Date: October 31, 2010
Join Date: Jan 2000
Location: Massachusetts, USA
Posts: 2,048
New Discovery? Costless Units!
Greetings again all,

Whilst fiddling with some values of units today, I made what could be a very interesting discovery. I do not know if this has been seen before, but it resembles the odd unit movement value phenomenon being discussed here. Perhaps William Keenan or someone has already figured this out. Perhaps not...

What I did was to mistakingly set the cost of a unit to 148. I just forgot to delete the 8 when changing the cost to 14. Well, to my surprise it resulted in the wierdest thing happening... the unit in question had a NONE listed as the cost! There was no shield box to be filled in, and of course any city or specific Civ can produce any unit at no cost to them! It would just require a dedicated ultra-expensive unit slot.

This will be good for scenarios where you want a very good unit, or lots of units, to be built from a worthless city or a city that shouldn't be of value when captured. No need to make city improvements extra cheap so the player wont sell them off etc. Many unique uses for this I believe. I havent really tested it much, I don't know if 148 is the magic number or what, but here are 2 screenies to show you what I am talking about. Try it out!

And if this is a new discovery, then it has my ™ on it!

-FMK.
Attached Thumbnails:
Click image for larger version

Name:	example2.gif
Views:	345
Size:	62.5 KB
ID:	11079  
__________________
It's a wonder that you still know how to breathe.
klesh is offline  
Old March 8, 2002, 22:41   #2
klesh
King
 
klesh's Avatar
 
Local Time: 17:29
Local Date: October 31, 2010
Join Date: Jan 2000
Location: Massachusetts, USA
Posts: 2,048
And here is a shot of Berlin making the cheapest Konigstigers known to man!
Attached Thumbnails:
Click image for larger version

Name:	example.gif
Views:	334
Size:	33.7 KB
ID:	11080  
__________________
It's a wonder that you still know how to breathe.
klesh is offline  
Old March 8, 2002, 23:30   #3
techumseh
Civilization II PBEMScenario League / Civ2-Creation
Emperor
 
techumseh's Avatar
 
Local Time: 15:29
Local Date: October 31, 2010
Join Date: Apr 1999
Location: of the frozen North.
Posts: 4,197
I'm impressed. Good work.
techumseh is offline  
Old March 8, 2002, 23:35   #4
ravagon
Scenario League / Civ2-Creation
King
 
Local Time: 05:29
Local Date: November 1, 2010
Join Date: Sep 1999
Location: Australia
Posts: 1,515
Bah. I would have replied first but the bleeping server cut me off.

Does it actually work in practice (do you get a unit each turn? - even if a city is producing no shields) or is it just a graphical thing?

Also - What's the bribe price for a zero cost unit?

Very interesting indeed
ravagon is offline  
Old March 9, 2002, 01:14   #5
DarthVeda
Emperor
 
DarthVeda's Avatar
 
Local Time: 17:29
Local Date: October 31, 2010
Join Date: Dec 1969
Location: Baltimore, MD
Posts: 4,325
Makes me wonder what the other fields do with ludicrously high values?

The unit type slot...
The defense slot... (nuclear?)
The attack slot... (nuclear?)
The hitpoint slot...
The firepower slot...

Am I missing any?
DarthVeda is offline  
Old March 9, 2002, 01:17   #6
DarthVeda
Emperor
 
DarthVeda's Avatar
 
Local Time: 17:29
Local Date: October 31, 2010
Join Date: Dec 1969
Location: Baltimore, MD
Posts: 4,325
Although, couldn't you just set the production to 0 and achieve the same effect?
DarthVeda is offline  
Old March 9, 2002, 01:31   #7
ravagon
Scenario League / Civ2-Creation
King
 
Local Time: 05:29
Local Date: November 1, 2010
Join Date: Sep 1999
Location: Australia
Posts: 1,515
Quote:
Originally posted by DarthVeda
Makes me wonder what the other fields do with ludicrously high values?

The unit type slot...
The defense slot... (nuclear?)
The attack slot... (nuclear?)
The hitpoint slot...
The firepower slot...

Am I missing any?
I just started thinking the same thing after reading that quote from WK in FMK's other thread.

Move slot
Transport slot
Domain (?) slot - I've tried values up to about 9 or so and all of them crashed but I never thought to try anything that much higher...

I'm off to have a play, er, conduct a rigorous scientific investigation.
ravagon is offline  
Old March 9, 2002, 01:33   #8
MagyarCrusader
Civilization II PBEM
Emperor
 
MagyarCrusader's Avatar
 
Local Time: 13:29
Local Date: October 31, 2010
Join Date: Dec 1969
Location: Fascist
Posts: 3,161
I could have had uses for that back in my scen creation days... Damn you FMK for waiting so long to tell me! j/k Good work!
__________________
Re-elect Bush!
MagyarCrusader is offline  
Old March 9, 2002, 02:18   #9
klesh
King
 
klesh's Avatar
 
Local Time: 17:29
Local Date: October 31, 2010
Join Date: Jan 2000
Location: Massachusetts, USA
Posts: 2,048
Hey everybody,

Girlfriend Shanghaied me tonite soon after making this thread. Needless to say I haven't had any time to work on this (and I am quite drunk at the moment to boot).


Quote:
Does it actually work in practice (do you get a unit each turn? - even if a city is producing no shields) or is it just a graphical thing?
Take a closer look to that screenie of Berlin. The city is still producing 41 shields, its just that the unit costs zero.


Quote:
Also - What's the bribe price for a zero cost unit?
Again, I'll need to play around a bit to see if there is anything strange about the units built this way.


Quote:
Although, couldn't you just set the production to 0 and achieve the same effect?
Yeah, I suppose you could. I was just startled by this and didn't even think of it. I'll try that too. Perhaps entering zero for a cost might just default to 10?


Quote:
Damn you FMK for waiting so long to tell me!
Damn me for taking so long to stumble upon this!

I dont know, maybe this is useless. I'll have to fiddle more with this to see whats up. Maybe the AI still sees the cost as 148 and will refuse to buy such rediculous units...


-FMK.
__________________
It's a wonder that you still know how to breathe.
klesh is offline  
Old March 9, 2002, 02:26   #10
klesh
King
 
klesh's Avatar
 
Local Time: 17:29
Local Date: October 31, 2010
Join Date: Jan 2000
Location: Massachusetts, USA
Posts: 2,048
Just as I suspected Darth...
Ran a quick check here, and making a unit 0 cost in fact does default it's cost to 10.

-FMK.
__________________
It's a wonder that you still know how to breathe.
klesh is offline  
Old March 9, 2002, 04:13   #11
Henrik
Civilization II PBEMScenario League / Civ2-CreationNationStatesMacCivilization II Democracy Game: Red FrontSpanish CiversCivilization IV Creators
Emperor
 
Henrik's Avatar
 
Local Time: 22:29
Local Date: October 31, 2010
Join Date: Dec 2000
Location: The European Union, Sweden, Lund
Posts: 3,682
Re: Just as I suspected Darth...
Quote:
Originally posted by Field Marshal Klesh
Ran a quick check here, and making a unit 0 cost in fact does default it's cost to 10.
No it doesnt check again
The shield row gets a little bigger but the cost is still 0!
Atleast thats how it is for improvements.
__________________
No Fighting here, this is the war room!
Henrik is offline  
Old March 9, 2002, 05:14   #12
Xin Yu
Apolytoners Hall of Fame
King
 
Xin Yu's Avatar
 
Local Time: 13:29
Local Date: October 31, 2010
Join Date: Dec 1969
Location: Emeryville, CA, USA
Posts: 1,658
I suspected a while ago that setting too big a shield box would give a negative cost (you rush buy a unit and gain money from it). Perhaps you can test it as well.
Xin Yu is offline  
Old March 9, 2002, 06:56   #13
Paul Hanson
King
 
Paul Hanson's Avatar
 
Local Time: 22:29
Local Date: October 31, 2010
Join Date: Aug 1999
Location: Dilbert
Posts: 1,839
IIRC, this sort of thing happens on the USA 2010 scenario that comes with FW. Under the right circumstances, rushbuilding a Cyborg unit results in you receiving money.
__________________
"Paul Hanson, you should give Gibraltar back to the Spanish" - Paiktis, dramatically over-estimating my influence in diplomatic circles.

Eyewerks - you know you want to visit. No really, you do. Go on, click me.
Paul Hanson is offline  
Old March 9, 2002, 07:22   #14
our_man
Civilization II Democracy Game: Red FrontScenario League / Civ2-Creation
Prince
 
our_man's Avatar
 
Local Time: 22:29
Local Date: October 31, 2010
Join Date: Oct 2000
Location: Glasgow, Scotland
Posts: 522
Paul, Xin, this does indeed happen once a unit costs over 180 shields in FW. I think Microprose mentioned this in the manual, but they managed to fix the bug under MGE.

A classic example of this is playing as the Spanish in Jay Bee's War of Cuba. The weird thing about this is that there appears to be no discernable pattern to when you can buy a unit for a negative amount of money. For example, one turn a unit could cost you 220 shields and to buy it would give you money - the next turn it might have gone down to 215 shields and it'll cost you an absolute fortune to rush-buy. It's weird.
our_man is offline  
Old March 9, 2002, 12:55   #15
Paul Hanson
King
 
Paul Hanson's Avatar
 
Local Time: 22:29
Local Date: October 31, 2010
Join Date: Aug 1999
Location: Dilbert
Posts: 1,839
You're absolutely right. My friend who owned FW could get several thousand gold a turn by simply rushbuilding Cyborgs on USA 2010, whilst MGE-owning me couldn't get it to work.

And yes, the FW manual warns against setting build costs higher than 180 shields.
__________________
"Paul Hanson, you should give Gibraltar back to the Spanish" - Paiktis, dramatically over-estimating my influence in diplomatic circles.

Eyewerks - you know you want to visit. No really, you do. Go on, click me.
Paul Hanson is offline  
Old March 9, 2002, 14:34   #16
DarthVeda
Emperor
 
DarthVeda's Avatar
 
Local Time: 17:29
Local Date: October 31, 2010
Join Date: Dec 1969
Location: Baltimore, MD
Posts: 4,325
So what's the max shield cost in MGE/ToT?

250?
DarthVeda is offline  
Old March 9, 2002, 14:51   #17
klesh
King
 
klesh's Avatar
 
Local Time: 17:29
Local Date: October 31, 2010
Join Date: Jan 2000
Location: Massachusetts, USA
Posts: 2,048
I am gonna have to have some time to play around and get some findings. Beautiful day here, and the gf wont stand for me sitting in front of the pc. I will kepp testing though...

Henrik, yes it does... for units anyway. Entering 0 for a cost and looking at the shieldbox for the unit, it was a standard depth 10 shield unit.

All of this is being done with MGE as that is all I have. You guys will have to test the ToT and FW ones...

I'll also check on if you get money or something from building these units. More to come....

-FMK.
__________________
It's a wonder that you still know how to breathe.
klesh is offline  
Old March 9, 2002, 15:37   #18
klesh
King
 
klesh's Avatar
 
Local Time: 17:29
Local Date: October 31, 2010
Join Date: Jan 2000
Location: Massachusetts, USA
Posts: 2,048
Well I snuck some time for another quick test. The results are promising indeed.


When set to build these costless units any city really can build them. It isnt some graphic screw up where the units really cost 10 shields. A city that made 2 shields per turn could pump out these units.

Also, even rioting cities, which should have zero production anyway, can still pump out these units.

The units are supported as usual from the home city. Which makes me think that in the fanatic slot under a fundy gov., this technique could be deadly making free support/free build units from small little 'base' cities off out in nowhere or somesuch.

Now here is something strange indeed, when using the edit city function in cheat mode to reset cities's shield accumulation to zero, I found that cities which had just made one of these units had accumulation in the negative(-521 shields)! So I let those cities continue. They built another unit the next turn no problem. As I look now after the next turn... all the cities' progress is back to zero... no negative values anymore. Obviously, more in depth testing is needed. I would also like to see if the AI will choose these units to build. I will make their other stats (at/def) very appealing so they will want the unit. I would like to see if they are turned off to building it at all or something.

I also want to see how this effects the AI's use of cruise missile units, as it is commonly know they use a cost anaylsis to judge whether to send out a missle to strike.

Many things to test, and no time to do it right now. Argh!


-FMK.
__________________
It's a wonder that you still know how to breathe.
klesh is offline  
Old March 9, 2002, 23:17   #19
hardjoy
Scenario League / Civ2-Creation
Prince
 
hardjoy's Avatar
 
Local Time: 22:29
Local Date: October 31, 2010
Join Date: May 2001
Location: Odense, Denmark
Posts: 305
Very interesting discoveries, FMK! Keep up the good work! I will be following the test results closely ...perhaps even do my own bits of testing! intriguing to say the least..
__________________
The Slim End Of The Long Tail -
Kaplak Stream
hardjoy is offline  
Old March 9, 2002, 23:48   #20
ravagon
Scenario League / Civ2-Creation
King
 
Local Time: 05:29
Local Date: November 1, 2010
Join Date: Sep 1999
Location: Australia
Posts: 1,515
I did some playing too and got some rather odd results.
Firstly I was NOT able to reproduce the screen with the NONE unit cost. Still don't know about this one. Costs were always negative.

Unit costs of zero default to 10 shields (although it doesn't do this for improvements strangely enough where 0=0) and follows the usual pattern up to 127 (1270 shields)
At 128 (2^7) it flips to -1280 which rounds up to give the zero cost unit and thereafter continues increasing. ie: 129 --> -1270 etc, up to 200 which seems to be the max and has a shield cost of -560 (IIRC). Hence all unit costs above 127 are 0.

[This flip happens in the terrain resources too btw at the same point. 127 = 127 shields. 128 = -1280 (rounds up to 0 production)]

It works this way for the AI too, even though AI cities seem to produce a full shield box every turn (Graphical anomaly?)

An AI oddity that showed up however was a strong tendency to NOT attack with zero-cost units. I was at war with them and cheated in a horde of spies to keep an eye on their city production from turn to turn and my spies/other units were never attacked/expelled. This went on until I made peace. The AI then began expelling spies like crazy before sneak attacking with its zero-cost units on both my spies and other units but only for this turn.
The next turn business as usual. ie: His units just moving around not attacking spies or others in open terrain right next to his cities.
[Incidentally I was using the Jihad scenario and the fundamentalist and horseman slots to test all this]

One interesting thing that came to light was the ability to rush-build these zero-cost units. Cost was 0 gold and it produced the negative 1280 (using the production cost = 128) shields required to build the unit (although this didn't show up in the production box).
If you the changed the production queue to something else it showed a much much higher number of turns to build the new something due to the negative shield deficit that had to be "worked off" before applying shields to actually build it.

This might be ideal if somebody were designing a scenario and wished for cities to be unable to build anything for a number of turns before having their production resume at full strength.
It is still very cumbersome though as the minimum shield deficit seems to be 560 (from rush building a unit with a cost of 200) which is quite sizable.
All of this is completely irrelevant however if civtweak can set a cities shield production to a negative value (which I forgot to check )

[Edit: Actually, rereading FMK's post, he covered most of this anyway ]
ravagon is offline  
Old March 10, 2002, 00:25   #21
DarthVeda
Emperor
 
DarthVeda's Avatar
 
Local Time: 17:29
Local Date: October 31, 2010
Join Date: Dec 1969
Location: Baltimore, MD
Posts: 4,325
Oooh.... that will be useful...
DarthVeda is offline  
Old March 10, 2002, 09:39   #22
Goingonit
Warlord
 
Goingonit's Avatar
 
Local Time: 16:29
Local Date: October 31, 2010
Join Date: Apr 2001
Location: Toronto, Canada - AECCP member
Posts: 192
Neat.

IMO, the AI douesn't take cost into account when building units.
__________________
I refute it thus!
"Destiny! Destiny! No escaping that for me!"
Goingonit is offline  
Old March 10, 2002, 22:52   #23
Boco
Scenario League / Civ2-Creation
King
 
Boco's Avatar
 
Local Time: 16:29
Local Date: October 31, 2010
Join Date: Jan 2001
Location: of underdogs
Posts: 1,774
Watch out for Civ2 Editor resets
To make a 'slow road' terrain, I had set the movecost to 205 (Road bonus =25, set to >10 to take advantage of WK's fractional movement math). Civ2 behaves oddly but reproducibly with these settings. Regular roads (and rivers) cost 1/10 mf; the new 'slow road' costs 2/10mf.

Here's the kicker: the Civ2 terrain editor squawks when it encounters an out-of-range variable. I was tweaking the 'slow road' terrain image via the Editor menu in Civ2, when it spotted the movecost was set out of range. It did me the 'favor' of resetting the movecost to 0 in the rules.txt. I wouldn't be surprised if this were not an isolated incident.
Boco is offline  
Old March 11, 2002, 02:01   #24
DarthVeda
Emperor
 
DarthVeda's Avatar
 
Local Time: 17:29
Local Date: October 31, 2010
Join Date: Dec 1969
Location: Baltimore, MD
Posts: 4,325
Watch out for the civ2 editors period. They are far too buggy to be trusted by any serious scenario creator.

I recall several incidents where it changes the name of your civ to that of a resource and vice versa.
DarthVeda is offline  
Old March 11, 2002, 09:57   #25
Heresson
Scenario League / Civ2-CreationNationStates
Emperor
 
Heresson's Avatar
 
Local Time: 23:29
Local Date: October 31, 2010
Join Date: Jun 2000
Location: of syrian frogs
Posts: 6,772
Nice discovery, I'm sure it'll be usefull in making some computer-played civ properly dangerous for You. I don't see any use for it
in human-played civ though; most of scns are enough easy already.
__________________
"I realise I hold the key to freedom,
I cannot let my life be ruled by threads" The Web Frogs
Middle East!
Heresson is offline  
Old September 6, 2002, 16:34   #26
Boco
Scenario League / Civ2-Creation
King
 
Boco's Avatar
 
Local Time: 16:29
Local Date: October 31, 2010
Join Date: Jan 2001
Location: of underdogs
Posts: 1,774
*Bump*

Has anyone used costless units in a scenario?
Boco is offline  
Old September 6, 2002, 17:54   #27
William Keenan
Scenario League / Civ2-Creation
Prince
 
William Keenan's Avatar
 
Local Time: 16:29
Local Date: October 31, 2010
Join Date: Sep 1999
Location: New Jersey, USA, Earth, Sol, Milky Way
Posts: 705
Greetings all. Its been awhile.

I think I can help shed some light on this topic. Most Civ unit values are stored as signed byte integers (-128 to 127). This conserves computer memory but produces odd results when larger than expected values are inserted.

More in a moment .....
William Keenan is offline  
Old September 6, 2002, 19:48   #28
Goingonit
Warlord
 
Goingonit's Avatar
 
Local Time: 16:29
Local Date: October 31, 2010
Join Date: Apr 2001
Location: Toronto, Canada - AECCP member
Posts: 192
That gives me a new idea...

Ravagon was suggesting in the engineer/city-production thread that a Xin Yu or similar strategist could disband a city by selling its city walls and causing it to be destroyed by combat. Well, that would be a lot more balanced strategically if the city walls had negative cost! (and thus cost money to sell!) I'll test this, but it sounds practical and useful.
__________________
I refute it thus!
"Destiny! Destiny! No escaping that for me!"
Goingonit is offline  
Old September 6, 2002, 19:50   #29
William Keenan
Scenario League / Civ2-Creation
Prince
 
William Keenan's Avatar
 
Local Time: 16:29
Local Date: October 31, 2010
Join Date: Sep 1999
Location: New Jersey, USA, Earth, Sol, Milky Way
Posts: 705
..... back.

Computers do math using a base 16 system (hexidecimal), not the base 10 system (Decimal) we use.

One byte is 2 hexidecimal digits: 00 to FF

Decimal values: 0 to 255.

When a byte is signed decimal values are different
00 to 7F hex is 0 to 127 decimal and 80 to FF hex is -128 to -1 decimal. See Ravagons explaination above.

Civ2 uses signed bytes in unit values. It follows that a unit cost of 255 in the rules.txt is converted to a hex value of FF which to the computer is -1. Therefore the unit build cost would be (-1*10)=-10.

A city producing only one shield per turn will produce this unit evey turn because the total accumulated shield production of 1 is equal to or greater than the unit cost of -10.

Theoretically, a city with a -9 shield production would also produce the unit every turn. But a city with a -11 production would never produce the unit.

Quote:
Originally posted by DarthVeda
So what's the max shield cost in MGE/ToT?

250?
The highest possible positive number should be 1270.
William Keenan is offline  
Old September 6, 2002, 20:02   #30
Goingonit
Warlord
 
Goingonit's Avatar
 
Local Time: 16:29
Local Date: October 31, 2010
Join Date: Apr 2001
Location: Toronto, Canada - AECCP member
Posts: 192
Darn, it turns out that this doesn't work. Improvements, at least, have positive and accurate costs to 255, and them positive but inaccurate costs thereafter (the cost is equal to the set cost mod 256, which leads me to think that the cost is stored as an unsigned byte.)
__________________
I refute it thus!
"Destiny! Destiny! No escaping that for me!"
Goingonit is offline  
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 17:29.


Design by Vjacheslav Trushkin, color scheme by ColorizeIt!.
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Apolyton Civilization Site | Copyright © The Apolyton Team