Carmageddon 1 XNA / OpenC1
jeff_1amstudios on Sun Jul 12, 2009 7:52 pm
Post
Thanks for the info on the curb - it turns out (for CityB at least), the mesh is complete, but it was referencing DRKCURB.MAT - which wasn't listed in the track.txt resources section.

Edit: And drkcurb.mat is a simpmat which I hadn't implement yet!

@harm - yep Im looking forward to implementing grooves - so grooves are what makes the fan spin at the front of AgentOranges car, and the chainsaw at the front of Ivan?

@errol Once you've loaded all the resources, you can jam them into a Model and call Draw() on it but sounds like youve got a pretty good alternative there :)

mmm crush data!!
OpenC1 - Open-source Carmageddon engine! http://www.1amstudios.com/projects/openc1
User avatar
Toshiba-3 on Sun Jul 12, 2009 9:28 pm
Post
@ Errol: Actually I think nobody has any idea about the crush data. Econo once asked Stainless and they replied with 3 chunks of crush data making the car static. Not really what we are looking for but it's better than the spaghetti polygons we get when we use another car's crush datas ofcourse.
I never had a look at how the crush data works. I suppose there are transformation matrixes for front, rear, right, left, bottom, top impacts and concerned vertices move accordingly. I hope you guys won't have too much difficulty breaking this stuff, Econo and me could update all our C1 cars with real crush datas!
I'm looking forward for the updated C2 format specs :zomig:

@ Jeff: Grooves are used for most rotating and animated parts in C1. Other cars like the King Merc (FAUST.TXT) use FUNKS only though. I noticed C1 doesn't like cars with both grooves and funks. Cockpit views can have grooves too even if they are separate models (though they can be the same model as the 3rd view). Groove&funk-wise I think C1 is very similar to C2. The latter has just a few more features. In C2, a lot of keywords (related to grooves and funks) are declared within the executable but a third of them are unimplemented. I guess it is the same with C1.

Ah yes. I forgot to say it the other time: both games are able to render polygons (as opposite to only triangles). Dunno how to say it clearly so I'll just link to this picture of C2:
[img]http://www.toshiba-3.com/dotclear/public/C2/stelltiolol.png[/img]
The black lines here aren't textures or simpmats applied on a thin champher. There's a black model similar to the yellow one but it is rendered as a wireframe and thus it shows how it supports polygons composed of 2 triangles or way more. (the circles on the rims are wireframed polygons too)
Geez, I hope you see my point.
Image / carmageddon add-ons at road reaction
User avatar
Errol on Mon Jul 13, 2009 12:52 am
Post
Just for fun...

[img]http://www.everhard-entertainment.co.uk/images/carma/flyingthunderbucket.jpg[/img]

Flying Thunderbucket! With chase cam!

And about a gazillion rendering errors. Woo!

-Errol
jeff_1amstudios on Mon Jul 13, 2009 1:19 am
Post
awesome, looking great. You win the prize for the first screenshot of a car actually on the track :)

At this rate we'll have custom engines for C1 and C2 at the same time :)

What kind of fps are you getting?

Its nice having the same format for car models and tracks - once youve got one, the other just follows.
OpenC1 - Open-source Carmageddon engine! http://www.1amstudios.com/projects/openc1
User avatar
Errol on Mon Jul 13, 2009 1:40 am
Post
That prize is still up for grabs... my car is flying ;)
Although it shouldn't be for long, just adding in some trace code for each wheel and then introducing gravity should have him driving along the surface in no time.

FPS wise I'm getting around 48-50 but I haven't put any occlusion testing in yet so it's rendering the entire map all the time. Also I'm just doing a single pass render, I'll need double pass to fix the alpha/depth buffer issues.

I think you'll beat me by a long shot with regards to a finished engine, C2 peds are gonna be a pain in the arse and no mistake. IK, ragdoll physics, bone animation. Bah!

I'm sad to admit I'm most impressed by getting the wheels to spin in relation to the speed, things like that amuse me.
jeff_1amstudios on Mon Jul 13, 2009 3:05 am
Post
Hehe youtube video required :)
OpenC1 - Open-source Carmageddon engine! http://www.1amstudios.com/projects/openc1
Killer11 on Tue Jul 14, 2009 1:20 pm
Post
Sweet Jesus!!!!
It's happening again, a dude appears out of nowhere and starts coding an open-source clone of a game. Last time i saw this it was Transport Tycoon Deluxe being treated this way. Now it has perhaps hundreds of thousands of players and gameplay wise no commercial title can match it. I surely hope this ends up in the same epic way that OpenTTD ended up to be.
Good luck team awesome!
User avatar
Errol on Wed Jul 15, 2009 1:19 am
Post
[img]http://www.everhard-entertainment.co.uk/images/carma/airport.jpg[/img]

I recoded my parsers to correctly allow for the multiple mesh references within the map files.
Previously I was only drawing the first instance of a mesh. Also, the transform matrix should now be applied correctly so everything is positioned, rotated and scaled properly.

Still bugs with surfaces not being drawn through alpha channels and two-sided surfaces not showing from one side. The first of these I know how to fix, the second will likely prove troublesome. [s]I've also noticed some alpha channeled tiffs are parsing incorrectly, I'll have to sort that out sooner or later.[/s] (Fixed!)

Now the map is loading properly I should be able to begin introducing collision detection and physics. The fun stuff :) It's a bit sad how much I enjoy 3d maths, even though I suck balls at maths.

-Errol

Update:

[url=http://www.everhard-entertainment.co.uk/videos/carma/carmaModelViewer_2009-07-15_08-01-44-39.zip]Collision testing #1 - Video (8.48meg zipped xvid)[/url]

Quick video of slowly driving around a small portion of the map. The car doesn't handle like a car and it doesn't do slopes well (if at all).

Request:

Could someone knock together a basic map for me? I just need a large, perfectly flat map centred around 0,0,0 (as in the floor is less than 0 on the y axis) Preferably the floor will be more than just 2 polys, maybe tesselate it up a bit. It'll need textures but they don't have to be fancy, you can add walls around the outside if you want but the overall map should just be flat.

I'd make one myself but it's been over 10 years since I last made a C2 map and I've completely forgotten how to use Plaything 2.

I need something incredibly simple for getting the car handling right, I'll probably ask for ramps and stuff to be added in the future but I don't need anything like that right now.

Thanks in advance

-Errol
User avatar
Harmalarm on Wed Jul 15, 2009 8:53 am
Post
[img]http://harm.toshiba-3.com/images/testmap.jpg[/img]

[url=http://harm.toshiba-3.com/files/testmap.zip]http://harm.toshiba-3.com/files/testmap.zip[/url]

If you need changes like more ramps, more different materials etc etc... just shout
User avatar
Razor on Wed Jul 15, 2009 2:41 pm
Post
That was quick, Harm.
I've seen the video, Errol. You're making some good progress there, good luck with adding peds when you get around to it, that's gonna be tough. I'd like to know how Jeff is coming along.
[ Razor @ Carmajunkies ] [ My Downloads ] [ My Carma Items ] [ Conversion lists ]
For information about the progress of my TDR2000 to Carma2 mod visit my site @ http://r.carmajunkies.com
User avatar
Errol on Wed Jul 15, 2009 4:24 pm
Post
Thanks very much Harm, that's awesome.
Car physics, here I come!

Update:

Silly question but has anyone worked out a c2 to real life unit conversion? Say I wanted a map equivalent to a mile long, could that be done?

It's quite hard to judge anything without a single base measure.

-Errol
User avatar
timmy76 on Thu Jul 16, 2009 12:31 am
Post
wow your doing a amazing job :tup: keep it up cant wait to ay the new revamped c2
Online Banger Racing mod for Nascar Heat
http://www.onlinebangers.co.uk/
User avatar
Errol on Thu Jul 16, 2009 1:53 am
Post
Another question, has anyone put together an overview of the settings in the "MECHANICS STUFF" section of the car .txt files? Back when I made cars I just slapped some numbers about in there and hoped for the best, other people seemed to know what "Traction fractional multiplier" and "Downforce-to-weight balance speed" actually did.

Methinks I might need to get my copy of C2 working ;)

-Errol
jeff_1amstudios on Thu Jul 16, 2009 4:32 am
Post
Good stuff :)

As for me, I've been working pretty hard too. No screenshots as Im at work but will post some tomorrow.

I've worked out how the tracks are put together properly, so Im now only checking and drawing visible parts of the track. So rendering speed is great, even on my laptop. :)

Errol, I dont know if youve already figured this or if C2 is the same, but the track .act file is organized into a space partitioning tree, each node in the tree has its own bounding box. So doing camera frustum checks doesnt require many calculations as you can cull large portions (near the root of the tree) quickly without checking every single actor/model.

Now thats done, I am integrating the JigLib physics engine. I've got a car that drives (and skids!) along a flat plane, next step is to feed it the track geometry. I feel a video coming on :)

Also got horizons and proper fog going (reading from the race.txt file).

Fun times!
OpenC1 - Open-source Carmageddon engine! http://www.1amstudios.com/projects/openc1
User avatar
Errol on Thu Jul 16, 2009 5:26 am
Post
Jeff, I noticed that in the .act file too but because I convert the .dat into a mesh object I lose the ability to navigate the structure properly. For example... say I load a act/dat that has a structure like:

A
|-B1
| |-C1
| |-C2
|
|-B2
|-C3
|-C4

and then do (foreach mesh in model.meshes) I get A, B1, C1, C2, B2... and so on.
So even if I check the boundingsphere/box of B1 against the camera frustrum and skip rendering it the loop will still give me C1 and C2 to check. Pretty crap really.

I'm using bounding spheres over boxes to improve speed for the high level checks so that doesn't matter at the moment, I get a steady 60fps anyway. I think I'll need to extend my custom processor to build a more custom model class in the long term though.

I decided to go the more retarded route and code my own physics engine, I've got the driving in a straight line bit done ;)

I've never done fog in XNA, is it pretty easy? And does it improve FPS? I'd assume you can reduce the draw distance.

-Errol
User avatar
Harmalarm on Thu Jul 16, 2009 7:31 am
Post
@ Errol;

The Game seems to be using a dimension system that is 6 times larger than real life, or in other terms. 1 Carmageddon unit is 6 meters. 1 meter is 0.17 carmageddon units. (if you are using miles, just convert it :p ) There are no real life scale maps, most of it is done referencing a car model to get the scale right. At least, that is how I do it.

I was already thinking you would need some kind of distance meter in order to be able to compare the physics effects in a way. Like, braking distance, cornering angle, things like that. I'll see if I can update the track quickly for this.

There are a number of things in the mechanics stuff. by experimenting with them, I got a vague Idea what most of them mean. I don't know if it will help you in any way, perhaps some of us know a better explanation. Perhaps you are not even using them anymore, because you are now coding your own physics engine... anyway;

[b]Angular momentum proportions[/b]; when you increase these values, the car 'acts' as a big car. So, cornering get's harder, rocking left and right takes longer. The car is, in an invisible way, made bigger. The weight stays the same though!

[b]Downforce-to-weight balance speed[/b] With easy-to-tip-over-cars like a big monster truck for example, decreasing this value makes it more stable. I have no clue how to express it in technical terms, this is what it does simply.

Then there is some info in the Car-ed tutorial;

softness_factor - This value determines how tough your car is overall. A value of
0.5 is relatively soft, and a value of 0 is a solid granite car. Trucks have
a value of about 0.2.

Minimum turning circle - (In the mechanics section) This determines how sharp of a
turn you can make at low speed. 0.5 is average and 0.3 is super tight.

Acceleration - (In the mechanics section)
This value determines how fast your car will be. The average is about 5.0,
setting it up to 7.0 or 8.0 is about the limit of being able to handle it.
I actually set it up to around 200 once to see if I could break the sound
barrier on the runway but a 747 landed on me and that was that.

Center of mass - (In the mechanics section)
The closer this value is to the center of your 4 wheels the better.
If it is too high you will flip over in a turn and if it is to far back
or forward, you will easily lose control in a turn.

Mass - (In the mechanics section)
The more mass you have the more damage you can inflict.
1.5 - 2 is average, but 60-80 tons will let you smash through just
about anything.

Suspension give - (In the mechanics section)
Each of your wheels has this attribute. The average is about 0.01.
Stepping it up to 0.015 will give you a super plush ride, just make sure
you car is far enough off the ground to allow it.

Friction angles - (In the mechanics section)
Each of your wheels has this attribute. This value determines how much
traction your wheels have. The closer the number
is to 90 the more traction you will get. 83 is average, but 89 is about as much
as you can handle before you get a headache.

I suggest you indeed install a copy of the game again. Experiment with these values, see what they seem to be doing.

@Jeff; :sglasses: video's video's video's.... Sound like some good progress there man!
jeff_1amstudios on Fri Jul 17, 2009 9:41 pm
Post
[url]http://www.youtube.com/watch?v=N4KQ_q5vhwI[/url]
OpenC1 - Open-source Carmageddon engine! http://www.1amstudios.com/projects/openc1
User avatar
Errol on Fri Jul 17, 2009 10:09 pm
Post
Fancy!
User avatar
Razor on Fri Jul 17, 2009 10:45 pm
Post
Looking good so far mate, looks very promising.
[ Razor @ Carmajunkies ] [ My Downloads ] [ My Carma Items ] [ Conversion lists ]
For information about the progress of my TDR2000 to Carma2 mod visit my site @ http://r.carmajunkies.com
jeff_1amstudios on Sat Jul 18, 2009 12:16 am
Post
thanks :)

Physics test 101 - [url]http://www.youtube.com/watch?v=fBUbWGTx0C0[/url]

Ive got JigLibX hooked up and working inside my Carma engine. The hard bit now is to tweak it to behave nicely. Right now, its generally ok, but theres a lot of weird issues still! :)
OpenC1 - Open-source Carmageddon engine! http://www.1amstudios.com/projects/openc1
User avatar
Errol on Sat Jul 18, 2009 1:19 am
Post
Excellent! Flying along and no mistake.
It'll probably be awhile before I have anything new to show, I'm implementing my own rigidbody system and it's proving to be quite complicated.

I've got impulses at 0 gravity down. Apply an upwards impulse to the front of the car and it'll spin around the X axis. Impulse from the right and it'll spin around Z, that sort of thing.

I also have 4 traces from each wheel down and I'm able to define contact points, just need to define the resting force to cancel out gravity where appropriate and I should be able to drive around the map again.

Jeff, I'm not too sure if it's the same for C1 and if it is you've probably already worked this out but the "Angular momentum forces" in the car.txt are the values for setting up the cars moment of inertia.

For example:

0.320830, 0.238055, 0.774927 // Angular momentum proportions

Would plug into a Matrix and result in:

0.320830, 0, 0, 0
0, 0.238055, 0, 0
0, 0, 0.774927, 0
0, 0, 0, 1

Should give more accurate rolls and twists for each car.

-Errol
User avatar
Harmalarm on Sat Jul 18, 2009 11:03 am
Post
ah yes, the moment of inertia makes more technical sense. Why didn't they simply use those terms in the first place. :)

this starts to remind me of the linear algebra I had to do in my 2nd year. Damn, hard stuff. Though I was already then seeing the relation between the transformation matrix and the deformation of the cars in c2, especially since the book said all this could be used for crash simulation and games. Forgot most of stuff in these classes though, as ususal :nyaha:

Some of the terms in the game also show stainless did some real material behavior research. The track name 'sheik, rattle and roll' refers to actual material behavior calculations for 'shake, rattle and roll'. There are more of these references throughout the game. The guys must have really gone for a thorough realistic approach of real life physics.

Good work on the physics guys. What happens when you get a force from the side, but above the Center of gravity?
And you have the center of gravity, but when speed comes in play, for instance in cornering, you will get a different Center of gravity right, causing the car to lean over? And combining this with the suspension give... :s :uho: How are you planning on taking all that on?

Nice video's there Jeff, I see the effect of the fog very well. And I still see more in the horizon than in the original game right? It's nice that these new engines can render all the data a lot better, it really expands the game beyond its boundary's. I guess polygon count wise it can handle a lot more too right?

Are there also ways of implementing new stuff when all the original stuff is done? For instance graphic enhancements like environment mapping, or model rendering improvements like vertex coloring etc? This is of course tricky since the .dat files should contain this information, which will probably be impossible. But graphics there is more room for improvements right?

Do you guys still need a map with some real life scale elements btw? I'll wait with doing that until you guys confirm this.
User avatar
Errol on Sat Jul 18, 2009 7:16 pm
Post
"And you have the center of gravity, but when speed comes in play, for instance in cornering, you will get a different Center of gravity right, causing the car to lean over? And combining this with the suspension give... "

I think the physics library that Jeff is using can cope with all of that. Basically they all boil down to forces and impulses, you total them all up over the course of the update and apply the combined force at the end.

I implemented gravity and ground resistance last night, gravity is forcing down at mass * 9.8m/s and when the wheels are touching the floor they are forcing up at mass/4 * 9.8m/s (for a 4 wheel car) and thus the overall force is 0. Obviously mine isn't taking into account suspension yet as the car should sink down on its suspension, then bounce up a little and then settle.

Obviously, using an existing physics library is the best choice, almost no game studio codes their own these days with the likes of Torque and PhysX being so good and you get perfect results almost out of the box. I'm just a sucker for biting off more than I can chew and I love physics programming. I think with a project like Carmageddon 2 (what with it having near perfect real world physics) I should eventually end up with a library of my very own that I can use in other projects.

Shame I don't even have a college education, let alone a university one. This could take awhile ;)

-Errol
User avatar
timmy76 on Tue Jul 28, 2009 3:31 pm
Post
Hope you don't mind me asking, but is this new Carmageddon gonna be an online game? :smile:
Online Banger Racing mod for Nascar Heat
http://www.onlinebangers.co.uk/
Killer11 on Tue Jul 28, 2009 10:21 pm
Post
The answear is clearly no. But i guess it will support multiplayer. I really see no reason of throwing out singleplayer aspect of a game like carmageddon.
User avatar
Errol on Thu Jul 30, 2009 6:24 pm
Post
Not too sure what Killer 11 is on about because adding in multiplay doesn't mean you have to remove single player.

I can't see any reason why you can't have both.

-Errol
jeff_1amstudios on Sun Aug 02, 2009 4:33 pm
Post
Ok, im 90% of the way to figuring out the crush data! :) I spent literally all day on it yesterday, and have got to the point where i just need to figure out what a few more numbers do before I can implement it in my engine :)

Videos and format specs coming soon hopefully!
OpenC1 - Open-source Carmageddon engine! http://www.1amstudios.com/projects/openc1
User avatar
Harmalarm on Sun Aug 02, 2009 6:43 pm
Post
:decu: that is some good news Jeff! Does this mean that our custom C1 cars could now deform on the new C1 engine?
You are still making some nice progress in the background there, love it. Keep it up.
and hmmm, video's, gimme video's :heh:
Killer11 on Mon Aug 03, 2009 1:19 pm
Post
[quote=Errol]Not too sure what Killer 11 is on about because adding in multiplay doesn't mean you have to remove single player.

I can't see any reason why you can't have both.

-Errol[/quote]
He said make the game an online game. Aka an MMO and that means it's played solely online. Meaning no singleplayer.
User avatar
Razor on Mon Aug 03, 2009 7:58 pm
Post
No one said "make it only an online game"..
[ Razor @ Carmajunkies ] [ My Downloads ] [ My Carma Items ] [ Conversion lists ]
For information about the progress of my TDR2000 to Carma2 mod visit my site @ http://r.carmajunkies.com
Killer11 on Mon Aug 03, 2009 9:41 pm
Post
[quote=Razor]No one said "make it only an online game"..[/quote]
[quote=timmy76]Hope you don't mind me asking, but is this new Carmageddon gonna be an online game? :smile:[/quote]
Read again. I just wanted to fix the mixing up of online game and a game with multipayer over the internet.
jeff_1amstudios on Tue Aug 04, 2009 6:35 am
Post
[quote=Harmalarm]:decu: that is some good news Jeff! Does this mean that our custom C1 cars could now deform on the new C1 engine?
You are still making some nice progress in the background there, love it. Keep it up.
and hmmm, video's, gimme video's :heh:[/quote]
Hey, yes it does. Although you'd need to go back and create valid crush data for all your custom C1 cars, but I'll set out the file format once Ive got it sorted. Still working on those last couple of pieces...
OpenC1 - Open-source Carmageddon engine! http://www.1amstudios.com/projects/openc1
User avatar
Toshiba-3 on Thu Aug 06, 2009 10:46 pm
Post
I'm VERY eager (and I know Econobrick would be too) to read your work about the crush data.
I'm going to have to update 35 C1 cars with actual working crush data.

Isn't there any chance you could somehow create a little progie that could ease our work and generate crush data chunks with a pre-defined damage configuration? Like we'd set the front to be normal, the sides to be softer and a part to be unbreakable. Just an idea.

Keep up the good work Jeff, it's really great to see someone progressing so well with such a big carmageddon-related project!
Image / carmageddon add-ons at road reaction
jeff_1amstudios on Mon Aug 10, 2009 8:22 am
Post
I havent had much time to work on this lately - im in london for 2 weeks working on a project 7 days a week. (Im from New Zealand, so it was a pretty cool opportunity).

So basically, the way it seems to work - there are many of these structures in the car file:

Vertex index
bbox min
bbox max
scale1
scale2
list of affected vertices


So taking a vertex, if it collides with something, it can move within the defined bbox. The amount it moves for a collision is scaled by either scale1 or scale2 (not sure how this is determined yet).

Then the list of affected vertices is used to move points around the main vertex to make it look like the bodywork is compressing around it. Each affected vertex has some sort of scale (1-255), at 1, all vertexes move down, at 255 they all move upwards.
OpenC1 - Open-source Carmageddon engine! http://www.1amstudios.com/projects/openc1
jeff_1amstudios on Thu Aug 13, 2009 1:28 pm
Post
I've finally managed to get hold of a sample PhysX vehicle demo which behaves quite well. Getting some semi-realistic and fun physics is really difficult to get right, but Im hoping to be able to use the sample I have now to get a good car model driving around a carmageddon map soon.
OpenC1 - Open-source Carmageddon engine! http://www.1amstudios.com/projects/openc1
Pages:  << 1, 2, 3, 4, 5  >>



cron
Extra information
It is currently Tue May 30, 2017 3:43 am,

Please Register a username.
In total there is 1 user online :: 0 registered, 0 hidden and 1 guest
Users browsing this forum: No registered users and 1 guest
Moderators: coffeycup, Toshiba-3

Powered by phpBB :: Hosted by n3wton :: Molested by goats
CWA Links
Facebook