\"Duel\" mod code question

For all coding issues - MODers and programmers, HTML and more.

Moderators: Jeff250, fliptw

Post Reply
User avatar
Foil
DBB Material Defender
DBB Material Defender
Posts: 4900
Joined: Tue Nov 23, 2004 3:31 pm
Location: Denver, Colorado, USA

\"Duel\" mod code question

Post by Foil » Thu Jan 04, 2007 4:49 pm

Does anyone have the source code and/or level-design specs for the \"Duel\" mod?

I'm working on a mod myself (see http://descentbb.net/viewtopic.php?t=10707), and the major sticking point I'm up against is forcing players to a certain location or spawnpoint. The Duel mod does this (when a particular \"arena\" is picked), so I know it's possible, but I'm not sure how it's being done.
User avatar
Foil
DBB Material Defender
DBB Material Defender
Posts: 4900
Joined: Tue Nov 23, 2004 3:31 pm
Location: Denver, Colorado, USA

Post by Foil » Fri Jan 05, 2007 2:08 pm

Per the information I've been given, the original coder for \"Duel\" was Gwar. Anybody know how to contact him?
User avatar
The Lion
DBB Ace
DBB Ace
Posts: 197
Joined: Mon Apr 17, 2006 2:13 pm
Location: The Netherlands

Post by The Lion » Fri Jan 05, 2007 5:34 pm

Look in the dallasfuncs.cpp provided by the D3-SDK. There's a function
with which you can move objects, so you could get the code from there.
User avatar
DCrazy
DBB Alumni
DBB Alumni
Posts: 8826
Joined: Wed Mar 15, 2000 3:01 am
Location: Seattle

Post by DCrazy » Sun Jan 07, 2007 7:17 am

You have to be careful when moving objects to specific places. Once should be fine (we did it in OG3 using whatever function was available, I lost the source a long time ago :( ) but if you try doing this frequently you get stuttering.

I remember how I originally implemented the hovering code for OG3... every frame the game would shoot a ray downwards from the ship, determine the distance between the ground and the ship, and move the ship accordingly. Led to jerky gameplay.
User avatar
Foil
DBB Material Defender
DBB Material Defender
Posts: 4900
Joined: Tue Nov 23, 2004 3:31 pm
Location: Denver, Colorado, USA

Post by Foil » Sun Jan 07, 2007 2:13 pm

The Lion wrote:Look in the dallasfuncs.cpp provided by the D3-SDK. There's a function
with which you can move objects...
Including playerobjects? I'll have to look into it.
DCrazy wrote:...but if you try doing this frequently you get stuttering.


How often is "frequently"? I'll only have to do it once per player every few minutes or so... is this an issue?
User avatar
DCrazy
DBB Alumni
DBB Alumni
Posts: 8826
Joined: Wed Mar 15, 2000 3:01 am
Location: Seattle

Post by DCrazy » Sun Jan 07, 2007 10:33 pm

Foil:

That's fine. I was talking ~60 times per second. Though you might look into using waypoint objects if they suit your needs.

And come to think of it, we didn't actually use any functions to move the player; we set the player's position vector directly. It's part of the object struct, should be a Vec3 or Vector3 or whatever it's called.
User avatar
Foil
DBB Material Defender
DBB Material Defender
Posts: 4900
Joined: Tue Nov 23, 2004 3:31 pm
Location: Denver, Colorado, USA

Post by Foil » Mon Jan 08, 2007 9:25 am

Excellent, thank you!
User avatar
DCrazy
DBB Alumni
DBB Alumni
Posts: 8826
Joined: Wed Mar 15, 2000 3:01 am
Location: Seattle

Post by DCrazy » Mon Jan 08, 2007 11:16 pm

No problem; just be careful that your pointer to the player object is always valid, and remember that any changes you make won't be taken until the next frame.

Also, a lot of collision detection will be avoided if you directly set the object's position, and you might wind up not triggering the \"changed segment/room\" event that's normally raised when an object crosses from one room or terrain segment into another. Your best bet is to do a lot of debugging, and keep all the edge cases in mind.
User avatar
Foil
DBB Material Defender
DBB Material Defender
Posts: 4900
Joined: Tue Nov 23, 2004 3:31 pm
Location: Denver, Colorado, USA

Post by Foil » Tue Jan 09, 2007 1:37 am

Thanks for the advice.

I haven't yet dived back into the code, but I probably will here in the next couple of days.
Post Reply