OMEGANAUT

Post screenshots, binaries and projectfiles of the projects you have made with ZGE that you want to share!

Moderator: Moderators

User avatar
Ats
Posts: 713
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Post by Ats »

Cool, that was very helpful :P
By the way, I didn't know that you could spawn models using createModel(Blast); ...
That will simplify my code a lot!
User avatar
Kjell
Posts: 1911
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Hi Ats,
Ats wrote:By the way, I didn't know that you could spawn models using createModel(Blast); ...
That will simplify my code a lot!
You can also use "@SpawnModel(Model: Blast);" instead of "createModel(Blast);" if you want ;) It's basically the same thing ( createModel is a built-in function, while @SpawnModel calls the SpawnModel component ).

K
User avatar
Ats
Posts: 713
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Post by Ats »

Nice. Does that work with KeyPress too?
The F1 help file doesn't provide more than
Note: KeyPress can now also be used as a data type in ZExpressions, if you prefer.
It would be useful to avoid duplicating the same bit of code for keyboard and gamepad, but I can't do a thing using @KeyPress(Keys:"^8");
Since you're not talking about that in the Using KeyPress in ZExpression topic, I'm not sure if I can use it like that...
Last edited by Ats on Wed Nov 21, 2018 3:36 pm, edited 1 time in total.
User avatar
Kjell
Posts: 1911
Joined: Sat Feb 23, 2008 11:15 pm

Post by Kjell »

Hi Ats,
Ats wrote:Does that work with KeyPress too?
Not that i know of ..
Ats wrote:It would be useful to avoid duplicating the same bit of code for keyboard and gamepad
I usually use something like* the attached approach to combine keyboard and joystick input.

*Depends a bit on what input is needed and how it's used.

K
Attachments
JoyKey.zgeproj
(3.35 KiB) Downloaded 1078 times
User avatar
Ats
Posts: 713
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Re: This is not Starfox

Post by Ats »

So yeah, I was resurecting this game those last few days.
Now I have menus and everything's working on computer or Android. Everything but the explosions...

Here`s what it looks like on pc:
Image
BOOM!

And on Android:
Image

There is some kind of blue light on the background and models, and most of all, the particles are messed up.

Maybe that have to do with the model RenderOrder (Normal / DepthSorted) ?
Or the material Blend (None / Alpha/OneMinusSourceAlpha / Alpha/One / Color/OneMinusSourceColor / AlphaSaturate/One) ?
Or material ZBuffer (0 / 1) ?
Or is that a known bug that have nothing to do with me, such as described here:
viewtopic.php?f=3&t=1264&p=8179&hilit=s ... roid#p8173
Or here? viewtopic.php?f=3&t=1308&p=8467&hilit=a ... ency#p8467

What should I do?

(BTW Kjell, my rotating objects are mines, shrapnels and asteroids :D )
User avatar
Ats
Posts: 713
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Re: This is not Starfox

Post by Ats »

So after a bunch of tries, following the few advices that I found here and there, I managed to display the particles almost correctly on Android. They are drawn over everything, but at least they don't look like crap...
If only I could get rid of the blueish color in the background, there wouldn't be that black square effect around the explosions.
Image

So I checked the ZGE Android games I could find on Google Play.
Here's Saucer Invasion by JPH. Somehow, he managed to remove it. The black parts of the background are black. No problem with his particles.
Image

So did I miss a checkbox somewhere ?
I was also thinking of adding a background image instead of just having the black clear color. Maybe that should do the trick. But my spaceship also have the blue effect over it so I think it is some kind of weird ambiant light...
Maybe I have to add a camera instead of using App.Camera ?
User avatar
Ats
Posts: 713
Joined: Fri Sep 28, 2012 10:05 am
Contact:

OMEGANAUT

Post by Ats »

I've just released the first beta of my game for PC. I can't release the Android version yet with all the crap going on with the sprite's alpha...

The new name is OMEGANAUT !
I'll have to write a little backstory for the game. Arcade style.

Now I'm going to add new obstacles and ships with different behaviors and once I'll get enough, I'll work on the generative level design instead of spawning everything with complete randomness.

Your feedbacks are very welcome :wink:
Last edited by Ats on Sun Feb 13, 2022 6:25 pm, edited 3 times in total.
User avatar
Kjell
Posts: 1911
Joined: Sat Feb 23, 2008 11:15 pm

Re: OMEGANAUT

Post by Kjell »

Hi Ats,

I had a quick look at your game using a OpenGL debugger .. seems like there are quite a lot of texture swaps, you might want to look into that. In fact, you're using so few & little amount of texture data, i'd recommend bundling everything in a single texture. Aside from that, one of the ( particle? ) textures is rather unoptimized .. only 36 out of 256 pixels are non-zero, so ( in case you're using the entire texture coordinate space ) around 85% of the fill-rate is wasted.

Image

K
User avatar
Ats
Posts: 713
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Re: OMEGANAUT

Post by Ats »

Thanks Kjell, that's interesting. What OpenGL debugger program do you use?

I have only four textures in the game:
  • a bright circle for the stars
  • a blury circle for the smoke (that's the unoptimized one)
  • a square for the laser hit (that one is buggy, maybe I'm going to replace it by the stars one)
  • the digital font
Both circles are created using BitmapRect and BitmapBlur components. Is it better to trace a circle using a BitmapExpression?
But thanks for your image, now I understand how textures are used. So using a 16x16 for a 1 or 2 pixel star is a waste.
And using a 6x6 inside a 16x16 for the smoke is also a waste. I'm going to optimize that :lol:

So I'm calling those textures only when needed, on the onRender of their own models. Everything else is in the game covered with a FlatMaterial without texture. So I don't know why there would be that much texture swap? Unless particles are rendered between spaceships models?

Edit: Oh! And I had the wrong material/texture on the lasers...
User avatar
Kjell
Posts: 1911
Joined: Sat Feb 23, 2008 11:15 pm

Re: OMEGANAUT

Post by Kjell »

Hi Ats,
Ats wrote:What OpenGL debugger program do you use?
gDEBugger
Ats wrote:So using a 16x16 for a 1 or 2 pixel star is a waste.
Not necessarily .. it's about how you use that texture. For example, take the following texture ( 32x32 pixels of which only the middle 16x16 region is used ).

Image

If you use the entire texture on a sprite you end up with a lot of pixels that basically do nothing ( alpha blending disabled for demonstration purposes ).

Image

Whereas when you only use the middle 16x16 region ( by changing the texCoords ) that number is far lower ( you can scale the sprite down 0.5x to get the same result ).

Image

+ I just benchmarked this in ZGE by spawning a ton of models .. and the version with the exact same texture but zoomed texCoords on a smaller sprite literally runs 4 times faster even though they produce the exact same results.
Ats wrote:I don't know why there would be that much texture swap?
You control the order of how things get rendered .. ZGE doesn't do anything ( automagically ) in that regard.

K
User avatar
Ats
Posts: 713
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Re: OMEGANAUT

Post by Ats »

Thank you Kjell, that was very helpful :D

So I've optimized the textures: now I only have one 8x8 pixels circle (generated thanks to the example you provided here). The smoke explosions looks better, it works way better and I don't have the black void around the sprites on Android anymore. I think it came from the background starfield that was DepthSorted instead of Normal...

But even after trying all combinations of ZBuffer / DepthSorted / Rendering order, the sprites for the explosions are still rendered behind everything on Android. I believe it comes from here? viewtopic.php?f=3&t=1308&p=8467&hilit=a ... ency#p8467

So here's the new version: http://www.txori.com/data/documents/ome ... aut_pc.zip
And the dev log (in french): http://www.txori.com/forum/viewtopic.php?id=546

Now I only have to draw an icon, write some text and decipher the explanations of the new Google Play keystore for an Android release :lol:
User avatar
Ats
Posts: 713
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Re: OMEGANAUT

Post by Ats »

New version today with a screen to configure the keyboard or to invert the vertical axis (who does that anyway?), a lot of optimizations and everything is ready for the Android release. I just have to understand how the new Google Play App signing is working...

Omeganaut PC: http://www.txori.com/data/documents/ome ... aut_pc.zip

Next, I'll be working on sounds and savefile. I hope this example is working for PC AND Android :lol:
Last edited by Ats on Mon Jul 09, 2018 3:58 pm, edited 1 time in total.
User avatar
Ats
Posts: 713
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Re: OMEGANAUT

Post by Ats »

So savefile works like a charm on both devices. Though I don't know where my config.dat file might be hiding on Android.
I had to copy my parameters in a Setup array before saving, and the other way around for loading. It works, I hope that's how I should do it.

Anyway, here's Omeganaut for Android: https://play.google.com/store/apps/deta ... .omeganaut

The controls are quite experimental :
  • Use left thumb to go left
  • Use right thumb to go right
  • Use both thumbs to go up and down
Good luck !
User avatar
Ats
Posts: 713
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Re: OMEGANAUT

Post by Ats »

I just pushed a new version of Omeganaut for PC with a bunch of new things.
Here's the log: http://www.txori.com/forum/viewtopic.php?pid=9911#p9911
And it's still the same link to download the game: http://www.txori.com/data/documents/ome ... aut_pc.zip

Tomorrow I'll try to compile for linux, using the tutorial I wrote a few years ago. I hope I wrote that to be understandable... :lol:

Also I was wondering how should I do a background image... Maybe by drawing a 2D box? But since the clipping view is at 500 pixels, that would be a huge square. Maybe it is better to draw a smaller background using the Layer2d example. And what about the screen ratio?
User avatar
Kjell
Posts: 1911
Joined: Sat Feb 23, 2008 11:15 pm

Re: OMEGANAUT

Post by Kjell »

Hi Ats,
Ats wrote:Also I was wondering how should I do a background image... Maybe by drawing a 2D box? But since the clipping view is at 500 pixels, that would be a huge square.
The easiest solution is to simply draw your background using a Material with Z-Buffer disabled before anything else, then it will appear behind everything you render subsequently regardless of how far away it is. For example ..

Code: Select all

<?xml version="1.0" encoding="iso-8859-1" ?>
<ZApplication Name="App" Caption="ZGameEditor application" ViewportRatio="2" RenderOrder="1" FileVersion="2">
  <OnLoaded>
    <ZExpression>
      <Expression>
<![CDATA[//

for(int i=0; i<4; i++)
{
  Box.Position.X = random(0, 4);
  Box.Position.Y = random(0, 4);
  Box.Position.Z = random(0, 8);

  Box.Rotation.X = rnd();
  Box.Rotation.Y = rnd();

  Box.RotationVelocity.X = random(0, 0.125);
  Box.RotationVelocity.Y = random(0, 0.125);

  createModel(Box);
}]]>
      </Expression>
    </ZExpression>
  </OnLoaded>
  <OnRender>
    <UseMaterial Material="CorneriaMaterial"/>
    <RenderMesh Mesh="CorneriaMesh"/>
  </OnRender>
  <Content>
    <Mesh Name="CorneriaMesh">
      <Producers>
        <MeshBox Scale="5 5 1"/>
      </Producers>
    </Mesh>
    <Bitmap Name="CorneriaBitmap" Width="512" Height="512" Filter="1">
      <Producers>
        <BitmapFromFile DataWidth="512" DataHeight="512">
          <BitmapFile>
<![CDATA[78DAEDDD2B731B491706E0BFB170E107030303030D03050307060A060A1A0A061A060606FA277DB3EE55EFD1E99ED1C8D62DF2A37ACAA5CB68A6FB3DAA6AF55CE4BFBE7CFC0B00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000E014FE5E7D020000000000000000000000000000000000000000CEE47F5F3F03000000000000000000000000000000000017F661780000000000000000000000000000006EC4C76F5F0000000000000000000000000000801BF169BD0200000000000000000000006EDCE7EF5F0100000000000000803FD4C366000000000000EECC97C76F00000000DCB1D5E37700DEA1AF8F8F00BC43C3760BC03BF4EDC70F00DEA1F5D31300EF9019100000000000000000000000000000DCB7F5F6E98EDBFCEADE5D2C16F9CB5FFEF27FCB1BC785E3F2ED7BA7D6D65D72C9A6CB6207DF7E6CF7A75618573BD5C257F76561D7E42F7FF9CBFFA6F28FCD3BAA616943F199A336DA6D467972FBF4EBD8B1B2DBD4713DA3D4E6B61CE9BDE58DC77E98EBBB8E2D96FCE52F7FF95F3EFFB89599F1AB9B5EEDDAC122CE57A1B63936BEDBFD6E56EDE724AD39869F1A3CD585EE924BBA237FF9CB5FFEB79F7FBBF5F6BD532D2C4F3EBFDCEAABB1B3CBF3FFF9FBB9ACADBCBDAEA43CDF4DA61DB8DB11B6AE705C4F1B75DDE2F86A6A407C75AA58DDBEA4B7C85FFEF297FF6DE6DF5DBEDB8B944359AC865F4B90D26BB7183B959E8F09C4DC8A34B74AE14FA5D4CD36BDD4155FEDE639F3294D733DF9CB5FFEF2BF9DFC6BF7DBF1A876392550E28D393FF76EDD012BD531F528C6D596A06EA80CA0F193D0D634F6A8A617DB167B515EAACBC425EB02A97631A8FA52B78F69BAD7D64EFEF297BFFCAF927FDCAFD50E8871B02B6B2BB7F23045DD861F07E26EC26DBFBAD589CFC7FCE3305A57D5DD4A6C7CAA450AF9E0701CFB38F59DA4FD2630755049FEF297BFFCAF98FFD4E4AB96A676AADC29F9B7258B694CCDC5DAB1B55B82EE6A8BFA01688FCECF6495EE4F7D6788F9778B355582EEF1A9B40333BD94DE257FF9CB5FFE97CC7F26C66E1FE3F27186D54637351D8B6368BB9BAB3DEC923A5877F7D5EF006973719218B3EA0EB8074BD0AD66BCDF9E121077B8B58DEF9E9F267FF9CB5FFE97CFBF3D523C35692A4BC6DD6533D3AE6EFE71F4ECEEDA4ABBE3DAE94C9AB0742768DDB95577FE35559176BF5F77F9B6C1ED7CB6FDAAD3F648FEF297BFFCAF927F77FC4D73B158A3B4936AA1B4A1A95E77D73CF38149C59A0AAA5B82F92A84C6F4A772ED189D4E5A2BCF2CBC5C45FEF297BFFCAF927F3B7F99996ACD8F53F3D1CDE7DFAE3095238ED1ED2CB27B9CA57B6C254ECDEABBE6BF12B423EFFCCEC3DACDEE54B78D57FEF297BFFCAF927F3C19A93B292B1B7DD8FE2C0ECE56BA5578B9FF3C558234FF8AB3B9144277BC6BCF955DBE63AD8EB0690A39B3E72DADA77BBE59FD54CC5C8A2E7FF9CB5FFED7CD3FED768B752923480CBF6AC7E2D2AAF252B913179E394013334FF977939C3A39EAE07196927637BAB4FEA951B8FD863075CAF1D485EAED1DF9CB5FFEF2BF4AFE29FCF16F79B53E6C936FC5A6CE2CD62D413B0F9A39396A7EAFDD7CF229BAE547E4BB7B05DBF2A56EB633C4A98FBDFCE52F7FF95F31FFEE75134B927F857682D6EECE4AAD9AB9C46F4909627D0FAE6AC981A114FE541FBBC9B7179ECB5FFEF297FFB5F26FB778A6E427CA51FBF51CEEF74FEE3D78D2EC7C86F3D3AE8557E42D4F29FEA848DC23973A287FF9CB5FFE57C9FF2A99CF94607FB07BDE4DD69EA79A3D1F60F76CAB999CE747DEBAC051BD9B39F1201ECC92BFFCE52FFF0BE77F536237DB335AD3B83C7341449BEAD4F1FDEEEEBE7482569AD6BDAE5FB719B8FCE52F7FF9DF5E15F6AE6E0EBFF5B7F7647B3D457B647FEAE8F9D4295B533FC1F40705287FF9CB5FFE775085987C947E5E2FE53675A144EFF4E0E738EF8B4BB60774DE4FF8F297BFFCE57F1B85E85FEC36FF3BAEDD874B2E157FCF63AEFCE52F7FF9DFF2DEB94379FE7B103F1CC1790EFF33A2FF2F75D2C3773EE0CA5FFEF297FF8D4FCDE205D4E9DAB73053ABF3A9FEEFEFA5D9595940C2F2973FF2BFFD79D92EDB94FFAF99B3ADA64EE89DBF7810F9CB1FF9DFDA581C47E17048E5C0395AD296BFFC91FF7DEC978B13B178BC3EFCA39C7F884BFEF247FE777CD66EFA25BDF46380C85FFEC8FF2E77CAC59D6C0291BFFC913F00B4563B0FBBBFB7D32AF9CB5FFEF297FF05C2BF6EAF57AF2DC4AA31B3C0095BBBDDFDDD2EDBC4AAF750FEF297BFFCAF927FF75D672AC1FAC569C7E2D562C38BF988D6C734A6AC70BB33CC6E227DC359CD7E66E42F7FF9CBFF62F9D7F77647E793C4BEDE0D526D15D6AFAAC2541756FB21D497D6419BC67A5FDC684CA6DDDCB05F88755385D5FE2656F297BFFCE57F1BF90FB39B7E785B0962F2A31F3F7E3E3DFD1C6FE39DF92D1E2BF6A2C635ECBFB40963E53A4434EC1EAEC3AB69E5ABF077086F89CAFA37FBCD889F8A58FD617F55F297BFFCE57FF9FC4BC336FB2568C7E237265F6F63F267DD83B769CA1AC31FB75EFFAE9B4FE010DABC5E30E076C7DF4DB06ED61CE35D87B6C95FFEF297FFE5F3DF4CEB5661F5AAA3E40787F873ECE84B1B1AC31947FFD198FF68D3CB2A8D89EDF42D85B3C4A6E9FE7CECF297BFFCE57F99FCB7D3860525581D9349F710CCEA3C877B36FBDB2AE1975BA9422D441C37D7DB7F9FAC351A263EB4359F71B12525D884950C0BC297BFFCE52FFF0BE45FDBB00D5B4F2588B53836ABF680C8C2BD7CAB5394A0E63FDE7EBDDCDA1294FE6E5EBA5F6B544BD01D2EEB02E536F4A657537B3887FD55C95FFEF297FF55F28FC34D11DB5697D934C3F16A41ECE9C4A7B63D5353B9538DC8E5404FC9FFBF9FE00BA3F0EFDFBF53F76BF89B5EEC35A272AB052D2518F6DFB2D97F66B3BF4FB21BBEFCE52F7FF95F2CFF1A75FD1BA5B6A55178EA84D2F694A4EEFEBDCBEC8E1B6FB504BF77B7925B7D1873881FC21A784CBE84DFAEA1E4B3D98DE349BBAAB842F9CB5FFEF2BF7CFE75302AEBA9234B9CA4A4720CD3836C7B5AD7CC8EBE34F7D99CAD1CEB30231BFB380EC1B110A9B3E3332584D8F1748BC9C7FCCB701FBBD69DEBC5CFB9FCE52F7FF95F37FFBAC27AFF57B8C54D97F5B4A7BFA6939D36BDF95D778C4B874286539CFD35B347AE28258885A843EAF864DBEB987C37FCF644AC54DF54D0B245F9CB5FFEF2BF62FE7585ED6AD36CA5B6EA601FDBFD4B35E178F8A32D6B797E387315DA42D46ED67D74B104298452B8D29DF632BD7A503E06DB7E9853D1E52F7FF9CBFFF2F9C7ADD7FBE9BF18C45A2CE95DBBB7AA5C79515A558E80C4EEA40322651A580B51133B7915865D096A37CB9D322CCE845007DC87ED5C094A7FDB4F724D3BBE2A7FF9CB5FFE17CE3FADFC9FFF5CB07FD15C6DC092DFC4D8EC824A07A9EBFA5397DBAEA58323E39D7A5C7B385B096A93EAD78094DBF8649DAF956177EAEBC110EEA4E9673BE96B1390BFFCE52FFF8BE55F16FEEF1F96ED9F295AAAB0FC6791D2A1E7F1993A61297396218C7AF5F978A77B4BD7329CBC04F12CA9927F6D4C3C952BCEB986FDB41F66C7E23822A7E335F297BFFCE57FDDFCDFDE85998B26E2456A0FBD6BD3C6CED6EE97E9587DA6DC7938CFEEB8A1578234F81EECEFB15B69CF6493BFFCE52FFF3F37FF874317E875C34F1D8FF7BB83FE30FDB3A86F6F76D9749CFACD4C394FB2B9E13C6B96BFFCE52FFF53E5BF3ACF303DCC0E67C3FEB03593F970EA64EA3191331DF1198E6CB9FCE52F7FF95F2BFF63837DCBBBCED4BCE5DF1CE28EB80B6C57FEF297BFFCFFF4FCEF8958E42F7FE40F000000C01DF8FC080000BC179F360000C07BF1F13B0000F05E7C5803000000000077E7DB130000000000706F861F0000000000000000000000C0ADFBBA0500000000000000000000006EDDEA11000000000000000000000000000000000000000000000078AB2F1B0000000000000000000000000000000000000000000000E0AD1EBE0300000000000000000000000000000000000000000000000000000000000000000000C0FDFBBC060000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080EBFBF40D00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000EFB38000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000070091FBE02000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009CC4FF0134C57BC5]]>
          </BitmapFile>
        </BitmapFromFile>
      </Producers>
    </Bitmap>
    <Material Name="CorneriaMaterial" Shading="1" Light="0" ZBuffer="0">
      <Textures>
        <MaterialTexture Texture="CorneriaBitmap" TextureWrapMode="2" TexCoords="1"/>
      </Textures>
    </Material>
    <Model Name="Box">
      <OnRender>
        <UseMaterial Material="BoxMaterial"/>
        <RenderMesh Mesh="BoxMesh"/>
      </OnRender>
    </Model>
    <Mesh Name="BoxMesh">
      <Producers>
        <MeshBox/>
      </Producers>
    </Mesh>
    <Material Name="BoxMaterial" Shading="1"/>
  </Content>
</ZApplication>
K
Post Reply