Beta release 4.0b

Information and change log about the latest ZGameEditor release.

Moderator: Moderators

User avatar
rrTea
Posts: 475
Joined: Sat Feb 15, 2014 9:54 am

Doesn't detect errors

Post by rrTea »

To me this looks like it shouldn't compile, but it does (note the last line):

int sum;
for(int i=0; i<10; i++)
{if(i>=5)continue;
sum+=i;
}}}}}}Lorem Ipsum
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: Beta release 4.0b

Post by VilleK »

Indeed the compiler does not detect garbage if it comes last in the expression :). I should fix that.
User avatar
rrTea
Posts: 475
Joined: Sat Feb 15, 2014 9:54 am

Shouldn't compile?

Post by rrTea »

Maybe it doesn't matter if it's at the end, for example this also goes through (but nothing will be traced if you run it):

int inx,iny;
inx = 10;

} //mistake

inx += 2;
trace (intToStr(inx));

(I just found I posted something similar a long time ago:
viewtopic.php?p=8271#p8271)
User avatar
13r4nd0m
Posts: 3
Joined: Wed Jul 26, 2017 4:43 pm

Preview Window Malfunctioning

Post by 13r4nd0m »

While working with shader components, I noticed the preview window showing weird stuff. The program ran correctly (with f9). After closing the project and restarting the computer, the preview window seemed to function correctly until I changed the fragmentshadersource code.

I then started a new project testing out some mesh stuff, the problem came back but this time on clicking the preview play button this error was thrown: #Access violation at address 006323A4 in module 'ZGameEditor.exe'. Read of address 00000018.
Attachments
meshProb.zgeproj
(894 Bytes) Downloaded 702 times
fragsourceProb.zgeproj
(2.35 KiB) Downloaded 731 times
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: Beta release 4.0b

Post by VilleK »

Hi, the meshproblem error is because you need a "MaterialTexture" component to tie the Material and Bitmap together. I should add a test so it gives a better error message.

See modified project below.

The other project just shows a flashing image here. Not sure what the expected result is? Please compare with the sample zgeviz shader projects to get the basic view working.

Code: Select all

<?xml version="1.0" encoding="iso-8859-1" ?>
<ZApplication Name="App" Caption="ZGameEditor application" FileVersion="2">
  <OnLoaded>
    <SpawnModel Model="Model1" SpawnStyle="1"/>
  </OnLoaded>
  <Content>
    <Model Name="Model1">
      <OnRender>
        <UseMaterial Material="Material1"/>
        <RenderMesh Mesh="Mesh1"/>
      </OnRender>
    </Model>
    <Material Name="Material1">
      <Textures>
        <MaterialTexture Texture="Bitmap1"/>
      </Textures>
    </Material>
    <Mesh Name="Mesh1">
      <Producers>
        <MeshSphere RadialSamples="50"/>
        <MeshNoise Scale="0.3 1 1" NoiseSpeed="1 0 1" NoiseScale="1 1 1"/>
      </Producers>
    </Mesh>
    <Bitmap Name="Bitmap1">
      <Producers>
        <BitmapNoise Octaves="9" Persistence="0.77" ZHeight="42.08" Color="1"/>
        <BitmapPixels NOfPoints="43" Color="1"/>
      </Producers>
    </Bitmap>
  </Content>
</ZApplication>
User avatar
13r4nd0m
Posts: 3
Joined: Wed Jul 26, 2017 4:43 pm

Re: Beta release 4.0b

Post by 13r4nd0m »

Ok, that was my mistake on the meshproblem. Thanks for the clarification.

To replicate the shader preview bug in fragsourceprob:

Preview the project. Should be some random greyscale flashing with a black bar on the right.
Stop the preview.
Comment out lines 18 - 27 in Shader1 fragmentshadersource.
Uncomment line 16 in Shader1 fragmentshadersource.
Compile.
Preview the project. Preview window should show a gradient from white to black but instead shows black.
Run the project with f9 it displays correctly.
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: Beta release 4.0b

Post by VilleK »

Ok, I could reproduce that. It seems the Shader component needs the "UpdateVarsOnEachUse" property set. Try that and it should work.
User avatar
13r4nd0m
Posts: 3
Joined: Wed Jul 26, 2017 4:43 pm

Re: Beta release 4.0b

Post by 13r4nd0m »

Nice! Everything works as expected. Thanks for clearing that up, it helps a lot.
User avatar
rrTea
Posts: 475
Joined: Sat Feb 15, 2014 9:54 am

Re: Beta release 4.0b

Post by rrTea »

[quote="Rado1"][quote="rrTea"]Pressing "H" in the sound editor brings up Help instead of playing a note. Just a minor inconvenience.[/quote]
I cannot reproduce it on Win7. Do not have you somehow switched Alt on?[/quote]

I discovered how to trigger this: https://streamable.com/xbvpl
Again, just to confirm, this is without Alt. Same glitch does not happen when the window is detached. Sorry for the crappy recording, the lunch break will be over in a minute so this'll have to do ;)

Edit: doesn't always behave like this, no idea what does it depend on.
User avatar
rrTea
Posts: 475
Joined: Sat Feb 15, 2014 9:54 am

Re: Beta release 4.0b

Post by rrTea »

More about keyboard input leaking: https://streamable.com/lbw5l
shviller
Posts: 4
Joined: Tue Nov 10, 2009 4:47 pm

Re: Beta release 4.0b

Post by shviller »

[quote=rrTea post_id=8858 time=1543127745 user_id=221]
More about keyboard input leaking: https://streamable.com/lbw5l
[/quote]

Can confirm, I reproduced this.
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: Beta release 4.0b

Post by VilleK »

I can reproduce it now too after looking at that video. I will try to figure out what is wrong.
Post Reply