AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Module Coding (https://forums.alliedmods.net/forumdisplay.php?f=9)
-   -   Module: BMOD - Extended Physics Module (https://forums.alliedmods.net/showthread.php?t=178066)

xakintosh 02-12-2012 14:31

Re: Module: BMOD - Extended Physics Module
 
Wicked Work.
You are insane dude good job.

Kiske 02-13-2012 02:05

Re: Module: BMOD - Extended Physics Module
 
Quote:

Originally Posted by Backup (Post 1648908)
Code:

#include <amxmodx>
#include <engine>
#include <bmod>

public plugin_init() {
    register_plugin("bmod_test","0","asdf")
    register_concmd("bmod_test","_bmod_test")
}

new i=0

public _bmod_test(id){
    new entity = create_entity("func_wall")
    switch(i%5){
        case 0:{
            entity_set_model(entity,"models/fyzsph.mdl")
        }
        case 1:{
            entity_set_model(entity,"models/fyzbox.mdl")
        }
        case 2:{
            entity_set_model(entity,"models/fyzcyl.mdl")
        }
        case 3:{
            entity_set_model(entity,"models/fyzcap.mdl")
        }
        case 4:{
            entity_set_model(entity,"models/fyzcon.mdl")
        }
    }
    new Float:origin[3]
    entity_get_vector(id,EV_VEC_origin,origin)
    origin[2]+=128
    entity_set_origin(entity,origin)
    entity_set_float(entity,EV_FL_nextthink,86400.0)
    entity_set_int(entity,EV_INT_movetype,8)
    bmod_object_add(entity,i%5,1.0,24.0,24.0,24.0)
    i++
}

public plugin_precache(){
    precache_model("models/fyzsph.mdl")
    precache_model("models/fyzbox.mdl")
    precache_model("models/fyzcyl.mdl")
    precache_model("models/fyzcap.mdl")
    precache_model("models/fyzcon.mdl")
}


Very very thanks!

iBuX 02-13-2012 16:45

Re: Module: BMOD - Extended Physics Module
 
Very nice!

Good job.

Backup 02-13-2012 17:15

Re: Module: BMOD - Extended Physics Module
 
I'm very glad you like it, but i would also appreciate some feedback like: Is it working? Are there any functions you miss (like applying forces, setting gravity, callbacks)? Or should i work on entity handling (proper collision with walls, doors, breakables)? Or should i try to implement player collision?

Emp` 02-13-2012 19:33

Re: Module: BMOD - Extended Physics Module
 
Quote:

Originally Posted by Backup (Post 1649972)
Or should i try to implement player collision?

I think that would be one of the best goals you could accomplish with this, along with the entity handling.

One thing that I saw immediately that I would prefer you do is convert the following into an enumeration.
Code:

0 - sphere (x is radius)
1 - box (x, y and z are half of box dimensions)
2 - cylinder (same as box, x is radius; cylinder is situated along Z axis)
3 - capsule (x is radius, y is distance between half spheres; capsule is situated along Z axis)
4 - cone (x is radius, y is height; cone is situated along Z axis)

Using an enumeration would be easier to distinguish what is being created, instead of trying to remember the numeric values.

Also, I have not had any time to actually test anything with this, but could you answer these questions (they all have to do with how much entity data is used between "worlds"):
  1. Are entities' and objects' velocities tied both ways? Meaning if I set an entity's velocity, will it correctly alter the object's velocity?
  2. Does an entity's movetype also affect its movement? I.e. would an entity with MOVETYPE_FLY float in the air?
  3. Does the entity's gravity affect anything?

A feature that I think would be interesting, would be able to do something like Weapon Physics for the entities.

Backup 02-14-2012 10:09

Re: Module: BMOD - Extended Physics Module
 
Quote:

Originally Posted by Emp` (Post 1650061)
One thing that I saw immediately that I would prefer you do is convert the following into an enumeration.
Code:

...
Using an enumeration would be easier to distinguish what is being created, instead of trying to remember the numeric values.

Whatever, that was the most easy thing to do.
Quote:

Originally Posted by Emp` (Post 1650061)
Are entities' and objects' velocities tied both ways? Meaning if I set an entity's velocity, will it correctly alter the object's velocity?

Nope, bmod ingores and overwrites all your changes of velocity. I would have to store last frame velocity and that is wasting of memory, because i am able (*will be able in next version) to set velocity and forces directly using internal bullet functions.
Quote:

Originally Posted by Emp` (Post 1650061)
Does an entity's movetype also affect its movement? I.e. would an entity with MOVETYPE_FLY float in the air?

Nope, why would you hook an entity you want to be floating to an physics engine anyway?
Quote:

Originally Posted by Emp` (Post 1650061)
Does the entity's gravity affect anything?

Nope. I'm going to use origin, angles, velocity, avelocity and gravity to create bullet objects. (In current version only origin of entity is used)
Quote:

Originally Posted by Emp` (Post 1650061)
A feature that I think would be interesting, would be able to do something like Weapon Physics for the entities.

I don't get it, could you be more specific? What feature would be interesting?

joropito 02-14-2012 10:32

Re: Module: BMOD - Extended Physics Module
 
Player push will be great when collision occurs. It should be done taking into consideration the objects and players weight.

Exolent[jNr] 02-14-2012 10:49

Re: Module: BMOD - Extended Physics Module
 
Quote:

Originally Posted by Backup (Post 1650335)
Nope, why would you hook an entity you want to be floating to an physics engine anyway?

So, you're saying that if an entity doesn't have gravity, it shouldn't need better physics?
What about something like ricochet where discs fly around and push players? I think that would be a good purpose for such feature.

Quote:

Originally Posted by Backup (Post 1650335)
I don't get it, could you be more specific? What feature would be interesting?

Grenade explosions and bullets pushing entities, since it seems you have the bounce feature already made.

TheSpectator 02-15-2012 02:14

Re: Module: BMOD - Extended Physics Module
 
Just awesome!

mabaclu 02-15-2012 17:48

Re: Module: BMOD - Extended Physics Module
 
Quote:

Originally Posted by joropito (Post 1650342)
Player push will be great when collision occurs. It should be done taking into consideration the objects and players weight.

There could be a function called set_object_weight that would change the weight of an object. Then Bmod would calculate the acceleration using the formula: Force = mass x acceleration


All times are GMT -4. The time now is 09:45.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.