Jump to content

Where to start


Recommended Posts

So I finally got around to getting my fork of OpenJK set up and built. I copied over the base asset pk3s to the gamedata folder, and boom, I now have a fork of OpenJK running.

 

Im thinking of tinkering with some different things, but Id like to make the entry point into the game a little bit more convenient. Basically Id rather have the exe start up and load a basic map right off the bat when I test my build, instead of going through the whole intro cinematic for the first yavin level & so on. I suspect that this is probably written as a .menu file in one of the base assets that gets executed when the game starts up, but Im not sure which one. Does anyone know which one it is and where it is located?

Link to comment

Sounds like you want to start it with command line arguments.  eezstreet has a good tutorial about debugging here: http://jkhub.org/tutorials/article/183-debugging-like-a-pro-win32/ that I'll quote from, but I suggest you read the whole thing before getting started:

 

 

 

If you'd like to add any extra options (fs_game for instance), you can alter those in Project Properties > Debugging > Command Arguments. This works the same way as it would in a .bat file. You will also need to set fs_basepath to point to your Gamedata folder (not pictured)

 

Screenshot%202014-09-27%2021.42.16.png

BruceJohnJenner likes this
Link to comment

Is there a way to do it on linux using cmake?

They're basically just command line arguments.

eg: ./nameofexe -some argument

 

 I'm not super experienced with cmake, but I'm sure you can use it to add arguments with it.

You'd want something like this: openjk +set r_mode -2 +set map mp/ffa3

Which compiler are you using g++?

Link to comment

Thanks for the advice, but I got it to work just by editing the main.menu file in the base packages. The one thing that confused me about the way the OpenJK project is set up with cmake is that just running make without any additional flags only seems to produce the base executable, whereas to create a working copy of the program, you need to run make install (and copy over Assets 0-2 pk3 files from a normal distribution obviously.

 

I now have the program up and working, and the game goes directly from character selection to Oobahs Massassi temple, rather cool :D

 

The only issue I see so far is that NpcSP refuses to run with my OpenJK forked build. Whenever I try to run the game with the npcsp config and pk3 file, the program crashes while loading the map, and the console says something to the effect of "ran out of ui memory". Can anyone confirm that the latest version of OpenJK does not work with npcsp?

Futuza and therfiles like this
Link to comment

The only issue I see so far is that NpcSP refuses to run with my OpenJK forked build. Whenever I try to run the game with the npcsp config and pk3 file, the program crashes while loading the map, and the console says something to the effect of "ran out of ui memory". Can anyone confirm that the latest version of OpenJK does not work with npcsp?

I'll do some testing with it and let you know. Also, was it just singleplayer you tried or multiplayer or what? Mod not intended for multiplayer.

Link to comment

Thanks for the advice, but I got it to work just by editing the main.menu file in the base packages. The one thing that confused me about the way the OpenJK project is set up with cmake is that just running make without any additional flags only seems to produce the base executable, whereas to create a working copy of the program, you need to run make install (and copy over Assets 0-2 pk3 files from a normal distribution obviously.

 

I now have the program up and working, and the game goes directly from character selection to Oobahs Massassi temple, rather cool :D

 

The only issue I see so far is that NpcSP refuses to run with my OpenJK forked build. Whenever I try to run the game with the npcsp config and pk3 file, the program crashes while loading the map, and the console says something to the effect of "ran out of ui memory". Can anyone confirm that the latest version of OpenJK does not work with npcsp?

Whats the actual error?  I don't have one that says ran out of ui memory.

 

The one thing I notice when spawning NPCs is the console does say "unknown UI script ;"  But still spawns anyway. @@therfiles

Link to comment

Whats the actual error?  I don't have one that says ran out of ui memory.

 

The one thing I notice when spawning NPCs is the console does say "unknown UI script ;"  But still spawns anyway. @@therfiles

 

I cant remember the exact text of what it said. Ill try to run it again later today and post it.

 

If you're debugging from the terminal, you can do something like this:

gdb --args ./openjo_sp.i386 +set r_mode 5 +map ffa_bespin

I wouldn't set the window to fullscreen - it makes it a pain to debug then :P

 

So the command line arguments are already implemented in the current code? I thought I was going to have to write them myself sorry.  :rolleyes:

 

I'll do some testing with it and let you know. Also, was it just singleplayer you tried or multiplayer or what? Mod not intended for multiplayer.

 

Single-player, built vanilla off the most recent state of OpenJK on github. The actual repo is here:

 

https://github.com/BruceJohnJennerLawso/OpenJK

 

only a few commits behind the master

 

 

built using cmake & make on Ubuntu linux, running single-player. I cant stand multiplayer to be honest. #foreveralone

 

@@BruceJohnJenner

 

So I did some testing and it worked fine for me.  (Well other then the fact that my models are broken as hell, but that's something else unrelated to the mod).

 

<script pagespeed_no_defer="">//

I couldnt even get that far, the game crashes for me upon loading any map, unless I delete the npcsp files.

 

Its not a big issue, I just dont see any reason why npcsp should not work. Its not that in depth of a mod that it should have issues with different versions of the engine.

Link to comment

built using cmake & make on Ubuntu linux, running single-player. I cant stand multiplayer to be honest. #foreveralone

 

I couldnt even get that far, the game crashes for me upon loading any map, unless I delete the npcsp files.

 

Its not a big issue, I just dont see any reason why npcsp should not work. Its not that in depth of a mod that it should have issues with different versions of the engine.

Did you try it on debug or release mode? I did my testing on release. Also possible it could be a linux specific issue or something. I could fire up my vm and try it, but that probably won't happen any time soon since I'm be pretty busy this weekend.
Link to comment

Okay, heres the output in the console on linux:

bruce@BruceJohnJenner-ThinkPad-X130e:~/development/open_jk_test$ ./openjk_sp.x86_64
OpenJK: v1.0.1.1 linux-x86_64 Jan  7 2015
Initialising zone memory .....
----- FS_Startup -----
Current search path:
/home/bruce/.local/share/openjk/base
./base/zzzz_darth_necriss.pk3 (80 files)
./base/zzzzzzzzzzzzzzSilver Saber.pk3 (21 files)
./base/xyz_dc-15A_pah.pk3 (27 files)
./base/UltimateWeapons.pk3 (633 files)
./base/sssid_blockade_runner_v1.pk3 (51 files)
./base/Pande_JKG_Spaceport.pk3 (122 files)
./base/NpcSP_v1.1.pk3 (16 files)
./base/Massassi Temple.pk3 (539 files)
./base/elegance_hud.pk3 (13 files)
./base/Chiss_species_pack_v2.0.pk3 (230 files)
./base/assets2.pk3 (62 files)
./base/assets1.pk3 (8320 files)
./base/assets0.pk3 (15346 files)
./base

----------------------
25460 files in pk3 files
execing default.cfg
execing openjk_sp.cfg
couldn't exec autoexec_sp.cfg
Running Jedi Academy Mode
----- Client Initialization -----
----- Initializing Renderer ----
Trying to load "rdsp-vanilla_x86_64.so" from "."...
-------------------------------
----- Client Initialization Complete -----
--- Common Initialization Complete ---
SDL using driver "x11"
Initializing OpenGL display
Display aspect: 1.779
...setting mode -1: 800 600
Using 24 color bits, 24 depth, 8 stencil display.
Available modes: '1366x768 1360x768 640x480 800x600 1024x768'
GL_RENDERER: Mesa DRI Intel(R) Sandybridge Mobile 
Initializing OpenGL extensions
...GL_S3_s3tc available
...GL_EXT_texture_compression_s3tc available
...no tc preference specified
.....using GL_EXT_texture_compression_s3tc
...using GL_EXT_texture_env_add
...GL_EXT_texture_filter_anisotropic available
...using GL_EXT_texture_filter_anisotropic
...using GL_EXT_texture_edge_clamp
...using GL_ARB_multitexture
...using GL_EXT_compiled_vertex_array
...GL_NV_register_combiners not found

GL_VENDOR: Intel Open Source Technology Center
GL_RENDERER: Mesa DRI Intel(R) Sandybridge Mobile 
GL_VERSION: 3.0 Mesa 10.3.0
GL_ARB_multisample GL_EXT_abgr GL_EXT_bgra GL_EXT_blend_color GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_copy_texture GL_EXT_polygon_offset GL_EXT_subtexture GL_EXT_texture_object GL_EXT_vertex_array GL_EXT_compiled_vertex_array GL_EXT_texture GL_EXT_texture3D GL_IBM_rasterpos_clip GL_ARB_point_parameters GL_EXT_draw_range_elements GL_EXT_packed_pixels GL_EXT_point_parameters GL_EXT_rescale_normal GL_EXT_separate_specular_color GL_EXT_texture_edge_clamp GL_SGIS_generate_mipmap GL_SGIS_texture_border_clamp GL_SGIS_texture_edge_clamp GL_SGIS_texture_lod GL_ARB_framebuffer_sRGB GL_ARB_multitexture GL_EXT_framebuffer_sRGB GL_IBM_multimode_draw_arrays GL_IBM_texture_mirrored_repeat GL_3DFX_texture_compression_FXT1 GL_ARB_texture_cube_map GL_ARB_texture_env_add GL_ARB_transpose_matrix GL_EXT_blend_func_separate GL_EXT_fog_coord GL_EXT_multi_draw_arrays GL_EXT_secondary_color GL_EXT_texture_env_add GL_EXT_texture_filter_anisotropic GL_EXT_texture_lod_bias GL_INGR_blend_func_separate GL_NV_blend_square GL_NV_light_max_exponent GL_NV_texgen_reflection GL_NV_texture_env_combine4 GL_S3_s3tc GL_SUN_multi_draw_arrays GL_ARB_texture_border_clamp GL_ARB_texture_compression GL_EXT_framebuffer_object GL_EXT_texture_compression_s3tc GL_EXT_texture_env_combine GL_EXT_texture_env_dot3 GL_MESA_window_pos GL_NV_packed_depth_stencil GL_NV_texture_rectangle GL_ARB_depth_texture GL_ARB_occlusion_query GL_ARB_shadow GL_ARB_texture_env_combine GL_ARB_texture_env_crossbar GL_ARB_texture_env_dot3 GL_ARB_texture_mirrored_repeat GL_ARB_window_pos GL_EXT_stencil_two_side GL_EXT_texture_cube_map GL_NV_depth_clamp GL_APPLE_packed_pixels GL_APPLE_vertex_array_object GL_ARB_draw_buffers GL_ARB_fragment_program GL_ARB_fragment_shader GL_ARB_shader_objects GL_ARB_vertex_program GL_ARB_vertex_shader GL_ATI_draw_buffers GL_ATI_texture_env_combine3 GL_ATI_texture_float GL_EXT_shadow_funcs GL_EXT_stencil_wrap GL_MESA_pack_invert GL_NV_primitive_restart GL_ARB_depth_clamp GL_ARB_fragment_program_shadow GL_ARB_half_float_pixel GL_ARB_occlusion_query2 GL_ARB_point_sprite GL_ARB_shading_language_100 GL_ARB_sync GL_ARB_texture_non_power_of_two GL_ARB_vertex_buffer_object GL_ATI_blend_equation_separate GL_EXT_blend_equation_separate GL_OES_read_format GL_ARB_color_buffer_float GL_ARB_pixel_buffer_object GL_ARB_texture_compression_rgtc GL_ARB_texture_float GL_ARB_texture_rectangle GL_EXT_packed_float GL_EXT_pixel_buffer_object GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_rgtc GL_EXT_texture_rectangle GL_EXT_texture_sRGB GL_EXT_texture_shared_exponent GL_ARB_framebuffer_object GL_EXT_framebuffer_blit GL_EXT_framebuffer_multisample GL_EXT_packed_depth_stencil GL_APPLE_object_purgeable GL_ARB_vertex_array_object GL_ATI_separate_stencil GL_EXT_draw_buffers2 GL_EXT_draw_instanced GL_EXT_gpu_program_parameters GL_EXT_texture_array GL_EXT_texture_integer GL_EXT_texture_sRGB_decode GL_EXT_timer_query GL_OES_EGL_image GL_AMD_performance_monitor GL_ARB_copy_buffer GL_ARB_depth_buffer_float GL_ARB_draw_instanced GL_ARB_half_float_vertex GL_ARB_instanced_arrays GL_ARB_map_buffer_range GL_ARB_texture_rg GL_ARB_texture_swizzle GL_ARB_vertex_array_bgra GL_EXT_texture_swizzle GL_EXT_vertex_array_bgra GL_NV_conditional_render GL_AMD_draw_buffers_blend GL_AMD_seamless_cubemap_per_texture GL_ARB_ES2_compatibility GL_ARB_blend_func_extended GL_ARB_debug_output GL_ARB_draw_buffers_blend GL_ARB_draw_elements_base_vertex GL_ARB_explicit_attrib_location GL_ARB_fragment_coord_conventions GL_ARB_provoking_vertex GL_ARB_sample_shading GL_ARB_sampler_objects GL_ARB_seamless_cube_map GL_ARB_shader_texture_lod GL_ARB_texture_cube_map_array GL_ARB_texture_gather GL_ARB_texture_multisample GL_ARB_texture_query_lod GL_ARB_texture_rgb10_a2ui GL_ARB_uniform_buffer_object GL_ARB_vertex_type_2_10_10_10_rev GL_EXT_provoking_vertex GL_EXT_texture_snorm GL_MESA_texture_signed_rgba GL_ARB_get_program_binary GL_ARB_robustness GL_ARB_separate_shader_objects GL_ARB_shader_bit_encoding GL_ARB_timer_query GL_ANGLE_texture_compression_dxt3 GL_ANGLE_texture_compression_dxt5 GL_ARB_compressed_texture_pixel_storage GL_ARB_internalformat_query GL_ARB_map_buffer_alignment GL_ARB_shading_language_420pack GL_ARB_shading_language_packing GL_ARB_texture_storage GL_EXT_framebuffer_multisample_blit_scaled GL_EXT_transform_feedback GL_AMD_shader_trinary_minmax GL_ARB_ES3_compatibility GL_ARB_clear_buffer_object GL_ARB_copy_image GL_ARB_explicit_uniform_location GL_ARB_invalidate_subdata GL_ARB_texture_query_levels GL_ARB_texture_storage_multisample GL_ARB_vertex_attrib_binding GL_KHR_debug GL_ARB_buffer_storage GL_ARB_clear_texture GL_ARB_multi_bind GL_ARB_seamless_cubemap_per_texture GL_ARB_texture_mirror_clamp_to_edge GL_ARB_vertex_type_10f_11f_11f_rev GL_EXT_shader_integer_mix GL_INTEL_performance_query GL_ARB_conditional_render_inverted 
GL_MAX_TEXTURE_SIZE: 8192
GL_MAX_ACTIVE_TEXTURES_ARB: 8

PIXELFORMAT: color(24-bits) Z(24-bit) stencil(8-bits)
MODE: -1, 800 x 600 fullscreen hz:N/A
GAMMA: hardware w/ 0 overbright bits
rendering primitives: single glDrawElements
texturemode: GL_LINEAR_MIPMAP_LINEAR
picmip: 0
texture bits: 0
lightmap texture bits: 0
multitexture: enabled
compiled vertex arrays: enabled
texenv add: enabled
compressed textures: enabled
compressed lightmaps: disabled
texture compression method: GL_EXT_texture_compression_s3tc
anisotropic filtering: enabled  (16 of 16)
Dynamic Glow: disabled

------- sound initialization -------
SDL_Init( SDL_INIT_AUDIO )... OK
SDL audio driver is "pulseaudio".
SDL_AudioSpec:
  Format:   AUDIO_S16LSB
  Freq:     44100
  Samples:  512
  Channels: 2
Starting SDL audio callback...
SDL audio initialized.
UI menu load time = 1032 milli seconds
Loading... jedi_02
------ Server Initialization ------
OpenJK: v1.0.1.1 linux-x86_64 Jan  7 2015
Server: mp/ffa_mtd
Sys_GetGameAPI(./base/jagamex86_64.so) failed: "Failed loading ./base/jagamex86_64.so: ./base/jagamex86_64.so: cannot open shared object file: No such file or directory"
Sys_GetGameAPI(/home/bruce/.local/share/openjk/base/jagamex86_64.so) failed: "Failed loading /home/bruce/.local/share/openjk/base/jagamex86_64.so: /home/bruce/.local/share/openjk/base/jagamex86_64.so: cannot open shared object file: No such file or directory"
Sys_GetGameAPI(./OpenJK/jagamex86_64.so): succeeded ...
------- Game Initialization -------
gamename: OpenJK
gamedate: Jan  7 2015
ERROR: info_player_intermission is not a spawn function @(286.562 198.376 150.5)
ERROR: item_ysalimari is not a spawn function @(1632 2128 -4068)
ERROR: item_ysalimari is not a spawn function @(2048 1280 -3808)
ERROR: item_ysalimari is not a spawn function @(3488 1632 -4068)
ERROR: item_ysalimari is not a spawn function @(1792 -864 -4068)
ERROR: item_ysalimari is not a spawn function @(368 -736 -3752)
-----------------------------------
-----------------------------------
Done.
UI menu load time = 2075 milli seconds
UI_Alloc: Failure. Out of memory!
Segmentation fault (core dumped)
bruce@BruceJohnJenner-ThinkPad-X130e:~/development/open_jk_test$ 

Although there are a few mods installed, the behaviour was there when the game was completely vanilla (no extra pk3s besides Oobahs Massassi temple)

Link to comment

Well, something is using up a lot of the UI_Alloc memory to fill that 1 meg allocation pool.

 

I'm going to bump it up to 2 megs to be the same as what MP currently is at for UI allocations.  Maybe that will help.

 

Update your repo to the master to see if bumping the limit to 2 megs helps you.

 

Willing to bet its your species pack in combination with NPCSP that caused the issue.

Link to comment

Forgive me if this is a dumb question, but why cap the memory available to the UI?

Because it just is the way it always was.  Its not using the heap memory.  This is a throwback to q3a which only used qvms and cannot allocate using malloc/calloc/alloca/new.  Rather not go and change all of this for the time being.

BruceJohnJenner likes this
Link to comment

Because it just is the way it always was.  Its not using the heap memory.  This is a throwback to q3a which only used qvms and cannot allocate using malloc/calloc/alloca/new.  Rather not go and change all of this for the time being.

 

Ah, so it just initializes a block of memory at startup and uses it like a sort of scratchpad? Thats peculiar, but whatever works... At least its still allocated on the stack then.

 

Where can I adjust this in the code?

Link to comment

Look for UI_Alloc in ui_shared.cpp

 

Thanks. Is there any reason why not to simply set it higher by default in the main branch of OpenJK? A mb is pretty small potatoes for most computers RAM-wise these days, so maybe it would be better just to set the amount fairly high so problems like this dont happen very often?

Link to comment

Thanks. Is there any reason why not to simply set it higher by default in the main branch of OpenJK? A mb is pretty small potatoes for most computers RAM-wise these days, so maybe it would be better just to set the amount fairly high so problems like this dont happen very often?

First time I've heard it happen.

BruceJohnJenner likes this
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...