lfnetwork.com mark read register faq members calendar

Thread: Q3 Engine Game Bugs / JA bugs
Thread Tools Display Modes
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Old 03-08-2007, 02:30 PM   #161
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
I suppose though my svn build and code isnt exactly capable of being uploaded at the moment.


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 04-14-2007, 02:43 PM   #162
Gamall Ida
Lurker
 
Gamall Ida's Avatar
 
Join Date: Apr 2007
Location: France
Posts: 8
My 2 cents to this thread: clean ways to counter the q3fill attack (as opposed to counting the number of connections from the same ip during a given period, which works but allows some bots to get in)

The bots' userinfo is not exactly built like that of a regular player ; some info is missing, and other is specific to a fake. So, in ClientConnect(), just check whether
Code:
Info_ValueForKey(userinfo, "model")
for instance, is null or not. If it is, then it's a fake.

Conversely, if
Code:
Info_ValueForKey (userinfo, "cl_guid")
, for instance, is not the empty chain, then it is a fake.

Ways around that fix: for the first one, the attacker can add relevant info directly using q3fill. For the second one, they would need to alter q3fill source code and rebuild it. Either way it should keep the vast majority of attackers away, and I haven't seen any false positive.

Gamall Ida is offline   you may: quote & reply,
Old 04-14-2007, 08:21 PM   #163
dumbledore
Rookie
 
Join Date: Nov 2005
Posts: 85
yeah as you pointed out the big problem with checking stuff like that is that anyone could rebuild q3fill, and only one guy needs to do it and post it on the internet for it to become a big problem again...
dumbledore is offline   you may: quote & reply,
Old 04-14-2007, 10:14 PM   #164
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
Theres also a bug where many of the char arrays are bigger than they need to be in ClientConnect and ClientUserInfoChanged... And some are pointers when they should be sized arrays.


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 04-14-2007, 10:22 PM   #165
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
Quote:
Originally Posted by Gamall Ida
My 2 cents to this thread: clean ways to counter the q3fill attack (as opposed to counting the number of connections from the same ip during a given period, which works but allows some bots to get in)

The bots' userinfo is not exactly built like that of a regular player ; some info is missing, and other is specific to a fake. So, in ClientConnect(), just check whether
Code:
Info_ValueForKey(userinfo, "model")
for instance, is null or not. If it is, then it's a fake.

Conversely, if
Code:
Info_ValueForKey (userinfo, "cl_guid")
, for instance, is not the empty chain, then it is a fake.

Ways around that fix: for the first one, the attacker can add relevant info directly using q3fill. For the second one, they would need to alter q3fill source code and rebuild it. Either way it should keep the vast majority of attackers away, and I haven't seen any false positive.
I don't see how cl_guid makes any difference, JA doesn't use it. The latest q3fill lets you append any cvar AFAIK. Plus you can do it without q3fill and just append cvars mostly in commandline if you want to append bogus sh1t.

BTW, IP data cannot be spoofed on ClientConnect() and I have IPSPOOF protection anyway (which is different from # of connections thing).

I took a look at that rtf of ur code pieces and it looks kind of disgusting plus you have some structs or arrays that we don't even see in there... Clean it up if you expect any of the non-hardcore modders here to know what any of it means.

1) You can put the cvars in the cvartable and then you dont need those trap calls or using the ints/floats in the function and just call theVmCvar.integer
2) You're using a lot of strcpy on char XX[size] when that can be rly bad.
3) I think you could probably copy Q_stricmp and make a regular Q_strcmp for strcmp... and stricmp usage should be Q_stricmp because of strcasecmp hack for linux.
4) G_LogPrintf( "Sent command : [%s]\n", text ); should not use this whole thing because G_LogPrintf will take a dump if its big as well. I use Q_vsnprintf now for it though so it doesn't matter.
5) Checking string length could/should be done in G_Say not Cmd_Say_f and Cmd_Tell_f.
6) Your improved log messages don't take account for bots.
I use:
Code:
ClientConnect: num [ip] \"name\"\n
BotConnect: num \"name\"\n
ClientRename: num [ip] \"oldname^7\" -> \"newname\"\n
BotRename: num \"oldname^7\" -> \"newname^7\"\n
ClientDisconnect: num [ip] \"name\"\n
BotDisconnect: num \"name\"\n
7) What is the purpose of storing clientNum? You are never a different client number unless you fully disconnect.
8) IP Address in userinfo is lost after ClientConnect usually.


iojamp project lead / coder

Last edited by ensiform; 04-14-2007 at 10:48 PM.
ensiform is offline   you may: quote & reply,
Old 04-15-2007, 06:25 AM   #166
Gamall Ida
Lurker
 
Gamall Ida's Avatar
 
Join Date: Apr 2007
Location: France
Posts: 8
Quote:
Originally Posted by ensiform
I don't see how cl_guid makes any difference, JA doesn't use it. The latest q3fill lets you append any cvar AFAIK.
With model you can append it, with cl_guid it is hardcoded into q3fill, so you can't just append it like that, and the point IS that bots use it while JKA don't. And since you can't append a "null" cl_guid, this will work even if the attacker appends whatever he wants...

As long as nobody modifies q3fill.

Quote:
I took a look at that rtf of ur code pieces and it looks kind of disgusting plus you have some structs or arrays that we don't even see in there... Clean it up if you expect any of the non-hardcore modders here to know what any of it means.
That's why I didn't post the whole thing here I just posted the idea, which I know, for having tested it thoroughly, works.

The rest is off-topic since it is pertaining to my mod and the way I coded things (which I know is far from perfect ; I'm an amateur, too used to the convenience of C++ classes, and I learned both C and the JKA SDK at the same time I was writing this...).

However, since you are kindly offering your help, I'd be very foolish to ignore it

1 Yep, I figured that a little late in the game. But why does Raven use it that way ? In CheckVote, for instance :
Code:
if (trap_Cvar_VariableIntegerValue("g_gametype") != level.votingGametypeTo)
2 I use it 3 times in ClientConnect, and the buffer is large enough to receive it in all cases. Did you mean I should use Q_strncpyz instead ?

3 "strcasecmp hack for linux" What's that ?

4 Yep. I'll just cut it to a reasonable length. What's Q_vsnprintf ? couldn't find it in the SDK.

5 Why? G_Say and G_SayTo are called only by these two, so cutting it in Cmd_*_f also cuts it for G_Say(To). I've tested q3msgboom with say, say_team and tell ingame, and there is no problem.

6 The whole userinfo is stored in the logs right from the start, so it is stored for bots too. Making the log entry different for bots is a very good idea though

7 It is used for autokicking, in the # connect/time case : I need the client nums of the last connected clients, in order to kick them all, and not just the clientNum of the current connecting client.

8 Er. Ok. So ? I never use it anywhere after ClientConnect.

edit : typos


Last edited by Gamall Ida; 04-15-2007 at 06:40 AM.
Gamall Ida is offline   you may: quote & reply,
Old 04-15-2007, 08:43 PM   #167
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
Quote:
Originally Posted by Gamall Ida
1 Yep, I figured that a little late in the game. But why does Raven use it that way ? In CheckVote, for instance :
I'm not really sure, there are some cases that they just didn't want too and this one might even be a Q3 thing not JKA specific... I think it is because there are some cases like after restarts or if its going to restart or if it is a latch cvar, that the value in the vmCvar is not correct however the cvar_t data is always correct so that is probably why.


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 04-22-2007, 01:05 AM   #168
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
Lightsaber loading code seems wrong on client side...

When a player has a staff saber that you don't have, it should probably load parameters for "dual_1" instead of just the defaults maybe? Because if you've ever played on a JA- server without its client or the extra sabers and somebody is using a staff that you don't have, it looks like people are using staff moves with the default single saber. :<


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 04-22-2007, 03:59 AM   #169
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,176
It's a good idea, but is there a way to tell if a saber is a staff saber without the .sab file info?


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may: quote & reply,
Old 04-22-2007, 12:09 PM   #170
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
Uhhh... I suppose probably not.

Also: I found your bugfix for the Mods Menu:

basejka:
Code:
columns 1 2 40 20
ojp:
Code:
columns 1 2 40 280
in the LISTBOX for mods part of setup.menu

It seems as though they changed it in the setup.menu for SP in the actual assets but in the SDK, and ui/jamp it seems incorrect.

Edit: again i looked in assets3 and it looks like 1.01 fixed that for basejka too but the menus that come with the SDK are 1.00 or something.


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 04-22-2007, 03:50 PM   #171
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,176
Good thing you found it. I had totally forgotten about that.


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may: quote & reply,
Old 04-22-2007, 08:13 PM   #172
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
Yea that one was stumping me :/


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 08-08-2007, 01:27 AM   #173
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
CG_INCOMING_CONSOLE_COMMAND

Has issues when you're trying to grab /say cmd...

If you're checking if command contains 'say' and you type message in the chat box or just type in console without /say it will not recognize it as having come from 'say'.

There is nothing that can really be done about this without the engine.


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 08-14-2007, 01:36 PM   #174
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
For whatever reason I do not know why but they disabled cg_simpleItems for flags...

easy fix:

cg_ents.c, Function: CG_Item, Line: if ( cg_simpleItems.integer && item->giType != IT_TEAM ) {

Comment out the not team type part.


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 09-13-2007, 06:01 PM   #175
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
Is there a reason why obituary inherits the origin of the player that died? That makes no sense, its just printing a message. It has svf_broadcast anyway... No sense wasting bandwidth. Change self->r.currentOrigin to vec3_origin (0,0,0).

EV_SIEGESPEC can also be changed, as its just setting a a value on the client when sent to the client of te->s.owner. If anyone else thinks of any others, please do let me know. Generally G_TempEntity is what you would look for. Certain things though, do depend on the origin. You wouldn't want to change saber or fire effect stuff for sure. But messages and just simple setting stuff really shouldn't be used. Player Teleport is needed though. I'm also considering whether or not it would be good to change the default behavior of target_screenshake because I just don't see why you would want a screen shake to be a global effect like it is defaulted so. As seen here:

Code:
void SP_target_screenshake(gentity_t *ent)
{
	G_SpawnFloat( "intensity", "10", &ent->speed );
	//intensity of the shake
	G_SpawnInt( "duration", "800", &ent->genericValue5 );
	//duration of the shake
	G_SpawnInt( "globalshake", "1", &ent->genericValue6 );
	//non-0 if shake should be global (all clients). Otherwise, only in the PVS.

	ent->use = Use_Target_Screenshake;
}


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 09-18-2007, 10:40 PM   #176
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
Remove the UI_CacheSaberGlowGraphics and static qhandle defines for saber shaders. As the fixme says its busted on vid_restart. Remove instances of this func and move the qhandles into cachedAssets_t and also set them in AssetCache().


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 09-21-2007, 11:32 PM   #177
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
Why in heck are the item bounding boxes different when dropped from normal?

FinishSpawningItem:

Code:
VectorSet (ent->r.mins, -8, -8, -0);
VectorSet (ent->r.maxs, 8, 8, 16);
LaunchItem:

Code:
VectorSet (dropped->r.mins, -ITEM_RADIUS, -ITEM_RADIUS, -ITEM_RADIUS);
VectorSet (dropped->r.maxs, ITEM_RADIUS, ITEM_RADIUS, ITEM_RADIUS);
bg_public.h:

Code:
#define	ITEM_RADIUS			15		// item sizes are needed for client side pickup detection


Not really sure which way people wanna have it.


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 09-22-2007, 05:24 AM   #178
Tinny
 
Tinny's Avatar
 
Join Date: Apr 2002
Posts: 1,188
That is weird, do you know how some mods make items physics objects and allows them to be pushed/pulled around?


Redeemed!

An old school mod for jedi academy.
Tinny is offline   you may: quote & reply,
Old 09-22-2007, 03:01 PM   #179
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
Yes, mine does. Some mods actually create a new launched entity which is really bad, and just hide the original.

I just let them move it around but store the normal position to return to.

Hell, even JA+ puts the stupid hologram on (weapons and powerups) because slider doesn't know how to properly do it, really annoying too cuz you cannot then pick up dropped weapons if you already have it if it was pushed/pulled, which doesn't make any sense at all. Funny may it be, but what if i want to pull ammo from a guy i just killed towards me?


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 09-22-2007, 05:33 PM   #180
Tinny
 
Tinny's Avatar
 
Join Date: Apr 2002
Posts: 1,188
What do you do? Have a timer on it that makes it return to a position after it hasn't been affected a while? I tried making items a physics object but for some reason they still don't move around, I tried even editing the force_throw code to allow items to be allowed to move around but no luck.


Redeemed!

An old school mod for jedi academy.
Tinny is offline   you may: quote & reply,
Old 09-22-2007, 05:52 PM   #181
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
Code:
			} else if ( em_itemPush.integer && CheckPu****em( push_list[x] ) ) {	//rolling and stationary thermal detonators are dealt with below
				if ( push_list[x]->item->giType == IT_TEAM ) {
					push_list[x]->nextthink = level.time + CTF_FLAG_RETURN_TIME;
					push_list[x]->think = ResetItem; // return to original spot after CTF_FLAG_RETURN_TIME ms
				} else {
					push_list[x]->nextthink = level.time + 30000;
					push_list[x]->think = ResetItem; // return to original spot after 30 seconds
				}

				if ( pull ) {
					//pull the item

					push_list[x]->s.pos.trType = TR_GRAVITY;
					push_list[x]->s.apos.trType = TR_GRAVITY;
					VectorScale( forward, -650.0f, push_list[x]->s.pos.trDelta );
					VectorScale( forward, -650.0f, push_list[x]->s.apos.trDelta );
					push_list[x]->s.pos.trTime = level.time;		// move a bit on the very first frame
					push_list[x]->s.apos.trTime = level.time;		// move a bit on the very first frame
					VectorCopy( push_list[x]->r.currentOrigin, push_list[x]->s.pos.trBase );
					VectorCopy( push_list[x]->r.currentOrigin, push_list[x]->s.apos.trBase );
					push_list[x]->physicsObject = qtrue;
					push_list[x]->flags |= FL_BOUNCE_HALF;
				} else {
					push_list[x]->s.pos.trType = TR_GRAVITY;
					push_list[x]->s.apos.trType = TR_GRAVITY;
					VectorScale( forward, 650.0f, push_list[x]->s.pos.trDelta );
					VectorScale( forward, 650.0f, push_list[x]->s.apos.trDelta );
					push_list[x]->s.pos.trTime = level.time;		// move a bit on the very first frame
					push_list[x]->s.apos.trTime = level.time;		// move a bit on the very first frame
					VectorCopy( push_list[x]->r.currentOrigin, push_list[x]->s.pos.trBase );
					VectorCopy( push_list[x]->r.currentOrigin, push_list[x]->s.apos.trBase );
					push_list[x]->physicsObject = qtrue;
					push_list[x]->flags |= FL_BOUNCE_HALF;
				}
			}
I store the original position and such and whether it has spawned originally.
CheckPu****em checks to see if the item is suspended, has a hologram below it, or is flag and check against cvar being 2 to allow dropped flags to move.


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 09-22-2007, 07:33 PM   #182
Tinny
 
Tinny's Avatar
 
Join Date: Apr 2002
Posts: 1,188
Oh ok, thanks a ton Ensi.


Redeemed!

An old school mod for jedi academy.
Tinny is offline   you may: quote & reply,
Old 09-26-2007, 07:51 PM   #183
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,176
Quote:
Originally Posted by ensiform
Why in heck are the item bounding boxes different when dropped from normal?

Not really sure which way people wanna have it.
I'd use the normal bounding boxes in both cases. The dropped bbox sizes aren't what most people expect.


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may: quote & reply,
Old 10-09-2007, 07:47 PM   #184
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
Fixed Bug where maps that have pits but do not have "nodrop" surface down in the pit thus flags that fall/tossed/pushed/pulled down will sit there until they expire.

Above G_RunItem:

Code:
// double size of items
static vec3_t itemMins2 = {-16, -16, 0};
static vec3_t itemMaxs2 = {16, 16, 32};
This is what I did in G_RunItem:

Note, the code includes my method of item push/pull checking, and is not necessary for basejka.

Below the following statement:

Code:
	if ( tr.fraction == 1 ) {
		return;
	}
I added:

Code:
	if(ent->item && ((ent->flags & FL_DROPPED_ITEM) || (em_itemPush.integer && ent->think == ResetItem)))
	{
		int			entityList[MAX_GENTITIES];
		int			i, cnt;
		gentity_t	*other;
		gentity_t	*t;
		vec3_t		mins, maxs;

		VectorAdd(ent->r.currentOrigin, itemMins2, mins);
		VectorAdd(ent->r.currentOrigin, itemMaxs2, maxs);

		cnt = trap_EntitiesInBox(mins, maxs, entityList, MAX_GENTITIES);

		for( i = 0; i < cnt; i++)
		{
			other = &g_entities[entityList[i]];

			if(other == ent)
			{
				continue;
			}

			if(other && other->inuse && !Q_stricmp(other->classname, "trigger_hurt"))
			{
				if(ent->item->giType == IT_TEAM)
				{
					Team_FreeEntity(ent);
				}
				else
				{
					if(ent->think == ResetItem)
					{
						ResetItem(ent);
					}
					else
					{
						G_FreeEntity(ent);
					}
				}
				return;
			}

			if(other && other->inuse && (!Q_stricmp(other->classname, "trigger_multiple") || !Q_stricmp(other->classname, "trigger_always") || !Q_stricmp(other->classname, "trigger_once")) && other->target && other->target[0])
			{
				int hash = BG_StringHashValue(other->target);
				t = NULL;
				while ((t = G_FindByTargetnameFast(t, other->target, hash)) != NULL)
				{
					if(t && t->inuse && !Q_stricmp(t->classname, "target_kill"))
					{
						if(ent->item->giType == IT_TEAM)
						{
							Team_FreeEntity(ent);
						}
						else
						{
							if(ent->think == ResetItem)
							{
								ResetItem(ent);
							}
							else
							{
								G_FreeEntity(ent);
							}
						}
						return;
					}
					else
					{
						continue;
					}
				}
			}
		}
	}


iojamp project lead / coder

Last edited by ensiform; 10-09-2007 at 08:17 PM.
ensiform is offline   you may: quote & reply,
Old 10-10-2007, 12:14 AM   #185
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
The infamous obtained wrong item bug is caused by an issue with the engine because events use eventParm stuff which is sent over the network in 8 bits (0-255 range) where entity numbers can be 0-1024 range (10 bits). This cannot be fixed without modifying the engine sadly.

EV_ITEM_PICKUP sends the item that you picked up's entity number and can without a doubt be higher than 255. So, meh :<

Edit: It may actually be doable without the engine (since this may not be the real problem as previously thought/said).

I'm currently testing it with a modified version of the event with a temp entity instead. This would not work well with server-side only mods of course. I also recommend turning off cg_predictItems with this method, as server is always right.


iojamp project lead / coder

Last edited by ensiform; 10-12-2007 at 11:11 PM.
ensiform is offline   you may: quote & reply,
Old 10-25-2007, 10:15 PM   #186
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
Bug in TIMER_Clear2 that doesn't clear timers on entity 0.

Code:
if ( ent && ent->s.number > 0 && ent->s.number < MAX_GENTITIES )
Should be:

Code:
if ( ent && ent->s.number >= 0 && ent->s.number < MAX_GENTITIES )


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 11-02-2007, 11:31 PM   #187
eyen
Lurker
 
Join Date: Jan 2007
Posts: 7
Don't tell me there's more > 0 bugs ._. I might grep the source later on, unless you've already searched for them.
eyen is offline   you may: quote & reply,
Old 11-03-2007, 09:16 PM   #188
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
I'm sure there are, and no I really did not. >.<

Mostly in the NPC code you will find a lot of entity 0 stuff.


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 11-03-2007, 10:54 PM   #189
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
Unique1's Holocron code that is seen in OJP has an out of bounds bug:

Code:
if (number_of_holocronpositions > MAX_HOLOCRON_POSITIONS)
Should be >= because array is 0...max-1


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 11-05-2007, 07:50 PM   #190
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
CG_PointContents should use projected origin and angles in-case water is a moving entity such as draining water from an area.

Code:
contents |= trap_CM_TransformedPointContents( point, cmodel, ent->origin, ent->angles );
should be:

Code:
contents |= trap_CM_TransformedPointContents( point, cmodel, cent->lerpOrigin, cent->lerpAngles );


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 11-06-2007, 07:51 PM   #191
LightNinja
The Ninjonator
 
LightNinja's Avatar
 
Join Date: Sep 2003
Location: Somewhere-Spain Status: Ninjonator
Posts: 1,998
Hey ensiform, could you point me where's the code related to vehicles? I'm gonna have to take a look in order to make my dragon flyable. If you don't know where's it don't worry, its just that I've downloaded recently the SDK and I haven't looked at it yet, I've started programing in c++ in university and now I can understand things on this thread...

btw good job.




~JA MP Total Conversion~
LightNinja is offline   you may: quote & reply,
Old 11-08-2007, 05:42 PM   #192
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
Well you can make vehicles without editing the SDK. I would say start by making it a flying type vehicle for now.


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 11-08-2007, 05:44 PM   #193
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
CalcEntitySpot has a bug when SPOT_WEAPON is the spot being used...

Code:
	case SPOT_WEAPON:
		//NOTE: automatically takes leaning into account!
		if( ent->NPC && !VectorCompare( ent->NPC->shootAngles, vec3_origin ) && !VectorCompare( ent->NPC->shootAngles, ent->client->ps.viewangles ))
		{
			AngleVectors( ent->NPC->shootAngles, forward, right, up );
		}
		else
		{
			AngleVectors( ent->client->ps.viewangles, forward, right, up );
		}
		CalcMuzzlePoint( (gentity_t*)ent, forward, right, up, point );
		break;
But what happens when Ent is neither a player nor an NPC?

Answer: AngleVectors is inputted with an invalid first param and thus causes crashing.

Fix:

Code:
	case SPOT_WEAPON:
		if( ent->client )
		{
			//NOTE: automatically takes leaning into account!
			if( ent->NPC && !VectorCompare( ent->NPC->shootAngles, vec3_origin ) && !VectorCompare( ent->NPC->shootAngles, ent->client->ps.viewangles ))
			{
				AngleVectors( ent->NPC->shootAngles, forward, right, up );
			}
			else
			{
				AngleVectors( ent->client->ps.viewangles, forward, right, up );
			}
			CalcMuzzlePoint( (gentity_t*)ent, forward, right, up, point );
		} else
			return;
		break;
I put the client check there because, NPC's also have a client pointer. And its not like other things are supposed to be using SPOT_WEAPON anyway... But technically you could do else if client do the ps.viewangles and else do ent->r.currentAngles.


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 11-08-2007, 07:31 PM   #194
DarthDie
Junior Member
 
DarthDie's Avatar
 
Join Date: May 2005
Location: The Matrix
Posts: 407
That fixes seeker crashing when trying to shoot at shield(or trying todo something with shield) .


OJP Sponsors and websites

"...and what about all those screenshots in there of DarthDie with a swastika of demo charges."
DarthDie is offline   you may: quote & reply,
Old 11-09-2007, 02:30 PM   #195
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
Wonder why its even targeting the forcefield pickup or the forcefield it self for :S.


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 11-09-2007, 09:36 PM   #196
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
Download percentage overflow in ui_main.c @ UI_DisplayDownloadInfo.

Bug fixed In Icculus Q3:

http://svn.icculus.org/quake3/trunk/...e/ui/ui_main.c


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 11-11-2007, 02:01 AM   #197
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
2 hand lightning effect origin should probably be in middle, not coming from left hand only...

cg_players.c CG_Player:

The following gets changed:

Code:
		//trap_G2API_GetBoltMatrix(cent->ghoul2, 0, ci->bolt_lhand, &boltMatrix, tAng, cent->lerpOrigin, cg.time, cgs.gameModels, cent->modelScale);
		if (!gotLHandMatrix)
		{
			trap_G2API_GetBoltMatrix(cent->ghoul2, 0, ci->bolt_lhand, &lHandMatrix, cent->turAngles, cent->lerpOrigin, cg.time, cgs.gameModels, cent->modelScale);
			gotLHandMatrix = qtrue;
		}

		efOrg[0] = lHandMatrix.matrix[0][3];
		efOrg[1] = lHandMatrix.matrix[1][3];
		efOrg[2] = lHandMatrix.matrix[2][3];
to:

Code:
		if ( cent->currentState.torsoAnim == BOTH_FORCE_2HANDEDLIGHTNING_HOLD )
		{//find mid point between two bolts
			mdxaBone_t 	rHandMatrix;
			trap_G2API_GetBoltMatrix(cent->ghoul2, 0, ci->bolt_rhand, &rHandMatrix, cent->turAngles, cent->lerpOrigin, cg.time, cgs.gameModels, cent->modelScale);
			if (!gotLHandMatrix)
			{
				trap_G2API_GetBoltMatrix(cent->ghoul2, 0, ci->bolt_lhand, &lHandMatrix, cent->turAngles, cent->lerpOrigin, cg.time, cgs.gameModels, cent->modelScale);
				gotLHandMatrix = qtrue;
			}
			efOrg[0] = ((lHandMatrix.matrix[0][3] + rHandMatrix.matrix[0][3]) * 0.5f);
			efOrg[1] = ((lHandMatrix.matrix[1][3] + rHandMatrix.matrix[1][3]) * 0.5f);
			efOrg[2] = ((lHandMatrix.matrix[2][3] + rHandMatrix.matrix[2][3]) * 0.5f);
		}
		else
		{
			if (!gotLHandMatrix)
			{
				trap_G2API_GetBoltMatrix(cent->ghoul2, 0, ci->bolt_lhand, &lHandMatrix, cent->turAngles, cent->lerpOrigin, cg.time, cgs.gameModels, cent->modelScale);
				gotLHandMatrix = qtrue;
			}
			efOrg[0] = lHandMatrix.matrix[0][3];
			efOrg[1] = lHandMatrix.matrix[1][3];
			efOrg[2] = lHandMatrix.matrix[2][3];
		}
Alternatively, you could do it like Single Player and play the effect from both hands. (Though is extra things being drawn). So I compensated for this because, it looked as though and the code said that it was only coming from left, and being in center looks a little bit better.


iojamp project lead / coder

Last edited by ensiform; 11-11-2007 at 10:21 PM.
ensiform is offline   you may: quote & reply,
Old 12-21-2007, 11:17 PM   #198
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
Force Dodge shouldn't work while holding a rocket lock.

Jedi_DodgeEvasion:

Code:
	if ( self->client->ps.weaponTime > 0 || self->client->ps.forceHandExtend != HANDEXTEND_NONE )
	{//in some effect that stops me from moving on my own
		return qfalse;
	}
=>

Code:
	if ( self->client->ps.weaponTime > 0 || self->client->ps.forceHandExtend != HANDEXTEND_NONE || self->client->ps.rocketLockTime > 0 )
	{//in some effect that stops me from moving on my own
		return qfalse;
	}


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 01-22-2008, 08:40 PM   #199
ensiform
The Stig
 
ensiform's Avatar
 
Join Date: Nov 2004
Location: Sawtooth Cauldron
Posts: 1,241
Current Game: Borderlands 2
cg.snap->ps.fd.forcePowerLevel[] does not contain real data for most powers.

As far as I can tell its only FP_LEVITATION (1) and FP_SEE (14)


iojamp project lead / coder
ensiform is offline   you may: quote & reply,
Old 01-23-2008, 12:42 PM   #200
razorace
Impressive, Terran!
 
razorace's Avatar
 
Join Date: May 2002
Posts: 9,176
does that cause problems with the client side prediction?


---Jedi Guardian of the Newbie Questions
---Masters of the Force Team Leader / Creator
---Open Jedi Project Lead Moderator / Co-Founder
razorace is offline   you may: quote & reply,
Post a new thread. Add a reply to this thread. Indicate all threads in this forum as read. Subscribe to this forum. RSS feed: this forum RSS feed: all forums
Go Back   LucasForums > Network > JediKnight Series > Editing Central > JA Coding > Q3 Engine Game Bugs / JA bugs

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:28 AM.

LFNetwork, LLC ©2002-2011 - All rights reserved.
Powered by vBulletin®
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.