• Welcome to SC4 Devotion Forum Archives.

Query.txt

Started by sumwonyuno, September 13, 2009, 11:09:04 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

HeinBloed4711

#20
Ok, here's a little update:

I tested IM first, which created even more confusion. In contrast to IH, the number of R$$$ jobs is correct according to the census drive much more often, almost always. BUT I found a few mega lots that seemed to offer some more than the expected 5%, only a handful like 5-10 jobs though. This is true only if the number of R$ was still right for those (I only checked if R$=10*R$$$, since the proportion should be 50/45/5%) - however this seems more likely to me than not, because the relation of 50/45 between R$ and R$$ was still correct for those lots.

Then I went through all civic buildings. Apart from the medical clinic, I found the solar power plant to completely lack the 10 R$$$ jobs. And to make my confusion complete, the nuclear power plant has the right number of R$$$ jobs, BUT it lacks the 20 R$$ jobs. &sly

I also tried to find a pattern behind the affected IM/IH mega lots, but couldn't find one. :(

I'd be very grateful for someone else testing and confirming my findings.

Update: just made a quick run with a new city and all my plugins (except the SimCity 4 Extra Cheats Plugin.dll) removed - same result

sumwonyuno

Well, my assumptions have been corrected.  I know less about demand and census drives compared to the traffic simulator. 

HeinBloed4711, I agree industry lots are buggy and I've basically just avoided industry as much as possible to provide jobs in my region.  So now that I've seen your city layout, I understand.  The game does not follow what's logical to us.  For whatever reason, many jobs in large industrial areas are not taken.  There are also the quirks where there are more commuters going to a job building than there are jobs available in that building (as seen in your query.txt examples).  I've had your issues happen to me as well, but I really haven't bothered with it (other issues are more important to me).  I hope that both of us will get answers.

z, I lacked the specificity in my post; I did mean appropriate jobs.  So now my understanding is commuters go to the closest, available and appropriate job that is within the maximum commute time.


The City & County of Honolulu, a Mayor Diary based on Honolulu, Hawai'i.

mark's memory address - I've created a blog!

HeinBloed4711

Quote from: sumwonyuno on October 30, 2009, 06:36:58 PM
For whatever reason, many jobs in large industrial areas are not taken.

Excuse my hairsplitting, but I think we need to be precise here in order not to leave any misunderstandings ;): those jobs you mention don't just not get taken, from the game engine's view they're simply not there to be taken (talking about the R$$$ jobs in IH zones). I'll keep stating that at least as long as someone proves the opposite. ;) And if you want to verify this: Make sure not to test just one lot, but do it for a few ones, since, as I said, one of my many IH mega lots did have those R$$$ jobs.

In the meantime, I modded the large medical center to offer 1/6/1 (R$/R$$/R$$$) jobs, just like the small medical clinic. And guess what, it came up as 1/6/0 jobs, too. Then I went on to mod it to 1/6/2 jobs, result: 1/6/2 ! Final test was 2/6/1, result 2/6/1 ! This makes me quite confident there's some sort of rounding error going on, at least for the civic buildings (haven't tested with solar and nuclear power plant yet). I'm worried the same is true for the industry mega lots. Once again, none of the C$-CO$$$ lots are affected.

Maybe I can do more testing tomorrow, bedtime now.

sumwonyuno

#23
All right, I don't have evidence to refute what you're getting at.  I demolished part of my industrial district and then the mega high tech lots came in.


...
| Jobs $1385.2 $$11081.6 $$$1385.2 - Travel Jobs $1385 $$11136 $$$0
| Building: I-HT 10 N.Ass.T.I.  Nanotech, 14854 $$$
...



...
| Jobs $556.5 $$4452.0 $$$556.5 - Travel Jobs $556 $$4502 $$$0
| Building: I-HT 10 Integriculture HiRise Farm, 6146 $$$
...


Well, I can understanding rounding errors, for one R$$$ job (the game might be using a floor function), but it makes no sense for hundreds of possible R$$$ jobs.

On another note, I found a lot that's different with all the other queries I've done.  It probably has to do with the types of industrial buildings (anchor, mech, out).


|-----------------------------------------------------------
| Query info for cell (147, 143) on 9/25/2822
|-----------------------------------------------------------
| Lot: (149, 145) 5x5, east-facing, state: occupied new, configuration: IHT$$$9_5x5_gc_KelvinColdStorage_04052954
| Jobs $172.0 $$1376.0 $$$172.0 -> (142, 145)
| Building: I-HT 9 Kelvin Cold Storage, 1746 $$$
| Occupancy--building (tract): Ih 99% (100%),
| Zoned: Ih
| Altitude: 270.0
...


The City & County of Honolulu, a Mayor Diary based on Honolulu, Hawai'i.

mark's memory address - I've created a blog!

HeinBloed4711

#24
Quote from: sumwonyuno on October 30, 2009, 07:58:59 PM
On another note, I found a lot that's different with all the other queries I've done.  It probably has to do with the types of industrial buildings (anchor, mech, out).


|-----------------------------------------------------------
| Query info for cell (147, 143) on 9/25/2822
|-----------------------------------------------------------
| Lot: (149, 145) 5x5, east-facing, state: occupied new, configuration: IHT$$$9_5x5_gc_KelvinColdStorage_04052954
| Jobs $172.0 $$1376.0 $$$172.0 -> (142, 145)
| Building: I-HT 9 Kelvin Cold Storage, 1746 $$$
| Occupancy--building (tract): Ih 99% (100%),
| Zoned: Ih
| Altitude: 270.0
...


Yes, I saw those too. When I was talking about mega lots, what I meant are those clumped together industry lots that act as a single lot to the outside, aggregating their incoming and outgoing traffic on a single "anchor" lot. I used that term in this context because I thought I had read it once, but I could be way off. Anyway, the lot you pasted there is part of such a mega lot, imho, since all the lots I saw with that output were. In the line "| Jobs $172.0 $$1376.0 $$$172.0 -> (142, 145)" the coordinates in the parentheses are those of the "anchor" lot (i.e. where this lot sends its jobs so they're available for commuting sims).




Important update: Ok, I've got some relatively good news. After I had tried adjusting various parameters in different exemplars, I arrived at the IH Census exemplar. Here's the original property that sets the number of jobs to 10/80/10%:

Drives 0x47BB3F30 Uint32 10 0x00002010,0x0000000A,0x00002020,0x00000050,0x00002030,0x0000000A,0x00004C00,0x00000064,0x00004900,0x00000064


Since I still thought that there might be some sort of rounding error at work here, I tried to vary the job proportions, leaving the total at 100. 10/79/11 was much better already insofar as I did finally get those R$$$ jobs, however not as many as I expected but often still only ~2/3 of the number of R$ jobs. So basically, the calculated numbers were still way off. Then I tried with 10/78/12, and what can I say - this seems to do the trick. In all my testing so far, the relation between $/$$/$$$ holds perfectly, the total number of jobs seems to match the total number of jobs reported by the normal query, and, as a result of all that, I quickly convinced my R$$$ citizens to work at those newly created jobs much closer to them, without having to force them by cutting off the connection first ;)






Basically, for me the case is clear now that there's a (rounding/arithmetic) bug in the engine that leads to a wrong number of jobs in certain constellations (like that 10/80/10 default drive for IH). Seeing the chance of an official bugfix as non-existant, the best one can do to deal with this is to use a modified IH census that stays true to the game as much as possible - hence only the smallest modification possible. I rather have 20% more R$$$ jobs in my IH and 2.5% less R$$ jobs compared to how the game was originally designed than not have any R$$$ jobs at all.

You may be thinking "so what, it's only 10% of the IH jobs missing anyway", but think about this example: I have one city that now has about 45,000 IH jobs. So, this city lacked a total of ~4,500 R$$$ jobs, which equals a R$$$ population of about 8,000-9,000 (depending on the life expectancy). This is quite a large number, and I don't even have IH maxed out at all. Not having those jobs also means that the R$$$ population, which was STILL created by the IH census drive needs to look for those missing jobs elsewhere, which leads to all sorts of problems (traffic...). I didn't fully think through this yet, but I reckon that ultimately this lack of jobs led to an inherent imbalance in the game, because you can only satisfy the need for R$$$ jobs with CS$$-CO$$$ until a certain level before you definitely need some IH jobs. This is a complicated subject though with several influencing variables (workforce EQ, life expectancy...) Until now, I dealt with this problem by raising R$$$ tax in order to cut down demand.

What I'll do now is some more testing with the 10/78/12 census drive, possibly a few other ratios, then test IM and iron the (much smaller) observed error out there too. Then I can post a small .dat file containing the adapted census drives as a fix.

SC4BOY

#25
Very good work there.. thanks for checking it out.. In terms of "breaking the model" it won't do that as each residential class $ $$ $$$ adds to over 100.. but nontheless your point is excellent and helps explain why Industry become such a weak factor as you try to grow very large cities.. you have to do it almost totally on Commercail which you shouldn't have to do..

The rounding is very odd.. wonder if its in decimal? (the display and entries I mean) I only say this because 12 is 1/8 of 100 rounded almost like octal.. but I guess that's kind of disproved by your other numbers.. I dunno...just seems really odd.. perhaps it is just a bug, but you'd think they would have noted that.. hehe

Will continue to follow your investigations!

HeinBloed4711

#26
Ok, I left it at 10/78/12 for now. Apart from the inevitable rounding between "Jobs" and "Travel Jobs" (e.g. | Jobs $26,6 $$204,8 $$$31,9 - Travel Jobs $27 $$205 $$$32), the numbers seem to match the census drive now. As for IM, I decided to leave it alone because the few errors I observed with the default 50/45/5 drive only concerned R$$$, too, and were in the order of no more than 5 additional jobs, regardless of the lot size.

While I was at it, I tried to tweak the three ploppable buildings that I had found, i.e. the Medical Clinic, the Solar Power Plant, and the Nuclear Power Plant. I continuously added more jobs until the error was gone, here's a table that lists the changes (jobs $/$$/$$$):

BuildingProperty beforeerroneously created jobsProperty after (=created jobs)
Medical Clinic1/6/11/6/01/6/2
Solar Power Plant10/12/1010/12/010/12/12
Nuclear Power Plant20/20/820/0/820/23/8

I attached four single files (one for the IH census and one for each ploppable building) to this post, feel free to test and report your observations. ;)

(had uploaded them previously to http://www.mediafire.com/?sharekey=59d030429a5f92f00c814df2efeadc5039e94841451ff5c24ad239450a8c1cf1, in case there's a problem)

Quote from: SC4BOY on October 31, 2009, 09:12:17 AMIn terms of "breaking the model" it won't do that as each residential class $ $$ $$$ adds to over 100..
Yes that's true, and I've been wondering about that design decision for some time. Because what that effectively does is that it allows for unlimited expansion of basic demand (i.e. not the effective demand that is derived from that by applying demand caps, taxes...), if you make sure you have the right ratio of the various RCI types. I wonder if they introduced it after having tested the game and realizing this was necessary in order to overcome the flaws like the limited original traffic simulator (and the probably lesser effect of the missing IH R$$$ jobs). However, the simulation does need some slack to deal with the effects of EQ and life expectation.

It should be noted that using my IH census patch file, the game will effectively become "easier" because you will have more jobs available. But I don't feel this is some kind of cheat, because those jobs were meant to be there anyway, and they already created a certain demand for R$$$ zones, fully fulfilling which would probably have caused a lack of jobs, followed by abandonment. A city with IH that worked without this will get a sudden batch of additional available R$$$ jobs (which will NOT affect the existing demand in any way), which will lead to changes in traffic. Cities that didn't quite work out yet should (hopefully) experience less abandonment in R$$$ zones.

What this also means though, I'm afraid, is that theoretically every plobbable building can be concerned by this bug. I've checked all the default Maxis buildings already (I think, hopefully didn't forget any), but every user-made custom building should be verified really to be sure. :( The only true solution would be to fix it in the source code.


Update: Attached the files to this post after RippleJet kindly gave me the right to do so.
Update 2: LunarMongoose brought an error to my attention that slipped into the IH census; I had actually saved the exemplar with a 10/77/12 job ratio instead of 10/78/12, so 1% $$ jobs were missing. Please re-download the IH census file and overwrite the previous version with the contained dat file. Sorry for this.

SC4BOY

Aye.. no, I'd hardly see this as a "cheat".. Also I'd hope that as CAM 2.0 is IMMINENT *cough cough* that they will factor this into the "CAM" mod's.. its great that you're delving into this.. well worth the exploration

RippleJet

After coming home from a two-day business trip, I've now read through all this, HeinBloed, and I'm impressed at how much effort you've put on this so far.

What strikes me so far, is that your zeroes appear whenever two of the wealth categories are identical...


  • 10/80/10 becomes 10/80/0
  • 1/6/1 becomes 1/6/0
  • 10/12/10 becomes 10/12/0
  • 20/20/8 becomes 20/0/8

Especially the last case was the one catching my eyes here...


Quote from: HeinBloed4711 on October 31, 2009, 10:41:24 AM
Since I can't post attachements

You can now! :thumbsup:


Quote from: SC4BOY on October 31, 2009, 04:04:36 PM
Also I'd hope that as CAM 2.0 is IMMINENT *cough cough* that they will factor this into the "CAM" mod's..

*cough cough* ::)
Since almost all census exemplars are included and modded in the CAM, I will most certainly have to take this into consideration...

HeinBloed4711

Quote from: RippleJet on November 01, 2009, 10:43:21 AM
What strikes me so far, is that your zeroes appear whenever two of the wealth categories are identical...


  • 10/80/10 becomes 10/80/0
  • 1/6/1 becomes 1/6/0
  • 10/12/10 becomes 10/12/0
  • 20/20/8 becomes 20/0/8

Especially the last case was the one catching my eyes here...

You're right, that's an interesting observation. I think I'll investigate into this one of the next days, atm I'm busy. If someone else wants to do it right now, please go ahead. :)

sumwonyuno

I've been following what you've been finding, and good investigating.   :thumbsup:  I've noticed that relation too (missing jobs for those equal percentages).  Though, it doesn't seem to be a purely on-off bug (when you change it by one percentage point, jobs are still missing).  You had to adjust two percentage points for the missing jobs to be fully available to the game.  I'm trying to think of what kind of programming error would lead to this canceling out (float arithmetic?).

I don't consider the modifications a cheat (rather we've been cheated), as these jobs were intended to be there in the first place.


The City & County of Honolulu, a Mayor Diary based on Honolulu, Hawai'i.

mark's memory address - I've created a blog!

z

Quote from: sumwonyuno on November 01, 2009, 01:11:00 PM
I don't consider the modifications a cheat (rather we've been cheated), as these jobs were intended to be there in the first place.

I agree completely - creating a workaround for a bug is not a cheat.

LunarMongoose

Speaking of bugs no one else noticed... The IH Census file you posted here and on Simtropolis *actually* reads 10-77-12 in the exemplar data... I assume you typo'd the hex value; 4D is 77. Should be 4E right? ;)

HeinBloed4711

#33
Quote from: LunarMongoose on November 02, 2009, 01:47:32 AM
Speaking of bugs no one else noticed... The IH Census file you posted here and on Simtropolis *actually* reads 10-77-12 in the exemplar data... I assume you typo'd the hex value; 4D is 77. Should be 4E right? ;)

You're so right, thanks a lot for this notification! Must have overlooked this while varying the values. &mmm I'll change it immediately and upload the fixed file.

The fixed, correct file is at http://sc4devotion.com/forums/index.php?topic=8870.msg284277#msg284277 now.

HeinBloed4711

#34
I've taken the time to run the outstanding tests now, here are the results:

First I modded the CO$$ census (to test a different RCI type than IH at the same time), like this:

job ratio set ($/$$/$$$)job ratio in game ($/$$/$$$)
40/50/10 (original Maxis values)40/50/10
40/40/2040/0/20
40/20/4040/20/0*
33/33/3333/0/0
20/40/4020/40/40
40/30/3040/30/30
*(actually, I got a mixture of 0(%) and an absolute value of 5-10 jobs, regardless of the lot capacity here, e.g. 5 $$$ jobs for a 1600 capacity tower, 0 $$$ jobs for a 20 capacity building etc.)


Then I tested ploppable buildings, this time for the same reasons as above the Large Medical Center:

jobs set ($/$$/$$$)jobs in game ($/$$/$$$)
35/53/11 (original Maxis values)35/53/11
35/35/1135/0/11
35/53/3535/53/0
35/35/3535/0/0
11/35/3511/35/35
----------------------------------------------------------------------------------------------------------
50/35/550/35/5
35/55/1035/55/10
50/45/550/0/5
45/50/545/0/5
100/90/10100/0/10
90/100/1090/0/10

The last batch of ratios was tested because I had observed that marginal absolute error of 5-10 jobs with a few IM lots - IM has a census drive of 50/45/5.

My conclusions: As RippleJet has guessed, any two or three identical numbers seem to cause the error reproducibly, however only when the $ jobs are part of this. This is the case for the RCI census drives (growables) AND ploppable buildings. There must be more "magical" ratios though, as at least 50/45/5 resp. 45/50/5 (and multiples of that) have shown to be faulty, too. This has to be some weird arithmetic calculation error in the code indeed. Since it doesn't happen when $ is different from $$ and $$$, maybe there's some rest of an arithmetic operation carried over to the following ones. &Thk/( Cries for an official patch anyway. BATers (and LOTers) should be aware of this bug and ideally test their ploppable buildings against it.

niloluiz

Hi folks,

I was just notified by HeinBloed that he "re-discovered" the "IHT bug" that I originally mentioned on the release of the RCImulti mod about 20 months ago (Mar-11-2008) on this simtropolis forum topic: http://www.simtropolis.com/forum/messageview.cfm?catid=41&threadid=97952&forumid=1.

The RCImulti also deals with job rebalancing among other things including "homejobs" (sims work at home). Please take a look at the above link as it contains the detailed description of all the mod features and the mod concepts involved in it's creation (most of it was already documented by RippleJet here on SC4dev before RCImulti release, which I wasn't aware at the time). Sorry for not properly posting this findings here on SC4dev at the time and kudos for HeinBloed for documenting the Jobs bug here and releasing a proper stand-alone mod for this issue.

Since Cities XL wasn't what many of us was expecting, modding of SC4 will probably continue for yet a long time and it's interesting to have all informations documented on the main SC4 forums.  :)

Also I received many requests to make RCImod "CAMpatible" which would require some changes to the CAM mod itself  but I would like to have the Cam's team approval/guidelines to eventually make this modification.

RippleJet

Hi Nilo, and welcome to Devotion! :)
Let me first tell you I'm sorry nobody at first said anything in your thread where you first introduced your RCImulti mod.

I must confess that I myself didn't see your mentioning about the "IHT bug" either...
I had to go back and reread your thread over there...

Quote from: niloluiz at http://www.simtropolis.com/forum/messageview.cfm?catid=41&threadid=97952&forumid=1
BUG: The game engine have a BUG that prevents the JOBS$$$ and JOBS$ for Industry Hi-tech for being created. If you ever wonder why wealth sims ($$$) NEVER work on IHT building, now you know why. This bug occours when you try to use(when modding the game)  similar % for each JOB type. Since the default game specs dictate 10% for BOTH JOBS$ and JOBS$$$ on IHT industry, the game engine will truncate theses values and will generate noone.

Kudos to you for finding this already back then! :thumbsup:

Regarding RCImulti and CAM... maybe you'd want to take part in the development of CAM 2.0? :)

RippleJet

Double-posting as this is not directly related to my previous post (I hope Steve comes and reads this...)

Quote from: HeinBloed4711 on November 02, 2009, 06:42:25 AM
BATers (and LOTers) should be aware of this bug and ideally test their ploppable buildings against it.

I needed to recheck the formulas for civic jobs as set by the "X Tool",
and luckily I have never given the same formulas for jobs$ as for jobs$$ and jobs$$$.

E.g. medical clinics and hospitals are given jobs by these (XML) formulas:

<eval name="CivicJobs" value="int(ceil(Patients/30.))"/>
<eval name="Jobs1" value="5+int(CivicJobs*1./5.)"/>
<eval name="Jobs2" value="2+int(CivicJobs*3./5.)"/>
<eval name="Jobs3" value="0+int(CivicJobs*1./5.)"/>

The rare case when Jobs1 = Jobs2 = 6 ( when CivicJobs are 7 or 8 ) can probably be looked over,
as that would correspond to a patient capacity of only 181...240.

Ingame civic buildings should be recalculated with the "X Tool" for CAM 2.0 though... ::)

wouanagaine

Ha, your last post is a relief Ripplejet, I was thinking I'll need to create a special case, but hopefully you already did it right from the first time :)

Very nice and detailled information in this thread


New Horizons Productions
Berethor ♦ beskhu3epnm ♦ blade2k5 ♦ dmscopio ♦ dedgren ♦ emilin ♦ Ennedi ♦ Heblem ♦ jplumbley
M4346 ♦ moganite ♦ Papab2000 ♦ Shadow Assassin ♦ Tarkus ♦ wouanagaine
Divide wouanagaine by zero and you will in fact get one...one bad-ass that is - Alek King of SC4

niloluiz

Quote from: RippleJet on November 02, 2009, 11:34:36 AM
Hi Nilo, and welcome to Devotion! :)

Thanks man  :)

Quote
Let me first tell you I'm sorry nobody at first said anything in your thread where you first introduced your RCImulti mod.

I must confess that I myself didn't see your mentioning about the "IHT bug" either...
I had to go back and reread your thread over there...

Yeah I should've made a better job of making that info available.The simtrop mod forum was already "quiet" at the time I made that post so there wasn't any followup to the info posted there. I was also "switching off" from SC4 and so didn't finish the divulgation process.

QuoteRegarding RCImulti and CAM... maybe you'd want to take part in the development of CAM 2.0? :)

That would be interesting and I would be glad to partcipate in any way I can  :)