xboxscene.org forums

OG Xbox Forums => Software Forums => Homebrew & Ported Games => Topic started by: HCl on October 13, 2004, 01:25:00 PM

Title: Open Transport Tycoon Port
Post by: HCl on October 13, 2004, 01:25:00 PM
a while ago i did a port of open transport tycoon to the xbox, just
as a little pet/test project of mine.. wondering whether there's anyone who's
interested in it.

This post has been edited by HCl on Oct 13 2004, 08:25 PM
Title: Open Transport Tycoon Port
Post by: chilin_dude on October 13, 2004, 01:49:00 PM
Hell yes! There was a request in xports thread for it by a few people, so I'm sure that its wanted... And if you've already ported it and it only needs a bit of tweeking then go for it... I can't wait for it  :beer:
Title: Open Transport Tycoon Port
Post by: HCl on October 14, 2004, 06:30:00 PM
looked at it a bit...
fixed some issues...

networking/online play works now,
so does music/keyboard
(keyboard not working was yet another bug in libSDlx, fixed)

that was pretty much all on my todo list... so i guess i'll release it in a while..
Title: Open Transport Tycoon Port
Post by: Boff on October 15, 2004, 02:38:00 AM
just wondering, is the keyboard essential for play with your port, or can everything be controlled via the xbox pad?
Title: Open Transport Tycoon Port
Post by: HCl on October 16, 2004, 08:09:00 AM
don't need keyboard unless you want to change your name, which isn't exactly
needed to play the game...

as for controller/mouse,

i added controller support, but it breaks mouse support, so at the moment its
either one (this is also the last thing that needs fixing before i can really release
anything non-beta) (though i might simply release two .xbe versions, one for mouse and one for controller, if its hard to find/fix the bug)
Title: Open Transport Tycoon Port
Post by: chilin_dude on October 16, 2004, 08:16:00 AM
This sounds ace!!! Cant wait for it... Glad that you don't have to use Kb or mouse!
Title: Open Transport Tycoon Port
Post by: snes on October 16, 2004, 09:20:00 AM
Cool I'm really looking forward to it.Please release it as soon as possible
thx
Title: Open Transport Tycoon Port
Post by: XBOX War3z on October 16, 2004, 05:10:00 PM
yea release it any moment you can :)
Title: Open Transport Tycoon Port
Post by: Boff on October 18, 2004, 05:18:00 AM
I too cant wait for this release  :D  Used to spend hours playing it on the PC
Title: Open Transport Tycoon Port
Post by: zero5 on October 18, 2004, 06:13:00 AM
top stuff   ;)
Title: Open Transport Tycoon Port
Post by: Wolfblade12 on October 19, 2004, 03:07:00 AM
i would love it!
Title: Open Transport Tycoon Port
Post by: HCl on October 21, 2004, 03:24:00 AM
Released on xbins :)

Oh, here's the controller code i was talking about in the nfo:
CODE

  int i;
  xleft=yleft=xright=yright=0;
  for(i=0;i    xleft=SDL_JoystickGetAxis(joy, 0);
    yleft=SDL_JoystickGetAxis(joy, 1);
    xright=SDL_JoystickGetAxis(joy, 2);
    yright=SDL_JoystickGetAxis(joy, 3);
    if(xright>100||xright<-100||yright>100||yright<-100||xleft>100||xleft<-100||yleft>100||yleft<-100)
      break;
  }

  if((xleft>100||xleft<-100||yleft>100||yleft<-100)&&++jscount>=3) {
    int dx=0,dy=0;
    jscount=0;
    if(xleft>22000||xleft<-22000||yleft>22000||yleft<-22000) {
      xleft=xleft > 22000 ? 22000 : xleft < -22000 ? -22000 : xleft;
      yleft=yleft > 22000 ? 22000 : yleft < -22000 ? -22000 : yleft;
    }
    if(xleft>20000||xleft<-20000||yleft>20000||yleft<-20000) {
      dx=xleft/1500;
      dy=yleft/1500;
    }
    else if(xleft>15000||xleft<-15000||yleft>15000||yleft<-15000) {
      dx=xleft/3000;
      dy=yleft/3000;
    }
    else {
       if(xleft>10000)
         dx=2;
       else if (xleft<-10000)
         dx=-2;
       if(yleft>10000)
         dy=2;
       else if(yleft<-10000)
         dy=-2;
       if(dy!=0||dx!=0)
         jscount=-3;
    }
    ev.motion.type=SDL_MOUSEMOTION;
    ev.motion.x=_cursor.pos.x+dx;
    ev.motion.y=_cursor.pos.y+dy;
    if((_cursor.pos.x+dx)<2)
      ev.motion.x=1;
    if(ev.motion.x>_screen.width-2)
      ev.motion.x=_screen.width-1;
    if((_cursor.pos.y+dy)<2)
      ev.motion.y=1;
    if(ev.motion.y>_screen.height-2)
      ev.motion.y=_screen.height-1;
    ev.motion.state=0;
    ev.motion.which=5;
    ev.motion.xrel=dx;
    ev.motion.yrel=dy;
  }


If anyone feels like / is willing to write a better joystick-> mouse function, please,
be my guest... joystick axes range from -32000 to +32000, but on the xbox with my s controllers i noticed they mostly go from around 10000 to around 24000 (-24000 to -10000 for opposite direction) (they go up to +32k and -32k if you pull them all left, all right, or all down/all up, but if you move them to the bottom left or bottom right, they only get to -24000, 24000 and 24000,24000 (handling controller movement without mimicking a mousemovement is also possible, but requires different changes (for if you want to use absolute movement, for example))

This post has been edited by HCl on Oct 21 2004, 10:28 AM
Title: Open Transport Tycoon Port
Post by: Wolfblade12 on October 21, 2004, 03:34:00 AM
and again it doesnt work with me :(
it just goes to evox :blink:
Title: Open Transport Tycoon Port
Post by: XBOX War3z on October 21, 2004, 04:51:00 AM
works here
nice work :)
Title: Open Transport Tycoon Port
Post by: DeathsHead on October 21, 2004, 06:16:00 AM
Thats very nice, only problems I had were on my crappy tv I couldnt see the menu or the status bar.  Also the controls were very sensitive.

Would it be possible to add a sensitivity slider to reduce it?

Also, rather than worrying about scaling, is it possible to adjust the offset of the menu at the top and the status at the bottom?  That may be a simpler way to fix it.
Title: Open Transport Tycoon Port
Post by: HCl on October 21, 2004, 08:44:00 AM
wolfblade, read the readme, there are some files you need to install before it'll work.
(And it writes a logfile which should say what went wrong)

offset is the same thing, they can't be adjusted..
i'm gonna try to alter the graphic routines of openttd so it'll fit..
And about the controllers; see my post about the controller -> mouse port,
i fiddled with it quite a while to see what would work somewhat nicely...
after 3 hours of fiddling, i just went with the best i've come up with.
People are free to write a better controller -> mouseevent function..

I'll prolly be working on dosxbox for a while so don't expect too fast an update
on xottd...

PS.

Here is the controllermapping of xottd, forgot to put it in the nfo:

A button,Left Trigger - left mouse click
B button,Right Trigger - right mouse click
Y button - info click

Left controlstick - mouse
Right controlstick - viewport scroll

This post has been edited by HCl: Oct 21 2004, 03:49 PM
Title: Open Transport Tycoon Port
Post by: Wolfblade12 on October 21, 2004, 10:54:00 AM
sorry double post :o  

This post has been edited by Wolfblade12: Oct 21 2004, 05:55 PM
Title: Open Transport Tycoon Port
Post by: Wolfblade12 on October 21, 2004, 10:54:00 AM
works thanks :rolleyes: nice game btw
Title: Open Transport Tycoon Port
Post by: snes on October 22, 2004, 11:40:00 AM
QUOTE (HCl @ Oct 21 2004, 04:11 PM)
wolfblade, read the readme, there are some files you need to install before it'll work.
(And it writes a logfile which should say what went wrong)

offset is the same thing, they can't be adjusted..
i'm gonna try to alter the graphic routines of openttd so it'll fit..
And about the controllers; see my post about the controller -> mouse port,
i fiddled with it quite a while to see what would work somewhat nicely...
after 3 hours of fiddling, i just went with the best i've come up with.
People are free to write a better controller -> mouseevent function..

I'll prolly be working on dosxbox for a while so don't expect too fast an update
on xottd...

PS.

Here is the controllermapping of xottd, forgot to put it in the nfo:

A button,Left Trigger - left mouse click
B button,Right Trigger - right mouse click
Y button - info click

Left controlstick - mouse
Right controlstick - viewport scroll

Are you planning to make a menu for Dosbox??It would be much easier and Controller support would also be nice
Title: Open Transport Tycoon Port
Post by: DynaMight on October 22, 2004, 05:55:00 PM
I love this game, Thanks for this excellent release.
Title: Open Transport Tycoon Port
Post by: Wolfblade12 on October 23, 2004, 06:18:00 AM
btw. i dont have sound, do you have?

edit: i do have sound but i meant the BGM

edit2: fixed it... i did read the readme but i thought that was for custom soundtracks  :P  

This post has been edited by Wolfblade12: Oct 23 2004, 04:12 PM
Title: Open Transport Tycoon Port
Post by: Damessiah on October 31, 2004, 07:04:00 AM
Hi,

got this from Xbins but having trouble downloading - reading the readme; can someone interpret this for me lol?

'Read the original openttd's readme.txt for installation notes
(you need to have the original transport tycoon deluxe datafiles and copy them to data/)'

Does this mean I have to have the game for the PC? or anything else I can do?
Title: Open Transport Tycoon Port
Post by: Boff on October 31, 2004, 01:06:00 PM
heres the part of the readme you didnt read  :rolleyes:

QUOTE
4.0) Running OpenTTD:
---- ----------------

Before you run OpenTTD, you need to put the game's datafiles into the data/
subdirectory. You need the following files from the original Windows version
of TTD as OpenTTD makes use of the original TTD artwork.

IMPORTANT! You need the files from the WINDOWS version of TTD.

List of the required files:
sample.cat
trg1r.grf
trgcr.grf
trghr.grf
trgir.grf
trgtr.grf

If you want music you need to copy the gm/ folder from Windows TTD into your OpenTTD folder, not your data folder.


If you copy the music over you need to rename the files .mid instead of .gm.  Unfortunatly at the moment you are unable to see the menu/status bars which makes the game virtually impossible to play  :(  Once this is sorted it will the #1 game of choice for me on the xbox  :D  
Title: Open Transport Tycoon Port
Post by: lsd4me on October 31, 2004, 03:41:00 PM
QUOTE (Boff @ Oct 31 2004, 09:33 PM)
If you copy the music over you need to rename the files .mid instead of .gm.  Unfortunatly at the moment you are unable to see the menu/status bars which makes the game virtually impossible to play  :(  Once this is sorted it will the #1 game of choice for me on the xbox  :D

Right this game is basicly unplayable in this form, everything is setup and ready to roll once the screen problems are corrected.
Title: Open Transport Tycoon Port
Post by: HCl on October 31, 2004, 06:01:00 PM
fixed, finally figured out how to use the sdl_xbox_setscreen* functions
(wasn't sure whether it was wanting a percentage, a 0.80 (for 80 percent), or something else, turns out it wants a negative amount of pixels)
(why on earth did lantus make it use floats?)

anyways, i'm too lazy to add a nice config thing, so expect 1.1 on xbins soon
(when i get a hold of h3inrich)

i'll prolly release the source soon as well, along with the source of libsdlx 0.11-HCl
(fixed keyboard, and fixed memory leak, working sdlnet)
(dosbox needed the memory leak fix, xottd needed the keyboard fix)

This post has been edited by HCl: Nov 1 2004, 02:53 PM
Title: Open Transport Tycoon Port
Post by: Boff on November 01, 2004, 01:39:00 AM
excellent news HCl, thanks for all your work on this  :beer:

As I said earlier, once screen is fixed this will be my xbox game of choice for a long time  :D  
Title: Open Transport Tycoon Port
Post by: HCl on November 01, 2004, 06:52:00 AM
Published the source, wait a while till i can catch the xbins staff awake for the
binaries.

http://titania.student.utwente.nl/xbox/