Skip to main content
Topic: [patch] Replacing (aka the long, long crossing of the desert) (Read 66480 times) previous topic - next topic

Re: [patch] Replacing (aka the long, long crossing of the desert)

Reply #70
I've updated this patch to the latest revision. I haven't done further checks, but it compiles fine.

Edit: patch removed. New patches attached to later posts.

Re: [patch] Replacing (aka the long, long crossing of the desert)

Reply #71
Thanks, gerw.

Re: [patch] Replacing (aka the long, long crossing of the desert)

Reply #72
New version of the patch. Now convoi_t::goto_depot uses the possibility of route_t::find_route, to find the next depot. It haven't loop over all depots anymore.

Edit: Other new version: Now the sizes of the GUI frames are calculated correctly (and fit on the initial screen size).

Edit: patch removed. New patches attached to later posts.

Re: [patch] Replacing (aka the long, long crossing of the desert)

Reply #73
Unfourtunately find_route fails for ships and airplanes ...

Re: [patch] Replacing (aka the long, long crossing of the desert)

Reply #74
Prissi,

that's odd - my tests haven't found that. find_route works find for ships. It doesn't work for aircraft that are flying, but does work for aircraft on the taxiway or runway. The aircraft issue is not a problem for the replacing system, since the command to go to the depot is not issued until the aircraft is on the ground in any event.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Re: [patch] Replacing (aka the long, long crossing of the desert)

Reply #75
Find_route for ships has often problem with far away depot on large maps, since the tile buffer is full before a depot is reached.

Re: [patch] Replacing (aka the long, long crossing of the desert)

Reply #76
Ahh, hmm, I didn't use a large map. Perhaps the old iteration system should be used if find_route fails? What's the best way of checking whether find_route has failed?

Edit: Right, I have re-written it such that it falls back to the old system if it doesn't find a route using the new system. This will be in the next release of Simutrans-Experimental.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Re: [patch] Replacing (aka the long, long crossing of the desert)

Reply #77
Thank you prissi. Now it uses again the old depot finding algorithm for planes and ships.

Edit: New patch. Now, convoy_****embler isn't a pointer anymore. And if a depot is electrified, a little bolt is presented.

Re: [patch] Replacing (aka the long, long crossing of the desert)

Reply #78
THe withdraw all is on my todolist, since the replacing faces imho too many unresolvable problem with different vehicle length and pak sets.
With manual replacement, you will have the same problem with different vehicle length, won't you? And what do you mean with "pak sets"?

One real problem is the electrification...

Re: [patch] Replacing (aka the long, long crossing of the desert)

Reply #79
if you switch to another pak set maybe?  ;D
Parsley, sage, rosemary, and maggikraut.

Re: [patch] Replacing (aka the long, long crossing of the desert)

Reply #80
I couldn't get the most recent version to do anything in Tortoise SVN (didn't get the small window), the previous one in this thread patched though. Tortoise threw up some errors as well when I applied the patch, though this is my first time of doing anything like this so I'm probably going wrong somewhere.


More importantly... :)
I know this (or at least something similar) is now in experimental, any chance of it making it into a nightly of standard?

Re: [patch] Replacing (aka the long, long crossing of the desert)

Reply #81
Gryphonite,

the reason that it won't merge is because there have been vast changes to the code since this patch was originally written. As you note, there is a version of this feature in Experimental (which is somewhat of an enhancement of this version, as it has additional features). I am not aware of any plans to put this into Standard, but I cannot speak for the Standard developers on the subject.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Re: [patch] Replacing (aka the long, long crossing of the desert)

Reply #82
I couldn't get the most recent version to do anything in Tortoise SVN (didn't get the small window),
[...]

Patches record changes in the source code of the program.  They include the new lines/changes as well as the context (surrounding lines) where those changes are to be applied.

If the code has been changed a lot since the patch was generated, the patch program will not automatically find the suitable context and hence the errors.

Another possibility you have is to apply the patch to the revision from which it was generated (r2456).  But note that the game will not have the improvements made since then, savegames may not be compatible (opened) by an up-to-date version, etc.

...any chance of it making it into a nightly of standard?

That's not an easy task.  Code may have changed a lot in current version.  Not incorporated patches are very difficult to maintain.

Re: [patch] Replacing (aka the long, long crossing of the desert)

Reply #83
Thanks for the reply. I have about zero experience in programming, but see where you are coming from. Would be really useful to have though... perhaps I need to do some learning :)