Game Development Community

Melee port

by Skylar Kelty · in Torque Game Engine Advanced · 06/15/2008 (11:11 am) · 101 replies

This is a tgea 1.7.0 port of this

It compiles.... I havnt the time to test it though, please let me know

click me

Hope it works!

1.7.1 comin when i have the time to download it
#61
03/08/2009 (1:45 pm)
removed
#62
03/08/2009 (1:47 pm)
removed
#63
03/10/2009 (1:01 pm)
I finally got the melee resource working in my build! Mike Rowley's files work perfectly in TGEA 1.8.1, but I was making the silly error of compiling the wrong solution. This meant that the solution was compiling correctly with the melee resource files, but the executable of my current project was not changing. I removed my long comments above to keep them from confusing others. Just in case anyone runs into the same error I did, in which setArmThread comes up as an unknown command in the console, this most likely comes from compiling the wrong solution.

Thanks to Mike, Jaimi, and Tek0 for helping get this resource ported over to 1.8.1 and helping me to resolve what turned out to be my own error. :)
#64
03/10/2009 (9:30 pm)
I just tested it and the resource is working fine. But I did see that error in the console log about the setArmThread.

scriptsAndAssets/server/scripts/weapon.cs (344): Unknown command setArmThreadPlayOnce.
  Object (2480) Player -> ShapeBase -> GameBase -> SceneObject -> NetObject -> SimObject

So I just commented out this line of code and stopped the flood of errors and the melee seemed to work fine. But I have noticed that when I swing the sword my mouse speed is slowed. How can I make where the mouse speed isn't touched?

%vplayer.setArmThreadPlayOnce("h1stun");
#65
03/23/2009 (3:01 pm)
this is drivin me mad! I can't figure out where the problem is located. once the mission loads all the datablocks & objects it crashes & i get this error in the output.

Unhandled exception at 0x008080ee in BaseTestingDemo_DEBUG.exe: 0xC0000005: Access violation reading location 0x000000f8.

can someone point me in the right direction? All I know is that this error is commonly a problem with handling memory.
#66
07/06/2009 (9:12 pm)
@John, I am running into the same problem after merging the 1.8.1 version of the engine files over. The solution will compile correctly, but the game will crash after all the datablocks and objects load.

Unhandled exception at 0x005d1c20 in game.exe: 0xC0000005: Access violation reading location 0xb8edb6f0.

The disassembly pointed to this line when I selected Break:
005D1C20 movups xmm1,xmmword ptr [ecx]

I too am stumped by this.
Does anyone have an idea what could be causing this?

-Edit-
Here is some more info from VS2005's output:

*** Phase 2: Download Ghost Objects
Mapping string: MissionStartPhase2Ack to index: 1
Allocating a 512 px clipmap for a 16384px source texture.
- 5 base clipstack entries, + 1 cap.
- Using approximately 7.980000MB of texture memory.
Allocating a 512 px clipmap for a 16384px source texture.
- 5 base clipstack entries, + 1 cap.
- Using approximately 7.980000MB of texture memory.
Allocating a 512 px clipmap for a 16384px source texture.
- 5 base clipstack entries, + 1 cap.
- Using approximately 7.980000MB of texture memory.
Allocating a 512 px clipmap for a 16384px source texture.
- 5 base clipstack entries, + 1 cap.
- Using approximately 7.980000MB of texture memory.
The thread 'Win32 Thread' (0xdd4) has exited with code 0 (0x0).
Ghost Always objects received.
Mapping string: MissionStartPhase3 to index: 10
Client Replication Startup has Happened!
fxFoliageReplicator - replicated client foliage for 0 objects
*** Phase 3: Mission Lighting
Successfully loaded mission lighting file: 'scriptsAndAssets/data/missions/simple_41e2f05sg.ml'
Mission lighting done
Mapping string: MissionStartPhase3Ack to index: 2
First-chance exception at 0x005d1c20 in game.exe: 0xC0000005: Access violation reading location 0xb8edb6f0.
Unhandled exception at 0x005d1c20 in game.exe: 0xC0000005: Access violation reading location 0xb8edb6f0.
The program '[4872] game.exe: Native' has exited with code -1073741819 (0xc0000005).
#67
08/03/2009 (11:42 am)
It's in fact not exactly a "memory handling problem" it's likely that there is a resource missing, or no value set for some required argument.
I found that this happened to me if I didn't have all of the right .dts's, .dsq's, and scripts loaded.


#68
08/13/2009 (10:22 am)
renderInstMgr.h appears to be missing in 1.8.1.... so what can I change?
#69
09/14/2009 (6:57 pm)
Hey everyone! I've been porting this to a fresh copy of TGEA 1.8.1
I'm getting some compile errors & warnings. I'm using MS Visual Studio 2008 express edition & I've got the DirectX SDK March 2009 version installed.

Error	4	error C2086: 'F32 y' : redefinition	c:TorqueTGEA_1_8_1enginesourceT3Dplayer.cpp	1520
Error	1	error C2665: 'Con::executef' : none of the 20 overloads could convert all the argument types	c:TorqueTGEA_1_8_1enginesourceT3DshapeImage.cpp	1986
Warning	2	warning C4305: '-=' : truncation from 'double' to 'F32'	c:TorqueTGEA_1_8_1enginesourceT3Dplayer.cpp	1511
Warning	3	warning C4305: '-=' : truncation from 'double' to 'F32'	c:TorqueTGEA_1_8_1enginesourceT3Dplayer.cpp	1516

Tek0 came across one of these errors before. here's the function.

// -> SimpleMeleeMOD

      /*
		F32 y = move->yaw;
		if (y > M_PI) y -= M_2PI;
      */
      F32 y;
      if (mArmThreadPlayOnce)
      {
         //The divisor will increase or decrease the turning rate...
         y = move->yaw/6.28f;
         if (y > M_PI) y -= M_2PI;
      }
      else
      {
         y = move->yaw;
         if (y > M_PI) y -= M_2PI;
      }
	  // <- SimpleMeleeMOD

      F32 y = move->yaw;
      if (y > M_PI_F)
         y -= M_2PI_F;

The 1st compile error listed above:

Error	4	error C2086: 'F32 y' : redefinition	c:TorqueTGEA_1_8_1enginesourceT3Dplayer.cpp	1520

appears to be caused by the piece of code posted below.

// <- SimpleMeleeMOD

      F32 y = move->yaw;
      if (y > M_PI_F)
         y -= M_2PI_F;

It looks like this piece of code is identical to the code added by the melee resource. I tried deleting the extra piece of code that came after the melee modified code since it appears that it was identical. After that the error was gone, so just in case anyone has that problem this appears be the solution. :)

Still getting the following errors & I'm not sure what to do about the last error & I hope I can get rid of the warnings too.

Error	1	error C2665: 'Con::executef' : none of the 20 overloads could convert all the argument types	c:\Torque\TGEA_1_8_1\engine\source\T3D\shapeImage.cpp	1986
Warning	2	warning C4305: '-=' : truncation from 'double' to 'F32'	c:\Torque\TGEA_1_8_1\engine\source\T3D\player.cpp	1511
Warning	3	warning C4305: '-=' : truncation from 'double' to 'F32'	c:\Torque\TGEA_1_8_1\engine\source\T3D\player.cpp	1517

If anyone has a suggestion that would be great.
#70
09/14/2009 (8:43 pm)
with the last error it could be one of a couple things:

1) one to many variables being passed into the executef function

or

2) one of the variables is of the wrong type

or) a combination of the above.

do a search for the con::executef string and compare a working one with yours. It will give you the solution you need to fix it.
#71
09/14/2009 (9:12 pm)
@Roland Orr

Thank you I'll do that..

I have actually been looking into a thread I found that has been posted that's about an error very very similar to the 1 I have.

www.garagegames.com/community/forums/viewthread/91009

The thread above then lead me to this other thread shown below.

Quick Guide Porting Tips (to TGEA 1.7.0)
www.garagegames.com/community/forums/viewthread/74079

though I'm not sure if the solution offered in this thread would actually help & I wonder if there really needs to be this many changes, as it goes in to a massive amount of code changes to the engine.

Maybe someone could skim over it & give me a more informed opinion?

And take your advice & I'll keep searching for a thread to find a more viable solution.

thank you for the quick response though. :)
#72
09/14/2009 (9:21 pm)
as a side note about the warnings

F32 is a float type. so the compiler is warning you that converting a double to a F32 you may or may not lose data, as a double holds more data than a float does.

as an example, i added the door resource from tge into tgea, i was getting that exact same error on line 58, which read:

maxRotation = M_2PI / 4;

and changed it to:

maxRotation = M_2PI_F / 4;

cured the warning because now the code is using the F32(FLoat) of M_2PI instead of the double.

another simpler example:

Assign a double value to a Float(F32)

F32 a;
a = 0.1;

but would be better written and eliminate warnings with:

F32 a = 0.1f;
#73
09/14/2009 (9:30 pm)
@Roland Orr

sweet that did the trick the warnings are gone.
thank you again!
#74
10/27/2009 (6:31 pm)
I'm trying to implement this into the game engine( TGEA 1.7.1 ). I put the files included in the .rar file into this location

C:\Torque\TGEA_1_7_1\engine\source\T3D

I compiled the build files, and it gave me error messages saying it couldn't open any of the "include" files.

here's the list:
d3dx9.h
d3dx9core.h
d3dx9tex.h
dxdiag.h

i'm wondering what these files do, and what directories they are located in. If i am missing these files, where can i find them?
#75
10/27/2009 (6:34 pm)
You have to edit the file paths to point to those files, if that's the case then I doubt you have updated TGEA files, which means you'll have to do more updating.

The below link is for TGEA 1.8.1 but may work just dropping it into 1.7.1.
tek0.net/torque/meleeTGEA181.zip
#76
10/27/2009 (6:44 pm)
Do you mean i have to update my whole TGEA engine?
#77
10/28/2009 (4:21 am)
Yeah, there's no melee support in the stock TGEA, so some updating will have to happen, those files work 100% and are the files that come with TGEA, but contain the updated code, it's as simple as replacing them and compiling.
#78
10/28/2009 (7:38 am)
@Cody: The account you are using has not been licensed for TGEA(or any torque), questions about source code should be made from a valid account.
#79
11/02/2009 (11:11 am)
I'm a student, and the torque engines are licensed under my professor.
#80
11/02/2009 (12:28 pm)
@Cody
Please email me at the address in my profile and so we can verify you.