Developer diary

Launching android app on Windows/Linux/Mac

I just came across this reddit post today “You Can Now Run Android Apps on Chrome for Windows, Mac and Linux” and was quite intrigued

Basically it points to the chromeos-apk project on github ,  just load the provided extension on latest chrome version, load the sample/converted apk and that’s it, you have a running apk.

As I’m quite suspicious I tried to convert Alien Blitz, it’s more complicated than the sample, it uses open gl, loads library, and needs a more powerful device.

But conversion is very easy and everything seems to work !

capture_2014-09-19_19-26-23_0097_Extensions_Google_Chrome_

It’s quite surprising to be honest, it didn’t crash or anything (I was expecting a crash on startup), and speed is good. There seems to be some problem with touch events, it doesn’t always click at the right coordinates. And I can’t launch the full version of Alien Blitz (problem with Google Play Services, don’t know why, I’m not supposed to use that in the full version, and it works on the free one, nothing serious I guess)

But it’s promising, maybe in the near future we will be able to launch any Android app on our home computers, nice !

Read more

Alien Blitz 3d: camera placement, details

Camera placement

Camera position is mainly automatic in Alien Blitz 3d:

  • It follows a “virtual” point in front of the player (like in 2d)
  • It can be moved freely around the player using right mouse button
  • The camera will tilt left/right if you are on the left/right side of the map
  • The camera will zoom/unzoom depending on the size of the room player is in

And I’ve added a new tilt today, the camera will slowly tilt up (almost vertical) if there is a big wall in front of the camera blocking the view

capture_2014-09-16_22-15-53_0754_Alien_Blitz_ capture_2014-09-16_22-15-59_0415_Alien_Blitz_

 

Details

I’m mainly working on adding details here and there now, on episode 1 and the extra maps. I will make the video and screenshots using these maps, so other episodes will come later.

It’s a long work as I need to work with the smallest tool of the editor and just add blocks to get more details and something nicer.

capture_2014-09-16_22-04-35_0872_Level_editor_ capture_2014-09-16_22-04-47_0031_Level_editor_ capture_2014-09-16_22-05-59_0354_Level_editor_ capture_2014-09-16_22-19-55_0091_Level_editor_

I might work on that again tomorrow, and hopefully I should then be able to make the trailer for Steam Greenlight.

Read more

Alien Blitz 3d: enemy movements, video

Enemy movements

Currently in Alien Blitz enemy movements algorithm is quite easy:

  • A destination is looked far, depending on the monster state it might use a random position, look for the player, flee, or anything else
  • A path to the destination is built, can be a ray cast path (straight line) or A* path finding; the path is composed of all the positions the enemy must move to (every block), it just use 4 directions (no diagonal)
  • Every cycle/update if the movement path is not empty and the enemy is allowed to move (depends on speed) then a point is removed from the path and the enemy is “teleported” there if the point is still a valid destination.

It makes the enemy move in straight line, quite slowly, with robotic movements. I used a few tricks to allow quicker movements, but it’s just quick & dirty tricks.

A recent post on reddit was talking about that kind of things: http://www.reddit.com/r/gamedev/comments/2g6yv6/how_can_i_efficiently_remove_unnecessary_path/

So I’ve decided to try something like that. The first 2 points of the algorithm remain the same, but it changes afterward:

  • The enemy now has a “goal” destination, it will move in this direction according to its speed
  • If a path exists and the previous goal destination has been reached then a point is taken from the path. But this time it will not take the first available point, it will continue browsing the points available in path until it finds a point that is reachable and far enough. Some randomness is also used to just not always pick the farther point every time.

It makes movement more “natural” and now enemy can move in any direction (thanks to 3d it’s easy to just turn the model in the good direction) and all monsters have a slight increase in speed.

This new algorithm uses more cpu (as it needs to do a few raycast on every points to make sure actor can go there without touching a wall) but I don’t need to detail path for every small cubes anymore, so all in all it should be ok.

 

Video

Just a small webm video I made with the new enemy movements and the smoke effects.

I captured the above video using fraps and converting the video afterwards with VLC (it seems encoding messed up video total time), this is way too boring to do (as I need to use Windows for fraps)

I need to find a way to quickly make a webm screencast under Ubuntu, I tried Kazam, but it’s very slow, even if the game is at 60fps and I try to record 30fps, it will lag a lot, sometimes capturing at 5fps, sometimes at 30fps, quite boring.
The other boring thing is that I can’t get a webm video to be easily integrated with WordPress, I always have to manually add the video tag. I tried multiple plugins, nothing seemed to have good results.

Read more

Alien Blitz 3d: smoke effect, flee, new explosion

Smoke effect

I got inspired recently by the (again) excellent work by Kenney.nl: Smoke particle assets

So I tried to use the smoke effect on the rocket, basically I create lots of particle behind the rocket (replacing the old effect), I add some color and effect (scaling and opacity) and voilà:

capture_2014-09-11_15-54-38_0612_Alien_Blitz_

This feels really good, so I added the same effect to fireball from monsters:

capture_2014-09-11_16-47-04_0782_Alien_Blitz_ capture_2014-09-11_16-46-44_0888_Alien_Blitz_

And it seems pretty good too!

Problem is the old explosion effect seems a bit off now, too pixelated, so I will try to replace it too.

 

Flee

While doing tests I noticed the smoke effect could be interesting to use as a fog, to block view. So I gave it a try when enemies flee.

The first thing I noticed is that there was a bug there, fleeing was triggered a lot less than it should be, usually some monster will try to flee when low health or when the player shoot them a lot during last seconds. And then some randomness occur to decide if monster should flee (depends on monster). This last part was not working correctly and monster were almost never fleeing.

This is now corrected, and now when fleeing monsters have a chance to generate a fog around them, making them invisible, and they can’t be locked either while “fogged”

capture_2014-09-12_11-30-40_0552_Alien_Blitz_ capture_2014-09-12_11-19-07_0323_Alien_Blitz_

 

New explosion

And finally come the explosions effects

capture_2014-09-12_12-14-28_0237_Alien_Blitz_ capture_2014-09-12_12-14-45_0587_Alien_Blitz_ capture_2014-09-12_12-16-17_0454_Alien_Blitz_

These ones quickly fade away, to avoid visibility problems

 

Read more

Alien Blitz 3d: back to work, extra, mods

Back to work

I’m finally back to work, I’ve finished moving, I have a decent Internet connection, and a decent work setup… All good !

It’s quite hard to get back to work after these few weeks, I’ve done small things here and there, but that’s almost nothing. What remains is not some fun stuff, so it makes it harder to work on those, but I’ll try to do my best 🙂

 

New extra menu

A new menu has been added to the main screen, it is called “extra”

It will contain basically everything that doesn’t fit anywhere 🙂 level editor, level downloads, downloaded levels launcher, game mods,…

Currently it just contains the old launcher for custom level plus the new mod screen

capture_2014-09-04_09-55-59_0130_Alien_Blitz_
(The debug button is just available in development mode)

 

Game mods

Game mods have been added, there are a few more than before but total destruction had to be removed as it is a bit buggy, it might come back later on.

New games mods are mostly cheat options and can be activated only when game has been completed:

  • All monsters level 1
  • More bullets: weapons launch 10 bullets in a row instead of 1
  • Infinite ammo
  • Instant reload
  • Invincibility
  • First Person View: switch view (FPS, top-down) by pressing backspace

FPS view can be activated once 3rd map has been completed.

capture_2014-09-04_09-56-03_0714_Alien_Blitz_

 

Read more

Alien Blitz 3d: art, upcoming

Art

My nexus 7 is a 2012 version that doesn’t support art runtime, I tried installing CyanogenMod today, I didn’t expect it to support art since the official version doesn’t, but the option can be enabled.

So I gave it a quick try, the game starts, using menus works, but it crashes when I try to play something. Apparently something was not working when initializing the ShapeRenderer of LibGdx (it’s not LibGdx fault, it’s art as art is supposed to be fully compatible with dalvik), as I don’t use it in 3d I just removed it and everything seems to work. No improvement visible, it just works.

 

Upcoming

I’m quite busy these days, I had to find a new flat, and now I’m in the process of moving there. I will not get a decent Internet before at least 3 weeks. But after that it should be good (hmmm 500 mbps / 200 mbps, sending updates and videos should be quite quick compared to my current 5 mbps upload speed).

I will also work on the video teaser for Greenlight, screenshots and introduction text so that everything is ready for mid-september.

Read more

Alien Blitz 3d: level editor

Level editor

Even more work on the level editor:

New selection windows

These windows are generic, so once I made one all others were immediately available too

capture_2014-07-31_16-59-56_0259_Level_editor_ capture_2014-07-31_17-00-24_0787_Level_editor_ capture_2014-07-31_17-03-54_0807_Level_editor_

These screens are a lot more clear than old ones

Sprite list

The sprite list has been greatly reduced, useless sprites have been removed (monster animations, unused sprites,…) and sprites have been categorized. It’s a lot easier to use now.

Other windows

New map window and properties windows have also been adapted.

capture_2014-08-01_12-14-56_0147_Level_editor_ capture_2014-08-01_13-24-57_0502_Level_editor_

All awt windows should be removed now.

Performance

I’m quite amazed at how quicker it is to load a level and move around it, I can easily display the whole level at once and there’s absolutely no lag or fps drop when moving around.

capture_2014-07-31_17-00-20_0131_Level_editor_

It makes the whole experience a lot more enjoyable than before (and the cpu is a lot cooler)

Tile/Sprite preview

I had a problem with this new editor because the camera can now be moved freely, and the preview tool could not easily show what the tool will really do when applied (how the sprite will be rotated, how the tile will be inserted,…).

So I’ve added a preview directly inside the cursor, it’s a small version of what will be inserted on the map.

capture_2014-08-01_11-40-47_0600_Level_editor_ capture_2014-08-01_11-43-54_0343_Level_editor_

Basic history

There is now a very basic history, it will just save terrain, not properties, not sprites,… it’s not perfect but it’s still better than before.

Some “snapshots” are saved before performing actions. and can be restored using Ctrl+Z. Shift+Z will redo the action. There are 10 maximum snapshots.

Level modifications

To test this new editor I’m making modifications on existing levels; again adding more details.

It helps me testing and correcting bugs, and as I’m in the process of moving flat it’s good as I don’t need to focus on a single task for a long time, it’s just small modifications I can postpone at any moment.

Read more

Alien Blitz 3d: level editor

Level editor

More work on the level editor, it is quite easy so far.

Lights

I’ve added a new feature that was not in the old editor, lights can be directly previewed, it will not be the exact lights that you will see in game but it’s pretty close.

capture_2014-07-30_15-16-51_0995_Level_editor_ capture_2014-07-30_15-16-57_0450_Level_editor_

 

Camera

Camera can now be moved freely, it’s a lot better than isometric version where camera was fixed in isometric view 🙂

capture_2014-07-30_14-53-06_0856_Level_editor_

 

No 3d

I’ve removed 3d map support as I didn’t need it.
In old versions of the game it was possible to create cube above empty spaces, and have rooms above others. This was removed later as it wasn’t need in top view, and it was hard to visualize in isometric view.
In current version of the editor (Snorms) the editor was still loading/saving/displaying levels in 3d, but a second level was exported in 2d + heightmap. Only the exported version was released, so released levels could not be edited.

Now the level editor is fully 2d + heightmap, so if you place a block above empty spaces they will be filled too. It also means the level editor now directly load/save levels in compressed 2d format, so there is no “protection” for levels. I could add a specific export format for maps, with some kind of protection, but I don’t think it’s useful.

The engine could be converted back to full 3d, most functions are generic enough and old 3d support is still there and maintained… But it’s not useful, it might be available in a future version of the engine, but not now.

UI

I’ve also added the new UI system to the editor

capture_2014-07-30_16-32-42_0061_Level_editor_

It means I can now easily add windows/button/… in the level editor. I’ve just added a window for the help screen at the moment, but I think I will convert other window too, it shouldn’t be too hard (and will allow mouse selection that was not available before).

What decided me to switch from awt to this system is mainly that I will need to add a new window to publish levels online, and I really don’t want to do it in awt.

 

 

Read more

Alien Blitz 3d: jump, misc, speedrun, level editor

Jump

I had greatly reduced the possibility for monsters to jump in 2d as it was pretty much useless, it is now back in 3d

capture_2014-07-29_17-21-27_0083_Alien_Blitz_

Monster have a chance to jump across small obstacles, it’s random.

And they will also less get stuck in walls (when a monster is stuck in a wall for too long it will just get killed to avoid problems with 100% kills at the end of level)

 

Misc

Again, lots of miscellaneous corrections and improvements:

  • More 3d elements in levels
  • New patterns for attack of first boss when mid-life

It also seems the random bug I was referring to in an earlier post is gone, I have completed the game multiple times since and it didn’t happen once.

I have absolutely no idea what was this bug about nor why it is corrected, I changed a few stuffs in rendering (to get the dynamic FPS option to work), it could eventually be related.

 

Speedrun

I have some fun trying to speedrun Alien Blitz, it’s also very good for testing as it forces me to test unusual stuff and get the most of the engine.

I’ve found a few glitches, mainly level design glitches, that I don’t plan to correct. You’ll likely won’t encounter them in a normal playthrough, and they can’t be considered bugs (you can’t get stuck and it won’t crash the game, it’s just a quicker way to complete a level).

I was a bit afraid at first that speedrunning Alien Blitz will be just running and avoiding bullets (which can still be fun, but quickly boring), but you have to kill some monsters at some points (bosses, trigger kills, or just to get them out of the way) so you must always try to improve your weaponry and increase level. Furthermore beginning at episode 2 it is very easy to get killed as there are way too many monsters in some maps to you just avoid them.

 

Level editor

Up to now level editor was still on the old branch, using Snorms isometric engine. My plans were to release this version with the game as it’s working decently.

capture_2014-07-29_22-15-13_0877_Snorms_

But I still just wanted to try to plug the 3d rendering code into it, so I forked the project and copied the 3d rendering code… And surprisingly it’s working pretty well on first try

capture_2014-07-29_21-59-07_0693_Level_editor_

It’s just the first render after around 1 hour of work, but most tools seem to work so far. It’s a lot brighter than the old editor because textures have been changed since, other than that it seems ok.

So finally I might deliver this version in 3d, it will make the level creation easier, no more isometric artifacts and free camera movements.

I don’t know yet if I will make the editor compatible with my UI system, I might stick to the ugly awt frame for now.

Read more

Alien Blitz 3d: virtualization, bundle jre, achievements, immersive mode

Virtualization

I’m working on a Linux set-up (Xubuntu) but sometimes I need a Windows environment quickly to use programs that don’t exist on Linux. I can either start my desktop computer with a Win 7 installed or launch a virtual machine on my Linux.

I use VirtualBox as a virtualization software, up to now I knew that I couldn’t test my game on it, it was way too slow or would just crash, even with experimental 3d support activated. But today I ran a quick test just as I wanted to bundle a JRE with the game and needed to test on Windows:

capture_2014-07-27_12-21-28_0382_Bureau_

The game is fully playable! At a very stable 60fps. Yet another result I didn’t expect, there’s no MSAA as the virtualized 3d card reports it doesn’t support MSAA, and it’s just a mono core as I don’t need the virtual machine to use 2 cores. But other than that it seems just fine.

 

Bundle jre

As I said above I tried to bundle an Open JDK with the game, it seems to work fine. Current plan is that I will release the game only if it is accepted on Steam, I don’t know how they handle JRE but at least I know the game can run on its own with its own JRE and no other software requirements.

And it will also allow me to distribute the game to a few beta-testers before starting Greenlight.

 

Achievements

I have finally removed some achievements, so now there are less than 100 achievements, which is no big deal in my opinion.

There are now 10 speed run achievements (complete a specific level), they are not easy, some use glitches, other need a nearly perfect execution, but hey! it’s speed run, it’s not easy!

I have also added a global speed run achievement to complete the game as fast as possible (any%), I set it to 1 hour and 30 minutes (in-game time), my personal best (PB) at the moment is 1 hour and 20 minutes. If you don’t know about speed running this time might seems surprisingly short, but it’s not the “usual” time needed to complete the game on a normal play through (for example Zelda occarina of time can be completed in 18 minutes and 10 seconds, doom 2 in less than 20 minutes, half life 2 in less than 90 minutes,…)

 

Immersive mode

I’ve added immersive mode for Android 4.4+, it makes the screen a bit bigger on devices where virtual buttons were displayed.

I think I will publish a new android version soon, to test new stuffs, but 3d will be disabled for the time being (still needs some adjustments and optimizations)

Read more