News:

Simutrans Tools
Know our tools that can help you to create add-ons, install and customize Simutrans.

Trucks-order of introduction (pak128)

Started by zc15-nyonker, January 13, 2010, 08:48:06 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

zc15-nyonker

I was playing on pak128, and I set the date to 1920. Three styles of trucks were around: a bulk truck, grain truck, and fabric truck. I had started a road for a lumber line, and there were no truck to haul it. man has been using lumber much longer than coal or iron, plus a log truck is simpler, so why aren't they introduced first on pak128?

VS

The pakset was originally intended to be played from 1930 onwards, and that means nobody cared that much about earlier dates.

Can you suggest how to change them?

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

seeker

Quote
Can you suggest how to change them?

IF you are comfortable with a hex editor, as follows:

1) Open a timelone=off game, find the vehicle you want to modify,

2) Write down name & intro date,

3) Close game, find vehicle.?.pak file (might be tough to find correct pak file),

4) Use a decimal/hexadecimal convertor/calculator, do following:

  a) Multiply existing intro year (decimal) x 12, add number of intro month (0-11), convert to hexadecimal, write down,

  b) Do same with wanted intro date.
     e.g. Sindor-Sentinal Log Truck, intro December, 1921: vehicle.Sentinel_Wood_Lorry.pak
               (1921 x 12) + 11 = 23,063 decimal = 5A17 hexadecimal
            Change wanted; August, 1919:
               (1919 x 12) + 7 = 23,035 decimal = 59FB hexadecimal

5) MAKE A BACKUP COPY OF ORIGINAL FILE, in a folder above the 'pak128' folder OR make a copy within 'pak128' folder, and rename to e.g. vehicle.Sentinel_Wood_Lorry_pak.ORG

6) Start your hex editor, open the file you want to change, look for "VHCL", in a pak with just one object it is just a few lines from the beginning about 0x45, actual location may depend on pak version (older paks made for earlier Simutrans versions MAY be different). A few tens of bytes further, about 0x84 you should see "TEXT", immediately followed by the vehicle name. Between "VHCL" and "TEXT" are the vehicle specifications.

7) This step depends on your computer OS. Since the computer Stone Age, Microsoft OS's & PC's REVERSE the byte order, so 5A17 hexadecimal will appear as 17 5A. (Though I have seen programmers do the exact opposite to confuse just this kind of hacking). I can't speak for Linux, or MACs, but they may use the more logical  5A 17. (This has to do with the original design of CPUs. Do a Google search on "debian" or "non-debian" if you are curious.) In any event, find the appropriate bytes, and replace them with your new bytes, making sure to use the correct order. Save the file as its original name. Exit the hex editor, fire up Simutrans, and check your new intro date. If Simutrans crashes on startup, I can think of 2 immediate reasons, 1) you accidently added of deleted a byte in the hex editor, or 2) you used a value Simutrans couldn't handle (e.g. 0xFFFF might be interpeted by Simultrans as -1, not 65,535). If your new vehicle specs look out of whack, say top speed 23,000 Kph, you probably didn't replace the correct bytes, or didn't order the bytes properly. Erase the modified file, copy the original back to its correct name, and try again.

Keep in mind, this may be copyrighted material, so you may not distribute it without permission of copyright holder, though it is fine for your own use. And, you may affect the game balance intended by the pak developers, if you change things without thinking about how it affects other factors in the game. If you are comfortable with introducing a truck a few years early, fine, sticking a fusion reactor into 1920 is certainly going to change things. So will $1.00 locomotives. It's all up to you.

sdog

seeker, it's easier to change the dat files directly from the sources (git repository, is svn up already?) and run makeobj. Since VS is the maintainer of the pak, i think he was asking not so much how to do it, but what should be done.

@zc15-nyonker
easiest for your game is to skip a few years until 1930, when the pak becomes fully playable. You can do this by switching player to 'public service' and then go to the "world tools" toolbar, that's the one that should suddenly appear after switching players. There is a button to advance the timeling (in other words, skip) one year.

VS

#4
Ah, I got reintroduced to hex-editors without noticing! I think the message is a valuable text to have around anyway, for the more green modders :)

Anyway, sdog was right - "how to change" was meant as a prompt for opinions and ideas.


edit: oops, forgot "s" in "sdog" - sorry!

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!

sdog

let's have the graphics contest after this one with the theme increase the timeline for lorries to the past. Not too dificult subject, not too much overlap and useful for any pak-set. :-)

seeker

#6
Quote from: sdog on April 11, 2011, 04:54:37 PM
seeker, it's easier to change the dat files directly from the sources (git repository, is svn up already?) and run makeobj.

Agreed, sdog, IF the source is available. This works whether source is open or not. I may have misunderstood, but isn't some of the pak128 source still unavailable?

Quote from: VS on April 11, 2011, 06:18:48 PM
Anyway, dog was right - "how to change" was meant as a prompt for opinions and ideas.

Well, guess the 'easiest' thing to do is for community to ask pak128 developers for more "era diversity". Or maybe some of the artists around can develop some tips, tricks and guidelines for upscaling pak64 .pngs, with pak128 developers offering advice on balancing specs for their economy.

EDIT: One of the problems of getting old and crotchety, is I sometimes "Pause: Brain,  Engage: Mouth". I don't want to appear snide or arrogant, but I have spent a good part of the last week voraciously reading the forums. At the risk of going off-topic, I have seen a trend.

Simutrans and its present diverse content was created by a smallish group of knowledgeable enthusiasts. The measure of your success is your current appeal to a wider audience. Simutrans is in its adolescence. The community of developers is at a fork in the road ahead. I have seen other communities of moddable games split into factions and cliques, to the point where they won't even speak to each other or let mention of the other appear in their respective forums. (I know of one that auto-censors the name of a mythological figure, because it is the user name of a developer.) You shouldn't let that happen here.

I think sdog may sense the wider audience. Your topic http://forum.simutrans.com/index.php?topic=7146.msg69045#msg69045 and one of your posts in same http://forum.simutrans.com/index.php?topic=7146.msg69071#msg69071 is apropriate to this.

zc15-nyonker is an example of the problem. I had a similar problem. In all the great documentation, and collection of links to paks, addons, and tools nowhere is there any central statement about the core design principles of the timelines and economic balancing of the various paksets. I don't want to fault anyone, but in pak64, basically it says "We don't recommend starting before 1830." & "Leave passengers and mail until later." In pak128, unless I have missed it somewhere, you have to mine deep into the forums to find that pak128 is designed around a 1930 game start, and the forum consensus (I think) seems to be to go with passengers first. I was surprised that I could build a road depot in 1810, but couldn't find a road vehicle (or rail, for that matter) for a century. A little disconcerting.

I saw a post summarizing the current development status of paksets, and as is to be expected, many are in limbo, while a handful are in active development. People continue to create addons for pak64, because it is the "standard". Addons for 128 sets are more sparse, and tend to fall in line with the existing timelines. Pak64 stands on its own as far as gameplay, but graphically pak128 is gorgeous. Speaking as someone with aging eyes, that's a big +point for pak 128. I can live with the decision by the pak128 developers to adjust the economics, even if it is "harder". After all we get into these simulations for the challenge. Still, I think the developers missed a bet by restricting themselves to the 20th+ century.

Though I haven't yet explored the pak128.Britain set, I am aware they include 19th century content. A poster suggested incorporating content from Britain as addons to pak128, rightly cautioning about game balance & incompatabilities, but without going into any specific details.

Personally, I see pak128 as (potentially) the "official" "upgrade" from standard pak64. BUT, I think for that to happen, the pakset developers need to sit down and thrash out a common timeline/balance framework, and publicize it to the players. (And I'm not naive, I know that is a tremendous amount of work, but maybe a hiatus in pak development might be worthwhile.) Making them distinctly different in gameplay, imho, is a serious mistake, which will ultimately fragment the community.

In the meantime, to avoid answering zc15-nyonker, mine, and similar questions, maybe a short summary (written by the developers) outlining the difference between the paksts might be posted prominently somewhere?

Finally, despite my reputation as a curmudgeon, I DO appreciate the tremendous work you have all already put into this game.

"Steps down from his soap box...."