Announcements - New Reference Examples

Chris E
DX Studio Team
11 June 2010 15:53:48
Based on results from the recent survey, we've started updating the reference guide. There is also a new reference examples section on the Wiki.

Here's the main section for the Reference Examples
Charles L
Commercial Pro Edition
Joined 08 May 2010
11 June 2010 16:12:53
thanks





need more examples, of possibility to use the codes.
need to see more for understand the way.
Charles L
Commercial Pro Edition
Joined 08 May 2010
11 June 2010 16:23:20
There is nothing to give a computer to a grandmother. If she does not know where the start button.
Chris E
DX Studio Team
11 June 2010 16:38:03
Indeed. We'll be going through all of the Reference guide and adding examples.
Charles L
Commercial Pro Edition
Joined 08 May 2010
11 June 2010 17:44:38
Thank you very much.
Seminus
Commercial Pro Edition
Joined 08 July 2007
11 June 2010 19:27:36
Cool example chris. We need definitly more of this. I wished I had such small example when I began with DXS back then
MiKo
Commercial Pro Edition
Joined 07 September 2008
11 June 2010 19:55:49
There is nothing to give a computer to a grandmother. If she does not know where the start button
Hahaha. Well, yeah, many grandmothers fail at "to end Windows, press the start button", I think


Thanks for taking care of the Wiki, Chris E.
Btw. is it Based on results from the recent -still running- survey or Based on results from the recent -finished- survey ? I mean, pie-charts time again already?
BUnzaga
Commercial Pro Edition
Joined 07 June 2006
11 June 2010 20:29:06
I'm interested to see the results
burny
Non-Commercial Pro Edition
Joined 12 March 2010
11 June 2010 20:39:43
Wonderful Chris E... Thanks for giving The example
JimmDaBimm
Non-Commercial Pro Edition
Joined 25 May 2008
11 June 2010 21:32:49
I mean, pie-charts time again already?
Haha, MiKo and his pie-charts
Charles L
Commercial Pro Edition
Joined 08 May 2010
11 June 2010 21:51:23
Watch out for grandma pies are hard to beat.
hehehe
ucm
Commercial Pro Edition
Joined 17 October 2007
12 June 2010 02:49:39
Super Awesome!!! I can't thank you guys enough for this one

I plan to point people to these pages quite often
Tiptoe
Freeware Edition
Joined 12 April 2006
12 June 2010 07:14:38
Brilliant! This is one of the best things you could have done for DXStudio.

I'm just an artist and I learn best by studying working examples of code. Over the years, I've tried lots of different game engines, but I keep coming back to DXStudio. Why? Because it's the easiest to use for non-programmers like me.

Good documentation is worth its weight in gold. Because it doesn't matter how wonderful the engine is, if it has poor or non-existant documentation, then it's useless for anybody who isn't a programmer.

Honestly, you can never have enough examples and tutorials. Great job!
Chris E
DX Studio Team
14 June 2010 17:41:06
I've put up two new examples today :

Color Creation : Shows different ways of initialising Color variables using the Color Picker as a reference tool.

Array Basics : Explains some of the basics of arrays. There will be more array documentation in the future.

Coming up are some physics examples, some extra information on print as well as general improvements to the reference guide.
Seminus
Commercial Pro Edition
Joined 08 July 2007
14 June 2010 18:26:59
this docs are brilliant for new users. Really like the one with the array basics.
Explaining arrays for none programmer really well done

Keep them comming
Charles L
Commercial Pro Edition
Joined 08 May 2010
14 June 2010 18:39:38
Hey is well for me!!! Seminus

When we need a few things there will be an opportunity to continue our projects.
We need a place just like you have created too!

Chris E, If we have a suggestion, you accept them?
For user?
BUnzaga
Commercial Pro Edition
Joined 07 June 2006
14 June 2010 20:51:44
I am glad to hear about the physics documentation.
Charles L
Commercial Pro Edition
Joined 08 May 2010
14 June 2010 20:56:47
I did a search in the guide. I think there is nothing on the physics. I'm stoped
The informations in the guide is no need, on this subject.
BUnzaga
Commercial Pro Edition
Joined 07 June 2006
15 June 2010 00:08:21
I was talking about Chris E's comment:
"Coming up are some physics examples, some extra information on print as well as general improvements to the reference guide."
ucm
Commercial Pro Edition
Joined 17 October 2007
15 June 2010 03:56:37
You're doing GREAT!! Chris ^^
Chris E
DX Studio Team
15 June 2010 18:07:32
I've added the first Physics reference example : Physics - Forces and Impulses. There are more physics examples on the way, as there is a lot of ground to cover.
Charles L
Commercial Pro Edition
Joined 08 May 2010
15 June 2010 19:06:46
Thanks
So it is that replaces the posVelocity?
To rotate the ownership of an object. I do not know.
your example is the "world" rot and "world" pos and not the "Object" pos and rot?
BUnzaga
Commercial Pro Edition
Joined 07 June 2006
15 June 2010 19:25:14
That is a great start Chris E, for the physics documentation. Very fast too. I had one question though. In the past, when I have tried to apply a constant force to an object, it would have a 'ramp up' effect. Is there a good or standard way to apply a constant force to an object, that doesn't accelerate over time?

For example, if I apply a central force of (0,10,0) on update, the first update it is applied, it will be 0,10,0. The next update it will be whatever the current velocity is plus a new 0,10,0. Then the next update it would again be the current velocity plus another 0,10,0. Ths will continue until the object moves so fast it is out of control.

Is there a proven way to apply a constant force with some kind of 'max' value, like if the current velocity + the new velocity would be greater than the desired velocity, just add the difference to match the desired velocity, or don't apply the force at all?

Like if the current velocity is 0,8,0 and we want the velocity to be 0,10,0 then it should apply only the force to bring it to 0,10,0 which would be 0,2,0 for example (I realize it is probably much more complicated than this). Or if the current velocity already is 0,10,0 it shouldn't apply any velocity at all.

I'd like a way to get a consistent velocity (not acceleration).
Charles L
Commercial Pro Edition
Joined 08 May 2010
15 June 2010 19:31:07
@BUnzaga

add this :

onUpdate()
{

object.posVelocity.y = 10;


}

is easy?


: do not use this
BUnzaga
Commercial Pro Edition
Joined 07 June 2006
15 June 2010 19:40:02
I know I can force a velocity like that, but is it using the physics engine, or am I bypassing the physics engine by doing that?

I want to do it the way Ageia PhysX wants me to do it.
Charles L
Commercial Pro Edition
Joined 08 May 2010
15 June 2010 19:43:41
I hope that chris has a solution. In addition, the models passes into the walls like in butter.
ucm
Commercial Pro Edition
Joined 17 October 2007
16 June 2010 03:08:51
@BUnzaga: I think ( if i'm understaing what you're saying ) that you are using onUpdate to specify the constant force.

If that's the case then try only calling the constant force once and not in onUpdate. The contant force functions put a constant force on an object just like setting object.posVelocity

( at least that's how i understand it.. sorta.. )

@Support: I totaly vote for a maximum constant force value maybe like a:
object.physics.maxForceEnable = true;
object.physics.maxForce = Float

I think a float would be awesome as the player's c++ could check to see if object.physics.maxForceEnable is set to true and if so then do a calculation to convert the object's current velocity vector into a Float value. And then check to see if that float value is less than object.physics.maxForce and if not then rescale the velocity vector so that it's converted Float value is less than object.physics.maxForce

or something like that
BUnzaga
Commercial Pro Edition
Joined 07 June 2006
16 June 2010 08:01:00
"( at least that's how i understand it.. sorta.. )"

A couple of things wrong with this, is that if the object rotates, now the force direction needs to also be updated.

Also it might be friction or something else, but the force update acts like an impulse.

It just isn't smooth...

forcePush.dxstudio
Funkas
Non-Commercial Pro Edition
Joined 28 February 2008
16 June 2010 08:28:59
I don't think you get this part of physics right guys. Bear in mind, the constantly applied force causes object's constant acceleration AS_IT_SHOULD. If there was not gravity or friction objects would travel with increasing the velocity.
For example if you apply vertical force, which is equal gravity, object will truly levitate in the space.
If it's less than that it will fall. If more, it will be fired in direction to the moon.
The difficulty is to achieve that as stable physical state. Because of that you should modulate applied force accordingly.
In the example below the cube will levitate and applied force will reach value of 9,81, which is pretty obvious in real physic.

levitation.dxstudio
Charles L
Commercial Pro Edition
Joined 08 May 2010
16 June 2010 08:36:08
I am very small and Lege like a feather.

Funkas, your document is insanely great
BUnzaga
Commercial Pro Edition
Joined 07 June 2006
16 June 2010 08:37:46
Ok so back to the original question. How do we move things [over uneven terrain] with normal physics? Do we use object.physics, or do we use object.posVelocity?
Charles L
Commercial Pro Edition
Joined 08 May 2010
16 June 2010 08:44:57
is the secret of all the times.
I asked the same kind of question.

I think in real life we are move with the strength of our muscles.
then it would be with the velocity.
big muscle, big velocity.
Big e.keyId == "a", big velocity
We are not moved with the physics. we are facing to this.
i think
Chris E
DX Studio Team
16 June 2010 09:16:31
When using physics, object.posVelocity can still be written to and read from, but forces/impulses are recommended really. If you want an object to have a top speed, you can look into object.physics.linearDamping. This is a resistance factor (a float) against movement, giving the object a top speed. There is also object.physics.angularDamping too, which gives a similar effect for rotation.

I'll try and clear some things up in the upcoming examples.
Charles L
Commercial Pro Edition
Joined 08 May 2010
16 June 2010 09:19:43
Thank you for taking care of us.
I want to know too
BUnzaga
Commercial Pro Edition
Joined 07 June 2006
16 June 2010 09:56:47
Awesome to know Chris E.

Perhaps the next physics example could explore this concept in greater detail? *hint hint*
ucm
Commercial Pro Edition
Joined 17 October 2007
16 June 2010 10:21:18
Thanks Chris!! I look forward to those examples

Also if you do take a request here and there; my priorities on physics would rope/chain examples using constraints
Funkas
Non-Commercial Pro Edition
Joined 28 February 2008
16 June 2010 10:43:24
Hehe, someone is talking again about "rope/chain examples using constraints". It wakes some nice reminiscences
Well, to keep it short. if you have the situation like in the left image, you can use constrains to the heart's content. But if you want something like in the image rights, you might have problem with constraints. AFAIK it would require multiple joints (constrains).


There are ways to overcome it though. The whole discussion is here:
http://www.dxstudio.com/forumtopic.aspx?topicid=f59b145b-d9fb-49f6-8a97-e8f5e9575b79
Charles L
Commercial Pro Edition
Joined 08 May 2010
16 June 2010 20:49:38
This is the nunchaku of Funkas, watch out!!
heheh I remembered this post. cool prototype
Thanks is a gold mine
JimmDaBimm
Non-Commercial Pro Edition
Joined 25 May 2008
16 June 2010 21:42:56
Btw @Funkas: Thanks a lot for that example, helped me alot a few days ago for my spaceman project .
Charles L
Commercial Pro Edition
Joined 08 May 2010
03 July 2010 05:53:34
Chris E and support any information talked about this New Reference Examples?
physics, onUpdate method...
and 2D help for make 2D V4 game..

make a reference board information with this...
is the idea, and make all this the moment please
Charles L
Commercial Pro Edition
Joined 08 May 2010
03 July 2010 06:04:46
learning by you, future of DX Studio is in your hands.
Charles L
Commercial Pro Edition
Joined 08 May 2010
03 July 2010 06:10:34
but a good Script Reference guide with more informations to use the DX Script would be better
MiKo
Commercial Pro Edition
Joined 07 September 2008
04 July 2010 16:25:44
FYI, I noticed there might be some hierarchy adjustment needed here:



Btw, whoa, since when do we have that designMode and drawGrid thingies?
Totally missed those coming in
JimmDaBimm
Non-Commercial Pro Edition
Joined 25 May 2008
04 July 2010 16:45:27
Nice find. But i don't see any useful case for the "designMode" o.O...
Seminus
Commercial Pro Edition
Joined 08 July 2007
04 July 2010 16:47:50
I just saw that too... Interesting stuff Is this a V4 feature for the playing in editor stuff?
Funkas
Non-Commercial Pro Edition
Joined 28 February 2008
04 July 2010 16:58:02
Player and editor get melted together ("no F12") But there will be times you like to know you are still by editing. Lol. That is supposedly to avoid script execution "in editor".
Chris E
DX Studio Team
06 July 2010 09:53:40
There will be more reference examples coming soon. I've been working on some V4 features recently, which is why there hasn't been any.
ucm
Commercial Pro Edition
Joined 17 October 2007
06 July 2010 12:04:48
Thanks Chris
steenosterby
Commercial Pro Edition
Joined 12 October 2008
06 July 2010 12:15:55
thanx chris
Peter Goode
Non-Commercial Pro Edition
Joined 23 June 2010
21 July 2010 12:56:43
Quick question.

If the player is going to be integrated in the editor in v4... will that make plugin development more of a problem - it is very handy to spawn a separate player to test things, and to know that my DLL isn't going to be called all the time while the editor is running.

Perhaps a config option to keep the existing behaviour (player not integrated, and spawns on F12) would be useful ?
ucm
Commercial Pro Edition
Joined 17 October 2007
21 July 2010 13:00:01
I also would vote for having the option to keep the existing behavoir of using f12 to open the doc outside the editor for testing

Actualy I would totaly love it if we could specify a "Open Preview in specific Location" which we could then specify other computers and choose F9-F11 for those locations while F12 be the usual place

IE: XP machine     Vista Machine     Win 7 machine
Chris S
DX Studio Team
21 July 2010 13:20:11
Yes, F12 is still there. This is also handy for docs that may want to go exclusive mode or hide the mouse, etc.
Peter Goode
Non-Commercial Pro Edition
Joined 23 June 2010
21 July 2010 13:59:29
Good news, thanks Chris.

I look forward to trying out v4.

If you'd like to post to this forum, just create an account on the website, or login with your existing details.

When posting to a forum, you can use limited HTML tags:- 'a' for links, 'b' for bold, 'i' for italic and 'script' to encase a block of DX Studio script.  All tags must be properly closed. e.g. <script>var i=1;</script>

Note: If there are any offensive comments in this topic, please let us know straight away at . Always follow the forum rules.