News:

Come Chat with us live! Learn how HERE!

Main Menu

Wall Walking source code compiling error...

Started by Oddzball, October 15, 2003, 11:31:15 AM

Oddzball

pass 0: bg_lib
bg_lib:2808 Multiple definitions for acos


Im not sure whats wrong here..

I looked inside bg_public.c and i coudl see that timbo must have added that bit from Sunmicrosystems and im assuming that is where the error is... if someone else had this problem trying to compile the code and found a way to correct it let me know please.

Timbo

Your problem is you have multiple definitions for acos :) In other words you have more than one implementation of acos in your source code. The compiler doesn't know which one you want to use so it errors.

I used the Sun acos implementation because originally there was no acos implementation in the source. I could have used a lookup method like id initially did with the other trig functions, but this implementation isn't much more expensive and is inherently more accurate. id later added a lookup table based acos to bg_lib.c. I can't remember the exact version it was introduced, suffice to say if you're using the latest source code it should be commented out anyway. This is because later still (or maybe it was the same patch -- I can't remember) id added passthrough trig functions to the engine callbacks so that when you called a trig function in QVM space it was mapped to an implementation specific trig function provided by the C library. Curiously though, a passthrough for acos was only added to the client side callbacks.

The wall walking code uses acos in the prediction code, so it is relatively important that both server and client side implementations yield the same results. For this reason I disabled the client side acos passthrough by removing the line "equ acos                  -112" from cg_syscalls.asm. Now each module used the Sun acos implementation and everybody was happy :D

In short, my best guess is that your cg_syscalls.asm file still has the acos declaration in it and this is causing the compiler to see two acos definitions on the client side. You should remove this line.

Godmil

:o  you what?


:(


*Godmil gets back to the mapping, where everything is easy to understand

Oddzball

I got the wallwalk code to compile and managed to get it working and all. Only real problem is there is some super glitch when you switch into third person, bsicly pointing you view at the ground at your characters foot level, changeing the range and angle doesnt help it either. I was wondering if there was a way to fix this?

OverFlow

hm, I know timbo kinda fixed that in tremulous...

but the wallwalk source code hasn't really been updated since it was integrated into trem. *shrug*

Oddzball

Well i fixed the third person woes... the problem is in bg_pmove.c

under PM_UpdateViewAngles

//force angles to -180 <= x <= 180
 AnglesSubtract( tempang, 0, tempang );
 for( i = 0; i < 3; i++ )
 {
   while( tempang[ i ] > 180 )
     tempang[ i ] -= 180; // ~oddzball : I changed this from -360
  }  
   //while( tempang[ i ] < 180 ) // ~oddzball : Commented the second part out
   //  tempang[ i ] += 180;
 //}

Godmil

Well done :)

I like to use cg_thirdperson when testing my maps, so that could be handy :)

vcxzet


A_Total_noob

lawl, people still play Tremulous ?

Risujin

Quote from: vcxzetlast time I tried it was working
sneaky sneaky

Rawr

vcxzet: Winner of the biggest, most pointless sig award.

Lava Croft

vcxzet is well underway becoming my personal hero.