CPU use, framerate, shipscripts and random freezes.

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

Post Reply
User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

CPU use, framerate, shipscripts and random freezes.

Post by Capt. Murphy »

Using 1.75.2 and current trunk.

Windows XP, Pentium 1.73 mhz, 1gb RAM. Radeon x700 512Mb... rest is in the log posted below.

I normally run Oolite with a reasonably constant frame rate of 60 and with the CPU running at 70 to 80% ish. However I've noticed in some 'busy' systems CPU cranks up to 100% and frame rate starts dropping sometimes as low as the 30's.

I've also noted that if I'm testing my escort contracts OXP (which includes an NPC with a custom AI with lots of interaction with a shipscript) in one of these systems, I tend to lose another 3-4 frames per second (they are regained if I kill the NPC or the NPC docks). This may be because I'm logging it's AI messages though.

If the frame rate hits about 30 or below the game will sooner or later freeze (normally during combat) and I need to kill the process with task manager.

This isn't a new problem (present in 1.75.1 and 1.75.0), but intermittent enough that I couldn't really identify a possible cause to make it worth reporting as a bug. Also changing my graphic drivers from the official ATI Catalyst to the Omega drivers seemed to reduce the frequency of freezes a lot.

Anyway I'm now wondering if other OXP introduced entities with ship scripts are one of the problems. Is there a setting in logcontrol.plist that will log how many entities in a particular system have got an attached ship script? I then may be able to identify the OXP(s) that are giving me the most slowdown and/or causing the freezes?


e2a - I've just discovered script.trace.legacy & script.trace.javaScript in logcontrol.plist which may be helpful for me.

12:45:40.093 [log.header]: Opening log for Oolite development version 1.75.3.4560 (x86-32 test release) under Windows at 2011-06-12 12:45:39 +0100.
1 processor detected.
Build options: spoken messages, mass/fuel pricing, JavaScript console support, OXP verifier, localization tools, debug GraphViz support, JavaScript profiling.

Note that the contents of the log file can be adjusted by editing logcontrol.plist.

12:45:40.546 [display.mode.list.native]: Windows native resolution detected: 1280 x 800
12:45:49.703 [joystick.init]: Number of joysticks detected: 0
12:45:50.890 [dataCache.rebuild.explicitFlush]: Cache explicitly flushed with always-flush-cache preference. Rebuilding from scratch.
12:45:50.906 [searchPaths.dumpAll]: Unrestricted mode - resource paths:
Resources
../AddOns
../AddOns/AA_griff_shipset_all_in_1.oxp
../AddOns/AB_neolite-companion.oxp
../AddOns/AC_neolite-wolfies.oxp
../AddOns/behemoth 2.6.oxp
../AddOns/BGS-A1.3.3.oxp
../AddOns/black_baron.oxp
../AddOns/BountyScannerv2.0.oxp
../AddOns/BountyStatus 1.00.oxp
../AddOns/Cabal_Common_Library1.4.oxp
../AddOns/DeepSpacePirates 1.3.oxp
../AddOns/Escort Contracts 1.0.oxp
../AddOns/Flight Log 1.03.oxp
../AddOns/Fuel Station 1.32.oxp
../AddOns/Gates 1.12.oxp
../AddOns/Hired Guns 1.25.oxp
../AddOns/HyperCargo 1.04.oxp
../AddOns/Illegal_goods_tweak_1.3.oxp
../AddOns/longway 1.1.oxp
../AddOns/neocaduceus.oxp
../AddOns/neolite.oxp
../AddOns/Pirate_coves 1.2.2.oxp
../AddOns/railgun.oxp
../AddOns/RandomHits1.4.9.oxp
../AddOns/Rock_Hermit_Locator1.3.2.oxp
../AddOns/sell_equipment.oxp
../AddOns/Snoopers2.1.1.oxp
../AddOns/Stellar Serpents 1.11.oxp
../AddOns/sunskimmers.oxp
../AddOns/System_Redux.oxp
../AddOns/Target Autolock Plus 1.12.oxp
../AddOns/Target Reticle 1.2.1.oxp
../AddOns/thargoidcarrier.oxp
../AddOns/Tori2.01.oxp
../AddOns/UPS-courier v1.7.7.oxp
../AddOns/Vector1.5.oxp
../AddOns/wormhole_restoration.oxp
../AddOns/YOUR_AD_HERE.oxp
../AddOns/YOUR_AD_HERE_set_A.oxp
../AddOns/YOUR_AD_HERE_set_B.oxp
../AddOns/YOUR_AD_HERE_set_C.oxp
../AddOns/YOUR_AD_HERE_set_D.oxp
../AddOns/YOUR_AD_HERE_set_E.oxp
../AddOns/YOUR_AD_HERE_set_F.oxp
../AddOns/YOUR_AD_HERE_Z.oxp
../AddOns/zzz_personal_shipyard.oxp
../AddOns/zz_change_default_jameson_ship.oxp
../AddOns/Z_GrOovy_System_Stations.oxp
12:45:50.906 [rendering.opengl.version]: OpenGL renderer version: 2.1.7169 ("2.1.7169 Release"). Vendor: "ATI Technologies Inc.". Renderer: "ATI Mobility Radeon X700 (Omega 3.8.442)".
12:45:50.906 [rendering.opengl.extensions]: OpenGL extensions (82):
GL_ARB_texture_env_crossbar, GL_ARB_shadow, GL_EXT_texture_edge_clamp, GL_EXT_separate_specular_color, GL_EXT_blend_minmax, GL_EXT_texture_object, GL_ARB_texture_env_add, GL_ATI_meminfo, GL_EXT_texture_cube_map, GL_EXT_texture_env_dot3, GL_ARB_texture_env_dot3, GL_ARB_shadow_ambient, GL_EXT_framebuffer_object, GL_EXT_blend_subtract, GL_EXT_copy_texture, GL_ARB_multitexture, GL_EXT_stencil_wrap, GL_ARB_texture_border_clamp, GL_ARB_texture_env_combine, GL_EXT_texgen_reflection, GL_SGIS_texture_edge_clamp, GL_EXT_texture_env_add, GL_EXT_packed_pixels, GL_SGIS_texture_lod, GL_ARB_depth_texture, GL_ARB_transpose_matrix, GL_ARB_occlusion_query, GL_NV_texgen_reflection, GL_ARB_shading_language_100, GL_EXT_rescale_normal, GL_EXT_gpu_program_parameters, GL_ATI_fragment_shader, GL_ATI_texture_float, GL_ARB_pixel_buffer_object, GL_EXT_secondary_color, GL_ARB_texture_mirrored_repeat, GL_EXT_draw_range_elements, GL_EXT_texture_lod_bias, GL_EXT_texture_filter_anisotropic, WGL_EXT_swap_control, GL_SGIS_generate_mipmap, GL_ARB_texture_rectangle, GL_ARB_point_sprite, GL_EXT_texture_compression_s3tc, GL_EXT_packed_depth_stencil, GL_ARB_vertex_shader, GL_ARB_vertex_buffer_object, GL_WIN_swap_hint, GL_ARB_shader_objects, GL_EXT_texture_mirror_clamp, GL_ATI_separate_stencil, GL_EXT_texture_rectangle, GL_ARB_fragment_shader, GL_KTX_buffer_region, GL_EXT_texture3D, GL_EXT_fog_coord, GL_EXT_subtexture, GL_ARB_window_pos, GL_EXT_point_parameters, GL_ARB_fragment_program, GL_EXT_texture_env_combine, GL_ARB_vertex_program, GL_EXT_compiled_vertex_array, GL_EXT_bgra, GL_ARB_texture_cube_map, GL_ARB_point_parameters, GL_EXT_vertex_array, GL_ARB_multisample, GL_ARB_draw_buffers, GL_EXT_multi_draw_arrays, GL_ATI_draw_buffers, GL_ARB_texture_compression, GL_AMD_performance_monitor, GL_EXT_blend_func_separate, GL_ATI_texture_env_combine3, GL_ARB_texture_float, GL_EXT_texture_sRGB, GL_EXT_shadow_funcs, GL_ATI_texture_compression_3dc, GL_EXT_blend_color, GL_NV_blend_square, GL_ATI_envmap_bumpmap
12:45:50.953 [rendering.opengl.shader.support]: Shaders are supported.
[EliteWiki] Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: CPU use, framerate, shipscripts and random freezes.

Post by Svengali »

Sometimes it's just a single shader or AI/script that causes slowdowns.

As you are on a second generation gfx-card, try it without Griffs All-In-One. On my machine it causes FPS drops even if used as standalone OXP, probably because of shader swapping. Although it does not cause freezes for me.

Another thing is to try BGS-C + BGS-I instead of BGS-A.
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: CPU use, framerate, shipscripts and random freezes.

Post by Svengali »

Capt. Murphy wrote:
Windows XP, Pentium 1.73 mhz, 1gb RAM. Radeon x700 512Mb
Could be an idea to check the running background tasks as well. Maybe some of them can be suspended (not killed!) when running Oolite.
User avatar
Capt. Murphy
Commodore
Commodore
Posts: 1127
Joined: Fri Feb 25, 2011 8:46 am
Location: UK South Coast.

Re: CPU use, framerate, shipscripts and random freezes.

Post by Capt. Murphy »

Cheers Svengali,

I'm loathe to remove Griff's ship set, I've had it installed since more or less day 1 of my current OOlite addiction as I've said normally (70-80%) of the time the system runs at under 100% CPU and full frame rate.

I will look at reducing the amount of stuff I've got on in the background though, it's fairly extensive.

The extra logging is proving useful - there does appear to be a pattern with regards to what script has just been called and what is about to be called when a freeze occurs. I only suffered a couple yesterday though so need to do more testing.....
[EliteWiki] Capt. Murphy's OXPs
External JavaScript resources - W3Schools & Mozilla Developer Network
Win 7 64bit, Intel Core i5 with HD3000 (driver rev. 8.15.10.2696 - March 2012), Oolite 1.76.1
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: CPU use, framerate, shipscripts and random freezes.

Post by Svengali »

He, I haven't said that you should remove it completely .-)

Thing is that identifying bottlenecks on a system is a complex task, so if you see the same behaviour e.g. in vanilla Oolite or with a specific OXP this can be a pointer where to look closer. So switching the set of used OXPs is one step (and only one of quite a few steps) in this process.
User avatar
Griff
Oolite 2 Art Director
Oolite 2 Art Director
Posts: 2483
Joined: Fri Jul 14, 2006 12:29 pm
Location: Probably hugging his Air Fryer

Re: CPU use, framerate, shipscripts and random freezes.

Post by Griff »

I think it might be the griff_all_in_1 shipset behind the frame rate issues, v1.0 & v1.1 of the shipset spawn a cloud of burning space junk when the ships explode, (even if this happens off-screen) eaning it suddenly adds a lot of extra objects for Oolite to have to worry about and i think it's what is causing the frame rate stutters, i'm in the process of uploading v1.2 of the oxp to Commander Cheyd's deephorizon industries site, it removes the debris & alloy/junk items (which i'll then put into a seperate oxp for anybody who wants them back in-game)
Post Reply