Author Topic: [Fixed] Crash: git-master, when casting spells  (Read 1413 times)

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
[Fixed] Crash: git-master, when casting spells
« on: 22 May 2011, 07:46:18 »


Code: [Select]
Crash
Version: Advanced Engine git-master
Built: May 13 2011
Time: Sun May 22 03:40:32 2011
Description: SIGSEGV: address not mapped to object
Address: 0x84
Backtrace:
./glestadv(_ZN6Shared8Platform24PlatformExceptionHandler7handlerEiP7siginfoPv+0x301) [0x8522be7]
[0xfbb40c]
./glestadv(_ZNK5Glest8Entities4Unit5getIdEv+0x6) [0x8280f5e]
./glestadv(_ZN5Glest8Entities6EffectC1ENS1_12CreateParamsE+0x41) [0x82da3db]
./glestadv(_ZN5Glest3Sim13EntityFactoryINS_8Entities6EffectEE11newInstanceINS3_12CreateParamsEEEPS3_T_+0x3a) [0x84d7ad0]
./glestadv(_ZN5Glest3Sim19MasterEntityFactory9newEffectEPKNS_10ProtoTypes10EffectTypeEPNS_8Entities4UnitEPNS6_6EffectEN6Shared4Math5fixedEPKS7_PKNS2_8TechTreeE+0x77) [0x84d6433]
./glestadv(_ZN5Glest3Sim5World12applyEffectsEPNS_8Entities4UnitERKSt6vectorIPNS_10ProtoTypes10EffectTypeESaIS8_EES4_N6Shared4Math5fixedE+0x276) [0x84d13e6]
./glestadv(_ZN5Glest3Sim5World12applyEffectsEPNS_8Entities4UnitERKSt6vectorIPNS_10ProtoTypes10EffectTypeESaIS8_EERKN6Shared4Math4Vec2IiEENS0_5FieldEi+0x1e1) [0x84d1097]
./glestadv(_ZN5Glest8Entities4Unit17startSpellSystemsEPKNS_10ProtoTypes18CastSpellSkillTypeE+0x352) [0x82ab3ec]
./glestadv(_ZN5Glest8Entities4Unit6updateEv+0x274) [0x82aef82]
./glestadv(_ZN5Glest8Entities4Unit8doUpdateEv+0x11) [0x82aea0d]
./glestadv(_ZN5Glest3Sim5World11updateUnitsEPKNS_8Entities7FactionE+0x3d) [0x84d0401]
./glestadv(_ZN5Glest3Sim5World12processFrameEv+0xca) [0x84d04f6]
./glestadv(_ZN5Glest3Sim19SimulationInterface11updateWorldEv+0xce) [0x84c6710]
./glestadv(_ZN5Glest3Gui9GameState6updateEv+0x180) [0x82f5dde]
./glestadv(_ZN5Glest4Main7Program4loopEv+0x240) [0x83610dc]
./glestadv(_ZN5Glest4Main9glestMainEiPPc+0x33f) [0x835a9c9]
./glestadv(main+0x79) [0x835ad06]
/lib/libc.so.6(__libc_start_main+0xe7) [0x4bcce7]
./glestadv() [0x8274651]

=======================

Code: [Select]
<?xml version="1.0" standalone="no"?>

<unit>
<parameters>
<size value="2"/>
<height value="4"/>
<max-hp value="3000" regeneration="0"/>
<max-ep value="400" regeneration="10"/>
<armor value="35"/>
<armor-type value="light"/>
<sight value="12"/>
<time value="200"/>
<multi-selection value="true"/>
<cellmap value="false"/>
<levels>
<level name="brutal" kills="8"/>
<level name="monstrous" kills="20"/>
</levels>
<fields>
<field value="land"/>
</fields>
<properties/>
<light enabled="false"/>
<unit-requirements>
<unit name="standing_stones"/>
<unit name="shaman"/>
</unit-requirements>
<upgrade-requirements/>
<resource-requirements>
<resource name="gold" amount="300"/>
<resource name="wood" amount="150"/>
<resource name="food" amount="3"/>
</resource-requirements>
<resources-stored/>
<image path="images/therian.bmp"/>
<image-cancel path="../dun/images/moon_cancel.bmp"/>
<meeting-point value="false"/>
<!--
<selection-sounds enabled="true">
<sound path="sounds/therian_select1.ogg"/>
<sound path="sounds/therian_select2.ogg"/>
<sound path="sounds/therian_select3.ogg"/>
<sound path="sounds/therian_select4.ogg"/>
<sound path="sounds/therian_select5.ogg"/>
</selection-sounds>
-->
<selection-sounds enabled="false"/>
<!--
<command-sounds enabled="true">
<sound path="sounds/therian_ack1.ogg"/>
<sound path="sounds/therian_ack2.ogg"/>
<sound path="sounds/therian_ack3.ogg"/>
<sound path="sounds/therian_ack4.ogg"/>
<sound path="sounds/therian_ack5.ogg"/>
</command-sounds>
-->
<command-sounds enabled="false"/>

<!-- *** EMANATIONS *** -->

</parameters>

<!-- *** SKILLS *** -->


<skills>
<skill>
<type value="stop"/>
<name value="stop_skill"/>
<ep-cost value="0"/>
<speed value="100"/>
<anim-speed value="100"/>
<animation path="models/therian_stop.g3d"/>
<sound enabled="false"/>
</skill>

<skill>
<type value="die"/>
<name value="die_skill"/>
<ep-cost value="0"/>
<speed value="100"/>
<anim-speed value="100"/>
<animation path="models/therian_die.g3d"/>
<!--
<sound enabled="true" start-time="">
<sound-file path="sounds/therian_die1.ogg"/>
<sound-file path="sounds/therian_die2.ogg"/>
<sound-file path="sounds/therian_die3.ogg"/>
<sound-file path="sounds/therian_die4.ogg"/>
<sound-file path="sounds/therian_die5.ogg"/>
</sound>
-->
<sound enabled="false"/>
<fade value="false"/>
</skill>

<skill>
<type value="move"/>
<name value="move_skill"/>
<ep-cost value="0"/>
<speed value="220"/>
<anim-speed value="100"/>
<animation path="models/therian_move.g3d"/>
<sound enabled="false"/>
</skill>

<skill>
<type value="attack"/>
<name value="attack_skill"/>
<ep-cost value="0"/>
<speed value="75"/>
<anim-speed value="75"/>
<animation path="models/therian_attack.g3d"/>
<sound enabled="false"/>
<!--
<sound enabled="true" start-time="0.0">
<sound-file path="sounds/therian_attack1.ogg"/>
<sound-file path="sounds/therian_attack2.ogg"/>
<sound-file path="sounds/therian_attack3.ogg"/>
<sound-file path="sounds/therian_attack4.ogg"/>
<sound-file path="sounds/therian_attack5.ogg"/>
</sound>
-->
<attack-strength value="325"/>
<attack-var value="50"/>
<attack-range value="1"/>
<attack-type value="heavy"/>
<attack-fields>
<field value="land"/>
</attack-fields>
<attack-start-time value="0"/>
<projectile value="false"/>
<splash value="false"/>
</skill>

<skill>
<type value="cast-spell"/>
<name value="roar_skill"/>
<ep-cost value="200"/>
<speed value="40"/>
<anim-speed value="40"/>
<animation path="models/therian_roar.g3d"/>
<sound enabled="false"/>
<start-time value="1.5"/>
<!--
<sound enabled="true" start-time="0.0">
<sound-file path="sounds/therian_roar1.ogg"/>
<sound-file path="sounds/therian_roar2.ogg"/>
<sound-file path="sounds/therian_roar3.ogg"/>
<sound-file path="sounds/therian_roar4.ogg"/>
<sound-file path="sounds/therian_roar5.ogg"/>
</sound>
-->
<projectile value="false"/>
<splash value="true">
<radius value="5"/>
<particle value="false"/>
</splash>
<effects>
<effect name="roar_of_terror"
image="images/roar_effect.bmp"
bias="detrimental"
stacking="extend"
target="foe"
chance="75"
damage-type="spirit"
duration="20">
<multipliers>
<attack-strength value="0.75"/>
</multipliers>
<flags>
<ends-with-source/>
<recourse-ends-with-root/>
</flags>
<recourse-effects>
<effect name="fear_tap"
image="images/fear_tap_effect.bmp"
bias="beneficial"
stacking="stack"
duration="20">
<static-modifiers>
<hp-regeneration value="1"/>
<attack-strength value="5"/>
</static-modifiers>
</effect>
</recourse-effects>
</effect>
</effects>
</skill>

</skills>

<!-- *** COMMANDS *** -->

<commands>
<command>
<type value="stop"/>
<name value="stop"/>
<image path="../dun/images/moon_stop.bmp"/>
<unit-requirements/>
<upgrade-requirements/>
<stop-skill value="stop_skill"/>
</command>

<command>
<type value="move"/>
<name value="move"/>
<image path="../dun/images/moon_move.bmp"/>
<unit-requirements/>
<upgrade-requirements/>
<move-skill value="move_skill"/>
</command>


<command>
<type value="attack"/>
<name value="attack"/>
<image path="images/therian_attack.bmp"/>
<unit-requirements/>
<upgrade-requirements/>
<move-skill value="move_skill"/>
<attack-skill value="attack_skill"/>
</command>

<command>
<type value="cast-spell"/>
<name value="roar"/>
<image path="images/therian_roar.bmp"/>
<unit-requirements/>
<upgrade-requirements/>
<affect value="target"/>
<cast-spell-skill value="roar_skill"/>
<cycle value="false"/>
</command>

<command>
<type value="guard"/>
<name value="guard"/>
<image path="../dun/images/moon_guard.bmp"/>
<unit-requirements/>
<upgrade-requirements/>
<move-skill value="move_skill"/>
<attack-skill value="attack_skill"/>
<max-distance value="8"/>
</command>

</commands>
</unit>
« Last Edit: 28 May 2011, 00:26:06 by silnarm »

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Crash: git-master, when casting spells
« Reply #1 on: 23 May 2011, 08:47:30 »
Finally getting red cloned now, so hopefully I'll be able to reproduce and fix...

From a quick glance, <start-time value="1.5" /> is dodge... with the skill and anim speed sharing the same value (:thumbup:) what you're saying here is start the spell half way through the _next_ anim cycle. Should really be between 0.0 and 1.0 (very start and very end of cycle). My initial impression here is that this can probably be reported as an error... I don't think a value outside 0->1 can make sense, will have to think some more on that perhaps.

This shouldn't be causing the crash though, but its probably not as you intended.

Nice spell btw, keep the bug reports coming :)

Glest Advanced Engine - Code Monkey

Timeline | Downloads

John.d.h

  • Moderator
  • Airship
  • ********
  • Posts: 3,757
  • I have to go now. My planet needs me.
    • View Profile
Re: Crash: git-master, when casting spells
« Reply #2 on: 23 May 2011, 10:47:06 »
You mean that time value isn't in seconds? :look:

And PS, this is Solunar, which I don't have on GitHub yet.  I should probably remedy that.  I believe you still have it in your Dropbox, though?
« Last Edit: 23 May 2011, 11:01:58 by John.d.h »

silnarm

  • Local Moderator
  • Behemoth
  • ********
  • Posts: 1,373
    • View Profile
Re: Crash: git-master, when casting spells
« Reply #3 on: 23 May 2011, 11:20:23 »
You mean that time value isn't in seconds? :look:

Nope, as a fraction of the animation cycle (using g3dhack, slide the anim control to the point you want the spell/attack to start, use the "anim time" it reports for that point).

Quote
And PS, this is Solunar, which I don't have on GitHub yet.  I should probably remedy that.  I believe you still have it in your Dropbox, though?

Yeah, didn't look at the images first up, but that's ok, I have a clone of red now ;)

The problem was with creating the recourse effect, fixed with commit ff126a..
Glest Advanced Engine - Code Monkey

Timeline | Downloads

 

anything