Developer diary

Alien Blitz: back to normal operation

I’ve finally corrected my problem… to sum it up : changing mouse cursor too often in a small timestamp will cause glClear to crash with an Intel card with vsync disabled on Linux…

This whole sentence makes absolutely no sense to me but it explains why I didn’t have problems with nVidia card and why I didn’t have problems with the mobile version (which obviously doesn’t implement changing mouse cursor).

So I can now finish my tests of the Android version, update it, and I will probably create a beta PC version that I will add to Snorms version on IGS (maybe on Desura later on, if I fell like it), and also a demo version that I can freely distribute (episode 1 or just a few levels, or limited to 1 or 2 hours, don’t know yet).

logo_512x512

Read more

Loading...Loading...

How to disable vsync on Intel card / Linux

Just a small post to explain how to disable vsync on an Intel integrated graphic card on Linux to run a java application from eclipse (or any other application for that matter).

You might have some problem for example if you run a LibGdx game and setting the vSyncEnabled configuration option does not work at all (don’t forget to also update foregroundFPS).

To run a program and disabling vsync it’s quite easy, just set the vblank_mode environment variable to 0, for example :

$ glxgears 
Running synchronized to the vertical refresh.  The framerate should be
approximately the same as the monitor refresh rate.
304 frames in 5.0 seconds = 60.797 FPS

$ vblank_mode=0 glxgears
ATTENTION: default value of option vblank_mode overridden by environment.
ATTENTION: default value of option vblank_mode overridden by environment.
27598 frames in 5.0 seconds = 5519.494 FPS

$ export vblank_mode=0
$ glxgears 
ATTENTION: default value of option vblank_mode overridden by environment.
ATTENTION: default value of option vblank_mode overridden by environment.
27929 frames in 5.0 seconds = 5585.793 FPS

 

To do the same thing to test an application under eclipse you can just change its run configuration :

capture_2015-04-10_13-24-02_0246_Run_Configurations_

Just set it to 1 when you are done (or delete the variable)

 

Read more

Loading...Loading...

Some news: Alien Blitz, Crazy Minecart, Shadow Mapping

Alien Blitz

There is a very random bug that causes the game to crash sometimes on PC, I can’t find why it happens, so until I find the cause I won’t release the next Android version (as it is random it might maybe also happen on Android).

This is a very strange bug, the game just suddenly stops, no exception, no dump, nothing, I’ve tried a few things:

  • I made sure System.exit is not called by adding it to a SecurityManager (override the checkExit function)
  • I made sure all exceptions are logged
  • I made sure OutOfMemory exceptions are trapped  somehow (-XX:+HeapDumpOnOutOfMemoryError)
  • All possible missing exceptions are catched using Thread.setDefaultUncaughtExceptionHandler

Only thing I have figured so far:

  • It’s not an audio issue (only error message is related to audio, but this message also appear when exiting the game normally, I just removed audio to be sure and bug happened anyway)
  • It’s not linked to a LibGdx version, bug appear on 1.4.1 & 1.5.2 also (and game was working fine when I was using these versions)
  • It doesn’t seem to appear on mobile version running on PC (but as it’s random I can’t be sure, I was just maybe lucky during these tests)

It is either linked to a change on my Linux system or something in the code (but there was nothing big added recently).
Next tests will focus on Windows (to see if it’s a problem on the Linux version) & on the nVidia card (to see if it’s related to the Intel one). I suspect something bad happening with OpenGL (would explain the lack of traces as it’s not pure java code).
Problem is each test takes around 1 hour as bug is random. I basically launch the game, make some automatic stuffs (auto fire, wake all monsters,…) and wait 1 minute, check if game exited prematurely, if not launch the test again. The bug seems to appear every 10 games on average, usually it will appear in the first minute or so after start, if it does not the game will apparently be running fine afterward (I’ve let it work for 2 hours fine)

 

On another note I updated the way life bars are displayed above player & monsters, they look a lot nicer now. And I have also added an option to show numerical values for life / armor & ammos.

capture_2015-04-07_10-11-31_0401_Alien_Blitz_

 

Crazy Minecart

Some progress have been made on Crazy Minecart, I have some performance issues even without shadow mapping (40fps, it’s not a big deal but I don’t like that). So I removed some trees and simplified a few things, but I’ll have to pinpoint the issue.

capture_2015-04-08_10-58-46_0422_crazy_minecart_ capture_2015-04-08_10-58-51_0214_crazy_minecart_

I also need to change colors, problem is colors after exporting are not the ones I defined in Blender, it makes it a bit hard to do something nice.

 

Shadow Mapping

I’ve stopped working on part 5 (Multiple Render Targets) of shadow mapping tutorial for now, I’m just waiting for some commits to be included in LibGdx to support Cubemap, it will allow me to clean up the code and maybe add the MRT frame buffer more easily.

I saw this pull request recently, as I was about to make my own for the same purpose, good thing I checked up first :)

Read more

Loading...Loading...

Crazy Minecart : 3d test

Continuing on 3d version of Crazy Minecart I started tests on the game itself.

Exporting models

To export models from Blender I use a small script to export all models with a name starting with “export_”, they are all exported in the “exports” folder, in collada (.dae file)

This script is based on this post, I’ve modified it to export only objects with a name starting with “export_”, to move objects to origin, and to export to collada (as collada supports armature/animations, that could be needed for future projects)

import bpy

# get the path where the blend file is located
path = bpy.path.abspath('//')

# deselect all objects
bpy.ops.object.select_all(action='DESELECT')    

# loop through all the objects in the scene
scene = bpy.context.scene
for ob in scene.objects:
    # make the current object active and select it
    scene.objects.active = ob
    ob.select = True

    # make sure that we only export meshes
    if ob.type == 'MESH' and ob.name.startswith('export_'):
        # export the currently selected object to its own file based on its name
        print(ob.name.replace('export_',''));
        px=ob.location.x;
        py=ob.location.y;
        pz=ob.location.z;
                
        ob.location.x=0.0;
        ob.location.y=0.0;
        ob.location.z=0.0;
        
        bpy.ops.wm.collada_export(filepath=str(path + 'exports/' + ob.name.replace('export_','') + '.dae'),selected=True,triangulate=True);
        
        ob.location.x=px;
        ob.location.y=py;
        ob.location.z=pz;
        
    # deselect the object and move on to another if any more are left
    ob.select = False

I’ve replaced the bottom timeline with the text editor in Blender, it makes running script easier (and I don’t know yet how timeline works). When executing script make sure you are in object mode, it won’t work in edit mode.

capture_2015-03-30_16-54-35_0320_Blender_home_jb_jbs_Projets_Microbasic_CrazyMinecr

 

First tests

As I suspected I had problems updating Crazy Minecart, it was using an old version of libgdx and other libraries. LibGdx was easy to update (create a new project, copy old files), but mopub was a pain, their documentation is outdated and incomplete, so that doesn’t help. But it finally worked (not tested on ios yet, and I haven’t tested game centers yet, I just know it compiles…)

I am currently working on the title screen, it is easier to test there, first adding models :

capture_2015-03-29_19-12-26_0295_crazy_minecart_

 

 

Then adding some basic lighting :

capture_2015-03-29_19-25-07_0840_crazy_minecart_

 

The trees seems off, it’s because of back face culling (front faces are invisible, back faces that should be invisible are visible), I have no idea why but the normals are inverted :

  • In blender normals are correct
  • If I export as wavefront object with Blender and re-import it, on import model will have normals inverted
  • If I export as collada object in Blender, it is correct on re-import
  • If I convert the collada object to LibGdx format then normals will be inverted
  • If I invert normals on model and export it, it will be visible in the game but normals will still be off (the face in shadow will receive light, but not the one in light)

So I ended up recreating the tree from scratch, and this time it worked, I have no idea why the other tree is such a mess…

I also increased gap between ties as it doesn’t look good at high speed and I scaled / rotated trees randomly :

capture_2015-03-29_20-44-51_0763_crazy_minecart_

 

Inverting grass/dirt, it feels better at high speed :

capture_2015-03-30_00-08-31_0957_crazy_minecart_

 

Tuning lighting a bit (I still need to tune light direction, specular and “shininess”) and changing trees colors :

capture_2015-03-30_00-37-00_0326_crazy_minecart_

 

Adding some shadows (using an orthographic camera, to simulate sun light / directional light) :

capture_2015-03-30_12-24-44_0605_crazy_minecart_

 

Moving the light source position a bit :

capture_2015-03-30_15-17-50_0853_crazy_minecart_

 

At this point I began testing on my Nexus 7, sadly it is running at around 25fps… It is because of shadow mapping, writing to a FBO seems to be really slow even with simple models such as the ones I use. And this game really needs a stable 60fps.

I am currently continuing testing shadow mapping, and trying to improve performances, if I can’t get anything good I’ll try something else.

Read more

Loading...Loading...

Crazy minecart : more 3d (blender)

Continuing on testing 3d low-poly for Crazy Minecart, here is a blender rendered scene from behind

scene2

I think I will continue working on this update, as it will allow me to test stuff for the new engine I want to work one:

  • Real time shadow mapping (models are simple, so I hope I will be able to render scene at stable 60fps with shadow mapping)
  • Low poly lighting (shouldn’t be too hard)
  • Maybe try to reproduce this grainy look blender does, it looks really nice imo (click the image for 1080p version, it is more visible there)
  • And it will also help me test exporting multiple models at once with blender (through scripting) to automate this process.

Read more

Loading...Loading...

Crazy Minecart : 3d ?

As I was playing with low poly 3d lately I thought about trying to get crazy minecart in 3d.

Currently Crazy Minecart is in 2d:

phone-turn

 

What it could look like in 3d, blender renders:

scene1

 

And a rear view (I’ve moved the cart away from water)

scene2

I can’t make “organic” models (human), only artificial ones (or simple natural ones), so I doubt I will create a character to put in the cart, maybe I’ll be able to find a free one, or I’ll just leave the cart empty.

But I can make trees and such, some tutorials are very good, it will add details on the border (or make the water obstacle more visible for example).

So yea, maybe I will work on creating a new crazy minecart version, what bothers me the most is updating all the surrounding frameworks for that (ads, google play services, game center,…).

Read more

Loading...Loading...

More space ships

Continuing on working on some low poly space ships, I’ve added and cleaned a lot of stuffs

ships_scene

Here’s a top view, maybe the view will be a little more downward (as Alien Blitz) to see upper/down wings more easily :

ships_topfar

And here’s the workspace, with templates for parts size :

ships_parts

Read more

Loading...Loading...

Alien Blitz: new update (mobile), stamina (PC)

New update (mobile)

While digging on the possible errors that could have triggered the last update rejected on app store I noticed some errors were not correctly trapped, and that I had no way to check if errors happened on the iOs version.

So I’ve made some changes:

  • Automatic anonymous error reports are back, whenever an error occurs the stack trace is sent to my website (anonymous, the report just contains a few system parameters and the stack trace). It means I need the network permission back for the full release on Android.
  • I’ve corrected the process that catch errors, and it should work again if option file is corrupted (if it gets corrupted option file is reset and a message is displayed to warn user)
  • I’ve added more exception catching in missing places (basically exception catching was working fine when playing a level, but not always on startup and in menus)
  • The splash screen should disappear quicker on iOs (was 2.5 seconds on my iPod, it is now 2 seconds spent only in LibGdx stuff I can’t change)

I’ve also included some changes on balance, shotgun has been nerfed at high level, and double shotgun has been boosted. So player should upgrade to double shotgun at high level.

I will send this update soon on the mobile platforms.

 

Stamina (PC)

I like the stamina that was present in old versions of Alien Blitz (Snorms in this case), I removed it for mobile as it is quite hard to manage for the player, but I’ve decided to add it back on PC.

The way stamina now works (PC only):

  • Player uses stamina by pressing the shift key or the Y button of the controller (on xbox controller)
  • The auto lock button has been moved to the back button (xbox controller) by default, can be changed anyway
  • When using stamina player will move quicker if he is on ground (does not work when jumping, to avoid breaking levels)
  • When using stamina and shooting the weapons will reload a lot quicker and deal a little more damage (but it uses a lot of stamina)
  • Stamina will go up after 2 seconds (stamina button must be released)
  • By default stamina status is not visible on screen, but it can be turned on in the options.

So basically it works a lot like old stamina, except maximum stamina can’t be upgraded with level ups.

Here’s a little screenshot with stamina bar visible:

capture_2015-03-21_13-56-24_0463_Alien_Blitz_

I’ve also removed most of the sprite borders, and made the camera a little closer.

Read more

Loading...Loading...

Space ships

2d space ships

Quite some time ago I tried to work on some 2d space ships :

game-copie

It was inspired by kenney.nl work

The good thing with 2d is that adding details doesn’t use more memory/gpu/cpu, problem is that it doesn’t scale/rotate very well (especially with details)

 

Low poly

So I tried some 3d low poly render (made with blender) :

scene_all

It’s just some prototype but I quite like it, and it made me want to retry working on the game I was thinking for this asset.

As you might guess ship building / customization will be quite important in this game

Here’s some top views, probably the exploration/combat type of view :

scene_top scene_top_far

(background texture by Lyshastra on deviantart)

More info soon I guess if I continue working on that (not sure yet, I don’t have a lot of free time)

Read more

Loading...Loading...

Mobile site, App store

Mobile site

I received a mail from Google to tell me that my website was not appropriate for mobile, I knew it of course but never bothered looking into that up to now.

So I installed a theme switcher for WordPress (any mobile theme switcher), and a very simple theme (mobile). So mobile user will now get a simple theme that should display most pages nicely.

2015-03-19 21.12.54

I just had to manually set the menu name in one php file as wordpress does not support two theme configurations active at once, other than that it seems fine.

You can always choose the desktop version in your browser settings/menu if you want to.

 

App store

I’ve been able to test the latest update on a 64bit iPhone version, and it was also accepted for beta test, so maybe it means I’ve solved the issue. If I have not I will have to get an iPhone 6 or iPad air 2 / iPad mini 2 as I think issues comes from 64bits releases.

What I did is that I updated Libgdx and robovm to latest builds, cleaned robovm cache (delete .robovm/cache directory), rebuilt everything and increased eclipse heap size so that a full compilation doesn’t crash (might have been the problem before as it seemed to crash during 64bits compilation). The compilation lasted something like 10-15 minutes, we will see if it worked.

Read more

Loading...Loading...
Page 1 of 3412345...102030...Last »