Patch: Juanjo's patches

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

J0anJosep
Traffic Manager
Traffic Manager
Posts: 139
Joined: 06 Aug 2011 15:51
Location: Spain

Re: Patch: Juanjo's patches

Post by J0anJosep »

I'm currently trying to reserve paths for ships. It works using YAPF or NPF. The goal was to get a better behaviour at docks.

Ships still do strange things sometimes.
Attachments
Ships loading on a multiple dock
Ships loading on a multiple dock
spath.png (589.03 KiB) Viewed 5428 times
Formerly known as Juanjo
J0anJosep
Traffic Manager
Traffic Manager
Posts: 139
Joined: 06 Aug 2011 15:51
Location: Spain

Re: Patch: Juanjo's patches

Post by J0anJosep »

Another clean-up of the patches (some desyncs, critical bugs, memory leaks, documentation...).

I have added the possibility of building one-tile docks. Building complex docks with object tiles is easier using it.
Formerly known as Juanjo
User avatar
Gremnon
Tycoon
Tycoon
Posts: 1517
Joined: 16 Sep 2005 12:23
Skype: the_gremnon
Location: /home
Contact:

Re: Patch: Juanjo's patches

Post by Gremnon »

Getting this when compiling against r r24754:

Code: Select all

make[1]: *** No rule to make target `/home/liam/ottd/working/src/pbs_rail.cpp', needed by `pbs_rail.o'.  Stop.
make[1]: Leaving directory `/home/liam/ottd/working/objs/release'
make: *** [all] Error 1
As far as I can tell all the revisions since r24751 are all translation things.
No other patches applied.
J0anJosep
Traffic Manager
Traffic Manager
Posts: 139
Joined: 06 Aug 2011 15:51
Location: Spain

Re: Patch: Juanjo's patches

Post by J0anJosep »

Gremnon wrote:Code:

make[1]: *** No rule to make target `/home/liam/ottd/working/src/pbs_rail.cpp', needed by `pbs_rail.o'. Stop.
make[1]: Leaving directory `/home/liam/ottd/working/objs/release'
make: *** [all] Error 1

As far as I can tell all the revisions since r24751 are all translation things.
No other patches applied.
Don't know what I've missed out. Try making another time "./configure" and "make" again if you are running a Linux OS. If that doesn't solve it, I hope somebody else can help with this.
Formerly known as Juanjo
Eddi
Tycoon
Tycoon
Posts: 8257
Joined: 17 Jan 2007 00:14

Re: Patch: Juanjo's patches

Post by Eddi »

i haven't checked the patch, but possibly you forgot "svn add" the new files before "svn diff"? then the diff wouldn't have them.
J0anJosep
Traffic Manager
Traffic Manager
Posts: 139
Joined: 06 Aug 2011 15:51
Location: Spain

Re: Patch: Juanjo's patches

Post by J0anJosep »

I just moved to GitHub so I can maintain the code easily and prevent some problems like the one Gremnon had. Code can be found here.

From previous version, most noticeable change is the way locks are controlled. I have also added Cargo Distribution, as I always play with it while testing my own patches.
Formerly known as Juanjo
J0anJosep
Traffic Manager
Traffic Manager
Posts: 139
Joined: 06 Aug 2011 15:51
Location: Spain

Re: Patch: Juanjo's patches

Post by J0anJosep »

Toying with the idea of adapting OpenTTD for tablets, I am trying these on the tablet branch:
  • Build airport, depots and most of the infrastructure when releasing the mouse instead of when clicking it.
  • Force buttons to be bigger. The feature doesn't make sprites bigger, but at least buttons can be set to a more appropriate size for tablets. Values for the size of buttons and scrollbars are set in the configuration file of OpenTTD. You may want to add these to that file under [misc] section:

    Code: Select all

    min_button_size = 40
    min_step_size = 30
    bigger widgets.png
    Force buttons and scrollbars to be bigger.
    (179.87 KiB) Downloaded 7 times
  • Add buttons for supr, shift and ctrl keys. Also add a button for moving around. The "Ok/Cancel" buttons still don't work as expected, as I don't have a tablet to test them and figure out how they would have to work.
Buttons for tablets.
Buttons for tablets.
tablet-buttons.png (11.74 KiB) Viewed 13812 times
Formerly known as Juanjo
J0anJosep
Traffic Manager
Traffic Manager
Posts: 139
Joined: 06 Aug 2011 15:51
Location: Spain

Re: Patch: Juanjo's patches

Post by J0anJosep »

I have added a link for a compiled version of my latest branch for Android (see first post of the thread). It is intended to work with tablets, not with phones.

I'm still working on adapting the GUI. By now, I have adapted sizes of most GUI elements. I think the feature is working for screen resolutions between 640x400 and 2560x1504. I still have to adapt automatic sizing for screens with lower resolution, though I'm not keen on doing so.

The other feature I've added is a touchscreen mode. In the settings you can choose between:
  • playing with mouse,
  • playing with a simple adaptation for touchscreens (buttons to substitute X, Supr, Shift and Ctrl),
  • or playing with a confirm mode (the same as the previous, but having to confirm construction actions pressing a button). The confirm mode is not complete, as I don't want to modify the tile selection on viewports more than I have.
tablet.png
tablet.png (34.99 KiB) Viewed 13603 times
Next step is to see if it is possible to provide a NewGRF with sets of GUI sprites with different sizes and make the program automatically select the best set for screen resolution.
Formerly known as Juanjo
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Patch: Juanjo's patches

Post by planetmaker »

Juanjo wrote: Next step is to see if it is possible to provide a NewGRF with sets of GUI sprites with different sizes and make the program automatically select the best set for screen resolution.
Michi_cc had a tentative patch queue which principally enabled zoom levels for the GUI sprites as well, allowing sprites to be provided for 2x and 4x sizes in the base sets. Unfortunately I fail to dig it up at this time, I expected to find it in his gitweb at icosahedron.de
J0anJosep
Traffic Manager
Traffic Manager
Posts: 139
Joined: 06 Aug 2011 15:51
Location: Spain

Re: Patch: Juanjo's patches

Post by J0anJosep »

planetmaker wrote:Michi_cc had a tentative patch queue which principally enabled zoom levels for the GUI sprites as well, allowing sprites to be provided for 2x and 4x sizes in the base sets. Unfortunately I fail to dig it up at this time, I expected to find it in his gitweb at icosahedron.de
I found it in http://www.icosahedron.de/openttd/git/o ... s/heads/ez. I will go that way.

Anyway, is it not technically possible to make a NewGRF that loads different sets of GUI sprites via a parameter? I mean a NewGRF that when GUI sprites are needed at 1x size, loads GUI sprites at 1x size; when GUI sprites are needed at 2x, loads them at 2x...
Formerly known as Juanjo
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Patch: Juanjo's patches

Post by planetmaker »

Juanjo wrote:
planetmaker wrote:Michi_cc had a tentative patch queue which principally enabled zoom levels for the GUI sprites as well, allowing sprites to be provided for 2x and 4x sizes in the base sets. Unfortunately I fail to dig it up at this time, I expected to find it in his gitweb at icosahedron.de
I found it in http://www.icosahedron.de/openttd/git/o ... s/heads/ez. I will go that way.

Anyway, is it not technically possible to make a NewGRF that loads different sets of GUI sprites via a parameter? I mean a NewGRF that when GUI sprites are needed at 1x size, loads GUI sprites at 1x size; when GUI sprites are needed at 2x, loads them at 2x...
That's feasible. That's done ;-)
But it's not the best which can be done. A NewGRF needs be configured, either in the NewGRF settings which are saved with a map - thus you force every player to use the same setting. Or it can be done as static NewGRF, which has no ingame GUI yet. And it IMHO belongs simply into the GUI settings like language, currency, window snap radius etc. Alongside with a GUI for font and font size selection.

Thus an improvement over the current situation is to allow base sets provide the sprites for the different zoom levels directly, so that it needs no special config by any user other than choosing the right GUI size. Those spites in turn can still be replaced via NewGRFs to different looks, if desired.
J0anJosep
Traffic Manager
Traffic Manager
Posts: 139
Joined: 06 Aug 2011 15:51
Location: Spain

Re: Patch: Juanjo's patches

Post by J0anJosep »

planetmaker wrote:That's feasible. That's done ;-)
I even based my project on that one! :oops:
I explained the problem I have really bad. Right now, I don't know how to do the same with 32bpp. I need time to look NewGRF documentation and examples. Even better, I need help of NewGRF experts. :wink:
planetmaker wrote:But it's not the best which can be done. A NewGRF needs be configured, either in the NewGRF settings which are saved with a map - thus you force every player to use the same setting. Or it can be done as static NewGRF, which has no ingame GUI yet. And it IMHO belongs simply into the GUI settings like language, currency, window snap radius etc. Alongside with a GUI for font and font size selection.
I included a new setting: GUI sizing is user specified/automatic. In case it is user decided, user can decide sizes of GUI elements in the config file. In case it is automatically decided, the parameter of the NewGRF will be decided automatically and sprites reloaded when necessary.
Formerly known as Juanjo
User avatar
Andrex
Tycoon
Tycoon
Posts: 1308
Joined: 22 Nov 2002 05:08
Location: AR
Contact:

Re: Patch: Juanjo's patches

Post by Andrex »

Juanjo, sorry if this is an ignorant question, but exactly where can I find the compiled APK download URL with your modifications and updates? I'd like to try it on my Iconia B1 tablet. Thanks...
J0anJosep
Traffic Manager
Traffic Manager
Posts: 139
Joined: 06 Aug 2011 15:51
Location: Spain

Re: Patch: Juanjo's patches

Post by J0anJosep »

Andrex wrote:Juanjo, sorry if this is an ignorant question, but exactly where can I find the compiled APK download URL with your modifications and updates? I'd like to try it on my Iconia B1 tablet. Thanks...
There is a link at the end of the first post of this topic. Just download the .apk file.
Formerly known as Juanjo
pelya
Transport Coordinator
Transport Coordinator
Posts: 342
Joined: 18 Nov 2010 19:48
Contact:

Re: Patch: Juanjo's patches

Post by pelya »

Hi. I've merged your GUI-related patches into Android port, more info here.
Antaguana
Engineer
Engineer
Posts: 10
Joined: 05 Oct 2013 08:58

Re: Patch: Juanjo's patches

Post by Antaguana »

Is there any chance of getting these broken into separate patches?

I know a few people have asked now. I would really like to use the grouping with some other patches I have applied to the trunk. It would be much easier to apply the grouping patch and fix any issues it may have with trunk and the other patches I am using if we could get separate patches.
pelya
Transport Coordinator
Transport Coordinator
Posts: 342
Joined: 18 Nov 2010 19:48
Contact:

Re: Patch: Juanjo's patches

Post by pelya »

You may find individual Git commits here, they are quite hairy though: https://github.com/JJ-OpenTTD/openttd-c ... ts/JJ-last
J0anJosep
Traffic Manager
Traffic Manager
Posts: 139
Joined: 06 Aug 2011 15:51
Location: Spain

Re: Patch: Juanjo's patches

Post by J0anJosep »

Antaguana wrote: I would really like to use the grouping with some other patches I have applied to the trunk. It would be much easier to apply the grouping patch and fix any issues it may have with trunk and the other patches I am using if we could get separate patches.
I only do separate patches if somebody asks for them. I won't maintain different branches for each individual feature. The one with grouping vehicles is in the attached file. If it doesn't work, let me know.
Attachments
build-groups-r26654.diff
(35.71 KiB) Downloaded 222 times
Formerly known as Juanjo
J0anJosep
Traffic Manager
Traffic Manager
Posts: 139
Joined: 06 Aug 2011 15:51
Location: Spain

Re: Patch: Juanjo's patches

Post by J0anJosep »

I have added two new features.

You can change fonts and their sizes while playing:
fonts.png
fonts.png (287.29 KiB) Viewed 12441 times
I also added some fonts and graphics needed in the bundle.


I am also toying with the idea of multi-tile depots, built like stations and with added limitations, changing the strange "black wormhole" effect that allows to keep lots of trains hidden in just one tile. First of all, the default behaviour of depots (small depots) isn't altered.

For big depots, there are some issues to fix, but I think that the feature is already playable. As a first approach, I thought about this rules:

In big depots, user can join different depot tiles under the same depot (per vehicle type).
Servicing in big depots take some time: service is not done instantly.
In big water depots, only one ship is allowed in each depot part and ships don't disappear in the depots.
In big road depots, each tile can only store three vehicles. If one road depot consists of x road type tiles and y tram type tiles, the depot can have at most x*3 road vehicles and y*3 trams at the same time.
In big rail depots, a depot can be made of different platforms of different rail types. If possible, the trains are placed in the depots and can be seen if transparency for depots is enabled. In some cases, trains can't be placed in the platforms (length, rail type, no free platforms...). Under such circumstances, trains will be in the "black depot wormhole", waiting for a free platform where to be placed.

These images show what the idea is about:
bigdepot.png
Depot #3 is made of four platforms (3 rail + 1 monorail). There are four trains (1, 2, 4 and 5).
(427.11 KiB) Not downloaded yet
inside.png
Toggling transparency, trains 1, 2, 3 and 5 are visible. Train 3 is not inside the depot (it is moving along one platform). Train 4 is not visible and cannot leave the depot (all compatible platforms are occupied).
(432.52 KiB) Not downloaded yet
I don't have much time to improve the patches, but I will continue working on them when I have time and post here any update.
Formerly known as Juanjo
J0anJosep
Traffic Manager
Traffic Manager
Posts: 139
Joined: 06 Aug 2011 15:51
Location: Spain

Re: Patch: Juanjo's patches

Post by J0anJosep »

Still an unfinished feature, but it is worth a video. An intercontinental airport handled with a new controller.

Formerly known as Juanjo
Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 9 guests