Jump to content


Photo

Extremephysics - 2d Physics Engine For Game Maker


  • Please log in to reply
1138 replies to this topic

#1041 Maarten Baert

Maarten Baert

    GMC Member

  • GMC Member
  • 714 posts
  • Version:GM8.1

Posted 18 March 2012 - 11:35 PM

I understand, but what you are asking is pretty complicated and it seems you really have no idea where to start. I don't mind helping you with specific problems, but I really don't have time to do it all myself. What have you tried so far?

By the way, there is already a destructible terrain example in the ExtremePhysics ZIP file. It may not be as good as the one you want to use, but are you sure it isn't good enough?
  • 0

#1042 'tear

'tear

    GMC Member

  • New Member
  • 17 posts
  • Version:GM8

Posted 19 March 2012 - 01:02 AM

i am more advanced in the GML programing that you think :)
i will soon reply (tomorrow (i dont have time to explain))
  • 0

#1043 'tear

'tear

    GMC Member

  • New Member
  • 17 posts
  • Version:GM8

Posted 19 March 2012 - 03:28 AM

I am sure it isn't good enough for a grand -commercial game...

i need your help in defying the points for each 'triangle' in the terrain (can extreme physics allow you to move (update) the points on the static/dynamic multypolygons/other shapes, without destroying and recreating them)

all-so it will be good if you can tell me of how to check the block's collusion force when it is collided ? (ep_body_check_force() ?)

and if you cant help, then i understand, and i think i can figure it out ower a period of time...

thank you for your time :)

-Artur

Edited by 'tear, 20 March 2012 - 04:12 AM.

  • 0

#1044 Maarten Baert

Maarten Baert

    GMC Member

  • GMC Member
  • 714 posts
  • Version:GM8.1

Posted 21 March 2012 - 08:14 PM

You need ep_contact_get_point1_normalforce and a few more contact-related functions for that. Read this tutorial first if you don't know how to work with contacts.

There's no way to modify polygons after initializing them, you have to destroy them and create new ones (that shouldn't be a huge issue though, you only have to destroy the shapes temporarily).
  • 0

#1045 'tear

'tear

    GMC Member

  • New Member
  • 17 posts
  • Version:GM8

Posted 21 March 2012 - 09:41 PM

ok, i will try it :)
  • 0

#1046 'tear

'tear

    GMC Member

  • New Member
  • 17 posts
  • Version:GM8

Posted 21 March 2012 - 10:48 PM

Hello, i need one more thing :)

How do i check the gravity direction-
the gm- gravity_direction(point_direction(room_width/2,room_height/2))
i need to know the grawity direction script, not the- ep_body_set_grawity()
1. i need constant update with all bodies and to the center of the screen, is there anyvay to do it unlike in the fluid_sumulation (example)
(constant update and to the center of the screen)

Thank you for your help :)

-Artur
  • 0

#1047 Maarten Baert

Maarten Baert

    GMC Member

  • GMC Member
  • 714 posts
  • Version:GM8.1

Posted 23 March 2012 - 10:26 AM

Try this:
var g, dir;
g = 0.5;
dir = point_direction(x, y, room_width/2, room_height/2);
ep_body_set_gravity(global.world, body, lengthdir_x(g, dir), lengthdir_y(g, dir));
If this is not what you mean, please explain it again - I couldn't really make sense of your last post :).
  • 0

#1048 armorraja

armorraja

    GMC Member

  • New Member
  • 3 posts
  • Version:Unknown

Posted 24 March 2012 - 11:06 AM

hey guys have a question
how can i change the color of the fluid into red??
want to make it look like blood
pls answer :)
  • 0

#1049 Maarten Baert

Maarten Baert

    GMC Member

  • GMC Member
  • 714 posts
  • Version:GM8.1

Posted 24 March 2012 - 08:58 PM

Sorry, but if you can't figure that out by yourself I don't think you should try to use ExtremePhysics. It gets a lot harder. :)

Anyway, take a look at the step event of the controller.

Edited by Maarten Baert, 24 March 2012 - 08:58 PM.

  • 0

#1050 armorraja

armorraja

    GMC Member

  • New Member
  • 3 posts
  • Version:Unknown

Posted 24 March 2012 - 09:21 PM

sry bro im new at gamemaker pls answer :(
it says
draw_sprite(spr_water,0,xx,yy);
}
}

draw_set_blend_mode_ext(bm_inv_dest_color,bm_zero);
draw_set_color(c_white);
draw_rectangle(0,0,room_width,room_height,0);       // c = 1-c

draw_set_blend_mode_ext(bm_one,bm_one);
draw_set_color(merge_color(c_black,c_white,1-1/8));
draw_set_alpha(1-1/1);
draw_rectangle(0,0,room_width,room_height,0);       // c = c+1-1/8
draw_set_alpha(1);

draw_set_blend_mode_ext(bm_inv_dest_color,bm_zero);
draw_set_color(c_white);
draw_rectangle(0,0,room_width,room_height,0);       // c = 1-c

draw_set_blend_mode_ext(bm_dest_color,bm_one);
draw_set_color(c_white);
draw_rectangle(0,0,room_width,room_height,0);       // c = c+c
draw_rectangle(0,0,room_width,room_height,0);       // c = c+c
draw_rectangle(0,0,room_width,room_height,0);       // c = c+c

draw_set_blend_mode(bm_normal);

surface_reset_target();
i tried
make_color_rgb(255,0,0);
but doesnt work
  • 0

#1051 Maarten Baert

Maarten Baert

    GMC Member

  • GMC Member
  • 714 posts
  • Version:GM8.1

Posted 25 March 2012 - 03:01 PM

Whoops, seems like it was in the draw event after all :P.
draw_surface_ext(surf,0,0,1,1,0,make_color_rgb(0,80,200),1);
Just replace make_color_rgb(0,80,200) with your color.
  • 0

#1052 Maarten Baert

Maarten Baert

    GMC Member

  • GMC Member
  • 714 posts
  • Version:GM8.1

Posted 25 March 2012 - 03:03 PM

Whoops, seems like it was in the draw event after all :P.
draw_surface_ext(surf,0,0,1,1,0,make_color_rgb(0,80,200),1);
Just replace make_color_rgb(0,80,200) with your color.
  • 0

#1053 armorraja

armorraja

    GMC Member

  • New Member
  • 3 posts
  • Version:Unknown

Posted 25 March 2012 - 05:48 PM

Whoops, seems like it was in the draw event after all :P.

draw_surface_ext(surf,0,0,1,1,0,make_color_rgb(0,80,200),1);
Just replace make_color_rgb(0,80,200) with your color.


oh thanks i didnt look at the draw event .
:D
  • 0

#1054 'tear

'tear

    GMC Member

  • New Member
  • 17 posts
  • Version:GM8

Posted 27 March 2012 - 01:16 AM

Success :)
thank you...

http://www.heptic.co...984013_orig.jpg
  • 0

#1055 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Global Moderators
  • 14389 posts
  • Version:GM:Studio

Posted 30 March 2012 - 08:27 AM

getting a few errors about missing or extra arguments in the demos... Maybe I have an old gex registered
  • 0

#1056 D1g1talAli3n

D1g1talAli3n

    BoyGenius

  • New Member
  • 963 posts
  • Version:GM8

Posted 10 April 2012 - 06:55 AM

Hello, I tried using this in GM Studio. First it said that is was missing the ExtremePhysics.dll, so I manually put it in the project folder, which fixed it. Then, I tried running it, but it does not recognize any of the functions. In the GM IDE, all functions are there and listed when I press "Show extension functions". However, when I run the game, it gives the "unknown function or script". Do you know any way to make EP work with GM Studio? (Yes I have tried manually putting all the scripts inside GM, but GM Studio can no longer import a lot of scripts at once via .gml files)
  • 0

#1057 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • Global Moderators
  • 14389 posts
  • Version:GM:Studio

Posted 10 April 2012 - 07:42 AM

Hello, I tried using this in GM Studio. First it said that is was missing the ExtremePhysics.dll, so I manually put it in the project folder, which fixed it. Then, I tried running it, but it does not recognize any of the functions. In the GM IDE, all functions are there and listed when I press "Show extension functions". However, when I run the game, it gives the "unknown function or script". Do you know any way to make EP work with GM Studio? (Yes I have tried manually putting all the scripts inside GM, but GM Studio can no longer import a lot of scripts at once via .gml files)


Studio beta does not support GEX or dlls yet, they did not get that far in supporting the feature yet. even if the dll interface function are there, no dll will work period.
  • 0

#1058 D1g1talAli3n

D1g1talAli3n

    BoyGenius

  • New Member
  • 963 posts
  • Version:GM8

Posted 10 April 2012 - 08:07 AM


Hello, I tried using this in GM Studio. First it said that is was missing the ExtremePhysics.dll, so I manually put it in the project folder, which fixed it. Then, I tried running it, but it does not recognize any of the functions. In the GM IDE, all functions are there and listed when I press "Show extension functions". However, when I run the game, it gives the "unknown function or script". Do you know any way to make EP work with GM Studio? (Yes I have tried manually putting all the scripts inside GM, but GM Studio can no longer import a lot of scripts at once via .gml files)


Studio beta does not support GEX or dlls yet, they did not get that far in supporting the feature yet. even if the dll interface function are there, no dll will work period.

Oh, OK, Thanks! :smile: I suppose I should've looked up the beta possibilities before I came here :sweat:
  • 0

#1059 D1g1talAli3n

D1g1talAli3n

    BoyGenius

  • New Member
  • 963 posts
  • Version:GM8

Posted 13 April 2012 - 08:26 AM

Hey guys, sorry to bother you again, but I seem to have another problem. I recently updated to 8.1 and the collisions just don't seem to work. I was using GM8 before with EP 2.1 and it worked perfectly fine. I then switched over to GM8.1 and since I used EP 2.1 at the beginning of the project, I decided to go with it for the rest of the project. However when I run the game, everything works fine except for the fact that the ragdollls do not collide with the static blocks. The ragdolls are created, they are dynamic, they're affected by gravity and all the joints are correctly placed, but they do not collide with the static blocks. Absolutely no code has been changed. It works fine in GM8 but not in 8.1. Thinking it my be an incompatibility with EP 2.1 and GM8.1, I upgraded to EP 2.2. This did not fix the problem, however, and the objects still do not collide. I have checked the collision groups but I don't see anything wrong. Here are the codes for the static blocks and ragdolls respectively just in case:

Code for static block: (the codes for the other static objects like ramps are basically the same, but instead of a box shape they are polygons. the ep_body_set_collisions() function is the same)
body = ep_body_create_static(world,1);
bodyshape = ep_shape_create_box(world,body,sprite_width-2,sprite_height-2,0,0,0,1);

ep_shape_set_collision(world,body,bodyshape,1,1,0);
ep_shape_set_material(world,body,bodyshape,0.6,0.6,0,0);
ep_body_set_position(world,body,x,y,0);

Code for ragdolls: (it's quite long so I shortened it to the quote that I think must the important)

The body is the main body part, which creates the other parts.
global.my_id = global.body_id;
global.body_id +=1;

body = ep_body_create_dynamic(world,0);
shape = ep_shape_create_box(world,body,sprite_width-4,22-4,0,0,0,1);

ep_shape_set_collision(world,body,shape,1,1,GROUP_RAGDOLL+global.my_id);
ep_shape_set_material(world,body,shape,0.5,0.4,0,0);
ep_body_set_position(world,body,x,y,0);

ep_body_calculate_mass(world,body);

ep_body_set_gravity(world,body,0,0.4);

The other body parts have generally this code:
body = ep_body_create_dynamic(world,0);
shape = ep_shape_create_box(world,body,sprite_width-4,sprite_height-4,0,0,0,0.5);

ep_shape_set_collision(world,body,shape,1,1,GROUP_RAGDOLL+global.my_id);
ep_shape_set_material(world,body,shape,0.2,0.4,0,0);
ep_body_set_position(world,body,x,y,0);

ep_body_calculate_mass(world,body);

ep_body_set_gravity(world,body,0,0.4);

the constant GROUP_RAGDOLL is 1.
and object called EP sets global.body_id to 0 at its create event, where the world creation code is also located.
  • 0

#1060 Jake Armstrong

Jake Armstrong

    GMC Member

  • GMC Member
  • 390 posts

Posted 13 April 2012 - 03:06 PM

This physics engine seems awesome, although it's probably extremely overkill for what I want to do lol.

EDIT: (I was initially asking about the license as well but I saw a post you made on your website so I figured it out and removed that from this post.)

Edited by Jake Armstrong, 14 April 2012 - 05:22 AM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users