The International Simutrans Forum

 

Author Topic: Upgraded Code  (Read 19055 times)

0 Members and 1 Guest are viewing this topic.

Offline TurfIt

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 1326
Re: Upgraded Code
« Reply #35 on: February 26, 2014, 05:29:43 PM »
It's about as simple as can be. All the required libraries except SDL are already installed, eliminating the usual major pain.
1. Install XCode
2. Install the Command Line Tools - 'xcode-select --install'  (not sure needed for SDL2, they were for SDL1 else missing cocoa headers, but SDL2 isn't using the cocoa stub, but no harm installing anyway)
3. Checkout the source
4. Apply my patch from the Mac makefile improvement thread
5. Setup config.default
6. make
That's it. If you want the nightly translations, the distribute script works, but the part where it tries to create an .app doesn't.

Offline transporter

  • *
  • Posts: 136
Re: Upgraded Code
« Reply #36 on: February 26, 2014, 06:12:29 PM »
I just downloaded X11 the other day..Now to see what I can do

Offline BR84

  • *
  • Posts: 14
  • Languages: GE, EN
Re: Upgraded Code
« Reply #37 on: February 27, 2014, 04:26:55 AM »
What I have done:
1. Installed xcode5 incl. command line tools
2. Checkout the source fails in reason xcode5 always ask for password. Versions works fine without password. xcode5 has no repository manager anymore...:-(
3. checked out by Versions and added the files in xcode project
4. Added the the recommended patch from makefile improvement thread
5. Setup config.default fails ---- can activate SDL and MAC but no idea what are the other requested FLAGS to set or not

So far xcode always complains about "dataobj\koord3d.h" - no such file or directory. But is visible at left side structure. If try to fix, xcode ask for repository password again.

so far I am not successful.....but will work on it

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2908
  • D'oh
    • by An_dz
  • Languages: pt, en, it, (de)
Re: Upgraded Code
« Reply #38 on: February 27, 2014, 05:09:02 PM »
5. Setup config.default fails ---- can activate SDL and MAC but no idea what are the other requested FLAGS to set or not
The required are BACKEND, OSTYPE and COLOUR_DEPTH. I guess you need BACKEND=sdl2. The rest is optional.
You may also try MULTI_THREAD=1 later.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5543
  • Languages: EN, NO
Re: Upgraded Code
« Reply #39 on: February 27, 2014, 05:52:11 PM »
OPTIMIZE = 1 is probably also a good idea.

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2269
Re: Upgraded Code
« Reply #40 on: February 28, 2014, 06:58:00 AM »
The required are BACKEND, OSTYPE and COLOUR_DEPTH. I guess you need BACKEND=sdl2. The rest is optional.
You may also try MULTI_THREAD=1 later.
MULTI_THREAD already defaults to 1, you should set to the number of cores your machine has if it's different to this.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5543
  • Languages: EN, NO
Re: Upgraded Code
« Reply #41 on: February 28, 2014, 08:09:30 AM »
MULTI_THREAD already defaults to 1, you should set to the number of cores your machine has if it's different to this.

In my experience, multithreading (as Simutrans currently does it) isn't needed, so the usefulness of doing this varies from computer to computer apparently.

Offline kierongreen

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 2269
Re: Upgraded Code
« Reply #42 on: February 28, 2014, 11:01:16 AM »
Multithreading significantly speeds up rendering, switching to/from underground view and map rotation.

Offline TurfIt

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 1326
Re: Upgraded Code
« Reply #43 on: February 28, 2014, 11:42:03 AM »
MULTI_THREAD already defaults to 1, you should set to the number of cores your machine has if it's different to this.
Not any more... threads= in simuconf.tab should be set to number of cores. MULTI_THREAD=1 in makefile enables threading at all.


In my experience, multithreading (as Simutrans currently does it) isn't needed, so the usefulness of doing this varies from computer to computer apparently.
Higher resolutions (>1920x1200) are really annoying/bordering unplayable without the multithreaded rendering.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5543
  • Languages: EN, NO
Re: Upgraded Code
« Reply #44 on: February 28, 2014, 04:39:09 PM »
Higher resolutions (>1920x1200) are really annoying/bordering unplayable without the multithreaded rendering.

Maybe, but 1920x1080 runs smooth as anything for me, except at when zoomed far out, something I never do anyway as things are too tiny to see. It is also said that Simutrans suffers badly when compiled as 64-bit rather than 32-bit since the hand optimized assembly code won't be used, but I am no longer the only one to have played 64-bit Simutrans without problems.

Multithreading significantly speeds up rendering, switching to/from underground view and map rotation.

Map rotation I can understand, but I never use that feature. I'm not comfortable with how it's implemented. It's too fragile for my taste. But this has been discussed before, and showing the map from different angles without actually changing the map to face that way is currently virtually impossible.

My point is that there is no need to start tweaking MULTI_THREAD for personal builds unless you notice that Simutrans still doesn't perform well enough.

Offline BR84

  • *
  • Posts: 14
  • Languages: GE, EN
Re: Upgraded Code
« Reply #45 on: March 01, 2014, 04:01:21 PM »
Folks, thanks for your kind advices & support.
Just detected there is something more than using xcode only. So far I need to get allegro installed and running, but not sure if I am going with MacPorts or homebrew for this...
Time to time I'll keep working on it.
If it is successful done I'll summarize it for other newbies trying to make ST running on OSX.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5543
  • Languages: EN, NO
Re: Upgraded Code
« Reply #46 on: March 01, 2014, 04:49:00 PM »
You shouldn't need Allegro unless you prefer that over SDL. I think the Allegro support in Simutrans is only for Haiku or something.

Offline BR84

  • *
  • Posts: 14
  • Languages: GE, EN
Re: Upgraded Code
« Reply #47 on: March 01, 2014, 05:57:01 PM »
The build in xcode always come with allegro.h missing error - the allegro header is called by allegroo.cc in sound folder

Offline TurfIt

  • Dev Team, Coder/patcher
  • Devotee
  • *
  • Posts: 1326
Re: Upgraded Code
« Reply #48 on: March 01, 2014, 06:03:40 PM »
If you're trying to compile from some sort of IDE, you're on you own. But, you appear to be adding too many files. See the makefile for what files should be included for the various OS and backend options. i.e. You don't compile every file in the source.

The steps I listed above are for compiling from the command line using the makefile. The only sensible way IMHO.

Offline BR84

  • *
  • Posts: 14
  • Languages: GE, EN
Re: Upgraded Code
« Reply #49 on: September 14, 2014, 08:46:44 AM »
Got lost for few months in company projects and lot of travelling.
Now is more time to care about ST again, but noticed that "svn://tron.homeunix.org/simutrans/simutrans/trunk --username anon" will not work anymore. Did not follow up complete now.
What is actually the working checkout command?
Also the exact make command incl. parameters to know would be very helpful.
I am not programmer even joined some courses about. But this has been 25 years ago ;-)
In fact I am working with MacBook Pro (early 2011 series) and think it should be possible to follow up al the advices above.
Once I get it working, it shall be possible to provide a working OSX release (with better performance than the cross compiled one) at least once a month, always related to the latest nightly.
I am offering my support in this way, please help to make it happen.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5543
  • Languages: EN, NO
Re: Upgraded Code
« Reply #50 on: September 14, 2014, 09:01:29 AM »
Now is more time to care about ST again, but noticed that "svn://tron.homeunix.org/simutrans/simutrans/trunk --username anon" will not work anymore.

The documentation was upgraded long ago: http://www.simutrans.com/en/develop#code If you already have checked out, and even modified, some code, the exact SVN command for switching was posted on the forum somewhere. It was long ago, so it has probably dropped very far down in the topic lists.

Also the exact make command incl. parameters to know would be very helpful.
[...]
In fact I am working with MacBook Pro (early 2011 series)

I think building for Mac is a special thing, at least for the native builds. There is also how to make sure you have the libraries Simutrans needs installed, which is slightly different between native build and SDL build. You'll have to wait for some Mac developer to come through for that. I can't help you there.

Offline BR84

  • *
  • Posts: 14
  • Languages: GE, EN
Re: Upgraded Code
« Reply #51 on: September 14, 2014, 09:24:00 AM »
Thanks for fast answer! Found the switch thread.
Sudo svn checkout svn://tron.yamagi.org/simutrans works fine for me. checked out V7318 by today.
Changes advised by TurfIt also ok. Config setup done.
Now dealing with make command. hope one Mac developer can give some additional suggestions to createnative 32bit Simutrans.app

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9568
  • Languages: De,EN,JP
Re: Upgraded Code
« Reply #52 on: September 14, 2014, 08:26:09 PM »
I think Timothy had once a native patch but sadly it was not complete and hence not source for it.

In principle, not much is needed. Elementary events need to be processed and the graphics need to be copied to the screen using a blitter.