Share My Creation AFV: Hail of Gunfire

Yup that's what I'm calling it:
https://play.google.com/store/apps/details?id=afv.seu

2qef7GJkltHEmIMw1SiYdXzgf7m3WibN0M3cuS0U4wmSW1pGknNrrEF5JbWFGD7QrbQ=w705


F5WO9qoQ6idi-7l4KRL07b1jww1z60ZLJzl0kElkZst5IG8hGsnmj3k2Wohow0PN5nBb=h230
 

Attachments

  • iconframeb4a.png
    iconframeb4a.png
    29 KB · Views: 4,457
Last edited:

capisx

Member
Licensed User
Longtime User
Nice latch, good graphic. Run smooth on my Lenovo A800 (ICS, 4.5inch screen), but sluggish on my G-Tab 7" P1000 (Gingerbread). I've found some bug:

When i'm exit your game via back button or menu button and then enter your game again, i've got black screen with a voice and clink sound (rockets number increased when play it again after force close). That bug is also occurred when i turn off/on the screen. i have to force close your game to make it normal again

Anyway 5star from me :)
 

latch

Active Member
Licensed User
Longtime User
Looks really great! Well done. 5 stars...

Can you share some technical details on this app?

It took 18 days to write and you can see the progress this thread:
http://www.b4x.com/forum/test-my-app/28414-gameview.html
I stated using gameview and moved over to Informatix's ASL lib. Both of those beat coding opengl by hand(which I did last year at this time- the code was ugly and I really had to keep my head straight)

Anyway the ASL version works even on Gingerbread. It looks too cramped on a small phone to be able to play. The most recent version I uploaded has small screens not supported in the manifest and that removed 208 devices. We'll see if I have to remove more.


every surface draw event(timer1.interval=40) the game draws 256 blocks, a 2048x2048 background, up to 200 bullets, up to 50 foes, up to 50 rockets, shadows for all players, and controls and displays. Menus are draw on canvas/pnls with transparency and visible=false when I don't need them.

In app purchases work like a charm!

I had modeled all the graphic assets in Blender last year so I already had them ready and I taught this app to read my FlaTank data file so I merely imported 136 levels into this game. Those levels were designed with a maze editor I wrote in VB last year.
You can see some of the Blender stuff including stuff in this game I was doing here:
Blender Render Compilation - YouTube
The walking dude is the little guys in the game- I gave him a backpack, a gun, and some color.

Nice latch, good graphic. Run smooth on my Lenovo A800 (ICS, 4.5inch screen), but sluggish on my G-Tab 7" P1000 (Gingerbread). I've found some bug:

When i'm exit your game via back button or menu button and then enter your game again, i've got black screen with a voice and clink sound (rockets number increased when play it again after force close). That bug is also occurred when i turn off/on the screen. i have to force close your game to make it normal again


Anyway 5star from me :)

I have yet to do something with the Android buttons- I think I will do that tonight when I add a couple new enemies I have planned.

I know I need to make a video that shows game play when you have most the power ups because you don't see much power and it feels sluggish until you upgrade. When it's most powerful, bullets and rockets pour out like water and you can run circles around the foes.

This is necessary later in the game because the supertanks that debut in level 66 take 200 rounds to destroy.

Gonna work on that file size too- most of it is my 'music.' The actual apk without it is less than 2 megs.
 
Last edited:

Informatix

Expert
Licensed User
Longtime User
Both of those beat coding opengl by hand(which I did last year at this time- the code was ugly and I really had to keep my head straight)

OpenGL is faster on devices with Gingerbread because it benefits from the hardware acceleration (ASL cannot), and is also faster (but a lot less) on devices with a more recent OS when it is used at its best (but how many of us can use it at its best? Especially when you have not enough time or envy to dive into its complexity).
I benchmarked my library recently on different devices (from a crappy chinese tablet to a fast Nexus 7) and performance are better than or similar to what you can achieve when you don't master OpenGL. To give an example, ASL is faster than SpriteBatcher. On my Nexus 7, ASL is almost two times faster.

every surface draw event(timer1.interval=40) the game draws 256 blocks, a 2048x2048 background, up to 200 bullets, up to 50 foes, up to 50 rockets, shadows for all players, and controls and displays. Menus are draw on canvas/pnls with transparency and visible=false when I don't need them.

Why do you set the interval to 40?
 

latch

Active Member
Licensed User
Longtime User
Why do you set the interval to 40?

When I started to write it, I wasn't sure how well it would perform so I set it high knowing I could get a little speed increase by decreasing the interval.

On my first game, FlaTank, the interval is set at 22 for the android market but to get good performance when I ported it to Blackberry I had to drop the interval down to 5.

Anyways, on my testing device(galaxy tab 2) it runs pretty good at 40, but a little slow on my phone(htc 4g) so I may have to add a bit of code that will adjust the interval as needed.

It doesn't seem like my calculations are loading down the cpu(s) very much though. I do some things to make it easier for the cpu- like avoiding division and too many nested loops etc. My phone lags a bit more since I added the 'music' it must be having some issue with the memory and it's throughput. I guess.
 

Informatix

Expert
Licensed User
Longtime User
When I started to write it, I wasn't sure how well it would perform so I set it high knowing I could get a little speed increase by decreasing the interval.

This interval should not be used to regulate the pace of your game. Why? Because:
1) Another task in the background may eat some CPU time (your email reader for example or the Google Play app installing an update in auto mode) and slow down the device;
2) Some slow devices (like a Galaxy Tab P1000) cannot deliver the pace you asked (in your case, 40 should not be a problem, but keep this fact in mind).
In both situations, the pace of your game is going to fluctuate, from quick to slow, depending on external factors. That can be irritating on devices with a slow CPU, and the experience will be very different among users.
Another reason to not set the interval as you did is the VSync. Each device runs its screen at a certain frequency and the closer you are to this frequency, the better and smoother will be the display. On most Android devices, the synchronization (VSync) between software and hardware is done at 16ms (62 FPS). That's why you should always set the interval to this value. Of course, you will get that interval only on fast devices, or devices with recent OS (the hardware acceleration helps a lot). But it's not really a problem on slow devices. Why? Because you should not use this interval to pace your game. The solution is to use a speed value and computes each move by dividing this speed by the elapsed time between two frames. Look at the two mini-games included with ASL. They use this technique. If you run them on different devices, you'll see no difference and what happens in the background will not have a significant effect on the game.
Things are more complex when you start to use a physics engine and there's still a drawback called the tunnel effect (see this other post), but it's already a good basis.
 

latch

Active Member
Licensed User
Longtime User
Small bug: the text that shows in the window when you finish the level is not scaled correctly. On Galaxy Nexus it is much too large. Make sure that you are not using 'dip' for the text size.

No I'm using this:
B4X:
Dim scale As Float
   scale=100/100dip
   If msgtime>0 Then ac.DrawText(msg,w/2,50,Typeface.DEFAULT,50*scale,Colors.white,"CENTER")

yup- I forgot to apply the scale variable to that function. Thank you!
 
Last edited:

latch

Active Member
Licensed User
Longtime User
WOW this is really 5 stars, did you make everything with B4A?

Thank you! I'm very happy with it too- in fact I'm going to skin this game a couple times to milk the code.

All code is written in B4A and all graphics were modeled in Blender and background was made in Gimp. Sound effects came from a variety of places and were edited in Audacity.
 

Informatix

Expert
Licensed User
Longtime User
I played your game on my phone and, IMHO, it suffers from two majors flaws that make it almost unplayable:
1) Often I can't see where I'm going and what's ahead of me. As I'm really bad at blind fighting, it's fatal. Usually, in this kind of game, the camera is still and the map moves around the vehicle or the camera moves but looks to the direction pointed by the turret.
2) The controls are difficult to master so the first level/map should be a lot easier. It's not a problem with the touchpads, it's just that you should let some time to the player to become familiar with them.
I don't think that a casual player will have fun being killed quickly because he doesn't see the enemy coming and has troubles to move correctly the vehicle and position the turret in the right direction.

Is the game made with Accelerated Surface?
 

latch

Active Member
Licensed User
Longtime User
Thank you for your input!
1) I haven't got much compliant about the way the cam moves since I narrowed the window, but on phone, I can see where that would be a problem. Although it can be played on a phone in pinch, I designed it for tablet.
2) This I get a lot of comments about. Stubbornly, I stick to my guns on this one(I know to the detriment of the overall popularity of the game) as when I conceived the game, the controls were precisely in my mind the way they were implemented. In fact, I wrote the whole game around those controls. I agree I could ease the player into them a bit and I will consider it. As the player get more power ups the game gets way funner. It doesn't bother me when gamers say it's too hard.

I think it's worth noting that Hail of Gunfire is my biggest money maker right now. Hail of Gunfire: Marine is merely milking that success.

Yes it is written with AC and I was so happy with it, I shot you some money for it a few months ago.
 

Informatix

Expert
Licensed User
Longtime User
Even if it's designed for a tablet, there's a problem with the camera. On a 7" tablet, go near a border and you'll be in the situation where you have plenty of space behind the vehicle and not a lot in front of it. That's great to see the enemy coming from behind, but it's a bit strange.

Did you try to port it to LibGDX?

I'm currently writing a tutorial about making games. Do you agree to read it (about 10 pages) before it is released?
 

latch

Active Member
Licensed User
Longtime User
I will consider your words! If an idea forms that I can quickly implement to make the camera more helpful to the player, I will do it

No I didn't convert it to libGDX- too many other things going right now- html5 games, a linux wm I'm working on, home life, and my day job!

Sure, I'll read it.
 
Top