Page 1 of 2
passenger transport
Posted: Sun Jun 08, 2008 6:43 am
by Neo_Jesus
you know the other day i was transporting passengers and i couldnt help but notice its really not worth any credits.. now i know this has been brought up befor... but i felt i have to ask. now that oolite is java is it possible to script and oxp that would make it more like cargo. like the more missions you did the more rich your customers would get. willing to pay larger prices for a safer or more scenic trip you know.. i just find it fun to taxi but i feel that 5 tons hull subtraction should atleast be worth something ya know.
once again sorry i know this has been brought up befor.. just figured i would throw it out there now that its on java.
Posted: Sun Jun 08, 2008 7:35 am
by krombart
There doesn't seem to be a interface to changing the prices for passagener transports, or asking for how many missions have been done.
Posted: Sun Jun 08, 2008 8:01 am
by krombart
Actually there is a reputation system for passenger transport, but it is only used for evaluating, wether a contract is displayed at all. It does not enter the fee and premium calculation.
Posted: Sun Jun 08, 2008 8:26 am
by krombart
Grab yourself a copy of the oolite-dev-source-1.71.2.tar.bz2
Learn how to compile oolite for your system
Then make the following changes to Universe.m in src/Core
At line 6573 there should look like
Code: Select all
- (NSArray *) passengersForSystem:(Random_Seed) s_seed atTime:(double) current_time
three lines down you see
Code: Select all
int player_repute = [player passengerReputation];
after that line add
Code: Select all
float fee_factor = 1;
unsigned f = 0;
if( player_repute < 0 ) {
for( f = 0; f < -player_repute; f++ ) fee_factor /= 1.17;
} else {
for( f = 0; f < player_repute; f++ ) fee_factor *= 1.17;
}
search for the line fee=cunningFee(fee) down in that routine.
add the line
Code: Select all
fee = (OOCreditsQuantity) floor( fee* fee_factor);
above the line fee=cunningFee(fee).
With good reputation your fees should triple, with bad reputation your fees should go down to one third.
Posted: Sun Jun 08, 2008 10:39 am
by krombart
After testing this I noticed that I got payed twice the amount, I was promised .... hmmm maybe I have to look into this.
Posted: Sun Jun 08, 2008 2:18 pm
by Frame
just one question
is bound to produce an error, unless this is something about cocoa i dont understand, i cant see how the compiler can figure out what f is, unless of course it assumes that an int is meant. The way it would work in C++, my compiler would give me an error, right there...
Are you aware of what the socalled basic types is, such as int,float,double what theire properties are and so on ?..
Further more i think it is ill advice to have people compile new local versions of Oolite, while they might not understand some fundamental things about object orientated programming.
Cheers Frame
Posted: Sun Jun 08, 2008 3:15 pm
by krombart
I've seen this in the source code of oolite.
And HEY! Don't tell me not to compile my own local version of oolite!
That's what OPEN SOURCE is good for.
Posted: Sun Jun 08, 2008 4:01 pm
by Frame
krombart wrote:I've seen this in the source code of oolite.
And HEY! Don't tell me not to compile my own local version of oolite!
That's what OPEN SOURCE is good for.
i did´nt tell you not to...
, just said i think it is i´ll advice, especially when the lines you tell him to add have an error.
So my search program which is ultra edit 8.1, damn good program too...
cant find
anywhere in the oolite source code, and if i read your post correct, this is actually something you tell him to add, so its your code at witch i´m pointing out there is a flaw in.
namely this piece of code
Code: Select all
float fee_factor = 1;
unsigned f = 0;
if( player_repute < 0 ) {
for( f = 0; f < -player_repute; f++ ) fee_factor /= 1.17;
} else {
for( f = 0; f < player_repute; f++ ) fee_factor
this is no where to be found in the oolite source code...
but allow me to correct it
it should be
Posted: Sun Jun 08, 2008 9:25 pm
by krombart
e.g. Universe.m Line 330
Posted: Sun Jun 08, 2008 9:44 pm
by Cmdr James
Code: Select all
unsigned i;
for (i = 0; i < 256; i++) [system_names[i] release];
He is correct, it is there, and compiles. I think I would tend to agree that it is more normal to see unsigned int.
I guess Frame could not find it because the variable is
not
.
Posted: Sun Jun 08, 2008 10:37 pm
by krombart
I don't know what happend, as the price which is displayed in the gui screen and the price put in the savegame both simply take the value calculated above.
But with the following modification to the _original_ Universe.m it seems to work.
Put
Code: Select all
unsigned f = 0;
if( player_repute > 0 ) {
for( f = 0; f < player_repute; f++ ) fee = fee * 117 / 100;
} else {
for( f = 0; f < -player_repute; f++ ) fee = fee * 117 / 100;
}
just before the line
best regards.
(Happy to have passenger contracts for up to 5000 Cr if you did well.)
PS.: I choose f as loop counter, to avoid name clashes.
Posted: Mon Jun 09, 2008 8:52 am
by Commander McLane
krombart wrote:And HEY! Don't tell me not to compile my own local version of oolite!
That's what OPEN SOURCE is good for.
Not if we want to continue to play the
same game.
If everybody would start to modify his game (the game code itself, I'm not talking about adding OXPs!), then there would quite quickly be nothing more to talk about in this forum, because there would no longer be a common base for us to build on.
So while an expert programmer might want to modify parts of the game code on his own private machine,
and at any time be fully aware of the changes he has made and the resulting differences to anybody else's game, it is certainly not advisable to make this the behaviour for the usual player,
who tends to forget that he is running a "custom" code, and will start to blame the programmers for behaviour that is seemingly different to what they tell him should be.
Posted: Mon Jun 09, 2008 5:17 pm
by Frame
krombart wrote:I don't know what happend, as the price which is displayed in the gui screen and the price put in the savegame both simply take the value calculated above.
But with the following modification to the _original_ Universe.m it seems to work.
Put
Code: Select all
unsigned f = 0;
if( player_repute > 0 ) {
for( f = 0; f < player_repute; f++ ) fee = fee * 117 / 100;
} else {
for( f = 0; f < -player_repute; f++ ) fee = fee * 117 / 100;
}
just before the line
best regards.
(Happy to have passenger contracts for up to 5000 Cr if you did well.)
PS.: I choose f as loop counter, to avoid name clashes.
okay i´m sry then.. and yeah i searched for
unsigned f;
But i´ll stick to that it is not something you are supposed to do, just because you find it in Oolite source code, dont mean its canon.
And i bet the compiler Assumes you meant an INT... which is bad, if you wanted a float. Also i bet there are different compilers out there, that might not all assume this, but there usually are standards so it should be pretty safe.
i just ran a test in Visual Studio...
Where i did not tell it that it where an int
after that i set f = 1.01f
SO I´m getting this warning, ofcourse
Code: Select all
"somepath\nointtest\nointtest\nointtest.cpp(10) : warning C4244: '=' : conversion from 'float' to 'unsigned int', possible loss of data"
Which would be bad, ofcourse especially if we where doing some OpenGL that relies heavely on floats..
Regarding name clashes... its allways good to reuse allready declared "variables", if you are not still inside the scope of the for loop which uses the same varible..
Why, cause it saves memory. an INT takes up a measely 4 bytes, but 4 bytes there, and 4 bytes there make megabyte..
..
And i´m with McLane 100%..
Posted: Mon Jun 09, 2008 6:02 pm
by krombart
Code: Select all
Not if we want to continue to play the same game.
If everybody would start to modify his game (the game code itself, I'm not talking about adding OXPs!), then there would quite quickly be nothing more to talk about in this forum, because there would no longer be a common base for us to build on.
So while an expert programmer might want to modify parts of the game code on his own private machine, and at any time be fully aware of the changes he has made and the resulting differences to anybody else's game, it is certainly not advisable to make this the behaviour for the usual player, who tends to forget that he is running a "custom" code, and will start to blame the programmers for behaviour that is seemingly different to what they tell him should be.
I disagree. If I want to have a targeting computer or increasing fees with better reputation, I want to have it. Period. If you are not willing to code it, I have to do it myself. (And I don't want to dispute arguments like: "It would be a too easy game with it.". I don't want to discuss about that, I just want the feature ( and it could be done in a way, that you can turn it off. )
I agree to you, that I can't blame the original authors for bugs appearing in the game with my modifications. If I want to report bugs, I have to use the original game. ( And I did bug reporting only for the original game. )
I also disagree that there would be no common base. The common base would always be the original game. Why not let have people fun with their own flavour of the game?
Posted: Mon Jun 09, 2008 9:38 pm
by Svengali
So, is it a suggestion for the game? :-)