Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Bobboau on February 26, 2004, 09:42:10 pm
-
this was V's doing by the way,
look at maybe_hack_cruiser_chase_abort()
for those of you unable to look at the source at the moment it goes a little something like this
int maybe_hack_cruiser_chase_abort()
{
ship *shipp = &Ships[Pl_objp->instance];
ship *eshipp = &Ships[En_objp->instance];
ai_info *aip = &Ai_info[shipp->ai_index];
// mission sm3-08, sathanos chasing collosus
if ( stricmp(Mission_filename, "sm3-08.fs2") == 0 ) {
if (( stricmp(eshipp->ship_name, "colossus") == 0 ) || ( stricmp(shipp->ship_name, "colossus") == 0 )) {
// Changed so all big ships attacking the Colossus will not do the chase code.
// Did this so Beast wouldn't swerve away from Colossus. -- MK, 9/14/99
//if ( stricmp(shipp->ship_name, "Sathanas") == 0 ) {
// do cool hack stuff here
ai_clear_ship_goals( aip );
aip->mode = AIM_NONE;
return 1;
//}
}
}
return 0;
}
basicly it says that if the mission file name is sm3-08.fs2 (my eyes bleed already) and ether our ship or the ship we are atacking's name is colossus, don't do anything.
sm3-08.fs2 == 'their finest hour'
-
!
They must have been running out of ideas. Or coffee, at 3am.
-
Wouldn't it just make sense to set the Sathanas on a waypoint and let the Colossus orbit it with its guns? I thought thats how it had been done...
-
...mission specific coding? :wtf:
-
i found an uglier one!!11
// For the subspace mission (sm3-09a)
// for delta wing
// if they're sufficiently far into the mission
// if they're near one or more enemies
// every so often
// fire a synaptic if they have one.
void maybe_cheat_fire_synaptic(object *objp, ai_info *aip)
{
// Only do in subspace missions.
if ( The_mission.flags & MISSION_FLAG_SUBSPACE ) {
ship *shipp;
int num, time;
shipp = &Ships[objp->instance];
if (!(strnicmp(shipp->ship_name, NOX("delta"), 5))) {
num = shipp->ship_name[6] - '1';
if ((num >= 0) && (num <= 3)) {
time = Missiontime >> 16; // Convert to seconds.
time -= 2*60; // Subtract off two minutes.
if (time > 0) {
int modulus = 17 + num*3;
if ((time % modulus) < 2) {
int count = num_nearby_fighters(get_enemy_team_mask(OBJ_INDEX(objp)), &objp->pos, 1500.0f);
if (count > 0) {
cheat_fire_synaptic(objp, shipp, aip);
}
}
}
}
}
}
}
-
shouldn't they be doing that in every mission?
that behavior, not that code
-
im guessing its a programed scripted sequence of events?
-
I think that Colossus thing would have been much easier to do by just not giving them attack orders and using some fire-beams instead... :p
Look for any such thing in the source regarding sm3-10 and end-campaign; there is a bug in the last mission that might have had such a hack to correct it but was removed at some point, since the bug has suddenly started to show up.
-
So what you're saying is that the Colossus really sucks more than we know? *gasp*!
-
Originally posted by PhReAk
i found an uglier one!!11
// For the subspace mission (sm3-09a)
// for delta wing
// if they're sufficiently far into the mission
// if they're near one or more enemies
// every so often
// fire a synaptic if they have one.
void maybe_cheat_fire_synaptic(object *objp, ai_info *aip)
{
// Only do in subspace missions.
if ( The_mission.flags & MISSION_FLAG_SUBSPACE ) {
ship *shipp;
int num, time;
shipp = &Ships[objp->instance];
if (!(strnicmp(shipp->ship_name, NOX("delta"), 5))) {
num = shipp->ship_name[6] - '1';
if ((num >= 0) && (num <= 3)) {
time = Missiontime >> 16; // Convert to seconds.
time -= 2*60; // Subtract off two minutes.
if (time > 0) {
int modulus = 17 + num*3;
if ((time % modulus) < 2) {
int count = num_nearby_fighters(get_enemy_team_mask(OBJ_INDEX(objp)), &objp->pos, 1500.0f);
if (count > 0) {
cheat_fire_synaptic(objp, shipp, aip);
}
}
}
}
}
}
}
[/B]
Whoa, trop chouette, là on comprend vraiment tout, j'adore. Merci, non, franchement, j'insiste, merci.
-
dude, ****.
mission specific coding is something i never expected in any usefull bit of code. they must've run out of FREDders, and have too much coders or something.
what happens when you make a compeltely different mission with the same filename?
-
Not much we can do about it, we have to maintain compatibility with the default data.
-
The mission could be fixed so you can get rid of that crap?
-
We need the code to work the default data.
Its all very well saying oh we will give them the fix,
but some people may never download the vp.
And in my opinion the vp should not be compulserary.
-
Nico, I dont see why that one is so bad, its generalised to subspace missions. However I have to agree the one Bob found is quite a bad hack.
-
I don't see why THAT ONE is so bad either, I don't even understand what it is ( since phreak believes everybody can read code ), but ten, twenty of those, and that's how you get a bloated code filled of lines useful for one single occurence in the game. Well dunno, I had the feeling that "cleaning the code" included stuff like that...
-
Originally posted by Nico
I don't see why THAT ONE is so bad either, I don't even understand what it is ( since phreak believes everybody can read code ), but ten, twenty of those, and that's how you get a bloated code filled of lines useful for one single occurence in the game. Well dunno, I had the feeling that "cleaning the code" included stuff like that...
Says in the comments...basically tells Delta wing to fire of a synaptic every few minutes if posssible.
How often are these functions called/checked? upon every mission?
-
every frame
-
They even managed to misspell 'Sathanas'. The code seems to apply to the Ravana 'Beast' as well. My personal favourite bit is where it says 'do cool hack stuff here' :nod:
-
IMHO Get rid of it and all of its brothers/sisters.
The SCP is no longer in a phase where you will have any justifiable benefit from using the new exe without any supplementary data.
-
those mission specific hacks can be removed if you rework the mission
hasn't V ever heard orf beam-lock-all
-
I'm usually against anything that would break backwards compatability but since these breaks would apply only to individual missions and wouldn't affect other campaigns I'm all for removing them.
-
Are they actually going to be causing a performance drain or are they just untidy for the coders?
-
Originally posted by Kazan
those mission specific hacks can be removed if you rework the mission
1. It seems unlikely that V would put such a nasty hack into the code if there was an easy way around to get exactly the same effect.
2. If we rework the mission then theres no guarentee everyone will download it (even if it is part of our main vp) and we could well spoil the FS2 experence for one or many people.
One if and a bit of code every frame, so what?
Its not going to make a big difference.
If anyone disagrees put timerbars round the code and prove it.
-
RandomTiger: there is absolutely no excuse for such hacks... period
-
Originally posted by Kazan
RandomTiger: there is absolutely no excuse for such hacks... period
Yes there is, if your boss tell you do something and he pulls rank you have to do it. I've been there before and I got very angry but in commercial situations this kind of stuff happens. Usually because publishers are breathing down peoples necks and making unreasonable damands.
I totally agree, its a terrible thing and hacks like this often cost more in the long term than they save in the short term.
But consider my worst fear. We fix the mission, remove the code. Hyperthetical simon (who hasnt played the mission much or at all) downloads the exe, doesnt download the vp (this could be for many reasons).
Simon plays the mission, it plays badly because he has neither the fixed mission or V's hack. But the game doesnt crash, he just thinks its rubbish and doesnt say anything. We've spoilt V's game for someone and noone even knows.
-
To justify removing this code I believe it must require one of the following to be true:
1. The code causes a significant slowdown.
2. The code is blocking developement.
-
'-Disable [v] Hacks' on the launcher perhaps?
EDIT : Good point RT, it's not going to effect anything except in those specific missions.
-
if((Math.random()>0.5)&&(deadline.up****Creek())
code.insert(hacks.getHacks());
Is there any way of checking & noting whether or not the original VPs' are in use? Or, more specifically, is there any way you could shuntify the mission specific hacks into a seperate chunk of code ( can you subclass it atall?) that's only used if it's an original V mission / vp?
sorry if this is daft, have no idea how the architecture of the code is or how much scope V left in for subclassing - and I've just spent the last 8 hours staring as other code, and my eyes feel like piss-holes in snow.......
EDIT: (sigh)
-
Deadlines dont have to == hacks but usually do and fs2_open will have hacks from FS1, FS2 and any other games it was used for. Im much more worried about overal structural problems we have.
Its a hack, good point, its a real shame, lets move on.
-
But consider my worst fear. We fix the mission, remove the code. Hyperthetical simon (who hasnt played the mission much or at all) downloads the exe, doesnt download the vp (this could be for many reasons).
Simon plays the mission, it plays badly because he has neither the fixed mission or V's hack. But the game doesnt crash, he just thinks its rubbish and doesnt say anything. We've spoilt V's game for someone and noone even knows.
How about having a second "core" VP containing such required files only and including it with all major FSO versions? Since it will only have a couple of files (things like this, along with the updated campaign file and maybe a few other things), it would be small enough to go into the main package without affecting the filesize much.
-
no good reason to remove it,
other than it's ugly, but that isn't good enough
haveing this disabled by flags would probly make it slower than it already is (wich isn't much)
I only pointed this out for entertainment purposes
-
Originally posted by Bobboau
no good reason to remove it,
I only pointed this out for entertainment purposes
It was worth pointing out, I just didnt want a pointless witch hunt to start on code that really isnt hurting performance or developement even though it is a horrible dirty hack.
-
So basically, cleaning the code has been thrown out as a project goal?
-
Oh dont be so dramatic!
Im constantly cleaning code, a week or so ago I purged software, glide, direct draw, texture sections in D3D, moved some D3D specific code under and general graphics interface.
Clean code that worth cleaning. Currently this code isnt hurting anyone and theres no way to fix it as far as I can see without causing Simon Syndrone.
This hack is not worth the time we have already spent on it.