IonicWind Software

Aurora Compiler => 3D Graphics => Topic started by: J B Wood (Zumwalt) on July 29, 2006, 07:20:17 PM

Title: Zumwalts Blast A Mech Code
Post by: J B Wood (Zumwalt) on July 29, 2006, 07:20:17 PM
-> code back online <-

Under Construction, but I am going to post all updates to this thread as I build it.
I'll go through all my other threads and kill the Aurora3d.zip file, just look here for each recent build.

This will also contain all my media and such that I use for the game, and if I report a bug in another thread, the code in that thread will only be a snippet, for the full source, always look here.

I have replaced the main mech with a tank.
This is a work in progress, as Paul and the gang increase there release builds, so will the sophistication of the game become.
(note, last webserver was rebuilt, lost that build, still looking for it, here is a backdated version for now, stable)
(as soon as I can find the latest build, I will update the post)
http://www.gamedevonline.com/subsite/demos/3impact/files/aurora3d.zip (http://www.gamedevonline.com/subsite/demos/3impact/files/aurora3d.zip)

Screenshot now available for in game demonstration.
(http://www.gamedevonline.com/subsite/photo_gallery/images/TankDemo.jpg)
Title: Re: Zumwalts Blast A Mech Game
Post by: kryton9 on July 29, 2006, 07:31:53 PM
Who is your web host Zumwalt, I got over 800k/sec download speeds, will write again when I check out the updates :)
Title: Re: Zumwalts Blast A Mech Game
Post by: kryton9 on July 29, 2006, 07:36:12 PM
That is fun. Did you set it up so the light follows the tank? I notice that if I drive through the mech with the tank and then go some, the lighting changes. I liked that.
Mech looks different in light and then darker.

That is really great considering we are in an alpha and Paul is not even 50% with this stuff so far.
Title: Re: Zumwalts Blast A Mech Game
Post by: J B Wood (Zumwalt) on July 29, 2006, 09:20:15 PM
I use Ezboxx as my hosting service.
www.ezboxx.com (http://www.ezboxx.com)

There located in Dublin Ireland.

For the mech, thats an interesting story, it has no skin. The fact it changes from one skin to another is because it seems to 'inherit' a skin from either my flat plane sprite attempt and the tank itself.

Each object has its own lighting from how gamespace exported it. I made both have infinate light.
This is just an 'alpha' demo per say, I have to be able to add gravity, which I can do atrificially, just don't have the time at the moment.
More features will be added to the example as more features get added to the 3d method list.
Glad you like it! :)
Title: Re: Zumwalts Blast A Mech Game
Post by: Rock Ridge Farm (Larry) on July 30, 2006, 04:37:28 PM
The link appears to be broken????
Title: Re: Zumwalts Blast A Mech Game
Post by: kryton9 on July 30, 2006, 04:49:18 PM
I connected to the link last night, but it took forever to load the pages.

I don't know how the download went so quickly when their main site was sooooo slow?

Zumwalt is paving the way for us with his game. Glad he is into this stuff, as I am sure I can learn a lot from
his examples in the coming weeks and months.

Already looking through it along with Paul's skinned x example, started to understand it. But still got a long way to go, before I can do the kind of things I want to do.
Title: Re: Zumwalts Blast A Mech Game
Post by: Steven Picard on July 30, 2006, 05:57:28 PM
The link doesn't work for me either.  I'm anxious to give it a try.  :)
Title: Re: Zumwalts Blast A Mech Game
Post by: J B Wood (Zumwalt) on July 30, 2006, 06:33:02 PM
Odd, that link works for me.
Its over 2 megs in size, so I can't post it here.
Which link is broken, the ezboxx one or my zip file?

Could it be the way your browser is setup and its stopping the file download box from showing up?
Title: Re: Zumwalts Blast A Mech Game
Post by: Ionic Wind Support Team on July 30, 2006, 08:22:57 PM
http:\\www.jbwws.com\jbwws\aurora\aurora3d.zip

Doesn't work for me either. 
Title: Re: Zumwalts Blast A Mech Game
Post by: kryton9 on July 30, 2006, 09:03:39 PM
They must be having server problems. Because I had a great download speed of over 800k/sec getting his mech example zip.

Then when zumwalt wrote back about the webhost and I clicked on the link, it took a very long time for the pages to load. So I stopped trying to read info from the site.

They must have realized something is wrong and are probably working on it. My only explanation.
Title: Re: Zumwalts Blast A Mech Game
Post by: J B Wood (Zumwalt) on July 30, 2006, 09:17:13 PM
Wierd, well if its the same tomorrow, I'll try to host it on another site.
Maybe they were doing some server maintance today.
Title: Re: Zumwalts Blast A Mech Game
Post by: Zen on July 31, 2006, 04:49:42 AM
There is nothing wrong with the link. It is a simple mistake of using backslashes instead of forward slashes, hence why the browsers keep adding a forward slash at the end.

Backslashes are used for file system navigation but not for URL's

Here's the link http://www.jbwws.com/jbwws/aurora/aurora3d.zip

Lewis
Title: Re: Zumwalts Blast A Mech Game
Post by: Steven Picard on July 31, 2006, 06:10:13 AM
Quote from: Zen on July 31, 2006, 04:49:42 AM
There is nothing wrong with the link. It is a simple mistake of using backslashes instead of forward slashes, hence why the browsers keep adding a forward slash at the end.

Backslashes are used for file system navigation but not for URL's
Good catch!  I feel stupid for not even noticing.  :P
Title: Re: Zumwalts Blast A Mech Game
Post by: J B Wood (Zumwalt) on July 31, 2006, 06:18:30 AM
Fixed the URL, I have no idea what I had it that way, good catch though. See how many of us it took to figure out that my / and \ were messed up? Thats just wrong :)

Glad it works.

I am going to try to work on it some more tonight, I want to split out the machine gun, the main turret and the treads from the tank body and allow for rotation to be added to each item. I am not good at UV mapping so it might look like crap, but going to atleast make it functional.

This will however, probably force me to create a physical Tank class with sub classes for the treads and turrets. I have to create a generic ammo class to hold all sorts of ammo and count for fire rate, amount, damage type etc. This will complicate the example some though, but I will try to keep it down to a bare minimum.
Title: Re: Zumwalts Blast A Mech Game
Post by: kryton9 on July 31, 2006, 12:03:32 PM
The old link worked for me in fact last night, i just hovered over the old way you had the link and in the status at the bottom it showed the correct link.

I think their servers were down for a time.

But yep, I never noticed the reversed slashes so that was a good eye to pick that up.
Title: Re: Zumwalts Blast A Mech Game
Post by: Parker on July 31, 2006, 12:51:48 PM
Okay okay, I'll update (still need that d3dx9r DLL ::))

While I'm waiting... I never knew .x files were just plain text. I guess if you had enough patience you could make a model in notepad.

Cool start... the finished product will be interesting to see.
Title: Re: Zumwalts Blast A Mech Game
Post by: Barney on July 31, 2006, 01:22:13 PM
Quote from: Parker on July 31, 2006, 12:51:48 PM
While I'm waiting... I never knew .x files were just plain text. I guess if you had enough patience you could make a model in notepad.
Not all .X files are plain text. There are also binary versions available. Technically you can create those with notepad but I would not be the one who will try it. Not even as an exercise :)

Barney
Title: Re: Zumwalts Blast A Mech Game
Post by: J B Wood (Zumwalt) on July 31, 2006, 01:42:48 PM
I save all of mine as text so that I can verify a few things in them, specifically the texture file path. Sometimes my gamespace saves the full path and other times not, its a value I have to check off and sometimes I forget, what that means is that if the image file is not in its full path, the rendering engine gives me errors, I update the path manually to match where the file will be stored.

All mesh files are is a list of coordinates, line from point a to b in a 3d system.
They also include more information in them, I just can't remember everything they store, and don't want to either.

Don't look for this to be much more than 2 machines, 1 computer controled, 1 human controled, and the ability to kill each other. The tech demo is supposed to be covering the following sets of rules:

1) simple architecture
2) easy to understand layout
3) basic structures
4) basic methods
5) basic AI
6) game loop demonstration
7) collision demonstration
8) end game resolve

All code will be provided in the tech demo, along with any textures / meshes that I use to generate the basic game. I don't want this to be hard to understand, and I want it to be just enough that a new person to Aurora can get started with there own 3'rd person type strategy game.

Core concepts will have enough in them so that someone could take it, build there own skeletal structure and use it for other games, like rpg, fps, puzzle, etc.

This is a work in progress, so please understand that it will grow only at the pace that Aurora grows, I don't want to write my own items into the engine for this, I want to use all native components, thats why I stopped my conversion for the ODE and I will wait on Aurora's implimentation of physics.

If there is a specific request that anyone has for the game to include, let me know and I'll see if it fits within the bounds of the tech demo, if so, I'll add it, if not, I'll explain the concept of how to do it.

Thanks to all the people downloading and testing it, I like feedback :)
Title: Re: Zumwalts Blast A Mech Game
Post by: J B Wood (Zumwalt) on August 03, 2006, 12:10:02 PM
Updated (or should be) as of 08/03/2006

Controls are updated forgot to document in code to display but:
A increase speed
Z decrease speed

Forward arrow = move tank
Left arrow = turn left
Right arrow = turn right

I'll iron it out some more tonight.
Title: Re: Zumwalts Blast A Mech Game
Post by: J B Wood (Zumwalt) on August 03, 2006, 12:31:20 PM
Just did a fast update. More realistic.
A = forward movement adjust
Z = reverse movement adjust
Forward arrow = move tank ( will add in code later for inertia)
Left - Right = turn
Back = unassigned now
Title: Re: Zumwalts Blast A Mech Game
Post by: J B Wood (Zumwalt) on August 03, 2006, 06:32:10 PM
Updated, now includes inertia, back arrow applies brakes, S and D keys assigned to camera to zoom in and out with assigned mininmum and maximum range, along with H to reset you back to spawn point, doesn't reset speed though ;) (did that on purpose cause I was having fun)

Let me know if you find any problems, will continue to build on it more, maybe another update later tonight or most likely tomorrow night, anything between now and then will most likely be minor adjustments. I need to get back to my sketch board to draw out the zoning criteria.
Title: Re: Zumwalts Blast A Mech Game
Post by: J B Wood (Zumwalt) on August 03, 2006, 08:04:53 PM
Last update for the night, got to get sleep. Here is what it does at the moment:
15 Key assignments as follows:

Comma = Machine Gun (text only)
Period = Missle Launcher (text only)
Comma+Period = Eject (text only)
A = Foward Throttle
Z = Reverse Throttle
H = Respawn at Home Point
S = Zoom camera In
D = Zoom camera Out
Q = Rotate Turret Left
W = Rotate Turret Right
1 = Raise Barrel
2 = Lower Barrel
Arrow Up = Move Tank (keep constant on throttle)
Arrow Left = Turn Left
Arrow Right = Turn Right
Arrow Down = Brakes :)


Rotation of turret does not current take into account the barrel, this will be fixed later with rotation limited to 3/4 rotation either side.
More to come later. The initial release will be all in the main, second iteration will be full OOP version so you can see the difference.
Title: Re: Zumwalts Blast A Mech Game
Post by: John S on August 03, 2006, 08:15:50 PM
cool demo.

S & D functions are reversed
Title: Re: Zumwalts Blast A Mech Game
Post by: ExMember001 on August 04, 2006, 12:24:52 AM
Great demo  ;)
very impressive!
Title: Re: Zumwalts Blast A Mech Game
Post by: J B Wood (Zumwalt) on August 06, 2006, 06:04:12 PM
Thanks, I am having a bit of a problem with the machine gun at the moment, but have added it the ability to rotate, use keys 3 and 4 for that.
Still researching how ot fix the machine gun.
Title: Re: Zumwalts Blast A Mech Game
Post by: Ionic Wind Support Team on August 09, 2006, 02:41:32 PM
OK in reference to your machine gun.  The meshes center of rotation is not the middle of the gun.  So to correct for it you use the transform node as I had suggested.

- Offset the transfrom using the Postion method so it as at the center of where you want the gun to rotate.
- Make the gun a child of the transform and offset it using the Position method so the point on the mesh where you want it to rotate is over the center of the transform.
- You rotate the transform then, not the gun.

After a few minutes of playing this was close:


//#include "ode.inc"
declare import,timeGetTime(),int;

global sub main()
{
// setup or variables
C3DScreen s;
C3DCamera c;
C3DMesh m;
C3DObject scene,trans;
C3DLight light;
CDirectInput di;
// tank stuff
VECTOR3 myMesh,myTerrain,mySprite;
VECTOR3 tankDIR, tankPOS;

// turret stuff
VECTOR3 turretDIR, turretPOS;

// barrel stuff
VECTOR3 barrelDIR, barrelPOS;

// mgun stuff
VECTOR3 mgunDIR, mgunPOS;

float tankAdjust;
float fadjust,fTarget;
//target 60FPS for camera movement
fTarget = 1.0f / /*FPS*/60.0f * 1000.0f;
fAdjust = 1.0f;

//Zumwalts FUN stuff!!!
C3DMesh z,sp,m1,tp1,tp2,w,zt,zb,mgun,mholder;

// create our window to handle our scene
s.CreateWindowed(0,0,1024,768,AWS_CAPTION|AWS_VISIBLE|AWS_SIZE,0,"Zumwalts 3D Test - ESC exits",NULL,false);
di.Init(s);
s.CenterWindow();
c.Create(s);
c.Position(1,1,1);
c.Rotate(0,0,0);
c.Orient(0,0,1,0,10,0);
//c.Orient(0,0,1,0,100,0);
c.SetBackPlane(500);
trans.createtransform(s);

// load our tank
zt.Load3DS(s,GetStartPath() + "media\\TankTurret.3ds",false);
zb.Load3DS(s,GetStartPath() + "media\\TankBarrel.3ds",false);
mgun.Load3DS(s,GetStartPath() + "media\\tankmgun.3ds",false);
mholder.Load3DS(s,GetStartPath() + "media\\tankmgun1.3ds",false);
//mgun.LoadX(s,GetStartPath() + "media\\mgun.x");
z.Load3DS(s,GetStartPath() + "media\\TankBody.3ds",false);
z.Scale(1,1,1);
z.Position(-79,-7.45,50); // hit is at -7.5, need to look into mesh later
z.Rotate(0,0,0);
z.EnableLighting(false);
z.UseVertexColor(false);
// add turret as a child to tank
z.addchild(zt);
zt.addchild(trans);
trans.addchild(mgun);
trans.position(.5,0,-.3);
mgun.position(-.4,0,.4);
//zt.addchild(mgun);

// add barrel as child to turret
zt.addchild(zb);

// Load our terrain
m.LoadX(s,GetStartPath() + "media\\terrain.x");
m.Scale(1,1,1);
m.Position(0,-7.5,0);
m.Rotate(0,180,0);
m.EnableLighting(true);
m.UseVertexColor(true);

// load our water
w.LoadX(s,GetStartPath() + "media\\water0.x");
w.Scale(1,1,1);
w.Position(0,-8,0);
w.Rotate(0,180,0);
w.EnableLighting(true);
w.UseVertexColor(true);

// load our sprite for above tank
sp.LoadX(s,GetStartPath() + "media\\sprite.x");
sp.Scale(1,1,1);
sp.Position(-104,0,40);
sp.Rotate(0,0,0);
sp.EnableLighting(false);
sp.UseVertexColor(false);

// load our mech
m1.LoadX(s,GetStartPath() + "media\\mech.x");
m1.Scale(1,1,1);
m1.Position(-89,-7.5,45);
m1.Rotate(0,0,0);
m1.EnableLighting(false);
m1.UseVertexColor(false);

// create our lighting
light.Create(s,LIGHT_POINT,1);
light.Position(110,110,150);
light.SetAttenuation(0,1/500.0,0);
light.SetSpecular(.5,.5,.5,1);
light.SetAmbient(1,1,1,1);
light.SetRange(1000);

// add children to scene
scene.CreateScene(s);
scene.AddChild(light);
scene.AddChild(m);
scene.AddChild(z);
scene.AddChild(sp);
scene.AddChild(m1);
scene.AddChild(w);


// set inital collision
z.initcollision(false);
m.initcollision(false);
m1.initcollision(false);

int fps = 0;
int startTime;
float angle = 0.0;    // Tank direction speed
float angleT = 0.0;  // Turret Direction speed
float angleB = 0.0;  // Barrel Direction speed
float angleG = 0.0;  // Gun Direction speed

float speed=0.0;      // travel speed
float maxspeed=1.0; // max travel speed
float minspeed=-0.5; // min travel speed
float inertia=0.0005; // Inertia balance factor
float camDMin=-5,camDMax=-40,camDCurrent=-20;  // Camera adjustments
float barMin=0.100,barMax=-0.100; // Barrel angle minimum and maximum

// obtain initial tank position
myMesh=z.GetPosition(0);


do
{
startTime = timeGetTime();
tankPOS = z.GetPosition(0);
tankDIR = z.GetDirection();
myMesh = z.GetPosition(0);
myTerrain = m.GetPosition(0);
turretDIR = zt.getPosition(0);
barrelDIR = zb.getPosition(0);
mgunDIR = mgun.getPosition(0);


// Home Position for the tank, simulate spawn
if di.KeyDown(DIK_H)
{
myMesh.x=-79;
myMesh.y=-7.45;
myMesh.z=50;
z.Position(myMesh.x,myMesh.y,myMesh.z);
}

//check for keys and move mech and camera accordingly
IF di.KeyDown(DIK_UP)
{
z.Position(myMesh.x+tankDIR.x*speed,myMesh.y,myMesh.z+tankDIR.z*speed);
}
else
{
//Assume inertia resistance on motion
if(speed > inertia) & !di.KeyDown(DIK_A) & !di.KeyDown(DIK_Z)
{
speed=speed-inertia;
}
else if (speed < inertia-0.001) & (!di.KeyDown(DIK_A) & !di.KeyDown(DIK_Z))
{
speed=speed+inertia;
}
else if (!di.KeyDown(DIK_A) & !di.KeyDown(DIK_Z))
{
speed=0;
}
z.Position(myMesh.x+tankDIR.x*speed,myMesh.y,myMesh.z+tankDIR.z*speed);
}

// apply brakes to stop the tank
IF di.KeyDown(DIK_DOWN)
{
if (speed < 0)
{
speed=speed+inertia*3;
}
else if (speed > .003)
{
speed=speed-inertia*3;
}
else if (speed <> 0)
{
speed=speed-inertia;
}
else
{
speed=0;
}
}

// increase speed
IF di.KeyDown(DIK_A)
{
if(speed<maxspeed)
{
speed+=.001;
}
else
{
speed=maxspeed;
}
}

// decrease speed
IF di.KeyDown(DIK_Z)
{
if(speed>minspeed)
{
speed-=.001;
}
else
{
speed=minspeed;
}
}

// turn right
if( di.KeyDown(DIK_RIGHT))
{
angle += .025 * fAdjust;
}

// turn left
IF di.KeyDown(DIK_LEFT)
{
angle -= .025 * fAdjust;
}

// rotate Turret Left
if (di.KeyDown(DIK_Q))
{
angleT -= .025 * fAdjust;
}

// rotate Turret Right
if (di.KeyDown(DIK_W))
{
angleT += .025 * fAdjust;
}

// rotate Turret Left
if (di.KeyDown(DIK_3))
{
angleG -= .025 * fAdjust;
}

// rotate Turret Right
if (di.KeyDown(DIK_4))
{
angleG += .025 * fAdjust;
}

// rotate Barrel Up
if (di.KeyDown(DIK_1))
{
if (angleB > barMax)
{
angleB -= .0025 * fAdjust;
}
else
{
angleB = barMax;
}
}

// rotate Barrel down
if (di.KeyDown(DIK_2))
{
if (angleB < barMin)
{
angleB += .0025 * fAdjust;
}
}

// physically rotate tank
z.Rotate(0.0f, angle,0.0f);
zT.rotate(0.0f,angleT,0.0f);
zB.rotate(angleB,0.0f,0.0f);

trans.rotate(0.0f,angleG,0.0f);

s.Clear(RGBA(0,0,0,255));
s.BeginScene(c);
scene.Draw();

// setup weapons keys, just show text for now
if di.KeyDown(DIK_PERIOD) & !di.KeyDown(DIK_COMMA)
{
s.RenderText(0,70,"Fired: Missle",RGBA(255,255,0,255));
}
else
{
s.RenderText(0,70,"Fired: ",RGBA(255,255,0,255));
}

if di.KeyDown(DIK_PERIOD) & di.KeyDown(DIK_COMMA)
{
s.RenderText(0,70,"Fired: Ejection Seat",RGBA(255,255,0,255));
}
else
{
s.RenderText(0,70,"Fired: ",RGBA(255,255,0,255));
}

if di.KeyDown(DIK_COMMA) & !di.KeyDown(DIK_PERIOD)
{
s.RenderText(0,70,"Fired: Machine Gun",RGBA(255,255,0,255));
}
else
{
s.RenderText(0,70,"Fired: ",RGBA(255,255,0,255));
}

// alter camera position
if di.KeyDown(DIK_S)
{
if (camDCurrent>camDMax)
{
camDCurrent-=.01;
}
else
{
camDCurrent=camDMax;
}
}

if di.KeyDown(DIK_D)
{
if (camDCurrent<camDMin)
{
camDCurrent+=.01;
}
else
{
camDCurrent=camDMin;
}
}

// render information to screen about what to do
//s.RenderText(0,0,"\xC9",RGBA(255,255,0,255));
s.RenderText(0,10,"FPS:"+NumToStr(fps),RGBA(255,255,0,255));
s.RenderText(0,32,"X:"+NumToStr(myMesh.x,2),RGBA(255,255,0,255));
s.RenderText(0,44,"Y:"+NumToStr(myMesh.y,2),RGBA(255,255,0,255));
s.RenderText(0,56,"Z:"+NumToStr(myMesh.z,2),RGBA(255,255,0,255));
s.RenderText(200,0,"Controls: Comma=Machine Gun, Period=Missle, Comma+Period=Eject",RGBA(255,255,0,255));
s.RenderText(200,15,"Arrow Up=Move **** Arrow Down=Brakes **** Arrow Left & Arrow Right = Steer",RGBA(255,255,0,255));
s.RenderText(200,28,"A: Forward Throttle",RGBA(255,255,0,255));
s.RenderText(200,42,"Z: Reverse Throttle",RGBA(255,255,0,255));
s.RenderText(200,54,"H: Respawn at Home",RGBA(255,255,0,255));
s.RenderText(200,66,"S: Zoom Camera Out",RGBA(255,255,0,255));
s.RenderText(200,78,"D: Zoom Camera In",RGBA(255,255,0,255));

s.RenderText(400,28,"Q: Rotate Turret Left",RGBA(255,255,0,255));
s.RenderText(400,42,"W: Rotate Turret Right",RGBA(255,255,0,255));
s.RenderText(400,54,"1: Raise Barrel",RGBA(255,255,0,255));
s.RenderText(400,66,"2: Lower Barrel",RGBA(255,255,0,255));
s.RenderText(400,78,"3: Rotate Gun Left",RGBA(255,255,0,255));
s.RenderText(400,90,"4: Rotate Gun Right",RGBA(255,255,0,255));

s.RenderText(800,0,"Tank Speed:"+NumToStr(speed,3),RGBA(255,255,0,255));
s.RenderText(800,20,"Tank Barrel:"+NumToStr(angleB,3),RGBA(255,255,0,255));

// position camera
c.Position(myMesh.x,myMesh.y+10,myMesh.z+camDCurrent);
c.Rotate(0,0,0);
c.Orient(0,0,1,0,10,0);
c.LookAt(myMesh.x,myMesh.y,myMesh.z);
sp.Position(myMesh.x+tankDir.x,myMesh.y+tankDir.y+4,myMesh.z+tankDir.z);
sp.Rotate(0,0,0);

// check for and annouce collision
if(m.ObjectCollided(z, true))
{
s.RenderText(0,90,"Hit Terrain",RGBA(255,255,0,255));
}

if(m.ObjectCollided(m1, true))
{
s.RenderText(0,90,"Hit Mech Dummy",RGBA(255,255,0,255));
}

// render the scene and loop
fps = s.RenderScene();
fAdjust = (timeGetTime() - startTime) / fTarget;
}until di.KeyDown(DIK_ESCAPE);
Scene.Free();
}
Title: Re: Zumwalts Blast A Mech Game
Post by: J B Wood (Zumwalt) on August 09, 2006, 09:06:14 PM
THANKS!
This is definately going to help, I was creating the tank class while on the airplane today, and this is going to help with the other problem I have with the other weapon mounts......

Title: Re: Zumwalts Blast A Mech Game
Post by: Steven Picard on August 10, 2006, 09:02:44 PM
Zumwalts, you've made some nice progress on this.  I look forward to your future versions.
Title: Re: Zumwalts Blast A Mech Game
Post by: J B Wood (Zumwalt) on August 11, 2006, 06:51:19 AM
I hope to have another release update this weekend, I have created a few classes and am starting to seperate everything out into them, including a V3 class I am working on to hold a type of radar system. putting all the math I need for calculations into that class, the tank class is coming along pretty nicely, so hopefully all a person has to do is create a new instance of the class or inherit the class if building a new class based on the tank properties and methods.

That will eventually be thinned down to a vehicle base class that the tank class will inherit from itself, which is smarter actually.
Anyway, if I am lucky the next release will have the first H.U.D. done (well started anyway).

I am also working out the details on paper for the weapon class and what all would a weapon contain. I know I talked about it earlier but hadn't really gotten around to designing it the way I wanted it to be. That and I am trying to totally understand the trans effect.

Hopefully this demo is helping others.
Title: Re: Zumwalts Blast A Mech Game
Post by: kryton9 on August 11, 2006, 10:13:06 AM
That will be sweet to see. Good luck, looking forward to the next update!!
Title: Re: Zumwalts Blast A Mech Game
Post by: J B Wood (Zumwalt) on August 11, 2006, 11:51:58 AM
Minor update before the weekend, this is now in a project format (although I don't know how to add an icon to the application yet)

The stuff on paper at the house is not in the code yet, but take a look, now I can keep track of targets, right now it has a static target of the mech, gun tracking not enabled in this build, that will come over the weekend for the machine gun and a key to turn it on and off for the turret / barrel.

I got to figure out in the next week or so how to use the mouse in 3d space in this engine....
Haven't even looked to see if its available yet either.
Title: Re: Zumwalts Blast A Mech Game
Post by: kryton9 on August 11, 2006, 04:04:22 PM
Great, I am going to work on making an animated mech and will place it into the models folder when it is finished.
Title: Re: Zumwalts Blast A Mech Game
Post by: J B Wood (Zumwalt) on August 11, 2006, 05:00:06 PM
Thanks Kryton9, much appreciated.
Title: Re: Zumwalts Blast A Mech Game
Post by: John S on August 11, 2006, 08:18:31 PM
looks neat Z.
the machine gun turns, can the turret turn too?
what did you use to create the models?
Title: Re: Zumwalts Blast A Mech Game
Post by: J B Wood (Zumwalt) on August 12, 2006, 08:42:42 AM
Yes, the keys for the turret are listed at the top with the key list.
I have found that the engine limits the number of keys you can have held down, so you can rotate the turret and gun, or the body and gun, or the barrel and turret, but only 2 things at a time, which is wierd, but the gun, turret, barrel and body move.

I have remarked out the border in this latest update so to speed it up like 4 fold.
I use Caligari's Truespace to do my work in, this is why I am so exicted about the OBJ format support, that is the native format to Truespace / gamespace.

EDIT: This build has the first attempt to the machine gun auto tracking in it, so the machine gun goes nuts, bear with me on that, but you can change the following lines:

//trans.rotate(0.0f,angleG,0.0f);
gunResult = dist.hdngtotarget(transpos.x,transpos.z,mechpos.x,mechpos.z);
trans.rotate(0.0f,gunresult,0.0f);

to match
trans.rotate(0.0f,angleG,0.0f);
//gunResult = dist.hdngtotarget(transpos.x,transpos.z,mechpos.x,mechpos.z);
//trans.rotate(0.0f,gunresult,0.0f);

This will let you manually control the rotation of the gun.
Title: Re: Zumwalts Blast A Mech Game
Post by: kryton9 on August 12, 2006, 11:40:56 AM
Wow, that is really coming along. That is wild about the machine gun. Looks neat though, a mind of its own. This is going to be fun :)
Title: Re: Zumwalts Blast A Mech Game
Post by: J B Wood (Zumwalt) on August 16, 2006, 11:10:56 AM
Teaser post and a bump.. FYI I have a generic gravity in place..... coming soon.... eta today I pray.

sweet, thats just fun..
Ok, basic gravity in place, not physics level, this is just a very basic level.
Only applied to tank at the moment while Kryton9 works on his mech to replace mine with.
New update on the link, with basic machinegun tracking that Kryton and I am trying to figure out...
Title: Re: Zumwalts Blast A Mech Game
Post by: J B Wood (Zumwalt) on August 16, 2006, 02:15:35 PM
Just updated, has new terrain (under construction, testing the refresh rate and such)
Both mech and tank now have my gravity component attached to them, tank result for collision with mech now works successfully, so I can work on that in a bit for damage, etc.
Title: Re: Zumwalts Blast A Mech Game
Post by: kryton9 on August 16, 2006, 05:15:28 PM
Zumwalt, wow you really got this going. Lots of fun and lots of stuff you are making work. Sliding collision was daunting me, now will have good code to study, great job!!
Title: Re: Zumwalts Blast A Mech Game
Post by: J B Wood (Zumwalt) on August 16, 2006, 05:19:31 PM
This is highly basic and is calculated on every game loop, very processor intensive if you ask me.
This solution I am using will NOT work for massive collision detection processes on moving objects.
On my laptop I loose around 5fps per object I add to the list in this type of check system.
I am trying to theorize better ways to accomplish this without a dynamic physics system.
Title: Re: Zumwalts Blast A Mech Game
Post by: Rock Ridge Farm (Larry) on August 19, 2006, 03:57:39 PM
Wow - finally got a chance to play with the tank. Cool.
Now make the treads rotate with the tank movement  :)
I am looking forward to you completion of this game.
This is so cool to be done in Aurora.
Title: Re: Zumwalts Blast A Mech Game
Post by: J B Wood (Zumwalt) on August 19, 2006, 08:33:22 PM
Thanks Larry.
As soon as I figure out animation, I'll have the treads moving :)
There is alot I still want to do with it before I call it a complete demo, atleast at the moment if you fall off the map you respawn at home point.
I am kind of tweaking it while I wait for the next release of the engine, doing some client / server stuff at the moment.
Title: Re: Zumwalts Blast A Mech Game
Post by: ExMember001 on August 19, 2006, 09:00:02 PM
new update looks very good !
now i've to learn 3d ;)
Title: Re: Zumwalts Blast A Mech Game
Post by: J B Wood (Zumwalt) on August 31, 2006, 08:14:56 PM
WARNING!!! TEASER NIGHT ATTACK!!!
(http://www.jbwws.com/jbwws/aurora/lightingworking.jpg)
Title: Re: Zumwalts Blast A Mech Game
Post by: kryton9 on August 31, 2006, 08:23:42 PM
Cool night shot, I like the widescreen shot.
Title: Re: Zumwalts Blast A Mech Game
Post by: J B Wood (Zumwalt) on August 31, 2006, 09:33:29 PM
I just uploaded the latest code / build, so the link is updated.
Only added the light to the tank, and you can turn on and off the global light with the L and RSHIFT-L

I seem to have lost my targeting image though.. Got to chase that one down..
Going to work on this some more tomorrow night when I get home from work to test out the new LookAt commands.

This update can give people ideas on how to handle the new light orientation.
Pretty cool.
Title: Re: Zumwalts Blast A Mech Game
Post by: kryton9 on August 31, 2006, 10:15:06 PM
L and RSHIFT+L are not working for me. Will look at the code. Glad you are back on it. Good luck!!
Title: Re: Zumwalts Blast A Mech Game
Post by: J B Wood (Zumwalt) on September 01, 2006, 06:19:20 AM
Hmm... Anyone else having this same problem?

Kryton, twords the bottom of the loop, does your code have this in it?


if di.KeyDown(DIK_RSHIFT) & di.KeyDown(DIK_L)
{
if (lightState=1)
{
lightState=0;
light.Disable();
}
}

if di.KeyDown(DIK_L) & !di.KeyDown(DIK_RSHIFT)
{
if (lightState=0)
{
lightState=1;
light.Enable();
}
}



In the initialization, you should also have a:

int lightState = 1;     // determine if global light is on or off



Most importantly, is the infinate light still on or is it night time?
Title: Re: Zumwalts Blast A Mech Game
Post by: kryton9 on September 01, 2006, 10:29:42 AM
Need to run errands for my Dad today, will look later tonight. Got sleepy after I played with it some and never got to looking at the code. It looks straightforward from your snippet, so I probably ran the wrong file while sleepy :)
Title: Re: Zumwalts Blast A Mech Game
Post by: J B Wood (Zumwalt) on September 01, 2006, 09:59:29 PM
Well bugger, back to the drawing board, the PointAt is only good for the INITIAL point at target, my mgun sits on the turret so it has a trans location, it points ok on init, basically the first and only time it point at the right location, then as I move the tank around its way off, which has always been my problem, so now I am concentrating on learning 3d math. I'll get this figured out, I have to, its core to what I am going to do next, guided missiles.
Title: Re: Zumwalts Blast A Mech Game
Post by: kryton9 on September 01, 2006, 10:14:45 PM
I was loading the wrong file, I like the new lighting. really adds ambiance!!

Where did you read about the new commands and how to use them, maybe my Beta install didnt put the new help in?
Title: Re: Zumwalts Blast A Mech Game
Post by: J B Wood (Zumwalt) on September 01, 2006, 10:23:19 PM
I just use the class view, then I look for the C3DOjbect class and see what it takes.
The problem is, my numbers adjust like they should but the mgun doesn't reset on each loop like it should.
For now, I am pointing the finger at me saying I am forgetting something in my call.

Small section of the code, its easy to figure out where I put this stuff.



float tX=0.0;
float tY=0.0;
float tZ=0.0;

do
{
transpos = trans.getposition(0);
mechPOS = m1.getPosition(0);

tX=(mechPos.x-transpos.x);
tY=(mechPos.y-transpos.y);
tZ=(mechPos.z-transpos.z);
trans.lookat(tX,0,tZ);

s.Clear(RGBA(0,0,0,255));
s.BeginScene(c);
scene.Draw();



The machine gun points at target correctly, but doesn't move, when I move it stays stationary, when I rotate the turret, it stays on its turret location but doesn't point to target, when it is obviously in the loop, and I am getting a new tX,tY,tZ on every loop from the new calculations, they do change, but the lookat is acting like it is ignoring them.
Title: Re: Zumwalts Blast A Mech Game
Post by: kryton9 on September 01, 2006, 10:34:34 PM
I was playing with the LookAt command all last night with my axis and points sample. I tried The lookat with everything available and couldn't get it to point correctly. It did point and would redirect when at different positions. I will look at it more tonight, but it seems like the Y direction is not working correctly. I can't ever get it to look to negative Y space.

Z and X look in both the positive and negative spaces, but not y. But still confused enough that I am going to clean up the code and just making everything a simple option to see all the different code and how it reacts. Instead of commenting and uncommenting stuff each time as I was last night.

I will write more about it tomorrow, I didn't mention anything because I thought I would let Paul finish his documentation and then see if I was doing something wrong.
Title: Re: Zumwalts Blast A Mech Game
Post by: kryton9 on September 01, 2006, 10:40:12 PM
I also like the loading update while it loads all the various parts, nice touch.

Fun driving around with those cool looking trees. Great job so far!!
Title: Re: Zumwalts Blast A Mech Game
Post by: J B Wood (Zumwalt) on September 01, 2006, 10:42:25 PM
Thanks.
At some point soon I am going to create a collision model so its not just the tank body mesh vs the terrain, it will be bouding spheres.
Alot to do.. alot to do..
Title: Re: Zumwalts Blast A Mech Game
Post by: kryton9 on September 01, 2006, 10:45:41 PM
That is alot to do. Just take your time.

I was just looking through some of the include files in Saperos stuff. There is tons of cool stuff with vectors and such.
There are tons of directx and directx10 includes with cool info.

Might save you from having to do your own routines for v3 and v2,
Title: Re: Zumwalts Blast A Mech Game
Post by: J B Wood (Zumwalt) on September 01, 2006, 10:48:04 PM
Avoid Dx10, its for Vista.
Title: Re: Zumwalts Blast A Mech Game
Post by: kryton9 on September 01, 2006, 10:52:43 PM
The includes have lots of functions, just to see how this stuff works. tons to look at in there. Sapero did an incredible amount of work. No wonder he can do so much and cool things.

I feel like a kid who discovered a secret toy room looking through it all. Now if I can figure out how to use any of it :)
Title: Re: Zumwalts Blast A Mech Game
Post by: Ionic Wind Support Team on September 01, 2006, 10:53:37 PM
I read somewhere that you can install dx10 on XP.  Just not officially.

Anyway you have to remember that the LookAt method affects the matrix, just like rotating affects the matrix.   So if you look at a point and then rotate you will be chaning the 'lookat' point.

The initial look at orientation is 0,0,1 normalized.  Which means it is looking at a point down the z axis into the screen.  Keep that in mind when creating your meshes.  If you create a character who's face is 0,0,-1 then the look at point is 180 degrees rotated.

Title: Re: Zumwalts Blast A Mech Game
Post by: J B Wood (Zumwalt) on September 02, 2006, 08:35:23 AM
Thats not the problem, not on mine.
My gun faces the mech correctly on the first pass of the do loop.
Each consecutive pass makes no changes to the guns facing.
So how do I make the gun do a lookat command and work?

...
...
...
Hold the phone a sec... I think I just figured out my problem.
Don't have a solution at the moment but it definately is the problem.

Lookat works, meaning that the point I am looking at is static, but the point I am looking FROM is not static.
So LookAt is pointing to a definate coordinate of x,y,z which doesn't change since the object doesn't move.

As I move my tank, point of origin being the gun is looking at the mech of x,y,z position, but the gun itself is moving.
LookAt in this instance is always getting the static of the x,y,z of the mech but it is not taking into consideration the guns position as it relates to the target being the mech.

Whats the guts of that code Paul? (lookat command code)
Title: Re: Zumwalts Blast A Mech Game
Post by: J B Wood (Zumwalt) on September 02, 2006, 08:57:31 AM
I am uploading new build now with a new command in V3 for finding the mid point between 2 3d points.
I have added to the code for demonstration purposes, a red sphere that sits on that mid point.
That mid point is what the LookAt command looks at, which shows the fact I am sending LookAt a new coordinate on every pass of the do loop.
I think this is boiling down to the facing of the object from the LookAt command, I assume there is math in the LookAt that determines between the source object and the destination object, the facing it needs to use.

What it doesn't take into consideration, is the current facing of the source object, to rotate it to a new facing based on a new coordinate passed into it after the first iteration of the routine.
Title: Re: Zumwalts Blast A Mech Game
Post by: J B Wood (Zumwalt) on September 03, 2006, 08:06:38 PM
Update build now has the target fixed because PAUL ROCKS!!!
The machine gun always targets the dummy mech (not krytons at the moment)
Now to figure out layered 2d screens on the 3d screen.
That will be some interesting code.
Title: Re: Zumwalts Blast A Mech Game
Post by: kryton9 on September 03, 2006, 10:59:56 PM
Why not use Sprites instead of layered 2d screens? Didn't know you could even layer 2d on top of a 3d screen.

Just downloaded the latest version, that is really neat to see that machine gun target like that. Great job Zumwalt, keep up the great work.
Title: Re: Zumwalts Blast A Mech Game
Post by: J B Wood (Zumwalt) on September 04, 2006, 08:40:20 AM
Thank Paul for the LookAt command, without it I would probably be months fiddling with it.
Title: Re: Zumwalts Blast A Mech Game
Post by: J B Wood (Zumwalt) on September 08, 2006, 07:20:17 PM
Paul can you please sticky this thread?
Kryton I have updated the game with your mechanical monster, needless to say the tank gets chased now, however I left the speed of the beast alone.
I made some slight changes to the code to adjust for the chase, including the continual lookat update.
Take a look at the new game.
Its really coming together.
Now to figure out how to speed up the chaser :)
Title: Re: Zumwalts Blast A Mech Game
Post by: Ionic Wind Support Team on October 01, 2006, 09:35:23 PM
How is the game going?  Let me know if there is anything specifics, besides physics ;)  that you need for the next update.  I have some time for coding this week and am looking for things to do.
Title: Re: Zumwalts Blast A Mech Game
Post by: Kale on October 02, 2006, 12:57:52 AM
Quote from: Paul Turley on October 01, 2006, 09:35:23 PM
How is the game going?ÂÃ,  Let me know if there is anything specifics, besides physics ;)ÂÃ,  that you need for the next update.ÂÃ,  I have some time for coding this week and am looking for things to do.

Sound Support. (mp3, ogg, wav, etc...) ;D
Billboards and Particles for the 3D engine too. :)
Title: Re: Zumwalts Blast A Mech Game
Post by: J B Wood (Zumwalt) on October 02, 2006, 11:14:15 AM
I have been concentrating on physics, mainly trying to intigrate PhysX into the system.
Which might not be possible, but like Kale mentioned, sound and particles would be a plus.
I'll write more tonight when I get home, I now have a dedicated programming machine at the house for nothing but Aurora.

I will definately need your help with Rakknet integration Paul.
Title: Re: Zumwalts Blast A Mech Game
Post by: Shannara on December 18, 2006, 02:33:03 PM
Sweet, how much did that PhysX card cost you? I've been looking to buy one locally, but have been unable to do so. I may need to buy one online.
Title: Re: Zumwalts Blast A Mech Game
Post by: J B Wood (Zumwalt) on December 18, 2006, 02:46:51 PM
Those cards cost from around $300 on.
I have been dealing mainly with the software side because the cards cost.
Title: Re: Zumwalts Blast A Mech Game
Post by: Shannara on December 18, 2006, 03:00:14 PM
Oo, the ones from Ageia Technologies?
Title: Re: Zumwalts Blast A Mech Game
Post by: J B Wood (Zumwalt) on December 18, 2006, 06:13:37 PM
Yup those are the ones. Aegia has a very cool physics engine, I got me a copy to use in freeware, fun to play with, haven't emplimented it in Aurora yet, been learning the API
Title: Re: Zumwalts Blast A Mech Game
Post by: J B Wood (Zumwalt) on January 31, 2007, 01:32:29 PM
I just fixed the main link to the download, however, do to a server crash and file purge that I had to find the latest stable release I had at hand, when I get home tonight, I will tear through 3 other machines to find the latest version since this one is missing the Kryton Mesh in it. However, the downloadable version has the code, images, everything that was used to build the alpha version.

Plus there are tons of odds and ends files in the project folder.
Including the core to Newton that I wrote.