Just some questions
Moderator: Moderators
excellent, that example, does what I was referring to. the zlibrary it uses is a bit intense though.
I thought there might be a simpler method.
But new problems have arisen, in order to utilise the zlibrary in the relative example I had to upgrade my version of z game from 1.9.9 to 2.0.0 now the game that I was working on gives me tons of error messages agh!
it seems mostly conditions don't work.
for example this one no longer works
--------------------
return App.CollidedCategory==22;
----------------
changing it to this
-------------------------------------------------------
return CurrentModel.CollidedWith.ClassId==sharkfinmodel.ClassId;
-----------------------------------------------
seems to fix the problem but I have tons of collisions
in my game and its rather annoying changing them all.
also does this mean that collision categories no longer need to be defined on loaded (as in cat1 cat2 etc) AS i notice that the new collision code references models directly rather than categories.
I thought there might be a simpler method.
But new problems have arisen, in order to utilise the zlibrary in the relative example I had to upgrade my version of z game from 1.9.9 to 2.0.0 now the game that I was working on gives me tons of error messages agh!
it seems mostly conditions don't work.
for example this one no longer works
--------------------
return App.CollidedCategory==22;
----------------
changing it to this
-------------------------------------------------------
return CurrentModel.CollidedWith.ClassId==sharkfinmodel.ClassId;
-----------------------------------------------
seems to fix the problem but I have tons of collisions
in my game and its rather annoying changing them all.
also does this mean that collision categories no longer need to be defined on loaded (as in cat1 cat2 etc) AS i notice that the new collision code references models directly rather than categories.
It is very seldom that ZGE upgrades makes old code incompatible but in 2.0 the collision property was changed because the new properties were much more flexible.
You can click the "XML" icon that let's you make text edits to the whole project. This means you can make global search-and-replace (right-click in xml edit window) and this should make it easier to change your App.CollidedCategory-tests. Of course you can make the same kind of edits directly in your zgeproj-file if you have another text editor that you want to use. That's the benefit of using a standard text file for the whole project in ZGE.
What kind of game are you working on? Post a screen shot if you want, it's always fun to see new projects and it gives me incentive to further develop ZGE.
You can click the "XML" icon that let's you make text edits to the whole project. This means you can make global search-and-replace (right-click in xml edit window) and this should make it easier to change your App.CollidedCategory-tests. Of course you can make the same kind of edits directly in your zgeproj-file if you have another text editor that you want to use. That's the benefit of using a standard text file for the whole project in ZGE.
What kind of game are you working on? Post a screen shot if you want, it's always fun to see new projects and it gives me incentive to further develop ZGE.
I'm working on an adventure first person platform game. It's a bitVilleK wrote: What kind of game are you working on? Post a screen shot if you want, it's always fun to see new projects and it gives me incentive to further develop ZGE.
of a silly game, Im doing it mainly so that I learn lots about using z editor.
I've decided to try and finish it using version 1.9.9 of z game, it feels like there's too many corrections to make when converted to 2.0.0. For example; I managed to fix up all the code so that no errors would appear ( the XML icon is useful) however some of my models that used render transform were a little deformed, also the collision detection in my game seemed different.
------------------------edit-------------------------------------------------------
I have a new problem.
This relates to doing leaves for trees.
I made some leaves, which used models for each leaf.
They were made for use on palm trees with only a few leaves each.
They looked ok.
However after adding a couple of trees to my game I noticed it impacted on the fps.
So I decided to try something else.
I decided to use a couple of ball models
placed on top of the tree with a texture
that faded to transparent with it’s texture coordinates clamped.
To do this i imported a bitmap of a green
scribble that blurs to black around the edges and made it into a material texture.
I tested multiple trees using this method and there was
no severe impact on the fps.
now the problem im having is with the transparency of the leaves:
if the leaf material has z buffer selected on it's properties
then the leaves display however the mesh they use is also visible
and is filled with the applications background color.
if the leaf material has z buffer deselected then the leaves are only visible where they intersect the branches of the tree.
any ideas how to make only the texture visible and not the full mesh?
You shouldn't set this property directly, it is set automatically when you import an image if an alpha-channel is present. Note that JPEG-files does not have alpha channels so you need to create an PNG-file or BMP with alpha channel and import it again.
Another option is the set BitmapFromFile.Transparency to BlackColor and make sure the transparent parts in your bitmap are black (rgb 0).
If you don't want to bother with that at the moment you can try setting Blend to Color/OneMinusSourceColor to test the basic idea.
Another option is the set BitmapFromFile.Transparency to BlackColor and make sure the transparent parts in your bitmap are black (rgb 0).
If you don't want to bother with that at the moment you can try setting Blend to Color/OneMinusSourceColor to test the basic idea.
That is what I tried initially. The transparency itself works however it doesn't seem to display properly in-front of other models.VilleK wrote: Another option is the set BitmapFromFile.Transparency to BlackColor and make sure the transparent parts in your bitmap are black (rgb 0).
I can post an example if that would help.
Hi jinxtengu ~
Attached is a example ( press M to enable / disable alpha testing ).

K
That's because the rotation order was changed in version 2.0.jinxtengu wrote:however some of my models that used render transform were a little deformed
Sounds like a sorting problem. Since ZGE doesn't support sorting at polygon-level, you'll run into this problem when meshes intersect each other. The easiest solution is to use alpha testing instead of blending .. although that's not build-in either, so you have to make some OpenGL callsjinxtengu wrote:The transparency itself works however it doesn't seem to display properly in-front of other models.

A example / screenshot always helpsjinxtengu wrote:I can post an example if that would help.

K
- Attachments
-
- Alpha.zgeproj
- (6.15 KiB) Downloaded 613 times
the leaves work with the alpha testing 
yay!
thanks Kjell!
-------------------------------------------------------------
back to fades..
the method of fade transition used in the example doesn't seem to work with my game. Here's a link to an image of what happens:
http://www.imageupload.org/?d=16D88E191
there is no solid area of fade just a bunch of rounded rectangles that fade.
any idea why this happens? also got any suggestions for a different method of doing fades?

yay!
thanks Kjell!
-------------------------------------------------------------
back to fades..
the method of fade transition used in the example doesn't seem to work with my game. Here's a link to an image of what happens:
http://www.imageupload.org/?d=16D88E191
there is no solid area of fade just a bunch of rounded rectangles that fade.
any idea why this happens? also got any suggestions for a different method of doing fades?
you were right, i accidentally selected the wrong material.Kjell wrote:
Looks like you're not using the correct material ( as there seems to be a texture applied ), and you need to disable alpha-testing before rendering your fade mesh.
K
I notice if alpha-testing is enabled then the end and start of the transition isn't completely smooth, however if I disable it then the models visible behind the fade transition don't display correctly :\
Hi again,

K
You can enable / disable alpha-testing multiple times per frame. So, enable it before rendering your models, and disable it before rendering your fade. Attached is a examplejinxtengu wrote:I notice if alpha-testing is enabled then the end and start of the transition isn't completely smooth, however if I disable it then the models visible behind the fade transition don't display correctly :\

K
- Attachments
-
- Combined.zgeproj
- (2.85 KiB) Downloaded 557 times
I noticed that you can't use
----------------
glDisable(0xBC0);
----------------
on the "on render" property of
an app state.
anyway I tried implementing the method in the combine example.
This time not all the models
were impacted by the fade. For example trees, sky, and horizon faded but obstacles and model ground wasn't affected. Also I tested having the fade model spawned in different positions on the list of spawned models, this didn't seem to change things either although I was able to have even less models effected by the fade.
----------------
glDisable(0xBC0);
----------------
on the "on render" property of
an app state.
anyway I tried implementing the method in the combine example.
This time not all the models
were impacted by the fade. For example trees, sky, and horizon faded but obstacles and model ground wasn't affected. Also I tested having the fade model spawned in different positions on the list of spawned models, this didn't seem to change things either although I was able to have even less models effected by the fade.

Works just fine, proof is attached.jinxtengu wrote:I noticed that you can't use glDisable(0xBC0); on the "on render" property of an app state.
I suspect you've got depth-sorted enabled for some models ( even though you probably don't need it since you're using alpha-testing ). In case you do, enable depth-sorted for the Fade model as well, make sure it's spawned last and apply the camera position to the model instead of using RenderTransform.jinxtengu wrote:anyway I tried implementing the method in the combine example. This time not all the models were impacted by the fade.
K
- Attachments
-
- State.zgeproj
- (1.73 KiB) Downloaded 609 times
my game gives me an error message
if I run a zexpression in the on render property of an app state with :
---------------------------------
glDisable(0xBC0);
--------------------------------
it gives me
------------------------
error for node: zexpression
unknown function
----------------------------
I can see in the example it works. In my game it is exactly the same, in-fact I tried copying it directly from the example into the on render, of my game. It still gives me an error,
and the zlibrary it uses is correctly placed in the onloaded property of my game :/
also strangely the error doesn’t appear like most errors in the little window on the right of the screen, it only happens when the project is run.
to get around this I put the z expression in the on render of the fade model. It works when it's put there.
The render order was set to normal for all my models but I changed it for the fade model since you suggested that; to depth sorted.
After doing this, the fade works perfectly and all the models display
properly!
Update
-------------------------------------------------------
I just worked out why I was getting an error message.
the zlibrary for alpha test wasn't at the top of the tree for on loaded,
it was at the bottom. placing it at the top stopped the error.
if I run a zexpression in the on render property of an app state with :
---------------------------------
glDisable(0xBC0);
--------------------------------
it gives me
------------------------
error for node: zexpression
unknown function
----------------------------
I can see in the example it works. In my game it is exactly the same, in-fact I tried copying it directly from the example into the on render, of my game. It still gives me an error,
and the zlibrary it uses is correctly placed in the onloaded property of my game :/
also strangely the error doesn’t appear like most errors in the little window on the right of the screen, it only happens when the project is run.
to get around this I put the z expression in the on render of the fade model. It works when it's put there.
The render order was set to normal for all my models but I changed it for the fade model since you suggested that; to depth sorted.
After doing this, the fade works perfectly and all the models display
properly!
Update
-------------------------------------------------------
I just worked out why I was getting an error message.
the zlibrary for alpha test wasn't at the top of the tree for on loaded,
it was at the bottom. placing it at the top stopped the error.