Game Development Community

Platforms Players can Ride Version 1.1

by Cinder Games · in Torque Game Engine · 01/27/2007 (4:34 pm) · 268 replies

Platforms Players can Ride Version 1.2!!!!!!
with Dynamic object Attachment
###################################
##This post has been edited and updated 2/13/07 ##
##################################

subvoicestudios.com/~ramensama/TorqueDynamicAttachment.jpg

Here's the new and improved files you'd need.
Version 1.2
subvoicestudios.com/~ramensama/torque1.5.2.zip

1.7.2008
What's new? There are several new features and improvements.

1) Removed or reduced jitter caused by multiple players on a platform
2) Support for new items on platforms. Now Items, Shapes, lights, particle emitters, and possibly others!
3) Object to object Attachment. Players can now attach Items, shapes, etc to them. Even the attached objects can attach more objects to themselves!
4) Reduced the number of code changes.... a little.


This must be extracted in the base torque directory where it's installed...
c:/torque

or whatever. it's designed to simply overwrite a stock install of torque.

Afterwards you must add pathshape.cc and pathshape.h to your project in visual studio or whatever.

img292.imageshack.us/img292/9507/addexistingxy9.gif

To attach an object, you must use this syntax:

ParentObject.attachChild(ChildObject);

So if you want to attach an item to the player, move the player towards the object, press F11 to get the object ID. Press ~ and type in $player.attachchild(ObjectID);

The item is now attached to the player.

$player.detachchild(ObjectID); is how to remove the object.






Ancient Versions of the code can be found here.
These are version 1.1, not the newest version and probably have bugs that the newer code does not.
Here's a link to the new updated code. It's for torque 1.4...
subvoicestudios.com/~ramensama/torque.zip

And for Torque 1.5
subvoicestudios.com/~ramensama/torque1.5.zip
Page «Previous 1 2 3 4 5 6 7 Last »
#1
01/27/2007 (7:47 pm)
If this is based on your last code then it works fine for tge 1.5, I have it working in 1.5 for my toby game.. the only problem I noticed was each collision would skip it to the next node which sucked to say the least.. i will merge this in and see if it works as well.. :)
#2
01/27/2007 (7:48 pm)
This fixes that issue with the platform skipping to the next node. I never noticed the problem before... but really it's up to each person to decide how they want the platform to start.

All that's new is a new callback for the pathshape... getState. which will return 0,1,2 depending on the direction it's moving along the path, or if it's stopped.

Also i changed the pathshape.cc file to change the default state from Forward, to Stopped. So before starting a pathshape along a path, you'd need to tell it what state to be in... %shape.SetState(0) will make it go foward.
#3
01/27/2007 (8:26 pm)
1>pathShape.cc
1>..\engine\game\pathShape.cc(257) : error C2039: 'getState' : is not a member of 'PathShape'
1> ../engine\game/pathShape.h(31) : see declaration of 'PathShape'
1>..\engine\game\pathShape.cc(259) : error C2065: 'mState' : undeclared identifier
1>..\engine\game\pathShape.cc(497) : error C2039: 'getState' : is not a member of 'PathShape'
1> ../engine\game/pathShape.h(31) : see declaration of 'PathShape'

I get this in my compile.. I just merged your new stuff with the old code.. so may go back to my old stuff and remerge that way..

everything else compiles fine..
#4
01/27/2007 (10:28 pm)
Doh. i forgot to include the new .h file

just add in

int getState();


under

void setState(State s);

in pathshape.h

i've fixed the zip.
#5
01/28/2007 (10:35 am)
Ok looking now to see..
#6
01/28/2007 (10:46 am)
Works perfectly in 1.5.. just use winmerge or any merge program and its works great.. :)

now to loop the shape.. :) thanks ramen-sama

great stuff.. :)
#7
01/28/2007 (3:05 pm)
Hmm only errors im getting with 1.5 is this
Error	1	error C2065: 'con' : undeclared identifier	g:\dev\Torque\tge.sdk\engine\game\gameBase.cc	457
Error	2	error C2227: left of '->getGhostIndex' must point to class/struct/union/generic type	g:\dev\Torque\tge.sdk\engine\game\gameBase.cc	457
im not all that familiar with the engine code yet, so i have no idea where to start looking to fix this.
any help would be great

-edit-
got the errors fixed, and engine compiles... however...
i loaded the mission that came in the zip, it has the path, but no platform?
#8
01/28/2007 (3:49 pm)
Include the pathshape.cc and pathshape.h .. :)

compile then it should work

oh and a small sample video.. :)

home.comcast.net/~theberk/platformTest1.avi

TomFeni
#9
01/28/2007 (7:38 pm)
Nice video! good to see it's being put to use.
#10
02/13/2007 (8:59 pm)
K, got it working in the FPS shooter. Still have that gray freeze screen in my game so it's gotta be something in my engine code. Hopefully I can fix that.
#11
02/15/2007 (5:00 am)
I got the platform working pretty nicely, but not in multiplayer.

The player and the platform run smoothly on one client but on the other they are very jerky movement.

When we connect three persons and all of us get onto the platform one of the player characters starts moving really oddly.

The same player is moving badly on all clients.

Other player characters are moving very smoothly so it can't be a network delay issue.

This looks really good and I really want to use it please help !!
#12
02/16/2007 (5:18 am)
Two videos which show the problem, they show the same game scene but from different player cameras.

http://rapidshare.com/files/16727772/Player1.mpg

http://rapidshare.com/files/16727839/Player2.mpg

In camera player 2 the other player (player1) is jittering a lot while riding the platform, although in the player1 camera there is no jitter at all.
#13
02/16/2007 (4:47 pm)
Right. Well i'm familiar with the issue at hand. Unfortunately, i'll have to reseach a little.
I'm going to assume that the other players, and handled via the AIPLayer class? i'm not sure how it all works.
I know there's no real support for the aiplayer class just yet, i'm not sure how networked players are considered.


The jittering is happening on non players due to the lack of interpolation on during the process ticks. I'll mess around later and apply the same functions the player uses to the AIPlayer class. that may be all it needs, but i don't really have a way of testing to make sure it's working.
#14
02/17/2007 (3:42 pm)
I have an odd problem, I crash out hard anytime a projectile get near the path shape platform. Its driving me crazy!
#15
02/17/2007 (4:07 pm)
That is a little odd.. i can shoot it just fine. Is this 1.4? 1.5? anything in the error log?
#16
02/19/2007 (2:15 am)
Hi Ramen,

Thanks for your reply but it is a bit ambigous. Did you say:

1. one of the two players in the videos is a NPC represented by an AIPlayer

OR

2. In Multiplayer, characters of human players (Player class) other than the Local player are represented by an AIPlayer object.


Statement one: In the videos posted both of the characters are human players.

About the second statement, according to the research I have done networked characters are not represented by AIPlayer class objects if they are human players. They are represented by the same Player class(through which the local player is represented).

I have been trying to fix this issue for some time now but have not been successful. The reason being my lack of knowledge of Torque networking and Interpolation techniques applied on Client end.

It would be really appreciated someone could explain these two issues or point me to a resource where they are explained.

This resource would be even better if we can get this to work properly in multiplayer.

Looking forward to some positive response,

Ali Khan.
#17
02/19/2007 (5:36 am)
Well i've tested the platform with the player and kork at the same time, and everything is well. I'm not sure how to go about doing a networked game so i can get a better look at the situation.
#18
02/19/2007 (11:35 am)
Ramen-sama,
This is 1.42 TLK. Nothing gets put in the log. And there is a very good chance i have done something elsewhere that is doing this, just it ONLY manifests itself near the platforms.
#19
02/19/2007 (2:12 pm)
I figured something out. I put a 'return;' at the start of ShapeBase::renderShadow, and now my path shape do not crash when interaction with projectile.
So after some experiments, i disabled ADVANCED_DYNAMIC_SHADOWS (shadows from more then ONE light source, so now the platform is only shadowed from the sun) and it worked fine.

If someone with 1.5 or TLK could see if they have the same problem that would be great.... I have a dirty little hack that solves the problem, but it may still be something I busted in the first place...
#20
02/22/2007 (2:25 pm)
As a follow up, I traced the bug down to my increasing the distance dynamic shadows can render, IE:shadowLen = 50.0f * mShapeInstance->getShape()->radius; After much experiments and tweaking I have found any dynamic mesh of a large size (seems to be anything much larger then my player mesh whats bounding box stands at 5.5 Torque Units tall, and 2.5 units radius) will cause a crash. Now something very neat here is sometimes one can scale LITTLE mesh to be big, and NOT get the dynamic shadow crash, of course this often mess up the shadows position and scale anyhow.
Page «Previous 1 2 3 4 5 6 7 Last »