Question about engines.h and speeds

Discuss, get help with, or post new graphics for TTDPatch and OpenTTD, using the NewGRF system, here. Graphics for plain TTD also acceptable here.

Moderator: Graphics Moderators

BillSargent
Engineer
Engineer
Posts: 49
Joined: 09 Oct 2010 13:45
Location: Göteborg, Sweden

Question about engines.h and speeds

Post by BillSargent »

Hi,

I've tried increasing the speed of the Dinger 1000 and Dinger 200, and I was going to increase the passenger capacity too. When I did this, the planes go crazy and will not land at the airprots. well they do, but randomly. Most of the time they just circle very fast above or near the airports. If I send them to the hangar a few times, a few of them will break formation and land.

Are there other variables I need to take in to count when adjusting base airplane speeds and cargo via engines.h ? What could be causing the planes to circle rather than land?



Thanks,
Bill
Eddi
Tycoon
Tycoon
Posts: 8276
Joined: 17 Jan 2007 00:14

Re: Question about engines.h and speeds

Post by Eddi »

you should only change properties like speed by means of a NewGRF, not in the code.
BillSargent
Engineer
Engineer
Posts: 49
Joined: 09 Oct 2010 13:45
Location: Göteborg, Sweden

Re: Question about engines.h and speeds

Post by BillSargent »

Eddi wrote:you should only change properties like speed by means of a NewGRF, not in the code.

It's my understanding that you're limited in speed with regards to aircraft by the game engine itself. Am I wrong?

Bill
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13233
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Re: Question about engines.h and speeds

Post by Hyronymus »

BillSargent wrote:
Eddi wrote:you should only change properties like speed by means of a NewGRF, not in the code.

It's my understanding that you're limited in speed with regards to aircraft by the game engine itself. Am I wrong?

Bill
Yes, you are wrong. Like Eddi said: speed of vehicles are defined in grf's. If you want to change the speed of a vehicle you should therefor edit the grf.
See here: http://wiki.ttdpatch.net/tiki-index.php ... ion0Planes
User avatar
PikkaBird
Graphics Moderator
Graphics Moderator
Posts: 5602
Joined: 13 Sep 2004 13:21
Location: The Moon

Re: Question about engines.h and speeds

Post by PikkaBird »

Newgrf aircraft are limited to 2040mph (8*255). I'm guessing he's changing the code to make aircraft much, much faster, and it's breaking the pathfinding in the airports.
BillSargent
Engineer
Engineer
Posts: 49
Joined: 09 Oct 2010 13:45
Location: Göteborg, Sweden

Re: Question about engines.h and speeds

Post by BillSargent »

PikkaBird wrote:Newgrf aircraft are limited to 2040mph (8*255). I'm guessing he's changing the code to make aircraft much, much faster, and it's breaking the pathfinding in the airports.

The aviators aircraft (av8) NewGRF has a concord that goes up to 2253. Is it still limited to 2040 but theres some other calculation making it go a little faster?

Bill
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Question about engines.h and speeds

Post by planetmaker »

BillSargent wrote:
PikkaBird wrote:Newgrf aircraft are limited to 2040mph (8*255). I'm guessing he's changing the code to make aircraft much, much faster, and it's breaking the pathfinding in the airports.

The aviators aircraft (av8) NewGRF has a concord that goes up to 2253. Is it still limited to 2040 but theres some other calculation making it go a little faster?

Bill
The use of proper units with your numbers could potentially reduce your confusion.
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13233
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Re: Question about engines.h and speeds

Post by Hyronymus »

Plus reading what we write to help you. That might benefit your quest for changing speeds too.
BillSargent
Engineer
Engineer
Posts: 49
Joined: 09 Oct 2010 13:45
Location: Göteborg, Sweden

Re: Question about engines.h and speeds

Post by BillSargent »

Hyronymus wrote:Plus reading what we write to help you. That might benefit your quest for changing speeds too.

Is there a specific way of extracting a single vehicle from the game to use as a template for NewGRF addon? I've looked but everything dealing with newgrf seems extremely over complicated.


Thats one of my primary complaints about the game itself. The development seems to be stuck in thinking along the lines of 1990's rather than modern computing. I don't see the need for everything being coded in hex in the creation of addon material for the game. I don't see the reason for needing grfcodec which wasn't even written for this game and is an ancient CLI. And I don't understand why even in the game code itself, there are references to mph and kph and then units which are calculated by x * 128 / 10.

To me, your goal was to create a game that worked like TTD. You've done that, but you've also coded yourself into a corner by seriously creating a game that is in most regards, a duplicate of the original in how it works, and how it functions in a modern computing environment. Your ability to create content for the game is a nice touch that was missing from the original game, but you're relying on older hacked together stuff by Josef Drexler and a few others (For whom I hosted the official ttdpatch mailing list for years) in order to create said content. Why are we not using a simple plain text variable based system for content creation? The metalanguage I saw in the forum seems to be a good idea, but also very complex for people who want to do what I want to do. Just modify a single vehicle thats already in the game.

Please take my criticism for what it is, constructive. I know all of the developers work very hard and I'd never say these things about the game if I didn't really enjoy it and want to see it progress beyond the nerds and geeks who think in hex and see the game go beyond flat 1 coreness. :)

It would be nice to have a VERY good GUI for all this. Not some one's slapped together VB 5 project that looks like they put it together between classes in high school.

Bill
BillSargent
Engineer
Engineer
Posts: 49
Joined: 09 Oct 2010 13:45
Location: Göteborg, Sweden

Re: Question about engines.h and speeds

Post by BillSargent »

Hyronymus wrote:Plus reading what we write to help you. That might benefit your quest for changing speeds too.
Well I know now not to go over 255. I didn't know that. I was calculating speeds using units of 300 and 500.....
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Question about engines.h and speeds

Post by planetmaker »

BillSargent wrote:
Hyronymus wrote:Plus reading what we write to help you. That might benefit your quest for changing speeds too.
Well I know now not to go over 255. I didn't know that. I was calculating speeds using units of 300 and 500.....
Most notably you were and still are NOT using ANY units, which basically stresses the need for the request of Hyronymus.
BillSargent wrote:I don't see the need for everything being coded in hex in the creation of addon material for the game. I don't see the reason for needing grfcodec which wasn't even written for this game and is an ancient CLI. And I don't understand why even in the game code itself, there are references to mph and kph and then units which are calculated by x * 128 / 10.

(...)
The metalanguage I saw in the forum seems to be a good idea, but also very complex for people who want to do what I want to do. Just modify a single vehicle thats already in the game.
(...)
It would be nice to have a VERY good GUI for all this. Not some one's slapped together VB 5 project that looks like they put it together between classes in high school.
Aha. So you expect for a (near) complete programming language (which newgrf extension basically is) a clicky-buntiy interface with all the versatility all the same? So basically a Jack-of-all-trades device which gives you your desired results without any thought nor effort? You mention and complain it looks like "slapped together VB 5 project" but actually want to be able to do exactly the same?

Face it: programming, and that's exactly what newgrf creation is about, is not a thing you can do with just clicking a few buttons and adding a number here and there. So in order to get somewhere, it means that you need be willing to get some very basic understanding of how things work.

As you already know about NML, you might just give it a shot. Or maybe you give grfmaker a try, it might just offer enough of what you look for. It will take you many places, but won't get you everywhere the real programming languages (nfo, nml) will take you.

EDIT: grfmaker, not grfwizard
Last edited by planetmaker on 13 Mar 2011 13:00, edited 1 time in total.
BillSargent
Engineer
Engineer
Posts: 49
Joined: 09 Oct 2010 13:45
Location: Göteborg, Sweden

Re: Question about engines.h and speeds

Post by BillSargent »

planetmaker wrote: Most notably you were and still are NOT using ANY units, which basically stresses the need for the request of Hyronymus.
No, what I think is the problem is that neither you nor he are telling me what "unit" is meaning in this context. In the game code itself, a UNIT is the number in engines.h that is calculated using x * 128 / 10 .... Which I DID give.

planetmaker wrote: Aha. So you expect for a (near) complete programming language (which newgrf extension basically is) a clicky-buntiy interface with all the versatility all the same? So basically a Jack-of-all-trades device which gives you your desired results without any thought nor effort? You mention and complain it looks like "slapped together VB 5 project" but actually want to be able to do exactly the same?
Absolutely not. I expect that the development of the game head in that direction. The complicated stuff was great in the beginning and I understand that a certain area of roughness is part of the development process. But what I don't want to see is the game stuck in an older way of thinking. I always make it a habit to mention the 1 core limitation of this game because of the fact that because this was coded with 1 core in mind, its now nearly impossible to change that. This project was started at a time when multiple processors and multiple cores were very much available, and yet nobody began thinking that someday we might want to make the code work that way. Now we're stuck. Now back to the language, I don't want to see us get stuck in an hex editing mode for this game all because the developers have spent years coding the game engine to accept only that way of doing things. And I'm not asking anyone to slap together a VB5 project. I'm asking people to put some effort in to creating tools that generate DESIRE to make content, that make people who have ideas like myself, want to create content rather than get frustrated and push it away.
planetmaker wrote: Face it: programming, and that's exactly what newgrf creation is about, is not a thing you can do with just clicking a few buttons and adding a number here and there. So in order to get somewhere, it means that you need be willing to get some very basic understanding of how things work.

As you already know about NML, you might just give it a shot. Or maybe you give grfwizard a try, it might just offer enough of what you look for. It will take you many places, but won't get you everywhere the real programming languages (nfo, nml) will take you.

I do not and will not accept that hex based stuff is coding. It is not. It might have been in 1986, but it's not now. We're not all using IBM mainframes from the 1950s. With the advent of real languages, thats what got people interested in coding for computers and it's what will get people interested in this game too. The more people using and creating content for this game, the more popular and more advanced it will be come allowing a more diverse range of people to do the things they want to do with it.

I gave an example idea that I had in another thread. Countries. A map large enough that it could be played multiplayer in such a way that each player remained on his own land mass. It's a brilliant and fun idea but is simply not possible because I feel that much of what is happening with the development of OpenTTD is to remain true to the original functionality of the original game rather than enhance it beyond the original goals. Bringing OpenTTD past its predecessor's limitations should be the goal. I even suggested to someone recently, that there be another project separate from OpenTTD for just that. So that people who are fine with playing with limits can still play the game on their 486 computers. But I'm not a C coder. I can manipulate code and compile and understand some things. I only know VB 6 and PHP. I don't know C and never will know it at the level the guys who developed openttd do. Meaning, while I have great ideas, all I can do is just speak my mind. :)

I will be giving the metalanguage a try. As it's more like C, it will take some getting used to, but it's better than trying to mess with ancient tools and hex.

OpenTTD has gone beyond what Chris Sawyer's ideas were for the game. For that I am really happy. But I just want everyone who is involved in development to be aware that just because the game looks the same, doesn't mean it needs to confine itself to the style of TTDLX/TTD. The reason I mock around in the source is because I like to "tinker" with things. See how changes make the game behave. Its a learning process for me.

So do I want a "clicky-buttony" interface? Yes.... I want a friendly environment in which I feel comfortable developing addons for the game. I don't expect it immediately, I just wish people would think more in that direction. And someone mentioned GRF Wizard.... It asks for the location of the original ttd content from the original game which already tells me it's not intended to be used with OpenTTD.

Seriously, do you think the stuff I'm asking is that bad????
User avatar
Hyronymus
Tycoon
Tycoon
Posts: 13233
Joined: 03 Dec 2002 10:36
Location: The Netherlands
Contact:

Re: Question about engines.h and speeds

Post by Hyronymus »

Well, it is your right to not accept that the hex-based stuff is coding.

But please allow me the right to ignore you from now on, Mr. Know-it-all.
BillSargent
Engineer
Engineer
Posts: 49
Joined: 09 Oct 2010 13:45
Location: Göteborg, Sweden

Re: Question about engines.h and speeds

Post by BillSargent »

Hyronymus wrote:Well, it is your right to not accept that the hex-based stuff is coding.

But please allow me the right to ignore you from now on, Mr. Know-it-all.

I apologize for upsetting you. I just have strong opinions and ideas. I'm sorry you felt the need to call me names and ignore me. I wish you could take my comments seriously rather than bashing me for having an opinion.

But please accept my apology for offending you. I really don't know what I did but I already regret coming here and trying to talk to you.

Bill
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Question about engines.h and speeds

Post by planetmaker »

BillSargent wrote:
planetmaker wrote: Most notably you were and still are NOT using ANY units, which basically stresses the need for the request of Hyronymus.
No, what I think is the problem is that neither you nor he are telling me what "unit" is meaning in this context. In the game code itself, a UNIT is the number in engines.h that is calculated using x * 128 / 10 .... Which I DID give.
That's no unit either ;-) And sorry, I did not know you didn't know the meaning of 'unit': http://en.wikipedia.org/wiki/Speed#Units and compare that with http://wiki.ttdpatch.net/tiki-index.php ... s#Speed_09_
And also compare
PikkaBird wrote:2040mph (8*255)
with your numbers from
BillSargent wrote:aviators aircraft (av8) NewGRF has a concord that goes up to 2253.
where you have no unit for speed. Thus for your lack of care for units you incidentially you compare mph (Pikka) with kph (you) and ignore any conversion factors, and wondering about your results.

In class you'd get at best 2/3 of the points were it an assignment and the rest correct ;-) I love to deduct points for this carelessness, it's actually pleasing.
BillSargent
Engineer
Engineer
Posts: 49
Joined: 09 Oct 2010 13:45
Location: Göteborg, Sweden

Re: Question about engines.h and speeds

Post by BillSargent »

Yep, I see my mistake now. I wasn't sure what you meant seeing as the code refers to units as a number between 1 and 255 (someone said earlier). I get it now. Just a little terms confusion on my part. And i was looking for maybe 4000kph as a speed for my plane. Yes its unrealistic :D

Do aircraft have the same limitations in speed in NewGRF as they do in engines.h? I have some towns that have massive amounts of passengers and trains were my original idea to get them hauled out, but people don't tend to want to live next to a station that's 30 tracks wide :D Most of my towns imploded on themselves leaving large tiles of grass in the middle of the city. So I assume by that, that they hate the trains and that the trains weren't doing an efficient enough job moving passengers. So I was going to try to increase speed and efficiency and make a super fast plane that could haul large amount of passengers very fast.... I love the logic train idea where you set a parameter and you can set its speed. Would be nice if I could figure out how to create a NewGRF of maybe a concord or something that went faster and carried more people depending on parameters you set. But thats beyond my scope of understanding right now :D

Bill
User avatar
DJ Nekkid
Tycoon
Tycoon
Posts: 2141
Joined: 30 Nov 2006 20:33

Re: Question about engines.h and speeds

Post by DJ Nekkid »

well, i assume ACs also can use 15 bit ubits for speed in CB36s, so a max speed could be 32767*8kmh or mph, whatever the internal unit is.
Member of the
ImageImage
Alberth
OpenTTD Developer
OpenTTD Developer
Posts: 4763
Joined: 09 Sep 2007 05:03
Location: home

Re: Question about engines.h and speeds

Post by Alberth »

BillSargent wrote:I really don't know what I did but I already regret coming here and trying to talk to you.
You believe we don't see the changes you suggest as desirable.
That is not true.

We do see them, but consider them non-feasible, and dismissed them a long time ago.

Today you come here, and post a message telling us that infeasible direction is exactly what we should do. You do not show to have knowledge of the obstacles, you do not explain how we should get around those obstacles that makes them non-feasible in our view, nor do you show any intention of wanting to work on any of them.



If you want to influence where the program goes, you are welcome to join and work on it.
Otherwise, we are very capable of deciding a more feasible direction by our own, thank you very much.
BillSargent
Engineer
Engineer
Posts: 49
Joined: 09 Oct 2010 13:45
Location: Göteborg, Sweden

Re: Question about engines.h and speeds

Post by BillSargent »

Alberth wrote:
BillSargent wrote:I really don't know what I did but I already regret coming here and trying to talk to you.
You believe we don't see the changes you suggest as desirable.
That is not true.

We do see them, but consider them non-feasible, and dismissed them a long time ago.

Today you come here, and post a message telling us that infeasible direction is exactly what we should do. You do not show to have knowledge of the obstacles, you do not explain how we should get around those obstacles that makes them non-feasible in our view, nor do you show any intention of wanting to work on any of them.



If you want to influence where the program goes, you are welcome to join and work on it.
Otherwise, we are very capable of deciding a more feasible direction by our own, thank you very much.
Yep. You dismissed them because you now cannot implement those ideas because of how the direction of coding has gone. Right?`e.g. multicore awareness. I'm not an idiot, and I'd appreciate it if you'd not talk to me like one. I'd also appreciate you and the others not taking on that STUPID attitude of "if you don't like our way, then do it yourself". And no, you're not all able to make more feasible decisions on your own otherwise there would be multicore use, and there would be better tools available for creating content rather than ancient command line stuff that looks like it came from DOS. There would not be a cryptic complicated way of creating vehicles and graphics. The idea behind the openness of this game is so that ideas can come in and be discussed. As far as I've been reading on this forum, nobody has suggested easier tools and a better way to easily do what I originally started this thread about. To simply extract a vehicle (Sprites and all), be able to modify its parameters and create a new grf.

Have you looked at the available content for download? There's not much there considering the number of people playing the actual game. Now look at games like The Sims, and other such games. They have huge communities of people developing content because the tools are there and are easy to use.

So why don't you guys cut the s*it, and sit down and talk to me about this rather than copping an attitude and dismissing me as unimportant and less superior. Because so far almost every response to my questions and ideas have been met with impolite attitude and name calling.

I won't be responding to any more hateful messages. If you guys want to discuss things and explain, I'd love to listen and comment. But until you knock the attitude thatt I don't know anything at all, it won't happen.

Bill
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: Question about engines.h and speeds

Post by planetmaker »

BillSargent wrote:The idea behind the openness of this game is so that ideas can come in and be discussed.
Wrong. The idea behind 'open' is that everyone can go, take the source and make it a 'better' game by his or her personal standards, not that everyone can go and tell others how they should do their work, especially not in a condescending way while missing any technical insight in the related issues. <rest of reply deleted due to conerns about politeness>
Last edited by planetmaker on 13 Mar 2011 13:52, edited 3 times in total.
Locked

Return to “Graphics Development”

Who is online

Users browsing this forum: No registered users and 2 guests