Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Dark Noob Games HQ

Author
Message
Fluffy Rabbit
User Banned
Posted: 10th Sep 2012 04:17
@BN2-

We've all been there. I sure feel sorry for you. In the meantime, I'm sure others will pick up the slack.
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 10th Sep 2012 10:57
Fluffy,

Quote: "I would definitely recommend compressed WAV files over OGG files..."


I played around with a couple of EXEs that come with WavPack that make it easy to pack and unpack WAV files. It's quite impressive! I packed a 54meg WAV down to 7.8 megs then unpacked it. WavPack has a few different options: lossless, which is it's default, and lossy, where you can control the depth of the compression. I compressed it using 128 kbits if I remember correctly to get it down to 7.8 megs. The unpacked super compressed version sounded almost exactly the same as the original and a spectral analysis revealed very little to no significant difference.

So WavPack seems pretty awesome for compressing WAV files. WavPack will also take a whole series of WAV files and pack them into a single EXE. The EXE is self extracting - according to the documentation. I haven't tried that yet, but that test is next on my list. Overall, I'm finding WavPack simple to use and quite impressive actually.

@LBFN
I finally had a chance to mess around with the tractor a bit. I never actually finished building the model that I gave you to texture but upon porting and viewing it in DBC, the texturing looked much better than it did when I imported the OBJ into Blender so I'll probably just leave it alone.

@BN2
I've got visitors coming and staying here for the next month so it's a bit chaotic and stressful around here so I hear ya. I'll get stuff done as I have free moments.

Enjoy your day.
Fluffy Rabbit
User Banned
Posted: 10th Sep 2012 11:15
@Latch-

I guess the reason I'm not all that excited about WavPack is that it's not something I can integrate into Dark Survival 2, plus it only really applies to WAVs, so it can't be used to create more generic compressed resource packs.
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 10th Sep 2012 20:24
Quote: "...so it can't be used to create more generic compressed resource packs."

Usually, one would compress audio separately from data/images/objects. Audio can be compressed based on frequencies - you can eliminate or reduce certain frequencies, or even break down the audio into just it's component frequencies, and since audio files tend to take up the most bytes as a type of media (not including video), having a dedicated compression algorithm is usually the way to go. It's most often acceptable to have some loss in audio.

With data however, you never want to lose information so you would use a different compression algorithm. But if the audio files are really small, it would probably be fine to use a more generic compression method.

There was a compression dll for general DBC use: dbLZH.dll . You might be able to find it on the forums, or if you have DBC on CD, it should be on there.

Enjoy your day.
Fluffy Rabbit
User Banned
Posted: 11th Sep 2012 04:08 Edited at: 11th Sep 2012 04:18
@Latch-

I meant a more general consumer-grade compression algorithm. Zip or 7-zip or rar or gz would be great.

EDIT: But I see your point about audio compression. That's a tough one. If only there were a way to quickly decode OGG files into WAV files.
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 16th Sep 2012 04:03
With my visitors here it's been tough to sneak away for a few minutes to work on this stuff, but i did manage to start converting the tractor to DBC limbs. I added a couple of things to it and used LBFN's UV mapping as a base. It's just about done. A little bit of texturing on the new stuff (pedals and fenders and smoke stack) and I have to program a couple of functions to rotate the wheels, and turn the steering wheel, front fenders, and front wheels together.

Enjoy your day.
Fluffy Rabbit
User Banned
Posted: 17th Sep 2012 07:18
@Latch-

People working on complex 3D elements always gets me excited for some reason. I guess I've always wanted to be a level designer. I'm not very good at freehand 3D work, though. Can't wait!
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 20th Sep 2012 03:30
Quote: "...not very good at freehand 3D work."


It can be tough. I'm not very good at it either, but I'm getting better through practice!

@All
The tractor model is finished. I wrote a few functions to make the wheels roll and to turn the steering wheel and have the front wheels turn with it. I remember reading somewhere once before that using ROTATE LIMB is very slow to execute and so it is when I animate the tractor. It's about 4 times slower when I rotate the wheels using rotate limb. So, I'm trying to make animations in keyframes. I'm still a little stuck on how to make the wheels turn with the steering wheel and rotate along the ground simultaneously without skipping a rotation. I've got a partial system worked out.

Here's what I mean:
The tractor is rolling along straight and I want to turn left, for example. The wheels are rotating along the ground and at any point they are at a certain X rotation angle. I want to change their Y rotation but not interfere with the X rotation. With key frames, everything is set to specific positions in the animation, so arbitrary turning at any desired time is a bit tricky.

Coding it directly using ROTATE LIMB works great, but it absolutely kills the frame rate. I tried to use both ROTATE LIMB and key frames, but the keyframe animation always overrides the ROTATE LIMB command. I'll keep messing around with the key frames and animation, but if anyone has any ideas, I'd be interested in hearing them.

Enjoy your day.
Fluffy Rabbit
User Banned
Posted: 20th Sep 2012 04:11
@Latch-

Idea 1- Don't rotate the wheels vertically. Control the steering wheel separately and nobody will notice if the wheels don't turn.

Idea 2- Synchronise the wheels with the steering wheel in the animation like you were going to do, but use rotate texture commands on the wheels (similar to the realtime shadows stuff) or you could scroll the textures, or for that matter you could have like 5 texture frames and cycle through them.
BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 20th Sep 2012 05:42
Quote: "or you could scroll the textures"


I would say that that is probably the best approach. The turning of the wheels shouldn't be a major system that requires complex rotation methods. Just adjusting the UV coordinates of the texture should do the trick.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
Fluffy Rabbit
User Banned
Posted: 20th Sep 2012 11:51
@BN2-

In order for that to work, the UV coordinates would have to be set up for that to happen. The treads would have to be the main part of the texture, and the center of the wheel should be a solid color. There could be some bolts along the edges to add some dimensionality to it, but because of the geometry, the closer you get to the center of each wheel, the more is cut off of the texture.
Silverman
17
Years of Service
User Offline
Joined: 18th Jan 2007
Location: France
Posted: 20th Sep 2012 12:58
Hi all,

@latch
just an idea; Make the object into 2 parts, the tractor and the wheels.
Then 'glue object to limb wheels, tractor, limb : rotate object wheels,x,y,z'.
Maybe this way is faster than 'rotate limb'.

DirectX 9.0c (February 2010)/ DBClassic v1.20
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 23rd Sep 2012 01:07 Edited at: 28th Oct 2012 21:15
I have revised the bed of the trailer so that it is metal:



So many games to code.......so little time.

Attachments

Login to view attachments
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 26th Sep 2012 20:20 Edited at: 2nd Oct 2012 01:33
LBFN

Looks good. I've added foot rests and a similar texture to the tractor so there'll be an aesthetic coherence.

All

I still have guests here until Saturday. It won't be until Sunday that I'll be able to get anything done.

EDIT
Here's a screeny of the tractor

Enjoy your day.

Attachments

Login to view attachments
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 27th Sep 2012 17:47 Edited at: 28th Oct 2012 21:12
Latch, do you want to export the revised trailer so that I can texture the new additions and keep it all on one UV map?

So many games to code.......so little time.

Attachments

Login to view attachments
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 2nd Oct 2012 00:49 Edited at: 3rd Oct 2012 12:49
@LBFN
Quote: "Latch, do you want to export the revised trailer so that I can texture the new additions and keep it all on one UV map?"

I'll attach the latest version. Didn't do much on the trailer, just added a couple of cables in the front and the implication of a hitch. If you want to add tail lights or anything like that feel free. I don't plan on spending any more time on the trailer.

Also, I think I figured out why the X file of the tractor wouldn't load. It was the names of the materials. The names were long and had spaces in between them. If there are spaces or periods in the name, Direct X 7 can hiccup. Use an underscore in place of spaces and dots.

@Fluffy, BN2, and Silverman

Thank you guys for all of the suggestions on how to rotate the wheels of the tractor. I wish I had read them before I had moved forward on it. I settled on programing the rotations with animations. The frames are divided into 3 sets of 360 rotations. One for left, one for right, and one for straight orientation. That allows for seamless switching between the rolling and the steering angle based on the degree of roll.

However, it's not as pretty as using the ROTATE LIMB commands on the fly because the steering is either full left or full right or straight. I don't think I'm going to mess with it anymore though. If I were to redo it, I would have the wheels, the fenders and the steering wheel as separate objects and control their rotations independently. Wheels would be child limbs of the fenders. The wheels would roll and the fenders would steer. This way, I could include independent animated rotations of the wheels, and steer at any angle without much of an overhead increase.

Enjoy your day.

Attachments

Login to view attachments
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 3rd Oct 2012 23:29
Just an update - I'm double posting to bring this thread to the top:

I've got the tractor rolling along the way points just fine using F1 through F6 as the commands to control which building the tractor will circle. I've got the wheels rotating and steering smoothly and the steering wheel turning smoothly. I decided to go with having separate objects.

The front and rear wheels roll according to the speed the tractor moves over the terrain. In case anyone is interested in how this is done, it's like this:

Each frame of animation represents 1/360 of a rotation. The diameter of the wheel helps us find the circumference which is the distance one full rotation would cover. When we want to move a certain distance, that distance can be converted to a certain number of degrees. We use the degrees to get the frame whose animation matches the angle of rotation degrees.

The formula is thus
framedegrees#=wrapvalue((360.0 * (distance#/circumference#))+framedegrees#)

This would also work with ROTATE LIMB (which is how I originally had it) but the command ROTATE LIMB is about 4 to 5 times slower than referencing an animation frame.

I've got to clean up the tractor code a bit. When LBFN gets the trailor textured, I'll have to DBC-atize it and then add it to the tractor movement functions so that it follows the tractors path in a way that makes it look like it's attached via a hitch.

Enjoy your day.
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 4th Oct 2012 16:57
okay, I added the implied hitch and the cables, and put some taillights on it. .x file and revised UV map are attached.

So many games to code.......so little time.

Attachments

Login to view attachments
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 4th Oct 2012 20:17 Edited at: 5th Oct 2012 23:04
LBFN,

Thanks! I'll start limbatizing (why do you look at me funny when I say that?) the model later today.

EDIT

Update:

I ran into a couple of snags with moving and animating the vehicles. I want the vehicles to be able to tilt according to the terrain, so I need to set up some collision tests. Also, in order to pivot properly, I'm finding I have to set up any animated parts as separate objects because, as I mentioned earlier, the rotations/orientations in a playing animation override any limb angle adjustments that I would use in tilting the tractor or trailer.

I tried gluing the object to a pivot but that only seems to works properly when the pivot isn't hidden or when the pivot object is in full camera view - it's inconsistent so I can't rely on it.

I'll keep going the way I'm going by separating out individual animated pieces because at least I have a plan this way.

All this could be solved by rotating the limbs without running animations, but those darn rotate limb commands are just too FPS hungry.

Anyway, it was mentioned earlier to try and just alter the textures for rotating wheels and such. This might be something to keep in ones back pocket. As it stands, I don't know how you would create the rotation of wheels without swapping multiple textures. And there would be two sets per wheel I think. I'm not sure what the overhead would be in terms of number of textures and smooth wheel rotation. It's something to think about. I don't know if anyone has tried the texture method or not. Like I said, I'll just keep going down the path that I kinda know what to do.

By the way, the tractor and the trailer look really nice together!

Enjoy your day.
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 9th Oct 2012 11:46 Edited at: 9th Oct 2012 11:48
I haven't vanished, I've been working on things as time has permitted. I'm just about ready to post the tractor, trailer and mounted gun along with code. I've been finishing up some texturing on the mounted gun. I was aiming for a heavy gun that could also be anti-aircraft but not too heavy like a turret. I also was aiming for something that looked kinda cool but was basically simple - and perhaps something that might have been saved as a souvenir from WWII and found it's way onto a farm. I went with an old rusty DSHK.

I need to do a few more modifications on the tractor and trailer including the tilting code, and I have to divide the DSHK objects properly so it can be rotated/aimed.

As far as the farm inhabitants, I originally thought it would be comical to have the goblin model that appears so often, or would one prefer people? If people, we could probably use some of the Dark Matter I models unless someone has some people models available.

Here's some screenies of the gun:



Enjoy your day.

Attachments

Login to view attachments
AbdulAhad
14
Years of Service
User Offline
Joined: 1st Feb 2010
Location: Karachi, Pakistan
Posted: 10th Oct 2012 02:14
Awesome work on this so far guys!

Is this going to be like one of those 3D isometric strategy games or a first/third person shooter?

I don't know if there is a list of the models needed for this current project, I would love to make stuff for this project! Someone might have to UVMap them though, because I absolutely suck at that and texturing. -.-

Abdul Ahad

Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 10th Oct 2012 23:49
@AbdulAhad

Hello,

Quote: "Awesome work on this so far guys!"

Thank you! It's mostly a shell right now, but there are a lot of plans/ideas/code on the table that just need to be sewn together.

It's most likely going to be a first/3rd person shooter. That's still being finalized. I'd like it to be 3rd person just for a little variance.

Currently, I think we are OK with models. Unless you can come up with some low polygon people that have individual meshes for each limb and they look pretty good. A low polygon person would have to be less than 2000 polygons. Ideally, less than 1000. It's not easy to do and keep them looking halfway decent. That is where texturing and UV mapping can help. We are likely going to be using DarkMatter models or some of the models that come with DBC because they look ok and are already formatted for use with DBC. If you think you can do it and wouldn't mind if for some reason your model didn't get used this time, then give it a go. At any rate, the work always pays off - you'll always learn.

@BN2
What's the computer situation? Is there anything you need right away from me to move forward?

@LBFN
Have you worked out an AI system for the aliens? Are they going to enter the structures and try and take people away? I posted the new farm a while ago. All of the structures can be entered. Check the house and the barn limbs to find the doors. They are set to pivot at where would be hinges. Is there anything you need from me right away to move forward?

@All
Fluffy's sliding collision is the method that currently stands. It works well but I'm a little worried it has too many collision calls per iteration. Has anyone thought of a way to streamline it a bit?

I have an idea, and I might aim this at BN2 because of past indications of his math involvement:

X-Z sliding collision
1. Use sphere collision of a certain radius from a certain position. The Y position should clear the ground enough to allow for moving up ramps and stairs relative to the character or camera moving around.
2. If there is collision, check if the Y value of the collision position is above the designated clear height.
3. The trick is calculating the position the sphere should be after the collision. It basically should be the radius times the normal of the surface it collided with. The problem is, for some reason the coldet sphere collision doesn't seem to return the correct normals all of the time. There should be a way to calculate the same final position knowing the start position of the sphere, the direction it is moving, the collision point, and the radius.

It should be basic triangle math of some sort, so maybe someone could tackle that. There may need to be a second sphere collision test after the first. Perhaps one for the X direction, and then the second for the Z direction. The goal is to limit the number of collision tests.

Y Collision
1. Once the X Z collision has been calculated, cast a ray down from the center of the sphere a certain distance. The distance is based on a maximum height before what would be considered a fall.
2. If there is collision, get the point of collision and position the camera/object and and collision sphere a certain height above the point of collision.
3. May need a "padding" or acceleration value to make ascents/descents smooth so going up or down isn't choppy.

Enjoy your day.
AbdulAhad
14
Years of Service
User Offline
Joined: 1st Feb 2010
Location: Karachi, Pakistan
Posted: 11th Oct 2012 02:32
I'm pretty confident with low poly modelling. I'm always on the lookout for a balanced look to models. I use blender to model my stuff, by the way.

Could you tell me what is needed at the moment?

Abdul Ahad

BN2 Productions
20
Years of Service
User Offline
Joined: 22nd Jan 2004
Location:
Posted: 11th Oct 2012 02:48
Quote: "
@BN2
What's the computer situation? Is there anything you need right away from me to move forward?"


I'm running on all cylinders now. I have a plan for working out a sliding collision system and some code I wrote a while back that didn't work, though I never got around to debugging it. I've been swamped for the past couple weeks though. I'm hoping things will ease up in the next week or so though and I can get some work done on things.

Since I can't guarantee that I will have any serious coding time in the foreseeable future, I would advise against counting on me for an integral component. If you have an idea, go for it. If it works, I'll see it. If not I will work things out here and there and post updates.

Great Quote:
"Time...LINE??? Time isn't made out of lines...it is made out of circles. That is why clocks are round!" -Caboose
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 11th Oct 2012 07:41
Quote: "Have you worked out an AI system for the aliens?"

I have not worked on the AI at all, but will plan to get started soon. If you or anyone else wants a particular feature / behavior, please let me know.
The basic plan is this:
Create a series of waypoints for the ships to drop off the monsters and also a series of waypoints for the monsters to move. The monsters will pick a destination that is relatively close to their dropoff point and will follow waypoints to get there. Once there, it will go into 'grab a human' mode, and once one is grabbed, it will return to it's original dropoff point.

Quote: "Are they going to enter the structures and try and take people away?"

Yes, I can code it that way. So I guess they drag them by the nape of their neck, kicking and screaming then? or maybe just carry them under one arm? How many people do you expect we should have in total (or maybe at a time)?

Quote: " Is there anything you need from me right away to move forward?"

I don't think so. I think I have the latest farm you posted. I can figure out the limbs to open the doors and can use a placeholder for the people. At some point, some additional animations of the monster will be needed.

I expect to update when I am further along. I guess I will use the code I have been working with previously and add subroutines / functions for the AI handling.

So many games to code.......so little time.

Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 11th Oct 2012 11:18 Edited at: 12th Oct 2012 21:52
LBFN,

Just so you know, I'm using object and image numbers 17000 through probably 17100 for the farm, vehicles, and mounted gun. I've defined all object variables with obj before the variables name. For images, I'm using img<name> . So it's easy enough to know what the ground object is for example = objground. The house = objhouse and objhouselmap for the house lightmap object.

@All
I'm adding an additional sliding collision routine to the dll for use with coldet. The first tests have been successful. It should be ready in a day or so.

@LBFN
Perhaps a few of the aliens should try and hunt down the player. The sliding collision routine would make it easy for them to slide around buildings if you are just pointing them towards the player and moving forward - if they don't get lodged in a corner or are exactly perpendicular to a wall.

Enjoy your day.
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 12th Oct 2012 22:06
Quote: "I'm pretty confident with low poly modelling. I'm always on the lookout for a balanced look to models. I use blender to model my stuff, by the way.

Could you tell me what is needed at the moment?

Abdul Ahad"

What version of Blender? If you can use 2.45, I've written a series of Blender API routines to make sure the model can be exported for use in DBC. I think they work for 2.49 too, but I've never tested them in 2.5 or above.

For now, how about a low poly human? Male or female. In the farm world 1 3d unit equals 1 foot or about 30cm. So an average male height could be around 5.8 units (about 5ft 10 inches) and average female height around 5.5 units (5ft 6 inches).

Enjoy your day.
AbdulAhad
14
Years of Service
User Offline
Joined: 1st Feb 2010
Location: Karachi, Pakistan
Posted: 13th Oct 2012 03:19
I use Blender 2.49b for modelling. I'll try modelling it asap!

Abdul Ahad

LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 13th Oct 2012 08:28 Edited at: 13th Oct 2012 08:29
Latch,

It seems pointless to reinvent the wheel with regard to writing code for AI movement. You have already numbered the farm objects in your 'load_farm' code. So, what I am working on is taking your code and combining it with the code from Fluffy, Obese and myself. It has been a struggle at times, as setting the directory the way you do is something I am not used to using. I have the new farm appearing and I can move around in it. The ships appear as they are supposed to (though the waypoints for their landing positions needs to be updated) and the aliens appear and move toward a center spot in the farm. It does not have collision yet, so once I get the updated dll I can work on getting that going. Once collision is in place I may post it all up so we have something we can move forward with together.

Quote: "Perhaps a few of the aliens should try and hunt down the player."

I could have the aliens check their distance from the player and put it into attack mode when close, where it simply pursues the player and lunges/attacks when in close proximity. Not sure about if the player is on the trailer. Perhaps the alien could knock him off the trailer. If the alien gets too far from the player, it could pick a new destination and look for a new waypoint.

AbdulAhad,
I've seen some of your stuff - you do good work.

So many games to code.......so little time.

AbdulAhad
14
Years of Service
User Offline
Joined: 1st Feb 2010
Location: Karachi, Pakistan
Posted: 13th Oct 2012 17:46
Thanks LBFN! But have we met before?

Abdul Ahad

LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 16th Oct 2012 00:00
I am progressing pretty well on putting the code together.

I only see two things that have doors: the house and the barn. The house only has one limb and the barn has two, with one being on the lower right side of the right door. I am working on putting limbs at both doors on the barn, so we can have them swing open when the aliens/monsters are attacking. To do that, I have to retexture it, as it comes out goofy otherwise. Shouldn't be a problem to do. As to the house, I can add a limb where the front door is.

I have created 42 waypoints so far in the code and as soon as I get done with the limbs on the house and barn doors, I plan to create some additional waypoints inside the buildings.

I don't see a gate in the fence. We could put one in (with an associated limb), so that the aliens could get in there and play havoc with either animals or people. I found a cow on TurboSquid that might work for this game if you are interested.

Abdul Ahad:
I must have seen some stuff that you posted in either 3D Chat or FPSC models and media, not sure, but I remember your name specifically.

So many games to code.......so little time.

Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 16th Oct 2012 01:03 Edited at: 16th Oct 2012 01:08
@LBFN

The limbs on the barn are correct. Rotating the limb on the y axis makes it swing correctly:

rotate limb objbarn,2,0,270,0
rotate limb objbarn,3,0,90,0

You shouldn't have to remake or retexture the doors because they are paired to a lightmapped object that has to have the exact same geometry; not just the same shape, but the exact geometry. At any rate, they should be able to be rotated properly.

The lightmap object for the barn doors should also swing.

The house dose not have a door with a lightmap. The door on the house itself is also setup as a properly swinging limb.

The pivot point is so that the doors swing on a hinge or they can fall over - be knocked down. It was intentional to have the pivots (joints) in the lower corners.

Enjoy your day.
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 16th Oct 2012 01:19
Okay, that does indeed work. What I see in my modeling program and what DBC sees are two different things. Anyway, there is no need to add limbs or retexture anything then.

So many games to code.......so little time.

Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 16th Oct 2012 02:30
So if you swing the doors on the barn, you'll also have to swing the doors on the lightmapped barn object.

If the doors open and close by collision, you will probably need to create a collision object specifically for them because once the limb is rotated, the collision trianlges won't change on the barn object, for example, so it would still be collidable even when the door was open.

That means:
1. Finding the dimensions of the barn limb(s)
2. Making a box that is the same size
3. Set the box to the same pivot as the door.
4. Orient the collision box to the door, but keep it's position at 0,0,0 (the pivot is at (0,0,0))
5. Create a collision object of the box in coldet
6. position the box object at the door
7. Use coldetUpdateObject() to set the position of the collision object at the door to match the position of the DBC box object
8. Once you are satisfied with the position, delete the DBC box object used to create the collision object. You no longer need it.
9. When you want to detect collision with the door, call that collision object specifically. You can then update the rotation of the collision object to match the rotation of the limb.

Enjoy your day.
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 16th Oct 2012 06:23
Perhaps it would be easier to create the doors as separate objects in the first place and just position them correctly on the barn. You then would be able to simply rotate them and update coldet.

So many games to code.......so little time.

Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 16th Oct 2012 14:59 Edited at: 18th Oct 2012 03:04
Quote: "Perhaps it would be easier to create the doors as separate objects in the first place and just position them correctly on the barn. You then would be able to simply rotate them and update coldet.
"


It probably would. But either way, you have to do two sets of rotations:
1. Rotate the door(s)
2. Rotate (update) the collision object(s). So at this stage, instead of messing with the model, it might be easier just to create the collision object(s).

Since it would probably be helpful for the future, I'll go ahead and do a little redesigning of the barn and house and their light maps so that we can have separate objects for the barn and house doors. It shouldn't be any major change and I don't think retexturing would be a factor. I cautioned against you doing it because of the lightmapping - but I have everything in the raw forms so I can change both (model and lightmap model including lightmap texture) without impact.

If this doesn't seem like it'll be quick, then I'll post collision models and their setup code since i have the exact specs of the doors.

EDIT

I've done another update to the sliding collision so I've removed the updates from this post.

Enjoy your day.
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 17th Oct 2012 18:35
I am / was trying to learn Coldet. I installed the updated version and the inc_dbccoldet file. I have tried running several of the current example programs. The result is always the same, "cannot load dll". It is in the correct folder. Many times when I run the farm game, I get this same error, but eventually it will load and run.

I would be glad to try any example code that you post, but if it will not load the dll, I don't see how I can use it. I am using Windows 7.

So many games to code.......so little time.

Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 18th Oct 2012 03:33
@LBFN
I'm sorry that it isn't working. I'm going to attach a complete test of a running goblin on the farm using the updated sliding collision I've put into the coldet helper dll.

The zip I'm attaching has all of the farm and collision objects as well as the new coldet. The directory structure is also included with everything in the proper places.

Unzip the archive to somewhere where it won't combine or touch the old farm information (just to be on the safe side).

There is a DBA file in the main farm directory labeled load_ground. You should be able to run it out of the box. This file contains detailed examples of how to set up the farm with sliding collision as well as setting up the individual objects for polygon collision. I've also included a door opening function that'll swing doors open when bumped into. It's just an idea, but it works pretty well.

If you are still getting the can't find dll error and everything has been extracted to the proper folders from the archive, then we'll have to decide on a next step.

Move the goblin around with the arrows and steer with the mouse.

Enjoy your day.

Attachments

Login to view attachments
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 18th Oct 2012 08:39
Tried the new 'load_ground' file and it worked great. The collision is outstanding. I was pleasantly surprised to see the barn doors and the door on the house open when I pushed against them. Nice work.

So many games to code.......so little time.

Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 18th Oct 2012 09:44
Whew! Good. And thanks! That means we can move forward. If you have any questions on how to set up objects for collision or using the library, don't hesitate to ask.

I know it's hard sometimes to get the idea from studying the code, but if you go over the load_ground.dba source, it should help a lot with understanding how the collision is setup and implemented using the collision library.

I've been sidetracked while working on that sliding collision so I had paused on the vehicles. I'll get back to that now.

Enjoy your day.
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 19th Oct 2012 02:39 Edited at: 19th Oct 2012 02:52
LBFN

You mentioned additional animations for the monsters. I have an idea, but don't know if it'll work. I've loaded the alien mutant into blender and adjusted the limbs so it is in a standard T-pose.

If you can load this alien into your modeling program (milkshape I think, right?), rig it so you can animate it there, animate it, then export the file as BVH, I may be able to take the BVH file and apply it to the DBC limbed version of the alien.

I'll attach the T-pose alien here. As long as the rotations that are applied to specific bones/joints correspond to the same limbs in the T-pose alien I'm going to attach, I should be able to very simply apply the BVH animation.

The first frame has to be the default T-pose of the alien with 0 rotations. If it's not, we could run into other difficulties. Make sure that pose is set as a key frame.

@AbdulAhad
Hows the person coming?

Enjoy your day.

Attachments

Login to view attachments
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 19th Oct 2012 03:11 Edited at: 19th Oct 2012 20:16
Latch,

Nice idea! However, Milkshape can only import BVH files and cannot export them. Is there another format that could be used?

EDIT:
I thought at one time you could load .md2 files into DBC. I tried it, but it would not work.

So many games to code.......so little time.

Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 20th Oct 2012 01:03
@LBFN

The BVH file would've been perfect because it's just animation data and I've got a pretty decent method for converting it to a DBC animation without much trouble.

Here's another idea:

Rig and animate the T-pose alien.
Export it to direct x in text format but make sure the animation keys are 0,1 and 2 but not 4. That may be direct X 9 in milkshape.

That means in the animation section at the bottom of your exported X file, you'll see something like:



But with more detail and there should NOT be a key like:



Once you've created the new text X file, copy the entire AnimationSet and paste it at the bottom of the original DBC-limbed T-pose. Replace any animation information that might already be there.

Now, the limbs have to be in the exact order on your export as the T-pose. Check the order on the T-pose by using PERFORM CHECKLIST FOR OBJECT LIMBS. This won't work the same on your export because usually there are two sets of limbs in a directX object that has a skeleton. It should be the first set, because likely they will repeat. You'll know by the count from the T-pose.

If the limbs are not in the same order, try to get them in the correct order before exporting. The animations have to match up to the correct limbs in the T-pose.

If you can't adjust the order before exporting, then you can manually swap the animation groups in the file. But that is a lot of work.

Hopefully, if you rig the model from the beginning so that the joint/limb order is the same as the original T-pose alien, you'll only have to copy and paste the animations and you're done. If not, I've got a couple other ideas.

Enjoy your day.
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 22nd Oct 2012 08:42
Latch,

I rigged the alien according to the same way that the limbs (meshes) are listed and created a short animation. I exported it as DirectX 8.0 (which seems to work best and looks like what you showed), grabbed the anim data out of the file and replaced the anim data in the original file that you sent. It shows up in the T pose, but no animation. If I try to get it to play, it bunches up in a ball like all of the limbs are at 0,0,0.

I renamed all of the joints to the same names as the limbs in the original, and they show up, but MS3D adds root scene animation data at the beginning of the animation. I removed it and tried it again, but no joy.

The original alien animations are beginning to look pretty good at this point.

So many games to code.......so little time.

Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 22nd Oct 2012 11:17
Quote: "If I try to get it to play, it bunches up in a ball like all of the limbs are at 0,0,0."

That makes sense believe it or not. There are 2 matrices assigned to each bone in direct x skeletal animation. The first one is the matrix that positions and rotates the bone within the mesh. The second one is an inverse matrix that translates the bone into bone space so it can be rotated around the origin before being "put back" during animation. When you are playing the animation in DBC, there is no "putting back" going on so the rotated meshes aren't going back to where they belong after being transformed. They are all rotating around the origin from your description.

Oh well, it was worth a shot. I think I could put together a simple DBC animator, unless you feel like learning Blender. I've been kicking around making direct x skeletal animation available as well to DBC but parsing X files isn't a lot of fun because there are so many variations.

Since this is all in fun, the project that is, and a working simple animator for DBC might be useful for this and other things, I'll poke around a little and see how much time it would take. I would only want to include the absolutely necessary things without adding any extra bells and whistles.

What do you think should be the bare minimum of functions? How would you like the interface to be controlled?

Here's a few things I'm thinking:
* Select limb by node - a node being some object that can be clicked on that is positioned at the limb joint
* Multiple camera views
* Select axis of rotation
* store key frame
* playback animation
* save animation
* load animation

Enjoy your day.
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 22nd Oct 2012 19:02
Quote: " I think I could put together a simple DBC animator, unless you feel like learning Blender."

I really should learn Blender. I have always figured it would take more time to learn than I have time available. However, I think a working DBC animator is something that is sorely needed to realistically develop games using DBC.

I would suggest using COLOR LIMB instead of a separate node for limb selection. I would also print out the current limb number on-screen. COLOR LIMB works very well.

Also, you would need to be able to declare parent/child limbs.

When I wrote something like this in DBP a while back, I used the L key to advance to the next limb, the X, Y, and Z keys to pick the axis and the arrow keys to rotate the limb on that axis. I used the WASD keys to move and rotate the camera. It seemed to work pretty well for me. In addition, you could use two keys (maybe the O and L keys) to move the camera up and down.

I definitely would use something like this, as one of the biggest difficulties I have found with DBC is creating animation easily.

So many games to code.......so little time.

Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 22nd Oct 2012 23:18
I think lightning limbs tried to be that DBC animator but never got finished and had a few challenges with the interface.

Alright, that's a good idea about the W,A,S,D . I'll incorporate the COLOR LIMB.

Declaring the parent and child limbs... hmmm... That can only be done if the limbs are built in DBC. Once a model is loaded with limbs, you can only add additional limbs (I think) but can't change the existing hierarchy. I actually have a way around this (but was kinda hoping to avoid it!) but I agree it would be a necessary addition.

Quote: "I would also print out the current limb number on-screen."


Do you have any list-box code laying around? I have some, but it's kinda slow and it's not 100%. It works, more or less. It would be nice to have a scrollable table with the limbs listed which would also allow selection.

Well, I have a couple of hours today so I'll see if I can come up with a basic animator, or at least the start of one. It probably won't be all that pretty and polished.

Enjoy your day.
LBFN
17
Years of Service
User Offline
Joined: 7th Apr 2007
Location: USA
Posted: 24th Oct 2012 20:23 Edited at: 25th Oct 2012 18:28
Just to let you know what I am working on, I am incorporating the most current _load_farm code you provided with the rest of the code and trying to get everything working.

[b]EDIT: Got everything up and running. The ships descend and drop off the aliens okay. Working on the AI / waypoints.

The addition of lights on some of the farm buildings is a really nice touch.

So many games to code.......so little time.

AbdulAhad
14
Years of Service
User Offline
Joined: 1st Feb 2010
Location: Karachi, Pakistan
Posted: 28th Oct 2012 01:58
Oh hey, I haven't been able to work on it primarily because of the university applying process and school.

I did manage to get a simple robot made. Posted it on the 3D 2012 thread a couple days ago. Trying to find time to make this. It's proving to be difficult.

Abdul Ahad

Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 28th Oct 2012 06:00
Quote: "The addition of lights on some of the farm buildings is a really nice touch.
"

Thanks.

The load ground code also sets the lights so that they do not respond to fog so they'll continue to "glow" at a distance through the fog. Oh, and a good fog distance is 125. That's about the diameter of the farm.

I started a new job this week, so I've been a little pinched for time. I do have a basic interface built for the animator, however.

Enjoy your day.

Login to post a reply

Server time is: 2024-11-21 20:32:17
Your offset time is: 2024-11-21 20:32:17