my folly: direct controllable road vehicles
Moderator: OpenTTD Developers
-
- Engineer
- Posts: 17
- Joined: 18 Jul 2004 18:19
my folly: direct controllable road vehicles
Hi freaks,
some days I though about how funny it would be to control openttd's road vehicles directly. I took as a small exercise to work myself into the codebase and finished it last night.
Note: The patch is for the SDL version only.
What you can do:
(all commands are transferred to the vehicle through its detail window)
keypad minus: toggle between normal control and direct control mode
kp 4: steer left
kp 6: steer right
kp 5: drive straight ahead (may cancel a former request to steer or turn)
kp enter: turn around
kp 8: increase tempomat speed
kp 2: decrease tempomat speed
kp 0: full stop (tempomat speed to zero)
kp plus: full throttle (tempomat speed to max_speed)
Note that although it is named direct control the vehicle works according to the game's rules. that means that you cannot leave the road tiles with this. furthermore the algorithm automatically adjusts movement if you try to steer in an invalid direction.
the steer commands are "executed" when the vehicle enters a new tile.
In dc mode the detail window will shows your current command and tempomat speed in green and the real velocity in black.
"for what is this useful?"
For nothing really. I did it for fun and to train my C skills a bit. furthermore
its the "matrix-style" of free software: I have the tools and the knowledge to modify the world, so why not do it.
Maybe someone else gets inspired to do something useful out of this (taxi driving? what about this mechwarrior thingie someone spoke on this board?).
here is a screenshot:
the patch can be applied to the openttd 0.4.0 sources.
beware: I modified the language files english.txt and german.txt a bit. OTTD will crash if you use another language without having defined the few extra strings. add them yourself (its easy look at the last lines in english.txt) or use english/german.
have fun
thebohemian
some days I though about how funny it would be to control openttd's road vehicles directly. I took as a small exercise to work myself into the codebase and finished it last night.
Note: The patch is for the SDL version only.
What you can do:
(all commands are transferred to the vehicle through its detail window)
keypad minus: toggle between normal control and direct control mode
kp 4: steer left
kp 6: steer right
kp 5: drive straight ahead (may cancel a former request to steer or turn)
kp enter: turn around
kp 8: increase tempomat speed
kp 2: decrease tempomat speed
kp 0: full stop (tempomat speed to zero)
kp plus: full throttle (tempomat speed to max_speed)
Note that although it is named direct control the vehicle works according to the game's rules. that means that you cannot leave the road tiles with this. furthermore the algorithm automatically adjusts movement if you try to steer in an invalid direction.
the steer commands are "executed" when the vehicle enters a new tile.
In dc mode the detail window will shows your current command and tempomat speed in green and the real velocity in black.
"for what is this useful?"
For nothing really. I did it for fun and to train my C skills a bit. furthermore
its the "matrix-style" of free software: I have the tools and the knowledge to modify the world, so why not do it.
Maybe someone else gets inspired to do something useful out of this (taxi driving? what about this mechwarrior thingie someone spoke on this board?).
here is a screenshot:
the patch can be applied to the openttd 0.4.0 sources.
beware: I modified the language files english.txt and german.txt a bit. OTTD will crash if you use another language without having defined the few extra strings. add them yourself (its easy look at the last lines in english.txt) or use english/german.
have fun
thebohemian
- Attachments
-
- openttd-dc.diff
- patch for direct controlled vehicles for plain openttd 0.4.0 source code (as provided via sourceforge)
- (14.37 KiB) Downloaded 344 times
-
- Tycoon
- Posts: 1966
- Joined: 21 May 2004 07:39
- Location: Singapore
Wow, that's genius! Lot of potential with controlling your own trains...
...Synthetic Intelligent Organism Normally for Infiltration and Dangerous Exploration...
...sionide.net...
...sionide.net...
Looking good, it'd be wicked if we could use it on trains!
James
James
(British) Modular Stations Set - Thread: | Website:
Swiss Set - Thread: | Website:
Route Map Creator
My Screenshot Thread
Swiss Set - Thread: | Website:
Route Map Creator
My Screenshot Thread
-
- Engineer
- Posts: 17
- Joined: 18 Jul 2004 18:19
Really I think this is just not useful but can be fun. I do not have much time these days but I think about adding direct control for other vehicles later.
If someones wants to enhance my patch in the meantime and has problems understanding parts of it just contact me. One bit that may be confusing is the bit fiddling for the road vehicle animations. Just take a look at this and the code and you will certainly understand http://page.mi.fu-berlin.de/~rschuste/o ... ement.jpeg (watch the bit masks!!)
btw: ottd road vehicles cannot crash into each other. thats lame
If someones wants to enhance my patch in the meantime and has problems understanding parts of it just contact me. One bit that may be confusing is the bit fiddling for the road vehicle animations. Just take a look at this and the code and you will certainly understand http://page.mi.fu-berlin.de/~rschuste/o ... ement.jpeg (watch the bit masks!!)
btw: ottd road vehicles cannot crash into each other. thats lame
IDEA OMG THAT'S AN IDEA!!
One can use this patch to create the waypoints along with orders.
This way, road vehicles will go anywhere player had set!
This will be useful and easy way to tell trucks to use specified way, like via the bridge instead of via the railway crossing.
It would be new era of road vehicles if someone makes trucks' paths based on user-made waypoints!!
One can use this patch to create the waypoints along with orders.
This way, road vehicles will go anywhere player had set!
This will be useful and easy way to tell trucks to use specified way, like via the bridge instead of via the railway crossing.
It would be new era of road vehicles if someone makes trucks' paths based on user-made waypoints!!
MeusH, an easier way to avoid railway crossings is to apply my patch... see part of http://www.tt-forums.net/viewtopic.php?p=284724
Re: my folly: direct controllable road vehicles
Sounds like U-Drive-It in Simcity 4: Rush Hour. Although I didn't try this patch, I think that it could be fun once in a while. Just like U-Drive-It.theBohemian wrote:some days I though about how funny it would be to control openttd's road vehicles directly. I took as a small exercise to work myself into the codebase and finished it last night.
-
- Tycoon
- Posts: 11501
- Joined: 20 Sep 2004 22:45
Checkout (from SVN) or download (from sf.net or nightlies.openttd.org) a copy of the source code. Use either TortiseSVN or patch(1) to apply the diff, and then compile with $COMPILER_OF_CHOICE.
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
if this evolves, one could make this game into RTS
select a group of evil buses and make a raid at enemy city (bus-rush ) X]
you could make road blocks with busses, trucks etc. (police cars? )
you know, now we have to design some tanks, warships, battle planes, and panzerwagons and implement "fire" feature, and the game might get a new dimension to its gameplay
heh.... openttd-capture-the-flag (bus-only) <lol>
this is neat.
racing championships also sound fun
---------------------------------------------
maybe we should suggest the developers to code some plugin support into the game. who knows what might pop-up? people could get encouraged to make modifications
select a group of evil buses and make a raid at enemy city (bus-rush ) X]
you could make road blocks with busses, trucks etc. (police cars? )
you know, now we have to design some tanks, warships, battle planes, and panzerwagons and implement "fire" feature, and the game might get a new dimension to its gameplay
heh.... openttd-capture-the-flag (bus-only) <lol>
this is neat.
racing championships also sound fun
---------------------------------------------
maybe we should suggest the developers to code some plugin support into the game. who knows what might pop-up? people could get encouraged to make modifications
- bobingabout
- Tycoon
- Posts: 1850
- Joined: 21 May 2005 15:10
- Location: Hull, England
i like the idea of adding this to trains, together with a decouple command. problem would be controling coupling....
JPG SUX!!! USE PNG!!!
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.
[/url]
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.
[/url]
Who is online
Users browsing this forum: No registered users and 1 guest