Jump to content


Jesper

Member Since 28 Jul 2005
Offline Last Active Jan 04 2012 01:04 AM

Topics I've Started

3d Game Techniques

13 September 2008 - 11:31 PM

Hey everyone,

When I browse the forums and look at what new there is in 3D Game Techinques, the name 3D Game Techniques always catches my attention. It gives me the impression that I am visiting a forum in which expert Game Maker users discuss the use of D3D in Game Maker. But instead of that, I see topics about how to start 3D mode, how to draw a floor, how to create a 3D MMORPG without making any effort, and so forth.

What I also see, is a bunch of closed topics. And in most cases of closed topics, I think it's good. But in some cases, I don't think it is, because some topics were actually topics about discussing 3D Game Techniques. It is currently not possible on the GMC to discuss GM 3D techniques unless you reply in a topic which is about the same but in the form of a question.

The 3D Game Techniques forum is a questions forum. You might think from the name it isn't but it is. As stated in the rules for the 3D Game Techniques forum:

This forum is for questions regarding GM's 3D capability.

So why is there no place to actually discuss 3D game techniques?

Ever since 3D was introduced in Game Maker, there has never been a real place for advanced people in making 3D games with GM to actually discuss 3D game techniques. The only place there is for those people is a forum filled with topics that ask the same questions over and over again (excluded some topics that actually did contain advanced questions). I know Game Maker was not created for 3D games, but the possibility to create 3D games it there, and people are willing to push 3D in Game Maker to it's limits. Those people are just slowed down because there is no place on the GMC where they can actually discuss 3D game techniques with other people. The Expert Users forum is not the place to discuss these things, because 2D and 3D in Game Maker are two totally different things, and also as we have by far not yet discovered for 3D what we have discovered for 2D in Game Maker.

A few months ago, this question was already asked in the changes to the expert users forum topic by l4nt0m:

Eventhough I'm not that much an actively posting member, I do like this set up, makes topic of a higher level and so also more interesting to read. I have a question/request though: is it possible to have something like this for the 3d forum too, or will this expert forum now also be for discussion on expert d3d topics?

but it received no response (nor from a GMC member neither from a GMC staff member).

Because several people have asked me to post examples of such topics, here are 2 examples (I agree, they are not the best examples of what I mean, but I couldn't go through all topics in the 3D Game Techniques forum to find the best because of the date-cutoff function, so I had to use the search engine to search for common terms).

Here is a topic which lies between a question and a discussion. It could very easily have (and would have if it wasn't closed) turned out to be a great topic where people would discuss techniques to have shadows wrapping around models in the most efficient way for Game Maker. But it was closed less than a day after it's creation.

Second is a topic about creating professional animated 3D characters (link). Again, not the best example I could wish, but it is a topic that is for discussing techniques to most efficiently create model animations in Game Maker. As the previous example I gave, this could also turn out to be a great discussion between GMC members giving possibly great results.

Please share your thoughts about this matter, and thanks for reading,

Jesper

G3d 3d Effects Database

12 August 2008 - 08:36 PM

G3D 3D Effects Library
http://www.g3d.uni.cc

Posted Image


We need more effects! Please upload anything you got. If it'd help, would you like us to create a new database for examples?


We are proud to announce that after a lot of hard work a website has been made in response to the ever expanding list of D3D effects at the GMC. Here at G3D, we provide hosting for all of these Game Maker made effects and more. G3D offers you the ability to rate and comment each other’s effects as well as your own dedicated page with commenting.

First and foremost you should start by registering to get the most out of G3D. You can do so by going to www.g3d.uni.cc and clicking on the “Register” button. When you've registered, we encourage you to ahead and post any 3D effects you've made with Game Maker to extend the database even further.

Once registered, you can also visit our forums to discuss suggestions for effects and the website, as well as discussing work in progress effects.

We will be trying our best to improve this site as time goes on.


We hope you enjoy your stay,

Jesper & Edge

G3d Villa Effects

04 July 2008 - 10:06 AM

G3D Villa Effects



Description:
This example shows that you can actually acheive rather nice things in 3D with Game Maker. It might not be perfect, but it does show what can be done in 3D with Game Maker. For example:
- Static shadows
- 3D Particle Effects
- Realistic environments
- Lighting

It is still in progress, so expect updates every now and then, I might even complete this someday.

And if you wonder why it's called villa effects: it started out as a villa, but then I added more. Great isn't it...

Screenshots:
Posted ImagePosted ImagePosted ImageScreenshot 4


Download:
YoYoGames
Host-A

Controls:
WASD - Move
Left Mouse Button - Shoot
F - Enable/Disable Flashlight



Well, I hope you all can enjoy this example,

Regards,

Jesper

Reduce Gm 3d Model File Size

06 June 2008 - 10:33 PM

Reduce GM 3D Model File Size




Description:
With this easy to use utitlity you can decrease the filesize of your model in a matter of seconds. It will decrease the number of decimals to either 0, 1, 2, 3 or 4, from your choice. It's not complicated, just a simple tool to reduce the file size of your GM models.

Just load the model, set the number of decimals you want in the file for each coordinate/normal/color/alpha/texcoord, set the save filepath and press the "Save" button. It's as quick as that.

This can easily reduce your model's file size to half of the original size, containing the original quality.

Screenshots:
Posted Image
Posted Image

Download:
Host-A Hosting
YoYoGames
64Digits

Compare:
View the difference between the original and the new file here.

Next version:
I'm planning on creating a new version of this tool shortly. The new tool would remove all unnecassary 0's after the decimal tot from a model. You know what? I'm gonna start right away.

I hope you can use this utility for your projecs,

regards,

Jesper



Please read:

Hi everyone,

For the next version of Reduce GM Model File Size, of which I have completed 75% of the coding, I'd like a new and nicer GUI. If you're interested in making one for me, please contact me :D.

Thanks in advance,

Jesper


Solving Alpha Issues

27 March 2008 - 07:33 PM

Solving alpha problems


Since I first came here, I've seen an enourmous amount of topics related to alpha problems. Therefor, I'm now posting this here that should explain everything to you about how to use alpha values when in 3d mode and overcome any problems related to that.


What are alpha values?
The alpha value determines the transperency of something. The value ranges from 0 to 1, where 0 would be totally transparent and 1 would be not transparent at all. The transparency means to what extent you can see through something.

How is the alpha value set in Game Maker?
The alpha value in Game Maker can be set by using the function draw_set_alpha(alpha), where the alpha argument determines the value you want to set the alpha value to. When you want to get the current alpha value, you can use draw_get_alpha(), which will return the current alpha value.

What is the problem with using alpha values in 3D?
When you do things right, there actually isn't any problem with them. But when you don't, things can look messed up. In 2D, the order in which everything with an alpha value larger than 0 and smaller than 1 is automatically set the right way by Game Maker. In 3D, however, it isn't. Now this can have it's advantages (which I will explain later), but it also carries it's disadvantages. The main problem people new at 3D face, is that their partially transparent models aren't drawn in the right order, which causes some pretty weird things sometimes. The best way I can explain what happens, is by showing you some images.
Posted Image
In this image, I've drawn 2 walls in mid-air with an alpha value of 1. I'm looking at them from the left side.
Posted Image
In this image, I've drawn 2 walls in mid-air with an alpha value of 0.5. I'm looking at them from the left side.
Posted Image
In this image, I've drawn 2 walls in mid-air with an alpha value of 0.5. I'm looking at them from the right side.

In the first image, there is no transperence, and therefor there are of course also no transperncy issues.
In the second image, there aren't any transparency issues either, but in the third one there are, while the third one is excactly the same setting as the second one, except that we're viewing the scene from another direction. Now, why are there transparency issues one time, and the other time there aren't?
It's not because of which side we're looking from, it's because of the order in which the walls are drawn. In this case, the red wall is drawn before the blue one. Now when the red wall's transparency is handled, it's texture actually changes. The texture changes to the view of what's behind the red wall, overlapped by a transparent red wall. The same is for the blue wall, except that it is in that case overlapped by a transparent blue wall.
Now when we're watching from the right side, the red wall's transparency stuff is still calculated before that happens for the blue one. So when the red wall determines it's new texture, the blue wall isn't drawn yet. That causes the red wall to change it's texture to a view of the scene without the blue wall as a transparent wall in fron of the red one. So then, when everything is drawn, the blue wall is behind the red one so that will be drawn first. Then the red one will be drawn, but it's texture doesn't involve the blue wall.
That's why you don't see the blue wall through the red one in the third image.
How can we solve this issue?
As we want to take every transparent object within our final render, the order in which everything should be drawn should be the following. The closer it is to the camera, the later it is drawn.
To solve the issue, we first have to determine what decides what is drawn first. What determines that, is the depth value. The depth value can be determined in the basic object window, but can also be set in code by using “depth=<value>”. Now the lower the depth, the later the object is drawn.
As the closer the object is to the camera, the later it should be drawn, the depth should also get lower when the object is closer to the camera. So we want to depth to depend on the distance from the object to the camera. We would set the depth like this in the step event (calling the following script for every object that has something transparent drawn in the draw event):

depth=-point_distance(x,y,obj_camera.x,obj_camera.y)


As lots of people also use GUI's by using an orthograpic projection which should be drawn on top of everything, which requires the lowest depth of everything, we don't want the depth of the object to get lower than the GUI object's depth. Therefor we could just divide it by a number, for example 8. The script would be:

depth=-point_distance(x,y,obj_camera.x,obj_camera.y)/8


Now we also want it to apply in 3D too, so we should use a d3d_point_distance() script (which Game Maker doesn't natively include). So we will make one ourselves:

{
// d3d_point_distance(x1,y1,z1,x2,y2,z2)

var tmp_x1,tmp_y1,tmp_z1,tmp_x2,tmp_y2,tmp_z2,tmp_retu
rn;

x1=argument0
y1=argument1
z1=argument2
x2=argument3
y2=argument4
z2=argument5

tmp_return=sqrt(sqr(tmp_x2-tmp_x1)+sqr(tmp_y2-tmp_y1)+sqr(tmp_z2-tmp_z1))

return(tmp_return)
}


The final script for calculating the depth would be

depth=-d3d_point_distance(x,y,z,obj_camera.x,obj_camera.y,obj_camera.z)/8


What's the good side of those alpha issues you talked about earlier?
The good part is, that when you use it right, you can show things that are behind other objects by setting the depth of the object that is closer to the camera higher than the other depths. Check this topic for more information and a download.


I hope this article/tutorial has made things clear for you, and feel free to ask your questions in this topic if you don't understand anything. And remember: objects closest to the camera should be drawn latest, and therefor have the lowest depth.



Regards,

Jesper