working on c# port of openttd
Moderator: OpenTTD Developers
working on c# port of openttd
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!
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 29 Jul 2006 13:40, edited 1 time in total.
-
- Tycoon
- Posts: 1828
- Joined: 10 Jul 2006 00:43
- Location: Spain
C#
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--.
-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.
- [list][*]Why use PNG screenshots in 8 bpp games.
[*]Caravan site New Industry. · Spain set. · Some spanish trains for locomotion[*]Favourites:GRVTS · ECS · FIRS
Re: working on c# port of openttd
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.
why not code this in C/C++, where it's actually planned to be coded and some work have already been done.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)
Re: working on c# port of openttd
And will these two override newgrf files, or will it be the other way around?exe wrote:- ideally all data of vehicle types, industries, cargos should be defined in external text files.
- new graphics support
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
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
-
- Engineer
- Posts: 63
- Joined: 26 Aug 2005 15:12
Re: working on c# port of openttd
Override, one would hope. Then you can make use of a newgrf's graphics, and do what you like to the values.DaleStan wrote:And will these two override newgrf files, or will it be the other way around?exe wrote:- ideally all data of vehicle types, industries, cargos should be defined in external text files.
- new graphics support
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
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.Snuk the Great wrote:I agree with Bjarni, however you probably live in a free country, so I wont stop you.
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.
-
- Engineer
- Posts: 63
- Joined: 26 Aug 2005 15:12
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.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.
To make a long story short. I agree with Bjarni, and I think its a waste of time.
Snuk the Great
Re: working on c# port of openttd
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.Bjarni wrote: why not code this in C/C++, where it's actually planned to be coded and some work have already been done.
Re: working on c# port of openttd
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.exe wrote:Bjarni wrote:OpenTTD is not written in "c/c++" but in pure c
Re: working on c# port of openttd
Didn't it used to be a mix of C and ASM?Bjarni wrote:It used to be pure C, but not anymore.
We Am De Best
Host of ThroughTheTube site
Host of ThroughTheTube site
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"? )
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"? )
Re: working on c# port of openttd
noSacro wrote:Didn't it used to be a mix of C and ASM?
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.
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.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"? )
two current screenshots:
- Attachments
-
- screen04.PNG (78.01 KiB) Viewed 6983 times
-
- screen05.PNG (40.58 KiB) Viewed 6982 times
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
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
-
- Engineer
- Posts: 63
- Joined: 26 Aug 2005 15:12
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.
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'!
Patches (OpenTTD): Improved smooth_economy [in trunk], More (diesel) smoke [in trunk], Realistic_acceleration finetune.
Keep 'em rollin'!
Who is online
Users browsing this forum: No registered users and 18 guests