Cubenemy : Android game

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

Moderator: Moderators

fracteed
Posts: 43
Joined: Wed Apr 30, 2014 1:14 am
Location: Sydney

Post by fracteed »

I only realised yesterday that it has been about 6 months since I have touched this, so I spent a day fixing up a few things so I can finally post a build. Of course I got lost in my code and had to find my way back, but isn't that always the way!

Have added a Windows build to my original post if anyone is interested in tryng it out. Feedback is always welcome. Keep in mind it was designed for a small touchscreen, so the models look kinda huge on a monitor. I will post an apk soon as I am interested to hear if it works ok on other Android hardware.

Currently there are only 10 levels, but I would like to add another 10 including a few boss levels. Then I want to add as a freebie on the GooglePlay store asap and move on to my more serious projects :)
Imerion
Posts: 200
Joined: Sun Feb 09, 2014 4:42 pm

Post by Imerion »

Soo true, if you leave code for too long, expect a long upkeep. :)

Anyway, I gave it a try. Those glow-effects look even more nice ingame than in screenshots, cool models, and overall the game has a very nice shiny look. Played well too, though I lost on the third level. :)

Would love to try it again on my tablet when your apk is ready!
fracteed
Posts: 43
Joined: Wed Apr 30, 2014 1:14 am
Location: Sydney

Post by fracteed »

Appreciate your positive feedback Imerion :) I am currently adding a further 10 levels and am up to level 15, which has the first boss enemy.

I will probably make some of the earlier levels a bit easier otherwise no-one will reach any of the higher levels. Trying to tread that line between too hard/ frustrating and too easy/boring. The early levels are randomly spawned but then there are repeated pattern levels after that with easy bonus levels every 5 levels to get your shield back to 100%.

Would love you to try out the apk. so I will post one later this week along with another exe.
fracteed
Posts: 43
Joined: Wed Apr 30, 2014 1:14 am
Location: Sydney

Post by fracteed »

I have finally found time to finish this off and work out how to create the apk file! Now there are 20 levels including a couple of boss levels, new music and a nicer learning curve. It should be easier to at least get past the first 10 levels in this version.

Just tap the left or right sie of the screen to move. No need to swipe the screen which is what I have seen other people do when I ask people to try it. Just think virtual on screen buttons. It also passed the "8 yo nephew test" with flying colours :)

I have attached an apk if anyone wants to try it out, as I have only tried it on one crappy Android tablet test so far. Would be good to know that it at least works smoothly on at least one other device before I put it up as a freebie on the Play Store. Works solidly at 30 fps on my tablet after I toned down the explosion and shrapnel.
Last edited by fracteed on Sun May 31, 2015 1:17 am, edited 1 time in total.
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 »

Hi fracteed, I tested cubenemy on both Nexus 10 and Nexus 7 and here are my comments:

1. Very nice graphics. What 3d editor you used to produce meshes? When using Wings3D or Blender, I always have problems with normals.

2. Level are much better than in previous versions.

3. The application icon is too small, because you used just res\drawable-ldpi. Try to add more icons in higher resolutions.

4. Even on such a good HW, all animations are very unsmooth (really "shaking"). E.g., when moving the rocket or it can be seen twice.

5. After the application lost focus, it produces very unpleasant sound.

6. After resuming from inactive, the game sometimes crashes.
Imerion
Posts: 200
Joined: Sun Feb 09, 2014 4:42 pm

Post by Imerion »

Awesome! Will give it a try once my tablet is charged. :)
fracteed
Posts: 43
Joined: Wed Apr 30, 2014 1:14 am
Location: Sydney

Post by fracteed »

Thank a lot for testing it out Rado1. Some replies to your comments:

1- Thanks!I used Blender and since I was going for a low poly faceted look, I used the edge split modifier on everything except the rocket which has some normals smoothing. Maybe this is why I had no problems with normals import as I either had all smoothed or all hard normals?

Another thing I realised towards the end, is that if I make several coloured materials on poly selections in Blender and export as 3ds. When I select "import vertex colors" in ZGE the colours are imported into ZGE even though I did not actually paint any vertex colours in Blender. I used this on the final boss character as I didn't need any texture map. Everything else has a basic color+AO baked map on it.

2- I kept tweaking it till it felt about right, and it can be hard to get that middle ground between stupidly hard and stupidly easy :)

3- I will respond to about this in my general discussion thread as it may benefit other users as well.

4- This reminded me that I am using a very old version of the beta from last year. I just downloaded the latest build (from Feb2015) and have changed from fixed/fps to free and now I get about 48fps on my tablet. Hopefully you get about 60fps on your good hardware...thanks for reminding me about this! The latest version seems much more optimised....maybe it is the new multithreading?

5- not sure about this as it doesn't happen on mine..

6- I haven't seen this issue either. Makes me realise how hard Android dev can be with all the variations in Hardware and OS versions...what OS version are you running?

I have attached an RCv2 to this post with free fps option on and fps meter. Would love if you can give feedback on this. I did notice that my highscore saving now seems screwed with this version of ZGE, even though I have not changed the code. Does this work for you?

@Imerion...any feedback on this version would be appreciated :)
Last edited by fracteed on Sun May 31, 2015 1:17 am, edited 1 time in total.
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 »

Hi fracteed, thanks for the explanation about meshes. How do you achieve ambient occlusion, by shader? I would be glad to achieve a nice look of objects as you do. Could you please share some example of your object(s) in simple ZGE project?

Here are my comments on cubenemy-rc2:

4. Performance is much, much better - everything goes smooth as on PC - 60fps.

5. Do you explicitly switch music off on loosing focus and starting it again when application got focus? You should.

6. I haven't observed this behavior on updated version. BTW I've tested ZGE applications on various devices and worked fine also on old devices with old OS versions. I'm using Android 5.1.1.

New comments:

7. I also observed that score is not being saved. How do you save it? I do not have file-related problems with my applications on Android.

8. After some time of playing I become crazy from music... In my Android games I always allow user to choose level for music and sound FX. In Karamball I also use rotating of several music files and allow users to use their own mp3 files to replace original soundtrack.

9. Starting always with level 1 is little bit frustrating. What about to allow user to continue with already achieved level?

Conclusion: I like cubenemy - simple, nice-looking and funny to play. Deserves to be published.
fracteed
Posts: 43
Joined: Wed Apr 30, 2014 1:14 am
Location: Sydney

Post by fracteed »

Rado1...thanks for taking the time to test this out!

No, nothing fancy as far as writing an AO shader, that would be way over my head. Just baked the AO in Blender to a map and multiplied it over the colour map. Then imported as a 512x512 map for each model in ZGE. If you PM me, I would be happy to send you some models, but I don't want to post them on a public forum, as I would never know where they could end up!

4- great to hear that it is smooth now. The new version of ZGE and non-fixed framerate was a good decision.

5- I have no idea how to go about doing this? I am using 4.1 kitkat and have never had this issue. Any advice?

7- The score saving on Android worked perfectly in the previous beta of ZGE, so something must have changed in ZGE. The weird thing is that it still works when I preview in Android, but when I build the apk, it now does that strange negative number display.

In ZGE I am just doing a simple read/write to a .txt file with binary encoding. I tried the char option but it doesn't work. The .txt file is read in the "On Loaded" function and is written to when a player gets a new high score. Any help would be appreciated here!

8- Yeah, the music was designed to be catchy/annoying in the classic arcade vein. Somewhat inspired by Galaga, where you just have music in between levels and on bonus stages. I usually would have a menu screen with level options but I wanted more of an arcade feel.

9- As noted above, I wanted the player to have to play all the way through from level1 ala 80's arcade game, rather than save points. Potentially annoying , but a design choice and it really is just a game about beating your previous high score.

Thanks for your optimism on the game. Just need to iron out the icons and high score and I am good to publish :)
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 »

fracteed, I tried AO baking as you described with Wings3D and Blender and works fine. BTW Blender gives better results.
fracteed wrote:5- I have no idea how to go about doing this? I am using 4.1 kitkat and have never had this issue. Any advice?

Code: Select all

<?xml version="1.0" encoding="iso-8859-1" ?>
<ZApplication Name="App" Caption="ZGameEditor application" EscapeToQuit="0">
  <OnUpdate>
    <Condition Comment="Android?" Expression="return ANDROID;">
      <OnTrue>
        <KeyPress Comment="Back" CharCode="253">
          <OnPressed>
            <ZExpression Expression="// handle the back button in the case ZApplication.EscapeToQuit is switched off"/>
          </OnPressed>
        </KeyPress>
        <KeyPress Comment="Lost focus" CharCode="255">
          <OnPressed>
            <ZExpression Expression="// switch music off"/>
          </OnPressed>
        </KeyPress>
        <KeyPress Comment="Resume" CharCode="254">
          <OnPressed>
            <ZExpression Expression="// switch music on"/>
          </OnPressed>
        </KeyPress>
      </OnTrue>
    </Condition>
  </OnUpdate>
</ZApplication>
fracteed wrote:7- The score saving ...
Hmmm... I tried to recompile Karamball with the latest ZGE beta and saving/loading files works without problems... If you just send me a code snippet which is not working for you I could have a look at it. BTW I see always score 0, not a negative number.
fracteed
Posts: 43
Joined: Wed Apr 30, 2014 1:14 am
Location: Sydney

Post by fracteed »

thank for the code snippet. I will probably leave this off for the moment, as I can't replicate your issue. I may have to go and buy another cheap tablet for reference.

My main concern is the lack of highscore saving. I just tried opening up my project file in the older build of ZGE 3.1b that I developed the whole game with and the file won't open now that I made a few changes in the latest build. I get the error message:

"TZXmlReader:Bad property ref high_score"

This is refering to me global variable for the high score. Now I am stuck on the latest version with this issue. Something must have changed with variables or saving between these builds or some sort of bug? It works when I preview on the tablet, but not when I build the apk.

So the zdat file works but not the apk. Is there some difference in the way they write/read to the txt file? Has any code changed pertaining to this in the last 9 months or so?

I am just saving a global variable(a float) to the high_score.txt file in "binary" mode.

This is the code on my "save component"

Code: Select all

<Group Name="Save">
  <Children>
    <File Name="score_file" Comment="Imported from score.txt" FileName="score.txt" Encoding="1">
      <OnRead>
        <FileMoveData Name="read" Property="high_score"/>
      </OnRead>
      <OnWrite>
        <FileMoveData Name="write" Property="high_score"/>
      </OnWrite>
    </File>
  </Children>
</Group> <!-- Save -->
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

That should work. Can you please show us the declaration of variable "high_score"?
fracteed
Posts: 43
Joined: Wed Apr 30, 2014 1:14 am
Location: Sydney

Post by fracteed »

Thanks for your interest Ville. It is very peculiar as ever since I started using the latest build(keep in mind I had been using a very old 3.1b build before this), the zdat Android build and the Windows build both load/save correctly but the apk does not. Now I can't load my project back into the older ZGE build as I get that error message.

The declaration of the variable(float) and reading the txt file in "OnLoaded" :

<Variable Name="high_score"/>
<FileAction File="score_file"/>

Let me know if there is anything else I can supply to track down this issue. I would be happy to send you the project file if that helps.
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

It could be something with insufficient privileges for write access on Android, we had problems with that earlier. Which Android version do you have selected in the Build APK dialog? Rado1, do you remember what was necessary to get write privileges on Android?
User avatar
Rado1
Posts: 775
Joined: Wed May 05, 2010 12:16 pm

Post by Rado1 »

cubenemy apk uses android.permission.WRITE_EXTERNAL_STORAGE permission and minSdkVersion is probably 8. Am I right? If so, I do not see any problem here. fracteed, if you send me your building directory (or at least AndroidManifest.xml) I could have a look at it and try compile with different versions of Android SDK... for instance from API level 19 this permission is not needed to write to application's own directories.
Post Reply