News:

SimuTranslator
Make Simutrans speak your language.

MaK DE 1002

Started by the almighty snark, November 21, 2008, 09:27:36 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

the almighty snark

Hello, ive been playing simutrans for quite a while now, and figured i should repay you all for the hard work you' ve done!

So, i decided to create some extra content for people to use. Im a gamedesigner, not graduated yet, but i can find my way around most tools! So i figured i should make one of my favorite locomotives, the MaK DE 1002, the loc that was used as the base for the NS 6400, which i find a joy for the eye to see, couple 5 to eachother with a coal train and feel the earth tremble!

As you can notice, im dutch, so i have been using Raven's NS package a lot! Its wonderfully done! I hope to be able to reach the same style by using 3dstudiomax and rendering it with basic materials. If this project will turn out succesfull then i might try and create more MaK locomotives!

But, i have a question, i think i got most of the proces right, but i couldnt find what i would need to put in the .dat file. If that is set-up correctly then all i need is the PNG and and makeObj?

And thanks again for creating this game!

DirrrtyDirk

Hi and welcome to simutrans and the forum!

The .dat files are just plain text files, containing all the values for the object, in case of vehicles that includes name, speed, power, cost, payload, etc. You might want to check pak64 sources (they're open source, available on sourceforge) for an idea of how .dat and pak files work together. For pak128 all you need to do is use bigger graphics (and a little different command in makeobj).

Out of the .dat file (with all the parameters) and the .png file (with the graphics), makeobj creates a .pak file that simutrans can use.

The hardest and most time consuming part is however simply to draw the graphics. Writing the .dat is easy and creating a pak out of both is the simplest of all. So, when you have the .png ready, you're already 98% done.
  
***** PAK128 Dev Team - semi-retired*****

the almighty snark

Cheers! ;D Sounds pretty straight forward, il check it out tommorow!


DirrrtyDirk

Quote from: the almighty snark on November 21, 2008, 09:58:08 PM
Sounds pretty straight forward

It is.  8) (Well, at least most of the time...)

You might also want to check out the wiki page on vehicles.
  
***** PAK128 Dev Team - semi-retired*****

the almighty snark

Thanks a ton!! ;D That's exactly what i was looking for!

One more question, how should i set-up the rendering for the best results? I set up the camera to orthographic and in a 26.57 down angle but should the vehicle fit in the 128x128 tile? Or is that merely for alignment and how will it effect the display?

Hope im not bothering you to much with n00bie questions :)

DirrrtyDirk

I'm a pixel pusher, not a renderer so I don't know anything about that, sorry.

However, vehicle size follows a certain scale in each pakset, and the length parameter in the .dat file.

In pak128, the scale is something like roundabout 2 - 2.5 meters per length unit. And length=16 is a full tile, so the default value of length=8 results in a vehicle with half tile length. Most vehicles have values between 6 and 10, since there's rarely need for more (or less). As pak128 is not yet open source, you can only check some addons to see about size and position for now.

You might want to checkout the Japanese pak128 addons site, since there are many (but not all) addons published including their source files. For a small and simple engine with sources, maybe try this one (it was done by me a while ago).
  
***** PAK128 Dev Team - semi-retired*****

the almighty snark

Aaah, makes sense! Il just experiment a bit with i until i get something that im happy with. I can only imagine a ludmilla or a clas 66 being a full tile long ;D

the almighty snark

Been experimenting with your source! Works like a charm, although the train now carries a halo around itself, not quite sure where it comes from, but i'm quite sure its my fault. Oh, the cars are from Ravens cargo set!

DirrrtyDirk

Looks like an anti-aliasing problem (or whatever the function for smoothing the edges of the engine with the background is called in your program) Anyhow, looks like your software used several tones of light blue around the edges, instead of the one and only correct RGB-value of 231/255/255.
  
***** PAK128 Dev Team - semi-retired*****

the almighty snark

#9
Quote from: DirrrtyDirk on November 22, 2008, 09:38:32 PM
Looks like an anti-aliasing problem (or whatever the function for smoothing the edges of the engine with the background is called in your program) Anyhow, looks like your software used several tones of light blue around the edges, instead of the one and only correct RGB-value of 231/255/255.

Righto, that is something i can fix !

EDIT:

There still is some white, which seems to appear after it has been saved as a PNG from photoshop, is there anyone else familiar with this kind off compressing?

prissi

Save as PNG with no JPEG compression (should be standard. Or save as BMP, load in paint, fille background with lets say green and edit the pixel and fill it again in transparent color can do the trick too. Imho photoshop is not very useful for pixel pushing. But everyone has the program he can use best.

the almighty snark

Il have to try that, and yes your right, photoshop isnt very helpfull when needing heavy pixel-texture control. I map for a game called Half-Life, and i spend a week getting alpha maps to work correctly. Photoshop almost always interpolates a few pixels to a in-and-between colour. Eventually i got it working, but it wont improve the image for Simutrans, so maby GIMP or Paint.net makes a good alternative next to the tools you mentioned!

VS

It is not about compressing. PNG is lossless - what you give is what you get again (btw, the jpeg extension is JNG and not used at all).

You must either

a) Configure your renderer not to mix background with objects, or

b) Select the colour e7ffff (231,255,255) with some tolerance and clear to this same colour. And when doing so, set the border to not smoothed, or something like this. It must select pixels either 100% or 0%, or there will be again some edge.

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!

the almighty snark

Thanks VS! It works perfect! All i need to do know is add some more detail and livery's! ;D

Oh, one more question, how should i put the pricing of this locomotive?

DirrrtyDirk

The position still seems to be a little off, but you're certainly getting there.  :)

And pricing... we are (well actually zeno is) creating a new pricing & balancing system for pak128, but that will still take quite a while until it is finished. So in the meantime, just make something up - within reasonable range. For now, just look around pak128 and use some price of a vehicle roughly similar to yours.
  
***** PAK128 Dev Team - semi-retired*****

the almighty snark

Yeah i noticed its a bit off too, might have something to do with the camera or the positioning in the PNG.

Il dive through the PAK files, i noticed Raven priced the trains in the NS pack very low, which would make this loc somewhere around 3000 compared to its spawn, the NS DE 6400 series, which has more power, is smaller and can go 30 KM faster, and is 3504.

I suppose its a bit low? Since its quite easy to make a lot of profit with raven's vehicles.

DirrrtyDirk

Yes, raven concentrated mainly on just creating graphics - he usually didn't care much for "correct" pricing and balancing, leaving that to others who where interested in his works.
  
***** PAK128 Dev Team - semi-retired*****

the almighty snark

Thanks, i got some usefull value's from looking at those. Il post some more info tomorrow!

Zeno

Quote from: the almighty snark on November 22, 2008, 10:21:15 PM
Oh, one more question, how should i put the pricing of this locomotive?
If you give me some data I can make a quick calculation for you. I'll need for that its weight, max speed, power, engine type, gear, and intro date.

the almighty snark

Weight : 90T
Max Speed: 90 KM/H
power : 1320 kW
Engine : Diesel
gear : unknown

Intro date 1986 -1993

DirrrtyDirk

#20
In simutrans, gear is just an internal multiplier for power. You can use it so that a vehicle still shows its real life power value, but internally the power gets modified by the gear factor, so that you can get the intended in-game behaviour, even when the original power value wouldn't allow for it.

So in your case a gear value of 2 (written as 200 in the .dat file) would give it an internal power of 2640kw (while still showing the original 1320).

So you just have to choose a value for that, usually it lies somewhere between 0.8 and 2.5 (= 80, 250 in the .dat file) - just look around other ST vehicles.

EDIT: Oh and intro date is only one year (and month), the other year you can specify is the retire_year (and month). So have you set intro to 1986 and retire to 1993 ?
  
***** PAK128 Dev Team - semi-retired*****

VS

It seems "off track" since the wheels (bogies?) have identical colour to track and gravel underneath it. Make them darker and you may see more clearly how it fits.

For what's it worth, almost all rolling stock in 128 has wheels depicted by only one or two rows of pixels; steam locos have more, but they have huge wheels irl, too.

But do as you please :) If you set your own style and create a large set, internally consistent, it is simply an alternative - not inherently better or worse.

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!

Zeno

I've calculated theorically balanced values for this loco, and are the following:
Purchase price: 45000 cr (DAT value = 4500000)
Running cost: 1.17 cr (DAT value = 117)
Gear: 1 (DAT value = 100, can be ommited)

Try with these values and tell me everybody your impressions; it will be a good feedback for me!

the almighty snark

@Dirk : It is indeed the retire date, 1993.

@VS yeah the gears are a bit screwy, i found that out only after rendering, and i decided that it was something for another day, i also lowered the gears in the 3d model so that there closer to the body for aesthetics purposes.

@Zeno, sounds good! I will have to give it a try to see if they work!

the almighty snark

Zeno, the price and all seems fair, although the acceleration with 8 empty cars behind it seems to be rather slow, should i up the gear a bit?

Although it is pretty realistic, this is a long hauler, not a PAX vehicle.

Zeno

Yes, raise gear to a value wich makes it accelerate as you expect. A value of 1.1 or 1.2 may be enough, but remember you are increasing the power of the loco, and you may get an unwanted result.
The best usually is to adjust and test comparing to other locos of the same ages and similar power, and see if it fits or not in there ;)
When you think you got the correct value, tell me and I'll calculate again the pricing (it will change a little with a higher gear).

the almighty snark

Ok, wil do, il have test it a bit more though, because a small train accelerates pretty fast, and i havent tested it in the standard 128pak yet, only combined with raven's train sets.

the almighty snark

Tested and approved ;D ;)!!

I included the .pak file in this post, i can use some feedback on the pricing, how it handles etc. I think its pretty good right now!

The graphics still needsome reworking, but im quite happy with how it came out :).

the almighty snark

#28
Hey guys, im working on the earlier version of this locomotive, which was introduced in 1982, 4 years earlier. It weighs heavier and has a weaker engine, so if someone would be willing to help me out on the pricing scheme of this one:

Weight : 80-100T
Max Speed: 90 KM/H
power : 1120 kW
Engine : Diesel
gear : unknown

Intro date 1982

Also, if anyone thinks that it would look good in a particular colour scheme then im also open for suggestions :)

EDIT: Here's a render of the current paint scheme, inspired by the HGK DE 93. The red varies on the serval loks painted in this scheme.

Zeno

Quote from: the almighty snark on November 24, 2008, 06:12:07 PM
Weight : 80-100T
gear : unknown
I'll need one defined tonnage... 80 or 100? If it's heavier as you say, I can suppose it's 100tn
Gear: Do your own tests and adjust it, at least a little. After that I'll give you numbers in a minute ;)

the almighty snark

Il keep the gear at 1 so far, it seems to have a decent acceleration when fully loaded, it also looks good. Il go with the 100T, i think they made serval engines for this version.

Zeno

Ok then... let me make some calcs... mmm ... aha!  ;D

RC: 103 cents
Cost: 3940000 cents

the almighty snark


the almighty snark

I completed the second paintscheme for the 1986 version, im working on the 1982 version right now! Here's a screenie for your viewing pleasure ;D.

vilvoh

#34
Looks good but I think you should apply a sharpen filter to the result of the render, in order to get more definition. It looks quite blurry... :-\... Anyway, I like the model. It's simple but the result it's very good. One doubt ¿How did you applied the textures? ¿UV Mapping? ¿projecting them on the model?

Escala Real...a blog about Simutrans in Spanish...

the almighty snark

I tried experimenting with sharpening a bit, you can see the results on the first page, im not quite sure if i should go with that, although it brings out more details. Il tinker with it a bit more!

I made a blend material in the multimaterial, i applied this to all the sides that needed the stripe. Then i added a white material to it, so it would mix them, to get the right mix i used a opacity map, simple black n white, black for what should stay red/orange, white for what should become the stripe.

I selected the objects before the UVmap, then with a mesh select the faces, then a edit mesh, then a UVWmap to get a basic projection, and then i applied the Unwrap UVW to align it out.

Hopes this makes sense, if you have any questions feel free to ask them!

vilvoh

So, If I've read correctly, you have used something like two layers, haven't you? The one at the back corresponds to the background color (red, yellow, etc..) and the one at the front is an image you use to apply the white texture using the alpha channel... interesting.

It seems you're using plain colors, however the result is really good. You get contrast and relief in the whole model surface. Which render engine are you using? 3dSmax default? You might try Brazil render engine. I tried it some time ago, and the render results were simply awesome.

Escala Real...a blog about Simutrans in Spanish...

the almighty snark

Default scanline render with raytracing, a skylight i added to thescene to provide basic GI, then i add the sun light with a light orange hue.

Yup, you are right about the layers, its a very effective way!

I use some spec with gloss turned down in the colours, so that the light spreads better along the surface of the model!

Yup, Brazil is really powerfull, ive seen some good results with it! Although i havent mastered the standard radiosity/raytrace engine yet! :)

vilvoh

Quote from: the almighty snark on November 25, 2008, 02:33:26 PM
Yup, you are right about the layers, its a very effective way!

It's a helpfull technique I sometimes use in Blender, but not always works as it should. There's another one that provides a curious way to apply textures called UVProject Modifier. It may be used with complex models where it's difficult to unwrapp the UV map, but I don't if you can do the same in 3dSMax.

Quote from: the almighty snark on November 25, 2008, 02:33:26 PM
Yup, Brazil is really powerfull, ive seen some good results with it! Although i havent mastered the standard radiosity/raytrace engine yet! :)

I used it with Rhinoceros, another 3D modeling Software, and the results are wOw...it's a pity that It's not compatible with Blender, however we have Yafray.... ;D

Escala Real...a blog about Simutrans in Spanish...

the almighty snark

Ah yeah i' ve heard of that one!

I think max has pelt mapping, although i havent tried it yet, im kinda picky on controlling every polygon.

the almighty snark

Vilvoh, how does this look? It indeed looks a bit blurry if you compare them now, but i tried to go with raven's style, and they fit better with those locs without sharpening.

vilvoh

Two thumbs up!! bright but with enough contrast. I like the second yellow one starting from the back. I've doubts about the ilumination. In red ones the left side seems more iluminated than the back part, whick is quite dark. In Simutrans the sun comes from South, so the lights positions on the scene must follow that scheme, in every view of the object.

See this diagram:


The rest is very good. Last question, does it fit on 128pak scale? It seems a liitle big

Escala Real...a blog about Simutrans in Spanish...

the almighty snark

I dont know, i dont really want to scale it down more, but if it needs to be done.

Please download them and see for yourself, if they need to be smaller then so be it!

The real loc is 13M long.

vilvoh

Ok. I'm not a 128pak expert but I've tested it and imho the scale is right.

Escala Real...a blog about Simutrans in Spanish...


DirrrtyDirk

Well, but 13m for length=8 seems a bit out of scale to me
  
***** PAK128 Dev Team - semi-retired*****

vilvoh

If I'm not wrong, the 128 pak scale policy for vehicles is:

  • Each tile is about 20-26m min. and 32m max.
  • For length=8, that corresponds to 16-20m aprox. even 25m in some cases, the recommended length in pixels is arround 32.

Snark's Mak loco length is 62 pixels (almost half a tile) Following the previous guidelines, its real size would be 32-40m.

Escala Real...a blog about Simutrans in Spanish...

the almighty snark

Il have to scale it down a bit then! Thanks for helping with the calculations, i just overlayed it on dirks source files.

vilvoh

Well, It depends on the real length the cab has, which I can't find right now, but I think so. How large is it? I mean real measures in metres.

Escala Real...a blog about Simutrans in Spanish...

DirrrtyDirk

#49
Well, personally I use a scale of 1 length unit = 2.5 meters for my Japanese 128 vehicles... and the original in my case is 18.60m long.

But since I only made a new livery for an already existing engine, I stayed with length=8 (even though 7 would have been a little closer to scale... - but with 1.10 m difference to a perfect "7" and just 1.40m to a perfect "8" ... 30cm didn't make that much of a difference, so I stayed with 8 - half a tile - for simplicity.)

For 13 m, a length setting of 5 or 6 (maybe even 7) should be more fitting.
  
***** PAK128 Dev Team - semi-retired*****

vilvoh

In case you want to improve your textures, or just have a good reference, I've found this site. It has good photos from different angles and views that may help you.

Escala Real...a blog about Simutrans in Spanish...

the almighty snark

Thanks for the help, im going to scale it again today and see how that works out!

the almighty snark

Ive been messing around a bit more, and im wondering, what size would fit the locomotive best, i made a screenshot from the train depot, you can see serval locs, im thinking about scaling it down a bit so it looks more like the red diesel loc in the middle(about 6 left of the MAK 1002). Any suggestions? Im a bit worried about losing too much detail.

vilvoh

Where's the screenshot? ???

Escala Real...a blog about Simutrans in Spanish...

the almighty snark

Oeps, forgot to upload it ;D

vilvoh

From my point of view, it seems slightly bigger, just two or three pixels, compared with the rest but I think it's OK. Let's wait for pak128 expert's opinion.

Escala Real...a blog about Simutrans in Spanish...

Zeno

Yes, it seems to be quite oversized (I would even say more than a couple of pixels). The red diesel loco on the left you mention may be a good reference in size terms. Once solved this, it a really looks like a good work :)

the almighty snark

Cheers, i geuss the red loc is going to be the target size then :). I started working on a Bombardier TRAXX 160 AC, i think its a beauty to watch.

the almighty snark

I have been trying to get it to compile again, but all i see is a bright white triangle in simutrans, what could be causing this? I still save it as a flattened PNG.

vilvoh

A screenshot would help..

Escala Real...a blog about Simutrans in Spanish...

the almighty snark

Sure, this should do it:


vilvoh

Ah!! The famous problem with transparency... It can be easily fixed just cutting and pasting in a new image.

Escala Real...a blog about Simutrans in Spanish...

the almighty snark

#62
Yup, worked :) Looks much better scaled down a notch.

EDIT:

How does the scale look on this version? And the detail? I applied a sharpen before scaling it down, which i think gives better results. Although removing the background before scaling was useless, PS applied a small blurred edge on the scaled object. So that is what causing the odd looking line.

VS


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!

vilvoh

In order to avoid the white edge, try to render it with transparent background (alpha channel)

Escala Real...a blog about Simutrans in Spanish...

the almighty snark

Yes, but 3D studiomax still seems to want to blur it with the background. So im messing with the AA properties(it brings out details when sharpening afterwards) and trying to scale it in the renderer instead of doing it in photoshop. No AA doesnt improve it in my oppinion.

vilvoh

One silly question: why do you exactly render and then rescale it? why don't you just render it in the proper scale?

Escala Real...a blog about Simutrans in Spanish...

the almighty snark

Usually rendering in a high resolution and then rescaling it brings out more detail in photoshop.

vilvoh

I'm not agree. In general, rescaling almost always means a lost of detail, no matter if you rescale up or down. Almost all complex rescaling algorithms (cubic, sinc3, etc..) blur the image.

Escala Real...a blog about Simutrans in Spanish...

the almighty snark

I dont know what software you are using, but if you use a bicubical sharper or nearest neighbour then it increases the sharpness of the image and definitely doesnt lose as much detail if you were to render it at its original resolution.

Scaling something up indeed does reduce detail and quality.

Zeno

I agree with vilvoh. Rescaling after render always end in worse results when making simutrans graphics, don't mind if rescaling is up or down. While logic says me the same you are explaining (scaling down should from a detailed image should be ok), experience has tought me to render in the appropiate size and not rescaling the image. Though, I've never seen a written rule on it ::)

the almighty snark

#71
Concering simutrans, then yes this might be the case. That i why im experimenting with it.

EDIT:

Straight from the render without AA:


Zeno

It's still white-edged (specially the first one), and maybe it's still a bit oversized. You have coded it with length=8 (or without any lenght, which is the same)? The optimum/desired situation is that when the multiple locos used together, they match exactly one after another, with a separation if you want of 1 pixel or so. In that capture the locos seem to get overlapped each one with the next one... you know what I mean?

the almighty snark

Yeah i get your point, what i did in this test was replace only one out of the 8 images with the render. The rest of them were still the old ones. I even modified it a bit more, il upload the vehicle.pak in a bit.