Patch: Juanjo's patches
Moderator: OpenTTD Developers
Re: Patch: Juanjo's patches
How does it compare to default OpenTTD directions?
Do you like drones, quadcopters & flying toys? Check out Drone Strike Force!
Base Music Sets: OpenMSX | Scott Joplin Anthology | Traditional Winter Holiday Music | Modern Motion Music
Other Projects: 2CC Trams | Modern Waypoints | Sprite Sandbox & NewGRF Releases | Ideabox | Town Names | Isle of Sodor Scenario | Random Sprite Repository
Misc Topics: My Screenshots | Forgotten NewGRFs | Unfinished Graphics Sets | Stats Shack | GarryG's Auz Sets
Base Music Sets: OpenMSX | Scott Joplin Anthology | Traditional Winter Holiday Music | Modern Motion Music
Other Projects: 2CC Trams | Modern Waypoints | Sprite Sandbox & NewGRF Releases | Ideabox | Town Names | Isle of Sodor Scenario | Random Sprite Repository
Misc Topics: My Screenshots | Forgotten NewGRFs | Unfinished Graphics Sets | Stats Shack | GarryG's Auz Sets
Re: Patch: Juanjo's patches
The pathfinder itself doesn't provide anything new. But it doesn't rely on finite state machines (so we can modify airport layouts).kamnet wrote:How does it compare to default OpenTTD directions?
Maybe this video can explain the idea behind this feature:
(the graphics of runways and flying aircraft doesn't look good by now)
Formerly known as Juanjo
Re: Patch: Juanjo's patches
Oh, HELLO!!!!! Now I see where you're going with this! Good gawd, man, hurry up and bring this into being!!
Do you like drones, quadcopters & flying toys? Check out Drone Strike Force!
Base Music Sets: OpenMSX | Scott Joplin Anthology | Traditional Winter Holiday Music | Modern Motion Music
Other Projects: 2CC Trams | Modern Waypoints | Sprite Sandbox & NewGRF Releases | Ideabox | Town Names | Isle of Sodor Scenario | Random Sprite Repository
Misc Topics: My Screenshots | Forgotten NewGRFs | Unfinished Graphics Sets | Stats Shack | GarryG's Auz Sets
Base Music Sets: OpenMSX | Scott Joplin Anthology | Traditional Winter Holiday Music | Modern Motion Music
Other Projects: 2CC Trams | Modern Waypoints | Sprite Sandbox & NewGRF Releases | Ideabox | Town Names | Isle of Sodor Scenario | Random Sprite Repository
Misc Topics: My Screenshots | Forgotten NewGRFs | Unfinished Graphics Sets | Stats Shack | GarryG's Auz Sets
Re: Patch: Juanjo's patches
*don'tJuanjo wrote:(the graphics of runways and flying aircraft doesn't look good by now)
It won't be a bug-free playable feature anytime soon. This feature is far from being finished.kamnet wrote:hurry up and bring this into being!!
By the way, I will concentrate on aircraft movement, but I won't spend time on airport graphics right now.
Formerly known as Juanjo
Re: Patch: Juanjo's patches
I'm very excited about the work you're doing here. I hope that this is something which can get fast tracked into OpenTTD proper. But I remember how long we also had to wait for CargoDist. And I know we're going to be waiting a long time for NRT. I just get very excited about these literal game-changing additions, even after all these years.Juanjo wrote:It won't be a bug-free playable feature anytime soon. This feature is far from being finished.kamnet wrote:hurry up and bring this into being!!
By the way, I will concentrate on aircraft movement, but I won't spend time on airport graphics right now.
Do you like drones, quadcopters & flying toys? Check out Drone Strike Force!
Base Music Sets: OpenMSX | Scott Joplin Anthology | Traditional Winter Holiday Music | Modern Motion Music
Other Projects: 2CC Trams | Modern Waypoints | Sprite Sandbox & NewGRF Releases | Ideabox | Town Names | Isle of Sodor Scenario | Random Sprite Repository
Misc Topics: My Screenshots | Forgotten NewGRFs | Unfinished Graphics Sets | Stats Shack | GarryG's Auz Sets
Base Music Sets: OpenMSX | Scott Joplin Anthology | Traditional Winter Holiday Music | Modern Motion Music
Other Projects: 2CC Trams | Modern Waypoints | Sprite Sandbox & NewGRF Releases | Ideabox | Town Names | Isle of Sodor Scenario | Random Sprite Repository
Misc Topics: My Screenshots | Forgotten NewGRFs | Unfinished Graphics Sets | Stats Shack | GarryG's Auz Sets
Re: Patch: Juanjo's patches
These months I have improved several things and I feel like writing an update now.
First of all, the water transport improvements I added were problematic. When loading an old game, ship reservation caused problems. So I decided on adding a new setting: do not reserve water paths (old style for old saved games)/do reserve water paths (aka "avoid ship collision"). This solves those annoying crashes with old saved games.
I still have some ideas for water transport that I will work on when I can. The first one has been around for years: add more lock sprites, so locks have gates that open and close and the water level of the lock can rise and descend (only if "avoid ship collision" is enabled). The second one is about improving ship movement along narrow paths when the "avoid ship collision" is enabled. I have a simple idea about how to do it. I hope this summer I finally deal with these once and for all.
A small change: I have included a minor shortcut for deleting all pending news messages. When changing the date or when some setting was changed, sometimes a lot of news windows appeared on screen. Maybe I missed something, but I found no easy way to delete those messages instantly. So Ctrl+Del now deletes all news windows, even pending ones.
Now, fonts and GUI size. Font sizes and GUI elements are too small or too big, depending on screen resolution. I have improved the "autosizing" feature a little. This feature I included some years ago lets OpenTTD decide font sizes. I have made some changes so it works better. The size of bevels, paddings and margins are now recalculated automatically as well. You can also choose the default bitmap font or a TrueType font (with my previous versions, default bitmap symbols didn't work well, but now they should).
See attached images. Buttons and other elements can be smaller if you think they are way too big. This is about making things easier for the user, not just making everything bigger.
As for the non-FSM tile-modifiable airports, there's still a long way to go but I am confident I will do it. At the moment, I am playing and "borrowing" airport sprites from "OpenGFX+ Airports" and I worked out how to rotate airports for the already defined layouts. This is still unfinished. Apart from this, aircraft pathfinding has improved a little bit, removing some serious bugs. There is a lot of work to do yet for helicopters and aircraft flying patterns though.
To sum up, this project is not dead and some things have been improved, but none of them is finished yet.
First of all, the water transport improvements I added were problematic. When loading an old game, ship reservation caused problems. So I decided on adding a new setting: do not reserve water paths (old style for old saved games)/do reserve water paths (aka "avoid ship collision"). This solves those annoying crashes with old saved games.
I still have some ideas for water transport that I will work on when I can. The first one has been around for years: add more lock sprites, so locks have gates that open and close and the water level of the lock can rise and descend (only if "avoid ship collision" is enabled). The second one is about improving ship movement along narrow paths when the "avoid ship collision" is enabled. I have a simple idea about how to do it. I hope this summer I finally deal with these once and for all.
A small change: I have included a minor shortcut for deleting all pending news messages. When changing the date or when some setting was changed, sometimes a lot of news windows appeared on screen. Maybe I missed something, but I found no easy way to delete those messages instantly. So Ctrl+Del now deletes all news windows, even pending ones.
Now, fonts and GUI size. Font sizes and GUI elements are too small or too big, depending on screen resolution. I have improved the "autosizing" feature a little. This feature I included some years ago lets OpenTTD decide font sizes. I have made some changes so it works better. The size of bevels, paddings and margins are now recalculated automatically as well. You can also choose the default bitmap font or a TrueType font (with my previous versions, default bitmap symbols didn't work well, but now they should).
See attached images. Buttons and other elements can be smaller if you think they are way too big. This is about making things easier for the user, not just making everything bigger.
As for the non-FSM tile-modifiable airports, there's still a long way to go but I am confident I will do it. At the moment, I am playing and "borrowing" airport sprites from "OpenGFX+ Airports" and I worked out how to rotate airports for the already defined layouts. This is still unfinished. Apart from this, aircraft pathfinding has improved a little bit, removing some serious bugs. There is a lot of work to do yet for helicopters and aircraft flying patterns though.
To sum up, this project is not dead and some things have been improved, but none of them is finished yet.
Formerly known as Juanjo
-
- Tycoon
- Posts: 5950
- Joined: 27 Apr 2005 07:09
- Contact:
Re: Patch: Juanjo's patches
I really like your ideas about "water transport". Good work so far.Juanjo wrote: I still have some ideas for water transport that I will work on when I can. The first one has been around for years: add more lock sprites, so locks have gates that open and close and the water level of the lock can rise and descend (only if "avoid ship collision" is enabled).
Regarding your ideas about locks, I don´t know if you remember that TTDPatch had locks visually *lifting/lowering* ships, rather than the OTTD thing of letting ships "slide" up/down a slanted surface of water. Sometime ago, Peter1138 made a patch for OTTD, implementing that behaviour, but never released it.
regards
Michael
Re: Patch: Juanjo's patches
Yes, I know about it. I already implemented lifting/lowering ships, also having in mind lock gates. I just skipped the part about drawing and coding the graphics for lock gates, which is heavy work.michael blunck wrote: Regarding your ideas about locks, I don´t know if you remember that TTDPatch had locks visually *lifting/lowering* ships, rather than the OTTD thing of letting ships "slide" up/down a slanted surface of water. Sometime ago, Peter1138 made a patch for OTTD, implementing that behaviour, but never released it.
Formerly known as Juanjo
Re: Patch: Juanjo's patches
I had an idea a few months ago, which was aimed to make pathfinding for ships less intensive than what it is in trunk, then saw you use path reservations on your ships. It calls the pathfinder only once, which is great! However, I noticed that ships would never cross the same reserved paths.
Do you have this part of the code separate from your build? Wanted to try to apply it against trunk without every other change that you've made. Not sure if I'm making myself clear. My idea was to try to keep the same ship crossing each other behaviour of trunk, but use the path reservations as a way to reduce pathfinding calls.
Instead of storing the reservation on the map array, it would store it somewhere else, I initially though of vehicle cache.
Do you have this part of the code separate from your build? Wanted to try to apply it against trunk without every other change that you've made. Not sure if I'm making myself clear. My idea was to try to keep the same ship crossing each other behaviour of trunk, but use the path reservations as a way to reduce pathfinding calls.
Instead of storing the reservation on the map array, it would store it somewhere else, I initially though of vehicle cache.
Formerly known as Samu
- HackaLittleBit
- Director
- Posts: 550
- Joined: 10 Dec 2008 16:08
- Location: tile 0x0000
Re: Patch: Juanjo's patches
Nice idea.xarick wrote: Instead of storing the reservation on the map array, it would store it somewhere else, I initially though of vehicle cache.
Maybe you don't have to store the whole reservation but just 10 or 20 tiles. after that you launch the path finder to get the next 10/20 tiles and so on.
That way you could use a fixed location.
I you have collision or mishap (change of landscape) you call pathfinder again.
Re: Patch: Juanjo's patches
Instead of giving you a branch, I will point you to the commits and parts of the code you are interested in. "ShipController" in ship_cmd.cpp is the function that should use the "cached" paths.xarick wrote:Do you have this part of the code separate from your build? Wanted to try to apply it against trunk without every other change that you've made. Not sure if I'm making myself clear. My idea was to try to keep the same ship crossing each other behaviour of trunk, but use the path reservations as a way to reduce pathfinding calls.
YAPF reserves a path from the origin to the last tile
NPF reserves a path from the origin to the last tile
You should adapt it to your idea.
Yes, create a node list with {tile, trackdir, next_node} and use it. That "cache" needs to be stored in savegames. Otherwise, desyncs will happen.xarick wrote:Instead of storing the reservation on the map array, it would store it somewhere else, I initially though of vehicle cache.
He can store the whole reservation, no matter what. Changes of landscape will be problematic, as the "cached paths" are not stored in the map array.HackaLittleBit wrote:Maybe you don't have to store the whole reservation but just 10 or 20 tiles. after that you launch the path finder to get the next 10/20 tiles and so on.
That way you could use a fixed location.
I you have collision or mishap (change of landscape) you call pathfinder again.
Formerly known as Juanjo
- HackaLittleBit
- Director
- Posts: 550
- Joined: 10 Dec 2008 16:08
- Location: tile 0x0000
Re: Patch: Juanjo's patches
Juano;
Attached is zipfile that contains a perl file that generates a svg from airport_movement.h
For visualisation and point locations.
I had it laying around doing nothing.
Maybe you find it usefull.
regards.
Attached is zipfile that contains a perl file that generates a svg from airport_movement.h
For visualisation and point locations.
I had it laying around doing nothing.
Maybe you find it usefull.
regards.
- Attachments
-
- airportmove_rep.zip
- (40.05 KiB) Downloaded 247 times
Re: Patch: Juanjo's patches
Thank you, but I have already worked that out.HackaLittleBit wrote:Attached is zipfile that contains a perl file that generates a svg from airport_movement.h
For visualisation and point locations.
I had it laying around doing nothing.
Maybe you find it usefull.
Right now I'm working on sprites for locks and airports and I hope next summer can deal with flying aircraft and fix some crashes that involve helicopters.
Formerly known as Juanjo
-
- Traffic Manager
- Posts: 161
- Joined: 02 Mar 2009 02:07
Re: Patch: Juanjo's patches
That screenshot looks amazing!
Re: Patch: Juanjo's patches
I have added gates for water locks. Moreover, I couldn't resist and I also added longer locks (5 and 7 tiles long). These longer locks would need some additional sprites, but they work as expected.
One and two-tile wide canals were problematic when ship separation was enabled. Ships used to get stuck easily. One solution to this problem is allowing users to decide which are the preferred directions on water tiles. It improves the situation if players use it wisely.
Finally, I have run out of ideas for water transport...Formerly known as Juanjo
Re: Patch: Juanjo's patches
Players could use my Sea Lanes, Channels and Buoys to guide their ships to the intended locks.Juanjo wrote:One and two-tile wide canals were problematic when ship separation was enabled. Ships used to get stuck easily. One solution to this problem is allowing users to decide which are the preferred directions on water tiles. It improves the situation if players use it wisely.
wallyweb on tt-forums: Screenshots - Wallyweb World - Projects & Releases
wallyweb on Simuscape: Projects - Releases
Other Stuff: TTDPatch 2.6 "Nightly" download - cirdan's OpenTTD branch (New Map Features)
Screenshot Of The Month Contest Winner: August 2015 - Tied May 2016 - January 2018 - December 2018 - May 2019
wallyweb on Simuscape: Projects - Releases
Other Stuff: TTDPatch 2.6 "Nightly" download - cirdan's OpenTTD branch (New Map Features)
Screenshot Of The Month Contest Winner: August 2015 - Tied May 2016 - January 2018 - December 2018 - May 2019
Re: Patch: Juanjo's patches
Good idea for guiding ships. My proposal does something similar: it guides the ships through some suggested directions (not forbidding, just "suggesting"), because when ship separation is enabled, narrow paths and crowded docks cause problems.wallyweb wrote:Players could use my Sea Lanes, Channels and Buoys to guide their ships to the intended locks.Juanjo wrote:One and two-tile wide canals were problematic when ship separation was enabled. Ships used to get stuck easily. One solution to this problem is allowing users to decide which are the preferred directions on water tiles. It improves the situation if players use it wisely.
Formerly known as Juanjo
Re: Patch: Juanjo's patches
Hello Juanjo,
Nice patches, some are very promissing, I'm looking/testing/trying some patches for auto group name of vehicles to compile for JGR patches (so I can actually play with more stuff, but did not find any patch separated from all the code)... and liked your way of doing, very clean, and lot of options. Is there a diff or something for it? I only need the diff for:
Dunno if it's easy to integrate to JGR but will try
Also, I did not test more because I could not add a train depot, always show "Can't build train depot here", for smaller or bigger depots...
And, my ships stay at dock and don't move if the option for reserve is On hehe
Nice patches, some are very promissing, I'm looking/testing/trying some patches for auto group name of vehicles to compile for JGR patches (so I can actually play with more stuff, but did not find any patch separated from all the code)... and liked your way of doing, very clean, and lot of options. Is there a diff or something for it? I only need the diff for:
Code: Select all
Group window: Automatic building of groups: Rebuild groups by order lists, visited towns, transported cargo, first engine class and first engine.
Also, I did not test more because I could not add a train depot, always show "Can't build train depot here", for smaller or bigger depots...
And, my ships stay at dock and don't move if the option for reserve is On hehe
Re: Patch: Juanjo's patches
Hi. You should look for the commits used for this feature and see how you can make them work with JGR patches. Some commits you can look are:nihues wrote: Is there a diff or something for it? I only need the diff for:
Code: Select all
Group window: Automatic building of groups: Rebuild groups by order lists, visited towns, transported cargo, first engine class and first engine.
https://github.com/J0anJosep/OpenTTD/co ... 005dccaf88
https://github.com/J0anJosep/OpenTTD/co ... acb866631a
https://github.com/J0anJosep/OpenTTD/co ... f3639ee3b6
https://github.com/J0anJosep/OpenTTD/co ... 6995fc3b24
You will probably need some other previous commits.
Can you provide a savegame and how do you trigger these? Next week I have some free time, so I can fix it soon.nihues wrote: Also, I did not test more because I could not add a train depot, always show "Can't build train depot here", for smaller or bigger depots...
And, my ships stay at dock and don't move if the option for reserve is On hehe
Formerly known as Juanjo
Re: Patch: Juanjo's patches
Thanks, I'll look at that.Juanjo wrote:Hi. You should look for the commits used for this feature and see how you can make them work with JGR patches. Some commits you can look are:nihues wrote: Is there a diff or something for it? I only need the diff for:
Code: Select all
Group window: Automatic building of groups: Rebuild groups by order lists, visited towns, transported cargo, first engine class and first engine.
https://github.com/J0anJosep/OpenTTD/co ... 005dccaf88
https://github.com/J0anJosep/OpenTTD/co ... acb866631a
https://github.com/J0anJosep/OpenTTD/co ... f3639ee3b6
https://github.com/J0anJosep/OpenTTD/co ... 6995fc3b24
You will probably need some other previous commits.
Can you provide a savegame and how do you trigger these? Next week I have some free time, so I can fix it soon.nihues wrote: Also, I did not test more because I could not add a train depot, always show "Can't build train depot here", for smaller or bigger depots...
And, my ships stay at dock and don't move if the option for reserve is On hehe
I did not made a save, just started a new game without newgrf.... (but there was the standard trains/rails and ships), i'll try again and make a save, but today got a busy day, i'll see later this week.
I remember that big depot was disabled when started, then found and enabled ingame the option to enable big depot, but same error for both depot types.
Who is online
Users browsing this forum: No registered users and 4 guests