Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (flink, AndrewAMD), 656 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rating: 5
Page 6 of 41 1 2 4 5 6 7 8 40 41
Re: Newton 2 wrapper [Re: BigM] #225119
09/02/08 21:58
09/02/08 21:58
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline OP

Serious User
VeT  Offline OP

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
hmmm.. not MAX_NEWTON_ADVANCE nor MIN_NEWTON_ADVANCE declared by default... how do you get it in your code? smile


1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro
Re: Newton 2 wrapper [Re: VeT] #225205
09/03/08 10:14
09/03/08 10:14
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline OP

Serious User
VeT  Offline OP

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
sorry, there weren't releases for a long time: now i have some hard work with compound objects wink


1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro
Re: Newton 2 wrapper [Re: VeT] #225221
09/03/08 11:47
09/03/08 11:47
Joined: Oct 2002
Posts: 799
Germany->Bavaria->Nuremberg
C
Christian__A Offline
User
Christian__A  Offline
User
C

Joined: Oct 2002
Posts: 799
Germany->Bavaria->Nuremberg
Great job, I will test your wrapper later. I have looked over the newton-files and i looks like you didn't implement the vehicle function yet. It would be great if you could face this next.


MfG, Christian__A. Visit my Site: www.chris-a.de


Re: Newton 2 wrapper [Re: Christian__A] #225224
09/03/08 12:28
09/03/08 12:28
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline OP

Serious User
VeT  Offline OP

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
no, vechile would be later, now i'm finishing my work on compounds, and working with arcimedian buoyancy.. after them there would be joints and vechile smile
i think, in a week or two, it would be ready wink


1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro
Re: Newton 2 wrapper [Re: VeT] #225301
09/03/08 21:44
09/03/08 21:44
Joined: Oct 2006
Posts: 36
BigM Offline
Newbie
BigM  Offline
Newbie

Joined: Oct 2006
Posts: 36
Sorry, I don't have much practice at quoting code...

I'm defining MAX_NEWTON_ADVANCE earlier in the code:

Code:
#define MAX_NEWTON_ADVANCE 0.01


Do you think this kind of time slicing is useful for the wrapper?

Re: Newton 2 wrapper [Re: BigM] #225316
09/03/08 23:22
09/03/08 23:22
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline OP

Serious User
VeT  Offline OP

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
heh, i send you pm and didnt see your message smile

i'd try to test ever time slicing wich i could find: in my previous demo, boxes falled like in water, too slow... maybe this could help, i'd see..


1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro
Re: Newton 2 wrapper [Re: VeT] #225375
09/04/08 08:35
09/04/08 08:35
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline OP

Serious User
VeT  Offline OP

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
fitst, can you tell one more time, why you are using proc_mode = PROC_LATE; ?
in this way all grapfical entities are moving a little bit "after" then physical bodies, where is the "plus" of this method? smile

second, using "slices" would be good for "slow-mo", i think smile
i tried another variables(not 0.01, but 1 or 1000), but i dont see any difference between this, so i'll think about your formula
Code:
int advance = time_frame/16;
		int slices = integer((advance / MAX_NEWTON_ADVANCE) + 1);
		int slices_left;

		for (slices_left = slices; slices_left > 0; slices_left--){
			NewtonUpdate(nworld, advance/slices);
		}



1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro
Re: Newton 2 wrapper [Re: VeT] #225376
09/04/08 08:38
09/04/08 08:38
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline OP

Serious User
VeT  Offline OP

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
okay, what about my part of work - i had a lot of troubles with compounds, but i'm still work hard on them...


1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro
Re: Newton 2 wrapper [Re: VeT] #225379
09/04/08 09:41
09/04/08 09:41
Joined: Oct 2006
Posts: 36
BigM Offline
Newbie
BigM  Offline
Newbie

Joined: Oct 2006
Posts: 36
Ok, regarding proc_mode = PROC_LATE:

The way I understand the engine processes stuff normally (without setting proc_mode) is by processing each loop that is waiting in the order in which they appear. So the first is the newton update loop and second the loop in main. Afterwards the engine will update the screen.

1- newton update loop
2- main loop
3- update screen

I understand that the time variables are relative to the period between screen updates, so, at any given point in the code execution, time_frame will always refer to the time between the previous two screen updates.

A (usually small) problem arises when you use the loop in main to calculate something that will be used in the newton simulation. Take, for example, a reaction to a mouse displacement that I want to convert into a target velocity and a required acceleration:

Code:
target_velocity = mickey.y/(time_frame/16)
acceleration = (target_velocity - actual_velocity)/(time_frame/16)

I then apply the required acceleration in a newton callback. However, because the NewtonUpdate loop is updated first, it will have access to a brand new time_frame value, which differs from the one used to calculate the desired acceleration. The result is that the body will be accelerated for a different time period and have a final velocity different from what is expected.

By moving the newton update loop to last you can be sure that not only it is more in sync with what is processed in main, but you also get a marginally faster response to input (user moves mouse and sees result in the following screen update instead of having to wait for two screen updates). Of course I could move the whole calculation process inside the callback and it would be ok then, but I think that is besides the point as other kinds of calculations might not be feasible in the callback, especially if it is something heavy and you don´t want to repeat it for all sub updates newton may have to perform.

This is how I interpret the flow of the engine, and indeed, in my case, the differences between desired velocities and resultant velocities did get smaller. Maybe someone has something to add/correct.

Re: Newton 2 wrapper [Re: BigM] #225475
09/04/08 19:18
09/04/08 19:18
Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
VeT Offline OP

Serious User
VeT  Offline OP

Serious User

Joined: Aug 2004
Posts: 1,345
Kyiv, Ukraine
Quote:

I then apply the required acceleration in a newton callback.

damned, so you again put not all code? laugh can you give me all code to see, how youe slicing works, because i like your idea, but code that you wrote dont works for me..


1st prize: Lite-C and Newton 2.17 by Vasilenko Vitaliy

Newton2 videos: http://tinyurl.com/NewtonVideos
LiteC+Newton2 discussion: http://tinyurl.com/NewtonWrapperDiscussion
Latest LiteC+Newton2 version(v23, from 29.10.2009): http://depositfiles.com/files/ae1l0tpro
Page 6 of 41 1 2 4 5 6 7 8 40 41

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1