New cargos experimental test version - a55vcs4

Get help, info, news and advice about the Transport Tycoon Deluxe patch.

Moderator: TTDPatch Moderators

User avatar
Csaboka
Tycoon
Tycoon
Posts: 1202
Joined: 25 Nov 2002 16:30
Location: Tiszavasvári, Hungary
Contact:

New cargos experimental test version - a55vcs4

Post by Csaboka »

Hi everyone!

Those who are regular on IRC may already know that Mek has sent me his unfinished code for the newcargos feature some time ago. Since the release of alpha 54, I have been working on his code, and today it reached the stage when it works well enough to release a test version of it.

Please note: To make this feature possible, I had to change a lot of code written for the existing switches. Therefore, if something works strangely or differently from previous versions, please report it here, it's possible that I broke it accidentally. It may have become broken even with newcargos off. The affected switches are: loadtime, gradualloading, feederservice, fifoloading, selectgoods and newstations.

WARNIG: To make more cargos possible, the handling of station data has been changed. Old savegames are automatically converted to the new format while loading, but once you saved the game again, going back to the old scheme is very difficult. Therefore, please back up your important savegames before trying the test version, just in case something goes wrong.

Compiled binaries (2.0.1 alpha 55 vcs 4):
DOS version (compiled blindly)
Windows version

Diffs for a55vcs against alpha 55
Diffs for a55vcs2 against alpha 55vcs
Diffs for a55vcs3 against alpha 55vcs2
Diffs for a55vcs4 against alpha 55vcs3

Diffs for a55vcs4 against alpha 55

Demo GRF (source) (version 2)

This GRF adds a new cargo named "Chemicals" into the game. Oil wells produce it in addition to oil, and refineries accept them as well. There's one rail chemical tanker added (really the tropic water tanker "refitted" for chemicals) so you can try the actual transporting as well.
Yes, I know it's unrealistic, I know it doesn't make too much sense, but it's only a demo after all. You aren't meant to play with it seriously, I hope some GRF coders will provide "real" new cargos soon. Oh, and it works on temperate only.

[edit] Now that the AI doesn't crash the game with newcargos on, it can be "taught" to use the new cargo types. This GRF contains a demonstration that allows AI players to transport chemicals with the chemical tanker. If it tries transporting chemicals via road vehicles, it will still fail, though.

Moreindustriesperclimate replacement GRF (Source)

From this version on, enabling either newindustries or newcargos will automatically disable moreindustriesperclimate. My code and Oskar's code don't play nicely together, but now this doesn't matter, since the same functionality can be provided by a custom GRF instead. Paper.grf adds the paper cargo to the temperate climate and enables paper mills and printing works as well. If it has 1 for its first parameter, it will try to work exactly as moreindustriesperclimate: that is, the new industries won't be built on the map, they will only be accessible by manually funding them. If the parameter isn't 1, these will be built on random maps, and they default colors are changed slightly so you can make difference between steel mills and paper mills, or factories and printing works.

It should be safe for existing savegames to migrate from moreindustriesperclimate to paper.grf as long as paper.grf is the first newindustry-grf in your newgrf.cfg (that is, it's the first GRF that touches industries).

Known limitations of the switch:
- You can't have more than 12 different types of cargo in a station. You can have 32 in total, but no single station can have more than 12 simultaneously.
- The cargo payment graph window doesn't access the extra slots yet, so you can't view the graphs for the new types. Solving this one will be tricky, since the graph-drawing routine of TTD can't handle more than 16 graphs drawn in the same coordinate system.

Notice for GRF coders: I'm open to suggestions about improving or changing the format. To make this process easier, I'm reserving the right of modifying the current format without maintaining backwards compatibility. Once the format has been finalized, backward compatibility will be provided as usual.

All changes in alpha 55 vcs:
- New switch: newcargos
- Devel: Restructured load/unload code to a single proc instead of a myriad of small patches
- Industry colors must always be specified from the DOS palette from now on. The Windows version translates colors automatically.
- Added variable 1A, which is always FFFFFFFF, to help specifying constants for action 2 calculations
- Added multiply, and, or and xor to the available operations for action 2
- Added warning if a loaded scenario doesn't contain any towns.
(hotfix 1)
- Made gradualloading and fulloadany compatible again
- Fixed feederservice bug that caused negative profit for vehicles
(hotfix 2)
- Bugfix: Industry tile prop. 10 didn't work
(hotfix 3)
- Bugfix: New industry tiles didn't work correctly for water industries
- Bugfix: The game no longer crashes when an AI player tries transporting a new cargo type. It still needs to be "taught" what vehicles to use for the new cargos, though.

All changes in alpha 55 vcs 2:
- Special industry tile type FF now works on land as well (it used to always check for water)
- It's now possible for houses to accept any cargo by setting new house property 1E or using callback 2A. (Wiki will be updated soon)
- Fixed station trigger 2 (it was broken with newcargos on)
- Ctrl-built buoys now should work correctly
- Fixed newcargos breaking fifoloading
- Station action 3 wasn't working correctly with newcargos
- "Cht: ReloadIndustries" to reload all industry data to existing industries.
- Fixed sorting veh. lists by cargo type (broken since a55vcs)
- Fixed a possible crash with DCxx textIDs

All changes in alpha 55 vcs 3:
- Support for house/industry tiles consisting more sprites. (Wiki will be updated soon)
- Support for parametrized variables (6x) that accept a byte parameter.
- Fixed random station trigger 1 (it was broken for DOS since a55vcs and it seems Windows versions were broken before a55vcs as well)
- Two new parametrized house variables 60 and 61 to count houses other than the current
- Fixed bug with newcargos messing up waiting cargo amount reported to GRFs
- New parametrized variables (60..64) to get data about a cargo type waiting without directly reading the station struct
(hotfix 1)
- Fixed bug with multi-sprite tiles not working correctly with the larger spritelimit enabled
- Added variable 48 for stations: bit mask of accepted cargos
(hotfix 2)
- Fixed incorrect re-applying industry data after loading a game
- Two new callbacks, 2B and 2C to decide industry tile acceptance
(hotfix 3)
- Industry properties 0C..0E were broken
(hotfix 4)
- Fixed crash while TTD tries to build an oil rig

All changes in alpha 55 vcs 4:
- New callback 2D to select vehicle recoloring independently from the owner
- With newcargos on, there can be up to 65535 units waiting from each cargo type from now on, although the display will be incorrect if more than 32767 units are waiting. (The old limit was 4095 units)
- The industry funding window now displays the map colors of industries. Until someone comes up with a good way to fix the map legend, this list can be used to identify industries on the map.
- Fixed crash with Cht: ResetStation if newcargos was on.
Last edited by Csaboka on 29 Jul 2005 19:42, edited 16 times in total.
Reality is that which, when you stop believing in it, doesn't go away.—Philip K. Dick
User avatar
Villem
Tycoon
Tycoon
Posts: 3310
Joined: 28 Aug 2003 09:38

Post by Villem »

Sounds nice that theres finally a new cargo, thats testable.
User avatar
Csaboka
Tycoon
Tycoon
Posts: 1202
Joined: 25 Nov 2002 16:30
Location: Tiszavasvári, Hungary
Contact:

Post by Csaboka »

A little taster screenshot:
Image
Reality is that which, when you stop believing in it, doesn't go away.—Philip K. Dick
User avatar
Rob
Tycoon
Tycoon
Posts: 4355
Joined: 31 Dec 2002 16:52
Location: Ven-Zelderheide, The Netherlands

Post by Rob »

Ok, in my existing game it doesn't seem to work.
The refinery only accepts oil, no chemicals.
If I start a new game the refineris except the chemicals just fine.
Now it may be that this happens because of the date I'm in atm : 3165

ps if you want the savegame, I'll upload it too.
Attachments
Clipboard.png
Clipboard.png (79.71 KiB) Viewed 741 times
Wie zich gelukkig voelt met het geluk van anderen, bezit een rijkdom zonder grenzen. (F.Daels)
Image
Still the best OS around
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

Rob wrote:Ok, in my existing game <snip>
Don't I remember Csaboka saying something about newindustries not working well in existing games?

Hmm... It appears I do. Looks like he said it in reply to a similar problem that Rob was having not too long ago.
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
Rob
Tycoon
Tycoon
Posts: 4355
Joined: 31 Dec 2002 16:52
Location: Ven-Zelderheide, The Netherlands

Post by Rob »

My game is a nice testcase for new devellopments..
Besides if nobody reports these things, nothing can be done about it.
I don't want Csaboka to fix my game or that he even fixes it for any existing game, but if he wants to do it he'll need as much support and data as he can get his hands on.
Csaboka wrote:if something works strangely or differently from previous versions, please report it here
I just follow ordes, as you can see here ^^^^^^. :roll:
Wie zich gelukkig voelt met het geluk van anderen, bezit een rijkdom zonder grenzen. (F.Daels)
Image
Still the best OS around
User avatar
George
Tycoon
Tycoon
Posts: 4363
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Post by George »

well may be we should write about uset slots here? O create a new topic? I'll take, lets say, slots 0D and 0E for petrol and tourists, and reseve slot 0F, Ok?
Image Image Image Image
User avatar
Csaboka
Tycoon
Tycoon
Posts: 1202
Joined: 25 Nov 2002 16:30
Location: Tiszavasvári, Hungary
Contact:

Post by Csaboka »

Rob: OK, it's my bad not telling it explicitly, but newindustries GRFs don't work well with existing savegames. I think I'll make a sign cheat to fix this. Paper.grf is an exception, it was written specially so it uses exactly the same internal slots as Oskar's switch and have the same characteristics, so you can't tell apart "old" and "new" paper mills/printing works.

George: You can announce what slots and bit numbers you use here if you like.

To all GRF coders: Expect a chart to be posted today, which will contain all important data of the original cargos, so you'll have a reference about how you should set your new cargos.
Reality is that which, when you stop believing in it, doesn't go away.—Philip K. Dick
michael blunck
Tycoon
Tycoon
Posts: 5948
Joined: 27 Apr 2005 07:09
Contact:

Post by michael blunck »

> well may be we should write about uset slots here? O create a new topic?
> I'll take, lets say, slots 0D and 0E for petrol and tourists, and reseve slot 0F, Ok?

I think it´s too early to "reserve" slots for individual cargo. Firstly, there´s no list for additional cargoes and secondly, this feature as well as the interface to .grfs is only in an experimental stage.

However, there´s need for some sort of cooperation between sets, most importantly between full train sets (which are developing into full "scenarios") and your road vehicle sets.

O/c, we could/should put together lists of "new cargoes" for the different climates (I´m only interested in temperate, ATM).

Here´s my working list:

raw materials:

01 coal
03 crude oil
04 livestock
06 grain
07 wood
08 iron ore
** sand, clay, lime
** potash, gypsum, salt
** wool
** fish

products:

09 steel
** timber
** clay bricks, cement
** glass
** sulphur [1]
** chemical products
** fertilizer
** beer
** textiles

goods (all 05?):

building materials
cars, machinery
food
textiles [2]

regards
Michael
User avatar
Csaboka
Tycoon
Tycoon
Posts: 1202
Joined: 25 Nov 2002 16:30
Location: Tiszavasvári, Hungary
Contact:

Post by Csaboka »

If anyone downloaded the DOS version before now, please download it again. It had a bug that made it crash with newcargos turned on.
Reality is that which, when you stop believing in it, doesn't go away.—Philip K. Dick
User avatar
Csaboka
Tycoon
Tycoon
Posts: 1202
Joined: 25 Nov 2002 16:30
Location: Tiszavasvári, Hungary
Contact:

Post by Csaboka »

Csaboka wrote:To all GRF coders: Expect a chart to be posted today, which will contain all important data of the original cargos, so you'll have a reference about how you should set your new cargos.
Here it is

Oh, by the way, I'm not sure if the AI can handle the new cargo types, feedback about this would be also welcome.
Reality is that which, when you stop believing in it, doesn't go away.—Philip K. Dick
User avatar
George
Tycoon
Tycoon
Posts: 4363
Joined: 16 Apr 2003 16:09
Skype: george-vb
Location: Varna, Bulgaria
Contact:

Post by George »

michael blunck wrote:> well may be we should write about uset slots here? O create a new topic?
> I'll take, lets say, slots 0D and 0E for petrol and tourists, and reseve slot 0F, Ok?
I think it´s too early to "reserve" slots for individual cargo. Firstly, there´s no list for additional cargoes and secondly, this feature as well as the interface to .grfs is only in an experimental stage.
But you'd agree, that the work should be coordinated? ;)
michael blunck wrote:However, there´s need for some sort of cooperation between sets, most importantly between full train sets (which are developing into full "scenarios") and your road vehicle sets.
Absolutely right!
michael blunck wrote:O/c, we could/should put together lists of "new cargoes" for the different climates (I´m only interested in temperate, ATM).Here´s my working list:
raw materials:
01 coal
03 crude oil
04 livestock
06 grain
07 wood
08 iron ore
** sand, clay, lime
sand is yellow as grain, clay is black as ore. Lime is ligth gray. May be it would be the best?
michael blunck wrote:** potash, gypsum, salt
How should they look like?
michael blunck wrote:** wool
Transported in closed box cars, like mail?
michael blunck wrote:** fish
Transported in food refs as food?
michael blunck wrote:products:
09 steel
** timber
Is it ply-wood we have now?
michael blunck wrote:** sulphur [1]
How should it look like?
michael blunck wrote:** chemical products
Lets reserve slot 10 for it?
michael blunck wrote:** fertilizer
How should it look like?
michael blunck wrote:** beer
** textiles
Transported in closed box cars, like mail?
michael blunck wrote:goods (all 05?):
building materials
cars, machinery
food
textiles [2]
May be they should be splitt? At least first 3?
Image Image Image Image
User avatar
Prebral
Traffic Manager
Traffic Manager
Posts: 141
Joined: 20 May 2005 13:22
Location: Prague
Contact:

Post by Prebral »

Lime would be nice and it is useful in many ways (construction, desulphurisation of power plant smoke, metallurgy) ...maybe including also limestone to introduce some quarries.

The lime cycle should look somehow like this:
Quarry -> limestone, maybe just bit of goods to include the material used for construction

limestone -> Limekiln -> lime

lime -> iron mill (medium accepted quantity), power plant (low accepted quantity), factory and/or refinery (the rest)


OK, this is a bit my "personal" theme. Here in Czech republic, limestone exploitation at Bohemian karst and Iron ore mining (both for steel works) were one of driving forces of industrial revolution and many railway tracks were built because of this.

Plus, limekilns (old ones preferably) are simply cool :wink: :
http://www.prebral.net/gal/ryba/kladno/ ... G_4219.jpg
http://prebral.net/gal/2p/Pan1.jpg

And quarries may be too...
http://www.hornictvi.info/techpam/amerika/tp.htm
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Post by wallyweb »

Two observations as questions:

1. Is it possible to have secondary industry produce two types of product?
eg - refinery accepts crude oil - produces oil (or petrol?) AND chemicals

2. Can a few slots be reserved as open so that a set with unique products can use them?
eg - France - grapes to wine (This could apply to many other countries as well)
michael blunck
Tycoon
Tycoon
Posts: 5948
Joined: 27 Apr 2005 07:09
Contact:

Post by michael blunck »

> 1. Is it possible to have secondary industry produce two types of product?
> eg - refinery accepts crude oil - produces oil (or petrol?) AND chemicals

Yes. Max is 3 types in and 2 types out.

> 2. Can a few slots be reserved as open so that a set with unique products can use them?

Yes, that was the idea. With 32 types of cargo we´d be able to both set up a "standard" list of cargoes for each climate plus to have some free slots for "exotic" or .grf specific cargoes.

I´ll write more on this later today.

regards
Michael
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Post by wallyweb »

michael blunck wrote: ... Yes. Max is 3 types in and 2 types out.
Perfect!
michael blunck wrote: ... plus to have some free slots for "exotic" or .grf specific cargoes.
Good!
michael blunck wrote:I´ll write more on this later today.
Watching topic 8)

Thanks Michael. :)
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Several issues

Post by wallyweb »

Sorry if this seems to be a double post but this is not related to my previous post.

I created a scenario under alpha 55. I only installed resource industries and 2 coal fired power stations and 7 banks. The only resource industries that would be affected by vcs would be the oil wells and rigs.

I played the scenario without the new vcs grf's and with newcargos commented out. It worked fine.

I then replayed the same scenario (not the savegame) with everything vcs turned on and using the vcs patch.
At the current point in time, I have not built any secondary industries. I have not yet built any freight trains.
The game has added a couple of secondary industries on its own although I have set number of industries to "none". (This is another issue that predates vcs)
I have not enabled the AI so I have no competition.

The issue seems to revolve around banks and valuables.
1. Train picks up valuables, mail and passengers.
2. Train stops at town with no bank.
3. At that town passengers and mail are unloaded.
4. Train does NOT pick up passengers and mail.
4a. If train is sent back to that station before continuing on, it will then pick up passengers and mail.
5. Train continues on to town with bank.
6. Train unloads valuables.
7. Train picks up passengers and mail.
8. Train does NOT pick up valuables.
9. Train's profit is negative value but company income is positive.

scenario, savegame, newgrfw.cfg and ttdpatch.cfg are below:
Attachments
vcs_issue.zip
scenario, savegame, newgrfw.cfg and ttdpatch.cfg
(206.37 KiB) Downloaded 197 times
User avatar
Csaboka
Tycoon
Tycoon
Posts: 1202
Joined: 25 Nov 2002 16:30
Location: Tiszavasvári, Hungary
Contact:

Re: Several issues

Post by Csaboka »

wallyweb wrote:The issue seems to revolve around banks and valuables.
It didn't have anything to do with banks. The first eight point was because of me messing up gradualloading if fulloadany is turned on, the last point was because of me messing up feederservice :oops:

Both bugs are fixed now, the fixed files are uploaded to the same URL.
Reality is that which, when you stop believing in it, doesn't go away.—Philip K. Dick
User avatar
wallyweb
Tycoon
Tycoon
Posts: 6102
Joined: 27 Nov 2004 15:05
Location: Canada

Re: Several issues

Post by wallyweb »

Csaboka wrote:
wallyweb wrote:The issue seems to revolve around banks and valuables.
It didn't have anything to do with banks. The first eight point was because of me messing up gradualloading if fulloadany is turned on, the last point was because of me messing up feederservice :oops:

Both bugs are fixed now, the fixed files are uploaded to the same URL.
Thanks Csaboka. No :oops: needed. After all, this is still experimental isn't it and you did ask that we report any issues so you could address them. I'll download the update and give it another try later today.
Thanks for the quick fix. :bow:
I'm looking forward to when the artists and coders get some stuff together. The potential here is phenominal. :wink:
Flamelord
Chief Executive
Chief Executive
Posts: 731
Joined: 24 Mar 2005 22:29
Location: Oregon

Post by Flamelord »

What about Trash? Is it possible for cities to produce Trash? I think it would be interesting to be able to haul away the cities' trash. I know at least several of the cities on the U.S. West Coast ship their trash away to remote landfills. Any possibility we could have trash cars?
Additional Livery Set
Official TT-Jewel Staite FanClub
Post Reply

Return to “General TTDPatch”

Who is online

Users browsing this forum: No registered users and 3 guests