Issue285

Title lvledit: do not give the same label to more than 1 obstacle
Priority feature Status open
Assigned To Keywords editor
Linked issues Watchers

Submitted on 2011-07-24 19h07 by tracker_migration, last changed by salimiles.

Messages
Author: tracker_migration Date: 2010-04-22   11h26
Submitted by hakzsam
Found on:
r2644 (probably always existed)

Steps to reproduce:
1. Start Level Editor
2. Select an obstacle
3. Create a new label for this obstacle
4. Select an other obstacle
5. Create a new label with the same name
6. Press Undo
7. The editor crashes...
Author: tracker_migration Date: 2010-04-22   11h29
Posted by matthiaskrgr
Please launch the game in a terminal, reproduce and post the crash-output there.
That might very much help fixing that bug. :)
Author: tracker_migration Date: 2010-04-22   11h36
Posted by hakzsam
command line : ./freedroidRPG -r2

the crash-output here :

Hello, this is FreedroidRPG, version 0.13+.
This seems to be a 'stable' release, so no exit on floating point exceptions.
-Signal Handling------------------------------------------------------
Setting up signal handlers for internal backtrace:
Now catching SIGSEGV: YES
Now catching FPE (if raised, that is!): YES


Video system type: x11.
Using screen resolution 1024 x 768.
Testing if color depth 32 bits is available... YES.

video mode set (bpp=32 RGBA=8880 depth=24)
-OpenGL-------------------------------------------------------
Vendor     : NVIDIA Corporation
Renderer   : GeForce FX 5200/AGP/SSE/3DNOW!
Version    : 2.1.0 NVIDIA 96.43.10
Extensions : GL_ARB_depth_texture GL_ARB_fragment_program GL_ARB_fragment_program_shadow GL_ARB_fragment_shader GL_ARB_half_float_pixel GL_ARB_imaging GL_ARB_multisample GL_ARB_multitexture GL_ARB_occlusion_query GL_ARB_pixel_buffer_object GL_ARB_point_parameters GL_ARB_point_sprite GL_ARB_shadow GL_ARB_shader_objects GL_ARB_shading_language_100 GL_ARB_texture_border_clamp GL_ARB_texture_compression GL_ARB_texture_cube_map GL_ARB_texture_env_add GL_ARB_texture_env_combine GL_ARB_texture_env_dot3 GL_ARB_texture_mirrored_repeat GL_ARB_texture_rectangle GL_ARB_transpose_matrix GL_ARB_vertex_buffer_object GL_ARB_vertex_program GL_ARB_vertex_shader GL_ARB_window_pos GL_S3_s3tc GL_EXT_texture_env_add GL_EXT_abgr GL_EXT_bgra GL_EXT_blend_color GL_EXT_blend_func_separate GL_EXT_blend_minmax GL_EXT_blend_subtract GL_EXT_compiled_vertex_array GL_EXT_Cg_shader GL_EXT_draw_range_elements GL_EXT_fog_coord GL_EXT_framebuffer_object GL_EXT_gpu_program_parameters GL_EXT_multi_draw_arrays GL_EXT_packed_depth_stencil GL_EXT_packed_pixels GL_EXT_paletted_texture GL_EXT_pixel_buffer_object GL_EXT_point_parameters GL_EXT_rescale_normal GL_EXT_secondary_color GL_EXT_separate_specular_color GL_EXT_shadow_funcs GL_EXT_shared_texture_palette GL_EXT_stencil_two_side GL_EXT_stencil_wrap GL_EXT_texture3D GL_EXT_texture_compression_s3tc GL_EXT_texture_cube_map GL_EXT_texture_edge_clamp GL_EXT_texture_env_combine GL_EXT_texture_env_dot3 GL_EXT_texture_filter_anisotropic GL_EXT_texture_lod GL_EXT_texture_lod_bias GL_EXT_texture_object GL_EXT_texture_sRGB GL_EXT_timer_query GL_EXT_vertex_array GL_HP_occlusion_test GL_IBM_rasterpos_clip GL_IBM_texture_mirrored_repeat GL_KTX_buffer_region GL_NV_blend_square GL_NV_copy_depth_to_color GL_NV_depth_clamp GL_NV_fence GL_NV_float_buffer GL_NV_fog_distance GL_NV_fragment_program GL_NV_fragment_program_option GL_NV_half_float GL_NV_light_max_exponent GL_NV_multisample_filter_hint GL_NV_occlusion_query GL_NV_packed_depth_stencil GL_NV_pixel_data_range GL_NV_point_sprite GL_NV_primitive_restart GL_NV_register_combiners GL_NV_register_combiners2 GL_NV_texgen_reflection GL_NV_texture_compression_vtc GL_NV_texture_env_combine4 GL_NV_texture_expand_normal GL_NV_texture_rectangle GL_NV_texture_shader GL_NV_texture_shader2 GL_NV_texture_shader3 GL_NV_vertex_array_range GL_NV_vertex_array_range2 GL_NV_vertex_program GL_NV_vertex_program1_1 GL_NV_vertex_program2 GL_NV_vertex_program2_option GL_SGIS_generate_mipmap GL_SGIS_texture_lod GL_SGIX_depth_texture GL_SGIX_shadow GL_SUN_slice_accum 


----------------------------------------------------------------------
Freedroid has encountered a problem:
In Function: action_change_obstacle_label.
FreedroidRPG package and version number: freedroidrpg 0.13+.
    The label label already exists on this map!  Replacing old entry with the new one!The problem mentionned above is not fatal, we continue the execution.
----------------------------------------------------------------------
print_trace:  Obtained 12 stack frames.
print_trace:  Obtaining symbols now done.
src/.(print_trace+0x1e) [0x809184e]
[0xb8051400]
src/.(TextWidth+0x1a) [0x80a9d3a]
src/.(show_backgrounded_label_at_pixel_position+0x2b) [0x8091c6b]
src/.(show_backgrounded_label_at_map_position+0x4c) [0x809328c]
src/.(show_obstacle_labels+0x69) [0x80a6739]
src/.(AssembleCombatPicture+0x3c9) [0x80a8cb9]
src/.(leveleditor_display+0x42) [0x80c0212]
src/.(LevelEditor+0x45) [0x80bd275]
src/.(main+0x12d) [0x809b82d]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe5) [0xb7c9e775]
src/. [0x805cd51]

print_trace():  received SIGSEGV!

----------------------------------------------------------------------
Termination of freedroidRPG initiated...Thank you for playing freedroidRPG.
Author: tracker_migration Date: 2010-04-22   12h19
Posted by stedevil
While you are technically completely correct Mattias, it was already covered on IRC today. Bug only created as a base to the RB patch review request that should come later today.

But of course pasting this discussion should probably have been done by you from the start hakzsam. Life sometimes change ones plans and thus good bug descriptions are always useful even if it's just an IRC cut & paste. :)

2010-04-22 13:15:53 <+Stedevil> hakzsam: confirmed
2010-04-22 13:16:14 <+Stedevil> btw, the issue really is that you are allowed to create 2 obstacles with the same name
2010-04-22 13:16:37 <+Stedevil> obstacle labels AFAIK has to be unique for the entire "world"
2010-04-22 13:16:56 <+Stedevil> so you can't even have 2 of the same on different levels
2010-04-22 13:18:04 <+Stedevil> so I presume fix would be to warn/refuse to create a label that is already exsisting i the world
2010-04-22 13:19:05 < hakzsam> Stedevil: Okay,  I can post this bug on the tracker ?
2010-04-22 13:19:10 <+Stedevil> (this btw is one of many issue that dont affect me at all since I already learned by experience how to do thing, but that will be highly annoying and potentially cause 
                                dataloss for a new person trying the editor)
2010-04-22 13:19:17 <+Stedevil> hakzsam: sure do :)
2010-04-22 13:21:14 < hakzsam> ok, then when this bug will be fixed, I'll try to improve obstacle and map labels :)
2010-04-22 13:30:21 < hakzsam> Stedevil: I posted the bug, I'll try to propose a patch before tonight :)
2010-04-22 13:31:07 <+Stedevil> hakzsam: Great and Super Great! :)
Author: tracker_migration Date: 2010-04-22   12h23
Posted by matthiaskrgr
Ok, I currently have no chance to join you on IRC, chatting is officially forbidden form library PCs. :/

Btw. MattHias, not Mattias. :) (Another variation if Mathias (posted just for more confusion :oP) )
Author: tracker_migration Date: 2010-05-19   19h58
Posted by ahuillet
Fixed in rev. 2778.

However, this revision introduces a new bug : it does not guarantee the unicity of an obstacle label. On step 5, you end up with two obstacles bearing the same label. 

Morphing title to reflect this.
Author: tracker_migration Date: 2010-05-20   14h32
Posted by stedevil
> However, this revision introduces a new bug : it does not guarantee the unicity of an obstacle label.

DO you mean to say that it's currently possible/legal to have the same name multiple times? That suits me just fine. Removes the need for sillyness like eg 
TutorialZigZag1
TutorialZigZag2
TutorialZigZag3
TutorialZigZag4
if I can just call all 4 
TutorialZigZag
and change all 4 at once in the dialog.
Author: tracker_migration Date: 2010-05-20   14h41
Posted by ahuillet
The underlying assumption is that an obstacle label identifies an obstacle in a unique manner.

If you want to challenge this assumption, this is something I'm open to think about.
Author: tracker_migration Date: 2010-05-26   15h40
Posted by stedevil
Well, I can see 2 proper behaviors from my POV

Either
"has to be unique, can never happen that we get both"
or
"is allowed to exist in multiple places, thus can be created multiple copies"

any mix between the two is not acceptable (which is what we have now with can be created but is not "allowed")
Author: tracker_migration Date: 2010-09-26   10h53
Posted by ahuillet
Moving to RFE as this isn't strictly speaking a bug.
History
Date User Action Args
2011-11-15 21:42:49salimilessettitle: do not give the same label to more than 1 obstacle -> lvledit: do not give the same label to more than 1 obstacle
2011-07-27 06:24:43ahuilletsetpriority: bug -> feature
keyword: + editor
title: EDITOR: do not give the same label to more than 1 obstacle -> do not give the same label to more than 1 obstacle
2011-07-24 19:07:53tracker_migrationcreate