Im sorry KoG but you are not helpping out correctly. Allow me to assist on this properly.
A collision system, how I could do?
There are multiple methods to accomplish a few algorithms on 3D collision. Understanding GM's potential, its better to go for the most efficient technique. As KoG stated earlier, sprite collision would be the most basic and reliable method on GM. However, sprite collision would apply for the x and y coordinates but NOT z. For that, you need to create your own constant or variable to specify a local z value for a specific object or entity. Then you would have to check if both top z and/or bottom is within a range from any of the collided entities' z value. For example:
Code:
if (z1 < other.z2 && z1 >= other.z1)
or (z2 < other.z2 && z2 >= other.z1)
{
// Do action
}
Also, avoid using the default collision event. GM's collision comes with a built in trigger that is automatically executed once you call the event. This trigger causes the entity to become solid and hault motion sometimes. This can lead to future bugs along the way and can be a pain in the head to resolve. For checking collisions, is recommended to use step event and this function:
Code:
place_meeting(x,y,object)
3D collision is one of the most complexive and challenging processes to establish in a game so take that note in mind.
From engine to engine x,y,z dif, so in 2d I know Y is the height and X is the width, so here who what does?
Depending on what perspective.
Normally in hud, xy can be width and z is height but in a projection view, its pretty much the same, x is x, y is y, and z is z.
However, when drawing a projection, you are viewing the world sideways so that z is the height. With some algorithms on tweaking the z rotation, you will be able to change that perspective. Is recommended to use lengthdir functions to establish the rotation of the projection. Since there is no lengthdir_z, you can still use lengthdir_x for that but requires to synchronize the length argument for the other lengthdir commands from x and y.
I want a method to check if the mouse is on the object, I find a way on the youtube, but that is a little bit tricky and I see a potential bug in it(the trick with draw model colour) also if I make that object on more drawing things to detect them.
I know three techniques that can work:
1. Using a 2D to 3D conversion script to convert the mouse coordinates so it can also specify depth as well (xyz). I rember one script back at the old gmc by "yourself" I dont remember.
2. Ray casting. Although this method seems complicated to establish, its the most used method by many game developers and most reliable. Calculating the direction, and length within projection view, you can trace out a depth and capture what entity has that trace pointed or meet up.
3. Color surface technique (which is the easiest method yet average). I use this technique myself most of the time since im lazy. What you do is create a surface image of the projection screen but using a shader that turns your view into color coding instead. Then by using surface_getpixel, i can retrieve a specific color id, which represents a specific entity on the screen. I use shaders now sinve it can help me determine at least the depth value as well. However, this is an average technique that costs your performance on pc.
Check terrain collisions..., who I can detectect my terain y, z or x (what coord def the up and down)
There a few ways to do this. What I usually do is create several variable arrays during the terrain creation process that determines the z hieght of each vertex. Then I create a script that checks for my xy position within the closest triabular boundary around me and with an algorithm for detecting the z height base on three vertices, i set that as a separate z value for my object.
and play sound volume ( how I can set the volume of that)
I remember in the old game maker legacy had a function for that but with gm studio, there is the new sound engine that comes with new functions. You can change the volume base on distance from projection view. That would be my idea. I really never worked with sounds in my projects to be honest so my knowledge isnt much there.
Ok so I hope most of that helpped you and if you need any help, check out in the programming subforum for a thread about game maker mentors. We have people who can help you out on the 3d creation process as well. Feel free to ask questions also whenever you are stuck. We are here to help always. I wish you luck with Game Maker