Test my platformer engine (WIP) (testing done, thanks!)

I’ve added a pause, press P or PAUSE to pause the game. I had some problems with PAUSE-key in Windows, thus P also works. The player light toggle is now behind O-key. :slight_smile: Oh, no need to worry about the FPS dropping down when paused, as the game starts sleeping so the FPS drop is normal.

This time I compiled the sources using javac instead of Eclipse compiler.

Kevin: Could you try again? It’s highly unlikely it works any better, though…

Sorry but I can’t find the log file, where did you save it?

APPDATA\platformer\engine.log on Windows, HOME\.platformer\engine.log on Linux and others (HOME is your home directory, like /home/username/ in Linux).

I did a search for .platformer

and I got nothing :frowning:

it runs slower now though.

Note that on Windows the dir doesn’t have a dot in its name… :slight_smile:

Windows 7 Beta
Intel Pentium Dual CPU T2370 @ 1.73 / 1.73 Ghz
2 GB RAM
GeForce 8600M GT

  • ~55-60 constant fps. I tried all sorts of key-spamming to get this to go down. Never did.
  • ~35-40% processor usage
  • Log attached
  • It’s got some style :slight_smile:

ouch cant start :frowning:

[quote]…
…extureManager: Loaded a texture from “media/mat/texture.png”.
TextureManager: Loaded a texture from “media/light2.png”.
TextureManager: Loaded a texture from “media/light3.png”.
ScriptManager: Cached script ‘media/scripts/lightswitch.pnuts’.
Generating outlines for 36 polygons…
Outline generation took 147.711231 ms.
LevelLoader: Level loaded from media/house.svg.
TextureManager: Loaded a texture from “media/bg.png”.
ModuleManager: Added module ‘GameModule’.
TextRenderer: Loaded a font from “media/fonts/vera.ttf” [size: 11.0].
An error occured and the game will exit:
Exception: org.lwjgl.opengl.OpenGLException: Invalid value (1281)
org.lwjgl.opengl.OpenGLException: Invalid value (1281)
at org.lwjgl.opengl.Util.checkGLError(Util.java:54)
at org.lwjgl.opengl.Display.swapBuffers(Display.java:640)
at org.lwjgl.opengl.Display.update(Display.java:660)
at nr.co.mhgames.platformer.PlatformerMain.run(PlatformerMain.java:83)
at nr.co.mhgames.platformer.PlatformerMain.main(PlatformerMain.java:26)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.sun.javaws.Launcher.executeApplication(Unknown Source)
at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
[/quote]

abirmingham: Thanks. :slight_smile:

You didn’t post the whole log, so I have to guess, but do you happen to have Ati GPU? A friend of mine tested a much older version of this engine, and got that same OpenGL error on Radeon 9600 Pro. He had pretty old drivers, updating did wonders in that case: the crash didn’t happen anymore and driver support provided FBOs and PBuffers, both of which were not supported in the old drivers. :slight_smile: Perhaps you could update yours, if it isn’t too much trouble. :slight_smile:

[quote][20:32:49] SoundSystem: Initializing OpenAL…
Mon Mar 30 20:32:49 CEST 2009 INFO:Initialising sounds…
Mon Mar 30 20:32:49 CEST 2009 INFO:- Sound works
Mon Mar 30 20:32:49 CEST 2009 INFO:- 32 OpenAL source available
Mon Mar 30 20:32:49 CEST 2009 INFO:- Sounds source generated
[/quote]
It works but I have no sound :frowning:

sorry logs was quite huge I should have post both start & end …

I got an ATI X800, I ll try to update drivers but I did it recently.

You mean the music doesn’t play when you press M? There is not actually any sounds yet, apart from the music test piece… :slight_smile:

I have to say this looks extremely promising. The framerate was about 30 fps on my MacBook, running OS X 10.5.6 and Java 1.5.0_16.


[9:46:04 PM] Log file 'engine.log' opened.
[9:46:04 PM] Engine: Running on Java 1.5.0_16 (Apple Inc.) in Mac OS X (10.5.6, i386).
[9:46:04 PM] Engine: Available processors/cores: 2
[9:46:04 PM] Settings: Unable to load the settings from "settings.cfg", reverting to defaults.
[9:46:04 PM] Settings: Successfully saved the settings to "settings.cfg".
[9:46:04 PM] Engine: Using the following settings:
[9:46:04 PM] useControllers = false
[9:46:04 PM] resolution = 800x600
[9:46:04 PM] useAudio = true
[9:46:04 PM] vsync = true
[9:46:04 PM] antiAlias = 0
[9:46:04 PM] fxLighting = true
[9:46:04 PM] disablePBuffer = false
[9:46:04 PM] disableFBO = false
[9:46:04 PM] colorDepth = 32
[9:46:04 PM] fullscreen = false
[9:46:04 PM] fxBloom = true
[9:46:04 PM] lineSmooth = false
[9:46:04 PM] 
[9:46:04 PM] Renderer: Initializing LWJGL 2.1.0..
[9:46:04 PM] Renderer: Requesting display mode 800x600, 32 bpp.. ok!
[9:46:04 PM] Renderer:
 * Card: Intel GMA X3100 OpenGL Engine(Intel Inc.).
 * OpenGL version: 1.2 APPLE-1.5.36.
[9:46:04 PM]  * Driver: null (null).
[9:46:04 PM] Renderer: Using Intel GMA series.
[9:46:04 PM] Renderer: Available OpenGL extensions:
[9:46:04 PM] GL_ARB_transpose_matrix, GL_ARB_vertex_program, GL_ARB_vertex_blend, GL_ARB_window_pos,
[9:46:04 PM] GL_ARB_shader_objects, GL_ARB_vertex_shader, GL_ARB_shading_language_100, GL_EXT_multi_draw_arrays,
[9:46:04 PM] GL_EXT_clip_volume_hint, GL_EXT_rescale_normal, GL_EXT_draw_range_elements, GL_EXT_fog_coord,
[9:46:04 PM] GL_EXT_gpu_program_parameters, GL_EXT_geometry_shader4, GL_EXT_transform_feedback, GL_APPLE_client_storage,
[9:46:04 PM] GL_APPLE_specular_vector, GL_APPLE_transform_hint, GL_APPLE_packed_pixels, GL_APPLE_fence,
[9:46:04 PM] GL_APPLE_vertex_array_object, GL_APPLE_vertex_program_evaluators, GL_APPLE_element_array, GL_APPLE_flush_render,
[9:46:04 PM] GL_APPLE_aux_depth_stencil, GL_NV_texgen_reflection, GL_NV_light_max_exponent, GL_IBM_rasterpos_clip,
[9:46:04 PM] GL_SGIS_generate_mipmap, GL_ARB_texture_env_crossbar, GL_ARB_texture_border_clamp, GL_ARB_multitexture,
[9:46:04 PM] GL_ARB_texture_env_add, GL_ARB_texture_cube_map, GL_ARB_texture_env_dot3, GL_ARB_texture_env_combine,
[9:46:04 PM] GL_ARB_texture_compression, GL_ARB_texture_mirrored_repeat, GL_ARB_shadow, GL_ARB_depth_texture,
[9:46:04 PM] GL_ARB_fragment_program, GL_ARB_fragment_program_shadow, GL_ARB_fragment_shader, GL_ARB_occlusion_query,
[9:46:04 PM] GL_ARB_point_sprite, GL_ARB_texture_non_power_of_two, GL_ARB_vertex_buffer_object, GL_ARB_pixel_buffer_object,
[9:46:04 PM] GL_ARB_draw_buffers, GL_EXT_framebuffer_object, GL_EXT_framebuffer_blit, GL_EXT_texture_rectangle,
[9:46:04 PM] GL_ARB_texture_rectangle, GL_EXT_texture_env_add, GL_EXT_blend_color, GL_EXT_blend_minmax,
[9:46:04 PM] GL_EXT_blend_subtract, GL_EXT_texture_lod_bias, GL_EXT_abgr, GL_EXT_bgra,
[9:46:04 PM] GL_EXT_stencil_wrap, GL_EXT_texture_filter_anisotropic, GL_EXT_separate_specular_color, GL_EXT_secondary_color,
[9:46:04 PM] GL_EXT_blend_func_separate, GL_EXT_shadow_funcs, GL_EXT_stencil_two_side, GL_EXT_texture_compression_s3tc,
[9:46:04 PM] GL_EXT_texture_compression_dxt1, GL_EXT_texture_sRGB, GL_EXT_blend_equation_separate, GL_EXT_packed_depth_stencil,
[9:46:04 PM] GL_APPLE_flush_buffer_range, GL_APPLE_ycbcr_422, GL_APPLE_vertex_array_range, GL_APPLE_texture_range,
[9:46:04 PM] GL_APPLE_pixel_buffer, GL_APPLE_object_purgeable, GL_NV_blend_square, GL_ATI_texture_env_combine3,
[9:46:04 PM] GL_SGIS_texture_edge_clamp, GL_SGIS_texture_lod
[9:46:04 PM] Renderer: Failed to set the window icon..
[9:46:04 PM] Renderer: Failed to set the window icon..
[9:46:04 PM] TextureManager: Non-power-of-two textures are supported.
[9:46:04 PM] TextureManager: Available RTT support:
[9:46:04 PM]  * FBOs supported (great!).
[9:46:04 PM]    -- Packed depth-stencil FBO extension supported.
[9:46:04 PM]  * PBuffers supported.
[9:46:04 PM] TextureManager: Maximum texture size is 2048 x 2048.
(...)
[9:46:33 PM] PROFILER RESULTS:
[9:46:33 PM] ============================================================================
[9:46:33 PM] Method                                            Calls     Seconds  Percentage
[9:46:33 PM] initialize:                                     1 calls     0.695 s  100.0 %
[9:46:33 PM]   initialLoading:                               1 calls     0.166 s   23.9 %
[9:46:33 PM]     TextureManager_bindTexture:                 1 calls     0.000 s    0.0 %
[9:46:33 PM] 
[9:46:33 PM] 
[9:46:33 PM] mainLoop:                                       1 calls    28.067 s  100.0 %
[9:46:33 PM]   Display_sync:                               748 calls     0.001 s    0.0 %
[9:46:33 PM]   Display_update:                             749 calls     8.338 s   29.7 %
[9:46:33 PM]   TextRenderer_renderString:                 1144 calls     0.368 s    1.3 %
[9:46:33 PM]     TextRenderer_renderGlyph:               67496 calls     0.243 s   66.0 %
[9:46:33 PM]       TextureManager_bindTexture:              21 calls     0.000 s    0.0 %
[9:46:33 PM] 
[9:46:33 PM]   TextureManager_bindTexture:                  45 calls     0.000 s    0.0 %
[9:46:33 PM]   Engine_update:                              748 calls     3.379 s   12.0 %
[9:46:33 PM]     TextureManager_bindTexture:                 1 calls     0.000 s    0.0 %
[9:46:33 PM] 
[9:46:33 PM]     ModuleManager_update:                    1516 calls     2.915 s   86.3 %
[9:46:33 PM]       initialLoading:                           1 calls     2.478 s   85.0 %
[9:46:33 PM]         TextureManager_bindTexture:            15 calls     0.001 s    0.0 %
[9:46:33 PM]       World_simulate:                        1514 calls     0.223 s    7.7 %
[9:46:33 PM]       Player_update:                         1514 calls     0.192 s    6.6 %
[9:46:33 PM]         PolyAnim_update:                     1514 calls     0.075 s   39.1 %
[9:46:33 PM] 
[9:46:33 PM]     ModuleManager_infreqUpdate:               748 calls     0.014 s    0.4 %
[9:46:33 PM] 
[9:46:33 PM]     updateLights:                             748 calls     0.351 s   10.4 %
[9:46:33 PM]       TextureManager_bindTexture:            1147 calls     0.001 s    0.3 %
[9:46:33 PM] 
[9:46:33 PM]   Game_render:                                746 calls    15.773 s   56.2 %
[9:46:33 PM]     Game_renderToTexture:                     746 calls     3.299 s   20.9 %
[9:46:33 PM]       TextureManager_bindTexture:             746 calls     0.000 s    0.0 %
[9:46:33 PM]       Level_render:                           746 calls     2.006 s   60.8 %
[9:46:33 PM]         Level_renderOutlines:                 746 calls     0.277 s   13.8 %
[9:46:33 PM]         LevelShape_render:                 129395 calls     1.654 s   82.5 %
[9:46:33 PM]           TextureManager_bindTexture:       12462 calls     0.007 s    0.4 %
[9:46:33 PM]       Level_renderFG:                         746 calls     0.612 s   18.6 %
[9:46:33 PM]         LevelShape_render:                  42435 calls     0.586 s   95.8 %
[9:46:33 PM]           TextureManager_bindTexture:        3881 calls     0.002 s    0.3 %
[9:46:33 PM]       renderLightMap:                         746 calls     0.062 s    1.9 %
[9:46:33 PM]         TextureManager_bindTexture:           746 calls     0.001 s    1.6 %
[9:46:33 PM]       Player_render:                          746 calls     0.476 s   14.4 %
[9:46:33 PM]         PolyAnim_render:                      746 calls     0.473 s   99.4 %
[9:46:33 PM] 
[9:46:33 PM]     bloomEffect:                              746 calls     9.135 s   57.9 %
[9:46:33 PM]       bloomEffect_bloom:                      746 calls     0.268 s    2.9 %
[9:46:33 PM]         TextureManager_bindTexture:          1492 calls     0.001 s    0.4 %
[9:46:33 PM]         bloomEffect_renderQuad:              1492 calls     0.124 s   46.3 %
[9:46:33 PM]       bloomEffect_composite_shader:           746 calls     8.857 s   97.0 %
[9:46:33 PM]         TextureManager_bindTexture:          1492 calls     0.001 s    0.0 %
[9:46:33 PM]         bloomEffect_renderQuad:               746 calls     8.839 s   99.8 %
[9:46:33 PM] 
[9:46:33 PM]     debugText:                                746 calls     3.327 s   21.1 %
[9:46:33 PM]       TextRenderer_renderString:            20142 calls     3.058 s   91.9 %
[9:46:33 PM]         TextRenderer_renderGlyph:          680839 calls     2.299 s   75.2 %
[9:46:33 PM]           TextureManager_bindTexture:         746 calls     0.003 s    0.1 %
[9:46:33 PM] 
[9:46:33 PM] 
[9:46:33 PM] ============================================================================
[9:46:33 PM] GlyphCache: 92 glyphs in 1 page(s).
[9:46:33 PM] TextureManager: Destroyed render texture 'sceneRTT'.
[9:46:33 PM] Closing 'engine.log'..

Finally someone with a Mac, thank you! 8) Seems that the window icon code fails, I’ll have to investigate.

Performance seems to vary a lot between different Intel GMA models. On my laptop the game runs mostly at 60 fps (except the shaders don’t work, so it only does lighting). If you disable the bloom (press B), you should get a nice speed increase - judging from the profiler results almost 60% of rendering time was spent on the bloom shader…

Edit: Ok, seems that Display.setIcon() always returns 0 on Mac OS X… No icons for Mac then. :stuck_out_tongue:


Engine: Running on Java 1.5.0_16 (Apple Inc.) in Mac OS X (10.5.6, i386).
Engine: Available processors/cores: 2
Settings: Successfully loaded the settings from "settings.cfg".
Engine: Using the following settings:
useControllers = false
resolution = 800x600
vsync = true
useAudio = true
antiAlias = 0
fxLighting = true
disablePBuffer = false
colorDepth = 32
disableFBO = false
fullscreen = false
fxBloom = true
lineSmooth = false

Renderer: Initializing LWJGL 2.1.0..
Renderer: Requesting display mode 800x600, 32 bpp.. ok!
Renderer:
 * Card: NVIDIA GeForce 9400M OpenGL Engine(NVIDIA Corporation).
 * OpenGL version: 2.0 NVIDIA-1.5.36.
 * Driver: null (null).
Renderer: Available OpenGL extensions:
GL_ARB_transpose_matrix, GL_ARB_vertex_program, GL_ARB_vertex_blend, GL_ARB_window_pos,
GL_ARB_shader_objects, GL_ARB_vertex_shader, GL_ARB_shading_language_100, GL_EXT_multi_draw_arrays,
GL_EXT_clip_volume_hint, GL_EXT_rescale_normal, GL_EXT_draw_range_elements, GL_EXT_fog_coord,
GL_EXT_gpu_program_parameters, GL_EXT_geometry_shader4, GL_EXT_transform_feedback, GL_APPLE_client_storage,
GL_APPLE_specular_vector, GL_APPLE_transform_hint, GL_APPLE_packed_pixels, GL_APPLE_fence,
GL_APPLE_vertex_array_object, GL_APPLE_vertex_program_evaluators, GL_APPLE_element_array, GL_APPLE_flush_render,
GL_APPLE_aux_depth_stencil, GL_NV_texgen_reflection, GL_NV_light_max_exponent, GL_IBM_rasterpos_clip,
GL_SGIS_generate_mipmap, GL_ARB_imaging, GL_ARB_point_parameters, GL_ARB_texture_env_crossbar,
GL_ARB_texture_border_clamp, GL_ARB_multitexture, GL_ARB_texture_env_add, GL_ARB_texture_cube_map,
GL_ARB_texture_env_dot3, GL_ARB_multisample, GL_ARB_texture_env_combine, GL_ARB_texture_compression,
GL_ARB_texture_mirrored_repeat, GL_ARB_shadow, GL_ARB_depth_texture, GL_ARB_fragment_program,
GL_ARB_fragment_program_shadow, GL_ARB_fragment_shader, GL_ARB_occlusion_query, GL_ARB_point_sprite,
GL_ARB_texture_non_power_of_two, GL_ARB_vertex_buffer_object, GL_ARB_pixel_buffer_object, GL_ARB_draw_buffers,
GL_ARB_shader_texture_lod, GL_EXT_compiled_vertex_array, GL_EXT_framebuffer_object, GL_EXT_framebuffer_blit,
GL_EXT_framebuffer_multisample, GL_EXT_texture_rectangle, GL_ARB_texture_rectangle, GL_EXT_texture_env_add,
GL_EXT_blend_color, GL_EXT_blend_minmax, GL_EXT_blend_subtract, GL_EXT_texture_lod_bias,
GL_EXT_abgr, GL_EXT_bgra, GL_EXT_stencil_wrap, GL_EXT_texture_filter_anisotropic,
GL_EXT_secondary_color, GL_EXT_blend_func_separate, GL_EXT_shadow_funcs, GL_EXT_stencil_two_side,
GL_EXT_depth_bounds_test, GL_EXT_texture_compression_s3tc, GL_EXT_texture_compression_dxt1, GL_EXT_texture_sRGB,
GL_EXT_blend_equation_separate, GL_EXT_texture_mirror_clamp, GL_EXT_packed_depth_stencil, GL_EXT_bindable_uniform,
GL_EXT_texture_integer, GL_EXT_gpu_shader4, GL_EXT_draw_buffers2, GL_APPLE_flush_buffer_range,
GL_APPLE_ycbcr_422, GL_APPLE_vertex_array_range, GL_APPLE_texture_range, GL_APPLE_float_pixels,
GL_ATI_texture_float, GL_ARB_texture_float, GL_ARB_half_float_pixel, GL_APPLE_pixel_buffer,
GL_APPLE_object_purgeable, GL_NV_point_sprite, GL_NV_register_combiners, GL_NV_register_combiners2,
GL_NV_blend_square, GL_NV_texture_shader, GL_NV_texture_shader2, GL_NV_texture_shader3,
GL_NV_fog_distance, GL_NV_depth_clamp, GL_NV_multisample_filter_hint, GL_NV_fragment_program_option,
GL_NV_fragment_program2, GL_NV_vertex_program2_option, GL_NV_vertex_program3, GL_ATI_texture_mirror_once,
GL_ATI_texture_env_combine3, GL_ATI_separate_stencil, GL_SGIS_texture_edge_clamp, GL_SGIS_texture_lod
Renderer: Failed to set the window icon..
Renderer: Failed to set the window icon..
TextureManager: Non-power-of-two textures are supported.
TextureManager: Available RTT support:
 * FBOs supported (great!).
   -- Packed depth-stencil FBO extension supported.
 * PBuffers supported.
TextureManager: Maximum texture size is 8192 x 8192.
TextRenderer: Loaded a font from "media/fonts/bluehigh.ttf" [size: 32.0].
TextureManager: Loaded a texture from "media/mhgames.png".
ModuleManager: Added module 'InitialLoadingModule'.
TextureManager: Created a new render texture (FBO) "lightmap" (256 x 256).
LightManager: Initialized the light map.
GlyphCache: Created a new page, number 0.
ScriptManager: Using Pnuts v1.2.1.
ScriptManager: Executing the startup script..
ScriptManager: Cached script 'media/scripts/startup.pnuts'.
Hello from "startup.pnuts"!
SoundSystem: Initializing OpenAL..
ShaderManager: Compiled a shader program from "media/shaders/blur_v.glsl + media/shaders/bloomblend.glsl".
ShaderManager: Compiled a shader program from "media/shaders/blur_h.glsl + media/shaders/bloomblend.glsl".
ShaderManager: Compiled a shader program from "media/shaders/bloomcomposite.glsl".
TextureManager: Created a new render texture (FBO) "bloomRT1" (256 x 256).
TextureManager: Created a new render texture (FBO) "bloomRT2" (256 x 256).
BloomEffect: Created successfully.
TextureManager: Created a new render texture (FBO) "sceneRTT" (800 x 600).
RenderPath: Selected the BEST render path.
Game settings dir: /Users/James/.platformer
SoundEngine: Started update thread.
TextureManager: Loaded a texture from "media/light1.png".
LevelLoader: Loading a level from media/house.svg..
MaterialLoader: Parsed 8 materials.
TextureManager: Loaded a texture from "media/mat/leaves.png".
TextureManager: Loaded a texture from "media/mat/wallpaper.png".
TextureManager: Loaded a texture from "media/mat/rocks.png".
TextureManager: Loaded a texture from "media/mat/bricks.png".
TextureManager: Loaded a texture from "media/mat/rocks2.png".
TextureManager: Loaded a texture from "media/mat/dirt.jpg".
TextureManager: Loaded a texture from "media/mat/texture.png".
TextureManager: Loaded a texture from "media/light2.png".
TextureManager: Loaded a texture from "media/light3.png".
ScriptManager: Cached script 'media/scripts/lightswitch.pnuts'.
Generating outlines for 36 polygons..
Outline generation took 71.73 ms.
LevelLoader: Level loaded from media/house.svg.
TextureManager: Loaded a texture from "media/bg.png".
ModuleManager: Added module 'GameModule'.
TextRenderer: Loaded a font from "media/fonts/vera.ttf" [size: 11.0].

That’s entirely possible, since Mac windows never have icons :slight_smile: You should supply an application icon though, you can set it either in the Application Bundle when you distribute your stuff (search Apple’s site) or in the command line add -Xdock:icon=

And after I pressed B the framerate went up to about 58-59.

Yep, I’ll keep this in mind for later. Thanks again! :slight_smile:

I’m on my notebook right now.
HP compaq, ATI/AMD tech stuff

I get this error, while starting up the game:
“An error occured and the game will exit:
Exception: org.lwjgl.opengl.OpenGLException: Invalid value (1281)”

I may have solved this problem… Could you try this version, it has some debug traces to help me narrow down the problem – and it doesn’t take the whole game down when the error occurs. It would help if you’d post the engine.log to me after you’ve tried it. :slight_smile:

Actually it seems to work just fine now, everything

But I can’t find the engine.log =P

It’s in APPDATA\platformer\engine.log on Windows, HOME.platformer\engine.log on Linux and others (HOME is your home directory, like /home/username/ in Linux).