More diesel_smoke patch

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

User avatar
SirkoZ
Tycoon
Tycoon
Posts: 1502
Joined: 06 Mar 2004 23:51
Location: The sunny side of Alps

Post by SirkoZ » 17 Jan 2007 19:04

Bjarni wrote:
SirkoZ wrote:I see.
I must mention here, that I tried to play some of the OpenTTD COOP save games with around 1000 diesel/steam trains running at any time and it ran fine. How many vehicles does my patch "steal" from the array? :)
one for each steam/diesel cloud anywhere on the map.
Oh my. :(
SirkoZ wrote:Is there any way to make the patch client-side?
Yes, but you will not like this. You will need to split eyecandy effects from vehicles, that affects the game. Overloading the eyecandy one will not affect the game while overloading the vehicle will.

Say we got close to the limit of vehicles in a game. One player (A) got really intense smoke from his steam trains, so he takes up say 20 vehicle space for each locomotive. Another guy (B) only use 8 vehicle slots for each steam locomotive. Eventually B will build a new vehicle and the game will allow him to do so because it can find free vehicle slots. The same goes for the server, so they both build the new vehicle. A already used all his slots for steam and the game will fail to build the vehicle and now we got a game, where all clients will not have the same amount of vehicles in the game -> desync.

I really can't see any easy way out of this one and splitting the vehicles and the "eyecandy vehicles" is a massive job.
Oh boy - now how would I - a simple (open)TTD fan - a lousy programmer go about and do that (and I mean that)? :D
No really - was any such task as decoupling of eyecandy vehicles (e.g. shadows,...) and vehicles planned by the OpenTTD developers? Because it sounds to me, that the whole graphics engine would have to be altered. :shock:

Now - I would suggest for the time being - let's try and test the worst possible scenario - how many steam/diesel engines could there be on one map that would not affect the buying/selling the same or other vehicles?
I know it's not the best sollution, but what I remember from the internet Mini_IN/Integrated_build games, there were never any problems with buying vehicles...
What say you? :)

DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan » 17 Jan 2007 19:28

Bjarni wrote:
SirkoZ wrote:Is there any way to make the patch client-side?
Yes, but you will not like this. You will need to split eyecandy effects from vehicles, that affects the game. Overloading the eyecandy one will not affect the game while overloading the vehicle will.

Say we got close to the limit of vehicles in a game. One player (A) got really intense smoke from his steam trains, so he takes up say 20 vehicle space for each locomotive. Another guy (B) only use 8 vehicle slots for each steam locomotive. Eventually B will build a new vehicle and the game will allow him to do so because it can find free vehicle slots. The same goes for the server, so they both build the new vehicle. A already used all his slots for steam and the game will fail to build the vehicle
1) Since when was there a reachable limit on the total number of vehicles in the game? And if that's a soft limit, whoever thought it was a good idea to make special vehicles count toward this limit?
2) What's keeping you from kicking out a steam puff or two?

Or better yet, revert whatever change it was that changed the vehicle array from a split (690+160) array to a common pool. It's not like special effects need all ~100 bytes of vehicle data.
SirkoZ wrote:was any such task as decoupling of eyecandy vehicles (e.g. shadows,...)
Shadows aren't eyecandy. They're honest vehicles, and under normal circumstances are the mail compartment.
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

User avatar
SirkoZ
Tycoon
Tycoon
Posts: 1502
Joined: 06 Mar 2004 23:51
Location: The sunny side of Alps

Post by SirkoZ » 17 Jan 2007 21:50

DaleStan wrote:
SirkoZ wrote:was any such task as decoupling of eyecandy vehicles (e.g. shadows,...)
Shadows aren't eyecandy. They're honest vehicles, and under normal circumstances are the mail compartment.
I see. Thanks for the correction. :)

peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1646
Joined: 30 Mar 2005 09:43

Post by peter1138 » 17 Jan 2007 22:55

To clarify:

There are actually 1024 reserved vehicle IDs just for special effects. These start from 0, and hence all real vehicles (including aircraft shadows) have IDs greater than 1024.

If there are too many special effects, then no more are created (until some are deleted). So they can't interfere with real vehicles, but could conceivably cause desyncs if clients have different settings, as some of the special effect handlers involve randomness.
He's like, some kind of OpenTTD developer.

User avatar
SirkoZ
Tycoon
Tycoon
Posts: 1502
Joined: 06 Mar 2004 23:51
Location: The sunny side of Alps

Post by SirkoZ » 17 Jan 2007 23:34

peter1138 wrote:To clarify:

There are actually 1024 reserved vehicle IDs just for special effects. These start from 0, and hence all real vehicles (including aircraft shadows) have IDs greater than 1024.

If there are too many special effects, then no more are created (until some are deleted). So they can't interfere with real vehicles, but could conceivably cause desyncs if clients have different settings, as some of the special effect handlers involve randomness.
Very nice! So I see no problem. :D

The patch is server-side - so it's settled. ;-)

User avatar
SirkoZ
Tycoon
Tycoon
Posts: 1502
Joined: 06 Mar 2004 23:51
Location: The sunny side of Alps

Post by SirkoZ » 27 Jun 2007 17:30

Again - an update of the 2.0b (diesel) smoke patch - this time for source r10348+ - the one with thoroughly fixed (finally) smooth_economy. :-)
Attachments
diesel_smoke_sz_2-0b_r10348_0.patch
patch
(4.69 KiB) Downloaded 142 times

User avatar
SirkoZ
Tycoon
Tycoon
Posts: 1502
Joined: 06 Mar 2004 23:51
Location: The sunny side of Alps

Re: More diesel_smoke patch

Post by SirkoZ » 29 Jul 2007 00:39

Another update to revision r10715 of the nightly source:
Attachments
diesel_smoke_sz_2-0b_r10715_0.patch
diff
(4.75 KiB) Downloaded 166 times

User avatar
White Rabbit
Tycoon
Tycoon
Posts: 1734
Joined: 22 Jun 2005 19:15

Re: More diesel_smoke patch

Post by White Rabbit » 29 Jul 2007 10:00

What about this?
White Rabbit wrote:Why not have even more options for longer steam trails and more frequent puffs, like TTDP? While there's a difference between steam/smoke generated by this patch and default OTTD, I still think there's not nearly enough of it, and the patch doesn't compare with the Patch, if you know what I mean...
You 'duelly noted' it, but then forgot. :(
Image

User avatar
SirkoZ
Tycoon
Tycoon
Posts: 1502
Joined: 06 Mar 2004 23:51
Location: The sunny side of Alps

Re: More diesel_smoke patch

Post by SirkoZ » 29 Jul 2007 11:04

Because I think the patch is good enough for now.
I mean - let's face it - it's still not in the main build although great many players have been really happy with it through the years of the integrated builds and also separate releases...
Not to mention there's no "bug" with it - like OpenTTD developers themselves said - if there's too many smoke phantom vehicles, OpenTTD will simply not draw them...but enough 'bout that.

User avatar
SirkoZ
Tycoon
Tycoon
Posts: 1502
Joined: 06 Mar 2004 23:51
Location: The sunny side of Alps

Re: More diesel_smoke patch

Post by SirkoZ » 23 Jan 2008 19:15

Here's the simpler version for the latest trunk with more either type of smoke emitted only at train's start 0-64 or some more km/h (decreases with speed for all 3 locomotive types).
Attachments
diesel_smoke_sz_finetune_r13916.patch
current version
(2.92 KiB) Downloaded 115 times
Last edited by SirkoZ on 01 Aug 2008 22:26, edited 2 times in total.

User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re:

Post by Bilbo » 23 Jan 2008 19:49

peter1138 wrote:To clarify:

There are actually 1024 reserved vehicle IDs just for special effects. These start from 0, and hence all real vehicles (including aircraft shadows) have IDs greater than 1024.

If there are too many special effects, then no more are created (until some are deleted). So they can't interfere with real vehicles, but could conceivably cause desyncs if clients have different settings, as some of the special effect handlers involve randomness.
There are two "random" generators - one that is used for simulating the game and is synchronized between client and server.
Second is "interactive" random, which is not synchronized, used for random events not communicated over network.

If those handlers would be rewritten to use the "interactive" random, it won't affect network game (ok, each of the clients would have slightly diferent eye candy, or even completely different if he desires and set it so. This could allow also perhaps some further optimizations (do not create eye-candy effects for vehicles not visible in current viewport, or create them with less detail)
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)

peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1646
Joined: 30 Mar 2005 09:43

Re: More diesel_smoke patch

Post by peter1138 » 23 Jan 2008 20:04

The 1024 reserved special vehicles no longer applies. That was removed quite some time ago.
He's like, some kind of OpenTTD developer.

User avatar
SirkoZ
Tycoon
Tycoon
Posts: 1502
Joined: 06 Mar 2004 23:51
Location: The sunny side of Alps

Re: More diesel_smoke patch

Post by SirkoZ » 23 Jan 2008 21:42

peter1138 wrote:The 1024 reserved special vehicles no longer applies. That was removed quite some time ago.
Oh and you didn't tell me that, peter1138?

That's just great!

BTW - with ALL integrated builds, where we extensively played over the net (NOT lan) - there were NO desyncs - at least no because of any of my patches!



Bilbo - I can have those rewritten in a Jamie, but that's besides the point. The point is apparently my vehicle stuff just don't fit into Peter1138's little agenda.

User avatar
Bilbo
Tycoon
Tycoon
Posts: 1710
Joined: 06 Jun 2007 21:07
Location: Czech Republic

Re: More diesel_smoke patch

Post by Bilbo » 24 Jan 2008 00:16

SirkoZ wrote:Bilbo - I can have those rewritten in a Jamie, but that's besides the point. The point is apparently my vehicle stuff just don't fit into Peter1138's little agenda.
Its not the only patch devs don't want (now) in trunk ... some of my patches were either rejected (FS#924, FS#1060) or I received no response to them for long time (FS#1059, no response for last 2.5 months, had to resync with updates in trunk several times).

Although 10 of them ended up as accepted, though these were rather minor corrections ....
If you need something, do it yourself or it will be never done.

My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility

Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)

User avatar
SirkoZ
Tycoon
Tycoon
Posts: 1502
Joined: 06 Mar 2004 23:51
Location: The sunny side of Alps

Re: More diesel_smoke patch

Post by SirkoZ » 24 Jan 2008 01:42

Well - so are my - quite tiny, but very useful indeed and what is of the most value - well tested.

One can't help but feel frustrated...

User avatar
Ben_K
Tycoon
Tycoon
Posts: 1166
Joined: 01 Jun 2006 15:15
Location: Sydney, AUS

Re: More diesel_smoke patch

Post by Ben_K » 24 Jan 2008 02:19

Well, don't stress Sirkoz, just keep up the good work. :)


User avatar
SirkoZ
Tycoon
Tycoon
Posts: 1502
Joined: 06 Mar 2004 23:51
Location: The sunny side of Alps

Re: More diesel_smoke patch

Post by SirkoZ » 18 Feb 2009 17:44

New version - let's call it v3, shall we? :-)

It's for trunk r15513 and it has been rewritten to be as simple as possible with amplified smoke effects for all locomotives (as usually).

File (patch):
Attachments
diesel_smoke_sz_finetune_r15513.patch
diff
(3.24 KiB) Downloaded 178 times

User avatar
Benny
Tycoon
Tycoon
Posts: 2185
Joined: 25 Aug 2007 17:03
Location: ~/

Re: More diesel_smoke patch

Post by Benny » 18 Feb 2009 19:44

Why isn't this in trunk? Does it have any bugs?
I love the patch by the way! :D
Image

Daniel Schuhmann
Engineer
Engineer
Posts: 3
Joined: 20 Aug 2008 19:02
Location: Munich / Germany
Contact:

Re: More diesel_smoke patch

Post by Daniel Schuhmann » 18 Feb 2009 22:34

Very nice patch - I like it!

Post Reply

Return to “OpenTTD Development”

Who is online

Users browsing this forum: No registered users and 3 guests