reprogramming, sort of

OpenTTD is a fully open-sourced reimplementation of TTD, written in C++, boasting improved gameplay and many new features.

Moderator: OpenTTD Developers

Post Reply
futhamucka
Engineer
Engineer
Posts: 57
Joined: 16 Sep 2004 01:47

reprogramming, sort of

Post by futhamucka »

hey i dont know a huge amount about programming, but, want to edit a lot of aspects and graphics on openttd, has anyone got any ideas of how i could go about this?

P.S. I'm a mac user so please dont suggest anythng windows based, or i may have to kill you :)
User avatar
toholio
Traffic Manager
Traffic Manager
Posts: 216
Joined: 20 Dec 2004 00:54
Location: S37°56.286' E145°07.628'
Contact:

Post by toholio »

Experiment! You might find OpenTTD a bit to complicated if you don't have much programming experience but there is only one way to be sure.

You should read: http://wiki.openttd.org/index.php/Compiling_on_Mac but to summarise and expand (now that we have openttd.xcode)

The first thing to do is get the right tools, you need:
  1. Fink - http://fink.sourceforge.net/
  2. Xcode and associated tools: http://developer.apple.com/tools/download/
  3. SDL: after installing fink run: fink install sdl
  4. libpng: after installing fink run: fink install libpng3
  5. svn: fink install svn-client
Now you can build the game:
  1. now, get the source by running: svn checkout svn://svn.openttd.org/trunk some_folder_name
  2. go into some_folder_name and open openttd.xcode
  3. Click build
OpenTTD should build and be ready to run!
futhamucka
Engineer
Engineer
Posts: 57
Joined: 16 Sep 2004 01:47

Post by futhamucka »

thanks for that mate:) ill give it a go, also can you program in C on these programs?
futhamucka
Engineer
Engineer
Posts: 57
Joined: 16 Sep 2004 01:47

Post by futhamucka »

plus, how easy dyou reckon it would be to smooth out some of the graphics, as i am a demon with photoshop :twisted:
User avatar
Purno
Tycoon
Tycoon
Posts: 16659
Joined: 30 Mar 2004 12:30
Location: Almere, The Netherlands

Post by Purno »

There's an edit button to edit your messages :wink:
Contributor to the The 2cc Set and Dutch Trainset. Inventor of the Metro concept. Retired Graphics Artist.
Image Image
Download TT | Latest TTDPatch | OpenTTD | OpenTTDCoop | BaNaNaS: OpenTTD content system | 2048² OTTD scenario of the Netherlands
GRF Codec | GRF Crawler | GRF Maker | Usefull graphics & tools sites | NML Documentation Wiki | NFO Documentation Wiki
All my graphics are licensed under GPL. "Always remember you're unique, just like everyone else."
User avatar
orudge
Administrator
Administrator
Posts: 25138
Joined: 26 Jan 2001 20:18
Skype: orudge
Location: Banchory, UK
Contact:

Post by orudge »

futhamucka wrote:thanks for that mate:) ill give it a go, also can you program in C on these programs?
OpenTTD is written in C. I presume xcode is a GUI for Mac OS X that makes the development process a bit easier.
futhamucka wrote:plus, how easy dyou reckon it would be to smooth out some of the graphics, as i am a demon with photoshop :twisted:
A new graphics engine will be worked on in a future version. Some examples of new graphics can be found in the "OpenTTD Graphics" forum, perhaps have a look there?
Bjarni
Tycoon
Tycoon
Posts: 2088
Joined: 08 Mar 2004 13:10

Post by Bjarni »

orudge wrote:
futhamucka wrote:thanks for that mate:) ill give it a go, also can you program in C on these programs?
OpenTTD is written in C. I presume xcode is a GUI for Mac OS X that makes the development process a bit easier.
you are right. It's way easier if you are not used to command line debugging :wink:

About encoding/decoding graphics files (grf files), you will need grfcodec. It do compile on mac, but unfortunately it's little endian hardcoded for file IO, so it will produce garbage data when reading files on big endian (like mac)
Hopefully this will be fixed eventually (I don't think I will have time to look at this soon :( ), but I will for sure make sure that a new graphics format will have endian safe tools
User avatar
toholio
Traffic Manager
Traffic Manager
Posts: 216
Joined: 20 Dec 2004 00:54
Location: S37°56.286' E145°07.628'
Contact:

Post by toholio »

futhamucka wrote:thanks for that mate:) ill give it a go, also can you program in C on these programs?
Yes.
orudge wrote:OpenTTD is written in C. I presume xcode is a GUI for Mac OS X that makes the development process a bit easier.
That's exactly right. Apple's Xcode page has more info.

I'll upload some screenshots with this post.
Attachments
Debugging OpenTTD in Xcode (using GDB)
Debugging OpenTTD in Xcode (using GDB)
openttd-xcode-gdb.png (160.12 KiB) Viewed 311 times
Building OpenTTD in Xcode (using a Makefile target)
Building OpenTTD in Xcode (using a Makefile target)
openttd-xcode-make.png (205.09 KiB) Viewed 304 times
OpenTTD.xcode loaded into Xcode.
OpenTTD.xcode loaded into Xcode.
openttd-xcode.png (143.63 KiB) Viewed 332 times
aantono
Traffic Manager
Traffic Manager
Posts: 211
Joined: 15 Apr 2010 21:01
Location: Midwest, US

Re: reprogramming, sort of

Post by aantono »

Just checked out the code, but can't seem to find the "openttd.xcode" file in there. Any tips on how to properly setup XCode to import the OpenTTD codebase into?
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: reprogramming, sort of

Post by planetmaker »

aantono wrote:Just checked out the code, but can't seem to find the "openttd.xcode" file in there. Any tips on how to properly setup XCode to import the OpenTTD codebase into?
There is no XCode project file in the code base. But you can simply from a terminal compile it: ./configure && make
Checkout our wiki for more details on how to compile.
aantono
Traffic Manager
Traffic Manager
Posts: 211
Joined: 15 Apr 2010 21:01
Location: Midwest, US

Re: reprogramming, sort of

Post by aantono »

I saw somewhere that people were doing code editing and debugging via XCode, so I was trying to find out what is the proper way to configure the XCode project to import the codebase, get the code completion, etc.
User avatar
andythenorth
Tycoon
Tycoon
Posts: 5658
Joined: 31 Mar 2007 14:23
Location: Lost in Music

Re: reprogramming, sort of

Post by andythenorth »

I used to just open the openttd '/src' folder in xcode. I did try configuring an xcode project once, but it didn't seem worth it. I just use TextWrangler now instead. Compile with make.
Post Reply

Return to “General OpenTTD”

Who is online

Users browsing this forum: No registered users and 35 guests