Orders patch - percentile and FIFO loading, cargo display...

Forum for technical discussions regarding development. If you have a general suggestion, problem or comment, please use one of the other forums.

Moderator: OpenTTD Developers

gigajum
Route Supervisor
Route Supervisor
Posts: 511
Joined: 08 Mar 2006 08:33
Location: Germany

Post by gigajum »

Darkvater wrote: Perhaps something like:
[Skip][Delete][Goto][Misc][Load][<>]

Where Misc (or a better name) would include a dropdown box of Priority/Non-Stop/Service (depot).
Load would contain a dropdown box of Load/Unload/Transfer with a another dropbox next to it with 0-100% in 10% increments? Then you can tell your train to load 10%, unload 30% and transfer 40% if wanted? Of course this scroller can be disabled if unload/transfer is selected if there is no code for that yet. Donnu how usable it is, but most used functions are available with one click and it still would look not too bad.
Yeah that's an idea how to design it :). I'll give it a try. Another question is: Is percential unloading and percential transfer needed. That on the screenshot was caused by something i took over from hzhook and checkt not if there are any errors in it.

For me i do not need percential unloading or transfer. I only load in and transport the cargo to a destination. But where is the appreciation for unload 20% (what is the next question: 20% means unload 20% of cargoor unload to 20% rest cargo).

Drop down boxes are nice but i haven't worked with them in the game.
User avatar
Darkvater
Tycoon
Tycoon
Posts: 3053
Joined: 24 Feb 2003 18:45
Location: Hong Kong

Post by Darkvater »

I don't really see a use for '50% transfer', can't really imagine what it would be like, but '40% unload' can be handy for example when supplying food to arctic towns for example. You can have a train visit a list of towns and only deposit part of its cargo.

Anyways, for options that don't have percentile settings when selected the [<>] can be greyed out, so that is not a big problem I think :)
TrueLight: "Did you bother to read any of the replies, or you just pressed 'Reply' and started typing?"
<@[R-Dk]FoRbiDDeN> "HELP, this litte arrow thing keeps following my mouse, and I can't make it go away."
User avatar
BoominGranny
Engineer
Engineer
Posts: 85
Joined: 18 Apr 2006 02:16
Location: Wellington, New Zealand
Contact:

Post by BoominGranny »

While your tinkering with the orders screen, how hard would it be to add a reverse cycle orders button to, once the orders reach the last one they work backward.

ie.
orders:

1) goto station 1
2) goto station 2
3) goto station 3
4) goto station 4

actual:

1) goto station 1
2) goto station 2
3) goto station 3
4) goto station 4
5) goto station 3
6) goto station 2

you could change the -- end of orders -- text to -- reverse cycle orders -- so you knew it was on/off.

;-) it would have no real purpose other than making realistic trains until cargo packets was implemented though.

If its too hard don't worry. i can't wait to see what you've done on this so far
gigajum
Route Supervisor
Route Supervisor
Posts: 511
Joined: 08 Mar 2006 08:33
Location: Germany

Post by gigajum »

this isn't such easy as you think. Every order contains a variable that links to it next. So they get forwarded with

Code: Select all

order = order->next;
and i had to implement a prev routine. At the moment it is not necessary, so i fix the other things first :)
gigajum
Route Supervisor
Route Supervisor
Posts: 511
Joined: 08 Mar 2006 08:33
Location: Germany

Post by gigajum »

Darkvater wrote:I don't really see a use for '50% transfer', can't really imagine what it would be like, but '40% unload' can be handy for example when supplying food to arctic towns for example. You can have a train visit a list of towns and only deposit part of its cargo.

Anyways, for options that don't have percentile settings when selected the [<>] can be greyed out, so that is not a big problem I think :)
Ok here it is as Darkvater suggested.

The miscellaneous needs to be shorted to "misc.". But for the percential loading button i had no idea except from "% loading" :(

I'll add percential unloading, but not percential transfer since there is no real use for it.
Attachments
new screen
new screen
new orders window2.jpg (41.36 KiB) Viewed 5531 times
Last edited by gigajum on 02 May 2006 10:38, edited 1 time in total.
User avatar
SirkoZ
Tycoon
Tycoon
Posts: 1518
Joined: 06 Mar 2004 23:51
Location: The sunny side of Alps

Post by SirkoZ »

Wow - it looks really nice. 8)

BTW - why not percentile transfer? If you have one long train transfering cargo to 3 stations, it can be useful - in other words - if it's there (transfer), let player decide what he uses.
gigajum
Route Supervisor
Route Supervisor
Posts: 511
Joined: 08 Mar 2006 08:33
Location: Germany

Post by gigajum »

SirkoZ wrote:Wow - it looks really nice. 8)

BTW - why not percentile transfer? If you have one long train transfering cargo to 3 stations, it can be useful - in other words - if it's there (transfer), let player decide what he uses.
Since that damn function is broken. I have no idea why and what it causes. i only see that it is not working. Or it works but the order window has an error with showing that to me. Dunno but that will be a large search after where's the problem. Maybe i'll add percential transfer later i don't know yet. Currently i will let it out until i'm finished with the gui rework and checking if all three options work perfect together.

And i'm still searching where to add the text color if the drop down option is selected. Reading grey text on black background is not that good
User avatar
SirkoZ
Tycoon
Tycoon
Posts: 1518
Joined: 06 Mar 2004 23:51
Location: The sunny side of Alps

Post by SirkoZ »

I see.

You meant black text on the grey background? It's readable...
I have to get started making an alternative/TTOriginal GUI/bahaviour for OTTD...There it will be black text on a nice TTOriginal-orange background... :)
gigajum
Route Supervisor
Route Supervisor
Posts: 511
Joined: 08 Mar 2006 08:33
Location: Germany

Post by gigajum »

SirkoZ wrote:I see.

You meant black text on the grey background? It's readable...
I have to get started making an alternative/TTOriginal GUI/bahaviour for OTTD...There it will be black text on a nice TTOriginal-orange background... :)
No grey text on black background (the selected dropdown option while the mouse is over it). The intro gui has white text on black background but mine unses grey text :(
User avatar
SirkoZ
Tycoon
Tycoon
Posts: 1518
Joined: 06 Mar 2004 23:51
Location: The sunny side of Alps

Post by SirkoZ »

Oh sorry - yes, that is quite awkward...

Look in the english.txt file - if there are any {GREY} settings written for your patch - replace them with {WHITE} or some other colour otherwise it's really strange...
gigajum
Route Supervisor
Route Supervisor
Posts: 511
Joined: 08 Mar 2006 08:33
Location: Germany

Post by gigajum »

So the percential unloading is in.

Here are 3 screenshots:
the orders is:

load full
half unload
full unload
Attachments
and the complete train empty :)
and the complete train empty :)
Nordheim Transport, 16th Jul 1950.png (93.04 KiB) Viewed 5443 times
train after half unload
train after half unload
Nordheim Transport, 5th Jul 1950.png (86.18 KiB) Viewed 5443 times
train loaded full
train loaded full
Nordheim Transport, 29th Jun 1950.png (88.21 KiB) Viewed 5443 times
User avatar
gkirilov
Chief Executive
Chief Executive
Posts: 696
Joined: 03 May 2005 09:32
Location: Othala

Post by gkirilov »

gigajum, can you do something about the following:
You have 5 station connnected one after the other. 1->2->3->4->5->1->2 .... After the last the train goes to the first.
So I want to put orders Go to Nr.1 and Go to Nr2. and the train will stop on all stations(1,2,3,4,5). The problem is that I want the orders for all station (including the one not in the list - 2,3,4) to be the same as the first one. The current situation is that the orders are load anything and leave.
OTTDCoop NewGRF Pack|Different sets of GRFs for TTDPatch (some of them work in OTTD) - 1|- 2|GRF sets for OTTD|OTTD nightly
Image
I hooked up my accelerator to my brake lights. I hit the gas, people behind me stop, and I'm gone.
Understeer is when you hit the wall with the front of the car. Oversteer is when you hit the wall with the rear of the car. Horsepower is how fast you hit the wall. Torque is how far you take the wall with you. Spoilers and bodykits are how much of the wall you take with you. Rollcages and windownets are how much of a mess you leave on the wall.
User avatar
Brianetta
Tycoon
Tycoon
Posts: 2567
Joined: 15 Oct 2003 22:00
Location: Jarrow, UK
Contact:

Post by Brianetta »

gkirilov wrote:The current situation is that the orders are load anything and leave.
This has always been the situation. It's the same with load and unload - if a train stops at stations between load and unload orders, it will drop what it can and pick up what it can. We've always had to be specific; this hasn't changed.

The only order modification which ever affected behaviour at other stations was non-stop.
PGP fingerprint: E66A 9D58 AA10 E967 41A6 474E E41D 10AE 082C F3ED
gigajum
Route Supervisor
Route Supervisor
Posts: 511
Joined: 08 Mar 2006 08:33
Location: Germany

Post by gigajum »

gkirilov wrote:gigajum, can you do something about the following:
You have 5 station connnected one after the other. 1->2->3->4->5->1->2 .... After the last the train goes to the first.
So I want to put orders Go to Nr.1 and Go to Nr2. and the train will stop on all stations(1,2,3,4,5). The problem is that I want the orders for all station (including the one not in the list - 2,3,4) to be the same as the first one. The current situation is that the orders are load anything and leave.
i don't think this is possible. Impossible is nothing, it only needs cpu time :) But i have no idea how to make it working or how to tell the game what to do.
gigajum
Route Supervisor
Route Supervisor
Posts: 511
Joined: 08 Mar 2006 08:33
Location: Germany

Post by gigajum »

Ok the transfer button now works again. It only was error with showing the right language lines right together.
Percential transfer is not implemented due to problems with the language lines. Exact loading is only possible if you have percential loading enabled, so this is disabled too. I'll look after it later. But for now it works so time to look at other things.

I looked at the save/load function but if i change something there the game crashes while loading the background game, since this savegame has no info about percential loading in it. Or i do something wrong with the savegame macros. Something to look at for todays afternoon.
gigajum
Route Supervisor
Route Supervisor
Posts: 511
Joined: 08 Mar 2006 08:33
Location: Germany

Post by gigajum »

Ok here is the newst version :)

It includes perciental loading, exact loading and priority loading (all working based on fifo loading).
percential loading works only on loading and unloading, not with any transfer option.
It can all be turned off in the patch window, but for default it is on. The window's wont change if it is turned off.
Saving/loading savegames that include orders with percent loading/unloading options works.


So feel free to test it if you find a bug and you can hopefully reproduce it, post it here.
The patch file can be found on my patch compile farm (there you find an compiled win32 exe, too) or here :)

Note: this is no release version so there are a lot of debug options in the code.

Edit: order window for non trains now corrected to work
Attachments
additionalorders_r4784.diff
the patch file against r4784
(46.87 KiB) Downloaded 304 times
gigajum
Route Supervisor
Route Supervisor
Posts: 511
Joined: 08 Mar 2006 08:33
Location: Germany

Re: Orders patch - percentile and FIFO loading, cargo displa

Post by gigajum »

Implemented and working, needs bugtesting:

Loading Percentiles
Exact loading
Prioritity loading
FIFO loading
Ablity to choose if the full load is based on cargo or train (not in any public patch file)


Started, but not in GUI or need to clear some things:
* Min and Max waiting times
* Leave if another X trains are at the station.
Global setting, configurable in patch window or add station settings to set min and max waiting time and leave if X trains at station (station setting is better imo)

* Show load on status bar
Is that needed?

* Move the FIFO ablity to the station gui
i don't understand why move to station gui, if you use it you use it everywhere or?

* Add default order options for station (eg. clicking goto on a station will use the default options for that station)
Dunno how to code that since i use some stations to load and unload (like stations near factories). So from where should the system know what i want to do with the station i clicked at.

* Prioritity trains given more chances of being allowed to continue first at a signal
Is that needed?

* Remove any of the patch options this will add gui items for
* Possibly also a dont stop if no room option. (Im going to need a new window I think)
?( again, can someone explain those 2 ideas to me. If not they are done.

The transfer of cargo is still a bit stupid with percential loading.
transfer only -> transfer and load -> load that what i transfered and more if possible.
transfer and full load -> same as above.
transfer and leave empty -> where whould i use a percent value here.

The patch is nearly finished. I implement things from those listed above only if they are really wanted or needed.
If anyone has another idea which could/should be added post it.
Sacro
Tycoon
Tycoon
Posts: 1145
Joined: 18 Jun 2005 21:08
Location: Here
Contact:

Post by Sacro »

re Show load on status bar: Why instead of just showing "Loading/Unloading", change it to "Loaded foo% out of bar%", then its informative.
We Am De Best

Host of ThroughTheTube site
User avatar
bobingabout
Tycoon
Tycoon
Posts: 1850
Joined: 21 May 2005 15:10
Location: Hull, England

Post by bobingabout »

lol, foobar... :P
JPG SUX!!! USE PNG!!!
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.

[/url]
Sacro
Tycoon
Tycoon
Posts: 1145
Joined: 18 Jun 2005 21:08
Location: Here
Contact:

Post by Sacro »

bobingabout wrote:lol, foobar... :P
Quite a lot of programmers use foo and bar as variables, I've seen it in a few IRC channels and websites personally
We Am De Best

Host of ThroughTheTube site
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: Ahrefs [Bot] and 15 guests