Jump to content
Sign In to follow this  
Mister Giggles

SimCity 4 on Ubuntu?

9 posts in this topic Last Reply

Highlighted Posts

Posted:
Last Online:  
 

I'm tired of XP. Very, very tired of XP. It's like looking at a 10 year-old program that's woefully obsolete but is used by most people anyway because it still manages to just work. Wait...

Anyway, I'm pondering getting off the rails and trying SC4 on Ubuntu, via Wine (obviously). I've heard it works quite well, but I want to measure twice before I get about to formatting. So, here are my questions to those of you who've played SC4 on Ubuntu:

1a: Do any major bugs exist when using Ubuntu 11.04 and Wine? Crashes, game not saving, major graphical anomalies, and such.

1b: Do any MINOR bugs exist? Flickering, props not displaying correctly, odd intermediate freezes.

2: Can the game be run in Hardware mode? I ask because I don't believe my CPU is strong enough to run everything on its own. At least, as the speeds I'm used to.

3: Anything not related to the above questions I should know about? Special configurations, maybe.

That's all I can think of at the moment...

Share this post


Link to post
Share on other sites
Posted:
Last Online:  
 

I'm tired of XP. Very, very tired of XP. It's like looking at a 10 year-old program that's woefully obsolete but is used by most people anyway because it still manages to just work. Wait...

Anyway, I'm pondering getting off the rails and trying SC4 on Ubuntu, via Wine (obviously). I've heard it works quite well, but I want to measure twice before I get about to formatting. So, here are my questions to those of you who've played SC4 on Ubuntu:

1a: Do any major bugs exist when using Ubuntu 11.04 and Wine? Crashes, game not saving, major graphical anomalies, and such. No more than usual. There is a glitch in wine that I'll discuss later.

1b: Do any MINOR bugs exist? Flickering, props not displaying correctly, odd intermediate freezes. None to speak of.

2: Can the game be run in Hardware mode? I ask because I don't believe my CPU is strong enough to run everything on its own. At least, as the speeds I'm used to. Yes, up to a point. See below.

3: Anything not related to the above questions I should know about? Special configurations, maybe. Stick with the default wine version and you should be OK. I've been running the latest beta, and it is also OK (1,3.29) but I have reverted to 1.3.15 because I switched to Linux Mint because of the unity desktop.

That's all I can think of at the moment...

The problem with running wine in hardware mode is that wine will only allocate one back buffer to the GPU. This means that when your city gets larger, the graphics will start to fail because there is not enough buffer space. At that point you have to switch to software rendering to continue.

As with all large cities on any platform, you should save frequently.

P.S. If you don't like the Unity desktop making your computer look like a telephone, 11.10 forces it. You might want to try LinuxMint (based on Ubuntu) instead.

  • Like 1

Beware: Emancipated user.  No Windoze for me.
The teacher opens the door but the student must enter himself. - Ancient Chinese Saying

Every minute of hate in which one indulges oneself is sixty seconds of happiness lost.
Music expresses that which cannot be put into words and that which cannot remain silent. -- Victor Hugo
If you always do what you've always done, you'll mostly get what you've always got.
JohnNewSig.gif
"We have met the enemy, and he is us" - Walt Kelly

Come join us at the Moose Factory

Share this post


Link to post
Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Thank you, Nonny. I was hoping you'd post. :)

    The problem with running wine in hardware mode is that wine will only allocate one back buffer to the GPU.

    Being no stranger to workarounds, is there a way to alter this setting? Or is so intertwined with the very "nature" of Wine that it can't fixed without re-programming the whole thing?

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Thank you, Nonny. I was hoping you'd post. :)

    The problem with running wine in hardware mode is that wine will only allocate one back buffer to the GPU.

    Being no stranger to workarounds, is there a way to alter this setting? Or is so intertwined with the very "nature" of Wine that it can't fixed without re-programming the whole thing?

    The wine source is available from the winehq site (there is a wiki entry on doing a regression that shows how to get the source). It is huge. If you fix this without killing all the rest, they will test it and if it doesn't cause any regressions they will add you to the development team if you are so inclined. I don't think it is being worked on. I did one regression for them that took a couple of days, but I did find and isolate a bug. It depends on how keen you are feeling. The whole business comes wrapped up in git, which is a source control and regression system. It slings stuff around very well, but if you don't have a recent multiprocessor, I wouldn't get involved. On my XP machine, initial compiles took four hours. On this machine they take about half an hour. Much faster with git after the first one.

    • Like 1

    Beware: Emancipated user.  No Windoze for me.
    The teacher opens the door but the student must enter himself. - Ancient Chinese Saying

    Every minute of hate in which one indulges oneself is sixty seconds of happiness lost.
    Music expresses that which cannot be put into words and that which cannot remain silent. -- Victor Hugo
    If you always do what you've always done, you'll mostly get what you've always got.
    JohnNewSig.gif
    "We have met the enemy, and he is us" - Walt Kelly

    Come join us at the Moose Factory

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Oh, no, no programming abilities here. A pity...seems XP doesn't get dragged out to the shed in back just yet.

    Although, while off subject, perhaps you could answer another question? You do seem quite the knowledge base. :D

    Earlier today I was looking for ways to speed up SC4's loading. On average, takes 3 minutes to load when starting it from a cold boot. Subsequent loads, 2 minutes.

    The subsequent loads number is the one I'm curious about. Normally I'd caulk it up to the game loading files to a swap space. Except, I have the swap file on XP disabled. Everything loads to RAM, and RAM usage is mostly identical after exiting the game as it was when I started it.

    Fiddling around in the registry, I found the following:

    HKEY_LOCAL_MACHINE\SOFTWARE\Maxis\SimCity 4

    One of the keys says "CacheSize" next to it. So logically, I zero'd out the number it contained. Still, first load takes 3 minutes, subsequent loads take 2 minutes. No noticeable effect.

    Clearly it's putting information SOMEWHERE during the first load that it accesses on all other loads, but I can't for the life of me figure it out. A temporary, hardcoded swap file it creates? Is it making a list of files during the initial loading that helps it load things more quickly the next time? Is the video card's ram being filled with crap?

    Most importantly...is there any way to track this behavior down to its source? In the end, I might not be able to change anything. But it'd sure be nice to know what's going on!

    Thank you. ^_^


      Edited by Mister Giggles  

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    I play SC4 in Linux Mint. The performance of the game is great, more beter than Win XP. The Advice of A Nonny Moose is excellet, you should take it. Actually I did a guide in spanish of installing SC4 in Linux Mint, is of the version 8 and 9, but It still works at the same way:

    http://alejandro24blog.blogspot.com/2010/04/simcity-4-en-linux.html

    http://alejandro24blog.blogspot.com/2010/07/simcity-4-en-linux-notas-adicionales.html


    linux_user.png

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Thanks for the good words, Alejandro.

    You don't need to be a programmer unless you want to monkey with the source code of, say, wine. This is not necessary. You can use it as it stands.

    FYI, today I spent most of the afternoon upgrading my copy of Ubuntu to 11.10, which runs SC4 under wine as well as it runs on W7. However, I am talking to you from LinuxMint 11 (Katia). I find that I like the Mint interface better, and I think it is also slightly faster by not having so much desktop junk.

    Now, about your XP discovery.

    When windows loads a program, it has to create a virtual operations unit the first time the program is called. It creates segment and/or page tables, and divides the program into executable, read-only, and writable pages. This file is kept around unless something else requires its space. So the first time takes a bit longer. I am going to reveal a deep dark secret of virtual operating systems. There is no part of the program in memory when the dispatcher (program scheduler) first transfers to it.

    "What, you say?" Well, here is what happens. After virtualizing the program and loading all its pages in the operations unit space, the program is initiated by putting the start address in the dispatcher queue, loading the page table, and kicking the dispatcher to run the program. The dispatcher transfers to the start address, but this code is not in memory. Instead, there is a page table translation by the hardware and lo and behold, the page is marked valid but not in memory. This causes a page fault which is a kind of software interrupt, and the memory control logic hands this fault to the virtual memory control system which reads the page in, the transfers control back to the dispatcher to try again, and the program starts.

    As the program runs though various routines, more pages are read in as the are found not in memory until the working set of pages for the program is present. If any part of the program writes on one of the data pages, this page is marked "dirty" by the hardware, and if it is necessary to replace this page because another page must be read in, the dirty page is written out to the backing store (swap file), and the new "clean" page is brought in. When the page that was written on the backing store is needed again, it is read in, still marked dirty. Clean pages are always read from the operations unit.

    End of brief description of how virtual memory works.

    And by the way, they all work this way, except Linux tends to use more of the virtual capability than windows. In addition to paging, it also uses segmentation, and the executable programs that are native to the operating system are already virtualized by the linker. So, when one of these programs is launched, only the segmentation table is read in, and the rest is handled by segment faults to get the page tables and page faults to get the text of the program. Sounds complicated, but it simply makes use of modern hardware.

    Oh, and did I say that I am a retired professor of computer science? I like to play with operating systems.


      Edited by A Nonny Moose  
    • Like 1

    Beware: Emancipated user.  No Windoze for me.
    The teacher opens the door but the student must enter himself. - Ancient Chinese Saying

    Every minute of hate in which one indulges oneself is sixty seconds of happiness lost.
    Music expresses that which cannot be put into words and that which cannot remain silent. -- Victor Hugo
    If you always do what you've always done, you'll mostly get what you've always got.
    JohnNewSig.gif
    "We have met the enemy, and he is us" - Walt Kelly

    Come join us at the Moose Factory

    Share this post


    Link to post
    Share on other sites
  • Original Poster
  • Posted:
    Last Online:  
     

    Professor, I fear you wasted an extremely well-written and intentioned description on a stump. I'm ashamed to say I barely understood any of it.

    Sure, I can install operating systems, troubleshoot hardware problems, bring dead computers back to life, but the programming of it all is a whole other beast. The SCIENCE that makes the hardware do something useful is something I never learned, and only vaguely understand. I know, however, to respect the people who can do something with it. Modern day wizardry, damn near.

    That said, to make sure I understand the gist if not the substance of your post:

    When a program loads for the first time, Windows makes something of a "map" of the program that is kept in memory. It is for this reason that subsequent loads are faster. This "map" is retained until some other program requires the memory space it's taking up.

    As for Wine, I am aware it can simply be installed and enjoyed. :) Changing its source code, however, is beyond me.

    P.S.: I want to make it clear I sincerely appreciate your attempts to enlighten me! It's not your fault I'm a F student. <_<


      Edited by Mister Giggles  

    Share this post


    Link to post
    Share on other sites
    Posted:
    Last Online:  
     

    Oh, that's OK. If you don't partake of the syrup of programming, it is insignificant to getting what you want out of your computer. Just go ahead and dual load up Ubuntu or LinuxMint. You'll probably be more at home in Mint than Ubuntu, but everyone to his taste.


    Beware: Emancipated user.  No Windoze for me.
    The teacher opens the door but the student must enter himself. - Ancient Chinese Saying

    Every minute of hate in which one indulges oneself is sixty seconds of happiness lost.
    Music expresses that which cannot be put into words and that which cannot remain silent. -- Victor Hugo
    If you always do what you've always done, you'll mostly get what you've always got.
    JohnNewSig.gif
    "We have met the enemy, and he is us" - Walt Kelly

    Come join us at the Moose Factory

    Share this post


    Link to post
    Share on other sites

    Sign In or register to comment...

    To comment in reply, you must be a community member

    Sign In  

    Already have an account? Sign in here.

    Sign In Now

    Create an Account  

    Sign up to join our friendly community. It's easy!  

    Register a New Account

    Sign In to follow this  

    • Recently Browsing   0 members

      No registered users viewing this page.

    ×

    Thank You for the Continued Support!

    Simtropolis depends on donations to fund site maintenance costs.
    Without your support, we just would not be in our 24th year online!  You really help make this a great community. *:thumb:

    But we still need your support to stay online. If you're able to, please consider a donation to help us stay up and running. This helps sustain a platform where we can share our community creations for years to come.

    Make a Donation, Get a Gift!

    Expand your city with the best from the Simtropolis Exchange.
    Make a Donation and get one or all three discs today!

    STEX Collections

    By way of a "Thank You" gift, we'd like to send you our STEX Collector's DVD. It's some of the best buildings, lots, maps and mods collected for you over the years. Check out the STEX Collections for more info.

    Each donation helps keep Simtropolis online, open and free!

    Thank you for reading and enjoy the site!

    More About STEX Collections