Transport Tycoon Forums

The place to talk about Transport Tycoon
It is currently Wed Mar 20, 2019 6:53 pm

All times are UTC




Post new topic  Reply to topic  [ 41 posts ]  Go to page 1 2 3 Next
Author Message
PostPosted: Wed Jul 19, 2006 1:01 pm 
Offline
Engineer
Engineer

Joined: Thu May 06, 2004 3:20 pm
Posts: 54
Hello! I'm working on c# port of OpenTTD. :)

some of the new features:

- ideally all data of vehicle types, industries, cargos should be defined in external text files.
- new prices, some economy rework to keep game challenging even after many many train routes are built, for ex very high inflation.
- new graphics support
- pluggable ai and bots

code changes:

- more oo and encapsulation, for example map which can be accessed only by Map class methods.
- windowprocs, windowdescs, widgetids replaced by virtual classes and methods like OnPaint(); commands packed into command objects; abstract tileprocs class
- ini options replaced by simple xml serialization of options class
- remove low level optimizations, especially in areas of gui, graphics rendering, except of optimizations of map storage and in other performance sensitive places pointed by a profiler.
- adding more and more unit tests (NUnit)

Graphics are opened directly through .pcx files generated by grfcodec, which were converted to .png and colorkey converted to alpha 0.

Speed: Game will propably be somewhat slower, but i don't think there will be much problems on 1024x1024 map.
Portability: I guess it should be possible to make it run on platforms other than windows with mono.

There is still very much to be done, but porting is quite mechanic so its moving steadily. I'd be glad for any comments or ideas!


Last edited by exe on Sat Jul 29, 2006 1:40 pm, edited 1 time in total.

Top
   
 Post subject:
PostPosted: Wed Jul 19, 2006 1:03 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Wed Oct 15, 2003 10:00 pm
Posts: 2566
Location: Jarrow, UK
Best wishes on your endeavour. I'm not aware of a C# compiler for Linux, so unfortunately I won't be able to enjoy the fruits of your labour, but it'll be nice to see it.

_________________
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED


Top
   
 Post subject: C#
PostPosted: Wed Jul 19, 2006 2:28 pm 
Offline
Tycoon
Tycoon

Joined: Mon Jul 10, 2006 12:43 am
Posts: 1808
Location: Spain
Some problems:
-New bugs: translating de code can create new bugs.
-Priority: is more importan write features than write the same game but with other code.
-Procesing power: C# needs more procesing power than C or C++.
I think that C is a better programing languaje for this game, but you can do it and continue the project yourself with a fork, the actual openttd team can continue the project with c languaje.

I dont like C# in my opinion I call It c--.

_________________
Sorry if my english is too poor, I want learn it, but it isn't too easy.


Top
   
PostPosted: Wed Jul 19, 2006 4:34 pm 
Offline
Tycoon
Tycoon

Joined: Mon Mar 08, 2004 1:10 pm
Posts: 2088
if you understand the code good enough to do this, then you can spend your time way better coding patches in C/C++, so we will work towards a common goal.

exe wrote:
some goals:

- ideally all data of vehicle types, industries, cargos should be defined in external text files.
- new prices, some economy rework to keep game challenging even after many many train routes are built, for ex very high inflation.
- new graphics support
- pluggable ai and bots

code changes:

- more oo and encapsulation, for example map which can be accessed only by Map class methods.
- windowprocs, windowdescs, widgetids replaced by virtual classes and methods like OnPaint(); commands packed into command objects; abstract tileprocs class
- ini options replaced by simple xml serialization of options class
- remove low level optimizations, especially in areas of gui, graphics rendering, except of optimizations of map storage and in other performance sensitive places pointed by a profiler.
- adding more and more unit tests (NUnit)


why not code this in C/C++, where it's actually planned to be coded and some work have already been done.


Top
   
PostPosted: Wed Jul 19, 2006 5:03 pm 
Offline
TTDPatch Developer
TTDPatch Developer

Joined: Wed Feb 18, 2004 3:06 am
Posts: 10285
exe wrote:
- ideally all data of vehicle types, industries, cargos should be defined in external text files.
- new graphics support

And will these two override newgrf files, or will it be the other way around?

_________________
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser


Top
   
 Post subject:
PostPosted: Wed Jul 19, 2006 5:35 pm 
Offline
Engineer
Engineer

Joined: Fri Aug 26, 2005 3:12 pm
Posts: 63
I agree with Bjarni, however you probably live in a free country, so I wont stop you.

_________________
Snuk the Great


Top
   
PostPosted: Wed Jul 19, 2006 6:05 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Wed Oct 15, 2003 10:00 pm
Posts: 2566
Location: Jarrow, UK
DaleStan wrote:
exe wrote:
- ideally all data of vehicle types, industries, cargos should be defined in external text files.
- new graphics support

And will these two override newgrf files, or will it be the other way around?

Override, one would hope. Then you can make use of a newgrf's graphics, and do what you like to the values.

_________________
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED


Top
   
 Post subject:
PostPosted: Wed Jul 19, 2006 6:07 pm 
Offline
Tycoon
Tycoon

Joined: Mon Mar 08, 2004 1:10 pm
Posts: 2088
Snuk the Great wrote:
I agree with Bjarni, however you probably live in a free country, so I wont stop you.

this have nothing to do with where exe lives, but the fact that OpenTTD is GPL allows him to do stuff like this if he just follow some basic rules.
He got the freedom to do a lot of stuff to his own copy of the game, including stuff that likely turns out to be a waste of time. Once you are done (say it will take you a year, maybe more) image how many new features there will be in OpenTTD that have been added in the meantime, that you will have to port as well. In a sense, you will never be done because you are just one person and there are a lot of people working on OpenTTD, so odds are that you can't keep up.


Top
   
 Post subject:
PostPosted: Wed Jul 19, 2006 9:00 pm 
Offline
Engineer
Engineer

Joined: Fri Aug 26, 2005 3:12 pm
Posts: 63
Bjarni wrote:
this have nothing to do with where exe lives, but the fact that OpenTTD is GPL allows him to do stuff like this if he just follow some basic rules.
He got the freedom to do a lot of stuff to his own copy of the game, including stuff that likely turns out to be a waste of time. Once you are done (say it will take you a year, maybe more) image how many new features there will be in OpenTTD that have been added in the meantime, that you will have to port as well. In a sense, you will never be done because you are just one person and there are a lot of people working on OpenTTD, so odds are that you can't keep up.

Lol. The country thing was a different use of the expression "its a free country". Meaning that he can do what he want. However I probably could not say that because he probably lives in different country. So I used "you probably live in a free country". So its in a figure of speach. Sorry it confused you.

To make a long story short. I agree with Bjarni, and I think its a waste of time.

_________________
Snuk the Great


Top
   
PostPosted: Thu Jul 20, 2006 4:28 pm 
Offline
Engineer
Engineer

Joined: Thu May 06, 2004 3:20 pm
Posts: 54
Bjarni wrote:
why not code this in C/C++, where it's actually planned to be coded and some work have already been done.

OpenTTD is not written in "c/c++" but in pure c, so a port to c++ still requires much work and to fork. From my gamer's perspective not much changed in openttd in last two years; last cool features were big maps and a stable multiplayer. I think having OpenTTD in c# or even c++ would allow to add new features much easier without going around c limitations,and then it is still a little work compared to various projects of writing new transport games from scratch.


Top
   
PostPosted: Thu Jul 20, 2006 4:47 pm 
Offline
Tycoon
Tycoon

Joined: Mon Mar 08, 2004 1:10 pm
Posts: 2088
exe wrote:
Bjarni wrote:
OpenTTD is not written in "c/c++" but in pure c

when I say that it's C/C++, then it's C/C++. Check out the newest revision from the svn server or the nightly build source (more or less the same), then you will see that features such as YAPF is written in C++. It used to be pure C, but not anymore.


Top
   
PostPosted: Thu Jul 20, 2006 11:45 pm 
Offline
Tycoon
Tycoon

Joined: Sat Jun 18, 2005 9:08 pm
Posts: 1141
Location: Here
Bjarni wrote:
It used to be pure C, but not anymore.


Didn't it used to be a mix of C and ASM?

_________________
We Am De Best

Host of ThroughTheTube site


Top
   
 Post subject:
PostPosted: Fri Jul 21, 2006 12:23 am 
Offline
Traffic Manager
Traffic Manager

Joined: Wed Apr 13, 2005 5:41 am
Posts: 196
Bjarni wrote:
He got the freedom to do a lot of stuff to his own copy of the game, including stuff that likely turns out to be a waste of time.


I don't particularly think that C# is a good idea, but I am curious. Is this what TTDPatch users were saying when OpenTTD started? ;)

-Hazelrah


Top
   
 Post subject:
PostPosted: Fri Jul 21, 2006 10:19 am 
Offline
Engineer
Engineer
User avatar

Joined: Mon May 01, 2006 9:09 am
Posts: 103
C# isn't as sucky as most people claim, sure it takes a bit of extra, and compiling cross-platform can be a bit dodgy (though the MONO project has made a -lot- of progress).. but it works
exe, maybe look at the source of RunUO, it's an uo emulator in C#, got a 'solid' network code that's easily adaptable to anything you want, plus the compiler it uses for custom scripts might be an interesting idea for your project (Can anybody say "Patches without having to recompile"? )


Top
   
PostPosted: Fri Jul 21, 2006 10:25 am 
Offline
Tycoon
Tycoon

Joined: Mon Mar 08, 2004 1:10 pm
Posts: 2088
Sacro wrote:
Didn't it used to be a mix of C and ASM?

no

the newgrf codec contains some ASM code and we added some ASM to OpenTTD to do specific tasks like counting cycles it takes to run a certain function (the timer stuff) to use when optimising and there is a file to add 64 bit windows support, but generally we don't use ASM and never did. It's truly a cross platform source and it works on more or less all hardware.


Top
   
 Post subject:
PostPosted: Wed Jul 26, 2006 10:30 pm 
Offline
Engineer
Engineer

Joined: Thu May 06, 2004 3:20 pm
Posts: 54
Xaroth wrote:
exe, maybe look at the source of RunUO, it's an uo emulator in C#, got a 'solid' network code that's easily adaptable to anything you want, plus the compiler it uses for custom scripts might be an interesting idea for your project (Can anybody say "Patches without having to recompile"? )


i'm not sure if Transport Tycoon needs that much customization, but i think that it would be nice and quite simple to add LUA scripting for game iconsole, to automate some tasks.

two current screenshots:


Attachments:
screen04.PNG
screen04.PNG [ 78.01 KiB | Viewed 4881 times ]
screen05.PNG
screen05.PNG [ 40.58 KiB | Viewed 4880 times ]
Top
   
 Post subject:
PostPosted: Thu Jul 27, 2006 3:06 am 
Offline
TTDPatch Developer
TTDPatch Developer

Joined: Wed Feb 18, 2004 3:06 am
Posts: 10285
Methinks something is broken.

_________________
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser


Top
   
 Post subject:
PostPosted: Thu Jul 27, 2006 9:17 am 
Offline
Tycoon
Tycoon
User avatar

Joined: Wed Oct 15, 2003 10:00 pm
Posts: 2566
Location: Jarrow, UK
DaleStan wrote:
Methinks something is broken.


But my OpenTTD looks like that all the time...

_________________
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED


Top
   
 Post subject:
PostPosted: Thu Jul 27, 2006 7:36 pm 
Offline
Engineer
Engineer

Joined: Fri Aug 26, 2005 3:12 pm
Posts: 63
Brianetta wrote:
DaleStan wrote:
Methinks something is broken.


But my OpenTTD looks like that all the time...

Yeah, thats the way its supposed to be!

_________________
Snuk the Great


Top
   
 Post subject:
PostPosted: Fri Jul 28, 2006 12:03 pm 
Offline
Tycoon
Tycoon
User avatar

Joined: Sat Mar 06, 2004 11:51 pm
Posts: 1499
Location: The sunny side of Alps
Very nice idea, this outside text files and all, especially the patches without compile thing.
Doesn't the Openttd.GPMI team work toward the Quake/UT-like mod system or is that only for AI?

BTW - that landscape there is seriously.....detached. ;)

_________________
NewGRF: Oil Wells in Temperate terrain now can Increase production, Better vehicle names, Use-able default aircraft, Oil Rig for Snowland and Desert, Speed for Suspension bridges.
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.

Keep 'em rollin'!


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 41 posts ]  Go to page 1 2 3 Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000-2019 phpBB Limited

Copyright © Owen Rudge/The Transport Tycoon Forums 2001-2019.
Hosted by Zernebok Hosting.