Beefcake!?

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
User avatar
Talonos
Posts: 789
Joined: Mon May 03, 2004 7:08 am
Location: At college!

Beefcake!?

Post by Talonos »

Okay. I summoned up one of my decorate monsters. It worked well for a while, but right as it was about to attack, it crashed. The problem? Something to do with Beefcake, apperantly... The report:

Code: Select all

Code: ACCESS_VIOLATION
Tried to write address beefcafe
Flags: 00000000
Address: 0045c07a

Windows NT 5.1 Build 2600 

GS=0000  FS=0038  ES=0023  DS=0023
EAX=00000000  EBX=febc1311  ECX=0423cd70  EDX=beefcafe
ESI=00000000  EDI=00000000
EBP=0090f1d8  EIP=0045c07a  ESP=0012fb9c  CS=001b  SS=0023
EFlags=00010246
 CF- PF+ AF- ZF+ SF- TF- IF+ DF- OF- NT- RF+ VM- AC- VI- VP-

FPU State:
 ControlWord=027f StatusWord=4020 TagWord=ffff
 ErrorOffset=0047f566
 ErrorSelector=0057001b
 DataOffset=0012fb5c
 DataSelector=ffff0023
 Cr0NpxState=00000000

MM0=ffffffb8fffffffd
MM1=000000a7006b006b
MM2=ab4e86701ee34000
MM3=8000000000000000
MM4=0000000000000000
MM5=0000000000000000
MM6=0090f1d800000000
MM7=000000230012fb9c

Running threads:
00000668 at 0045c07a*
000001d0
00000690
000003f4
00000280
000001cc
000000cc
00000500
000001a0

Loaded modules:
00400000 - 00630fff *zdoom.exe
77f50000 - 77ff5fff  ntdll.dll
77e60000 - 77f44fff  kernel32.dll
71950000 - 71a33fff  COMCTL32.dll
77c10000 - 77c62fff  msvcrt.dll
77c70000 - 77cadfff  GDI32.dll
77d40000 - 77dc5fff  USER32.dll
77dd0000 - 77e5afff  ADVAPI32.dll
78000000 - 7806efff  RPCRT4.dll
63180000 - 631e3fff  SHLWAPI.dll
71ad0000 - 71ad7fff  WSOCK32.dll
71ab0000 - 71ac4fff  WS2_32.dll
71aa0000 - 71aa7fff  WS2HELP.dll
76b40000 - 76b6bfff  WINMM.dll
10000000 - 10093fff  fmod.dll
77be0000 - 77bf3fff  MSACM32.dll
771b0000 - 772c2fff  ole32.dll
763b0000 - 763f4fff  comdlg32.dll
773d0000 - 77bbdfff  SHELL32.dll
5ad70000 - 5ada3fff  uxtheme.dll
76f50000 - 76f57fff  wtsapi32.dll
76360000 - 7636efff  WINSTA.dll
76f90000 - 76f9ffff  Secur32.dll
73f10000 - 73f64fff  dsound.dll
77c00000 - 77c06fff  VERSION.dll
72d20000 - 72d28fff  wdmaud.drv
72d10000 - 72d17fff  msacm32.drv
77bd0000 - 77bd6fff  midimap.dll
73ee0000 - 73ee3fff  KsUser.dll
7c620000 - 7c6a0fff  CLBCATQ.DLL
77120000 - 771aafff  OLEAUT32.dll
77050000 - 77114fff  COMRes.dll
6ce10000 - 6ce44fff  dinput8.dll
688f0000 - 688f8fff  HID.DLL
76670000 - 76753fff  SETUPAPI.DLL
73760000 - 737a4fff  ddraw.dll
73bc0000 - 73bc5fff  DCIMAN32.dll

Bytes near EIP:
0045c06a: 81 8c 00 00 00 08 75 2a 8b 41 24 3b c6 8b 51 28
0045c07a: 89 02 74 03 89 50 28 8b 81 f0 00 00 00 89 71 24
0045c08a: c7 41 28 fe ca ef be a3 f8 74 5b 00 89 b1 f0 00

ZDoom version 2.0.63a

Command line:
 C:\Zdoom\zdoom.exe -file ARTIFIC1.2.WAD artific2.1.wad artific3.wad myhack.wad -bex railgun.bex -record demoone
IWAD: doom2.wad

Current map: MAP01

viewx = 4386724
viewy = -30047989
viewz = 2597394
viewangle = 902823936

Possible call trace:
 0045c07a  BOOM
 0045dc61  call 0045c060
 0045d20b  call [edx+0xc]
 0045ddaf  call 0045d0e0
 0046218c  call 00460be0
 0045e26b  call 0045a1c0
 0045e798  call 0045dd70
 00461e65  call 0045e030
 004220f7  call [edx+0x10]
 004223a5  call 00422080
 00473934  call 00422330
 0042aaeb  call 00473850
 0041b572  call 0042a7d0
 0041760c  call 0041b280
 0040b083  call 0040afd0
 0049bbb6  call 0040b070
 0049bcd3  call 004ffb16
 00498d83  call 00417660
 00499095  call 004989d0
 00502fca  call 00499020
 00502e5e  call 005008c0
 00502e46
The decorate code of my monster is:

Code: Select all

ACTOR Artificer 9607 { 
 Health 104
 Radius 20
 Height 56
 Speed 12
 PainChance 200
 MONSTER 
 +FLOORCLIP
 SeeSound "grunt/sight"
 AttackSound "grunt/attack"
 PainSound "grunt/pain"
 DeathSound "grunt/death"
 ActiveSound "grunt/active"
 Obituary "O% contributed his body to the next flesh golem in the production line."
 DropItem Shell
 Damage 2
 States
 {
 Spawn:
 BISH ABc 8 A_Look
 Loop
 See:
 BISH AAACCCBBBCCC 4 A_Chase
 Loop
 Missile:
 BISH C 8 A_FaceTarget
 BISH C 0 A_Jump (23,15)
 BISH C 0 A_Jump (25,19)
 BISH C 0 A_Jump (28,24)
 BISH C 0 A_Jump (32,26)
 BISH C 0 A_Jump (36,26)
 BISH C 0 A_Jump (42,27)
 BISH C 0 A_Jump (51,29)
 BISH C 0 A_Jump (64,30)
 BISH C 0 A_Jump (85,38)
 BISH C 0 A_Jump (128,39)
 BISH D 1 A_CustomMissile ("RayOfFrost", 28, 0, 0) 
 BISH D 1 A_CustomMissile ("RayOfFrostFake", 28, 0, 0) 
 BISH E 1 A_CustomMissile ("RayOfFrostFake", 28, 0, 0) 
 BISH E 1 A_CustomMissile ("RayOfFrostFake", 28, 0, 0) 
 BISH D 2 A_CustomMissile ("RayOfFrostFake", 28, 0, 0) 
 Goto See
 BISH D 1 A_CustomMissile ("AcidSplash", 28, 0, 0) 
 BISH D 1 A_CustomMissile ("AcidSplashFake", 28, 0, 0) 
 BISH E 1 A_CustomMissile ("AcidSplashFake", 28, 0, 0) 
 BISH E 1 A_CustomMissile ("AcidSplashFake", 28, 0, 0) 
 BISH D 4 A_CustomMissile ("AcidSplashFake", 28, 0, 0) 
 Goto See
 BISH D 0 A_CustomMissile ("BurningHands", 28, 0, -8) 
 BISH E 0 A_CustomMissile ("BurningHands", 28, 0, -4) 
 BISH D 0 A_CustomMissile ("BurningHands", 28, 0, 0) 
 BISH E 0 A_CustomMissile ("BurningHands", 28, 0, 4) 
 BISH E 8 A_CustomMissile ("BurningHands", 28, 0, 8) 
 Goto See
 BISH E 8 A_CustomMissile ("MagicM", 28, 0, -45) 
 BISH D 8 A_CustomMissile ("MagicM", 28, 0, 45) 
 BISH E 8 A_CustomMissile ("MagicM", 28, 0, -25) 
 BISH F 8 A_CustomMissile ("MagicM", 28, 0, 25) 
 Goto See
 BISH E 8 A_CustomMissile ("MelfsAcidArrow", 28, 0, 0) 
 Goto See
 BISH E 8 A_CustomMissile ("FlamingSphere", 10, 0, 0) 
 BISH F 8
 Goto See
 BISH D 1 A_CustomMissile ("BurningRay", 28, 0, 0) 
 BISH D 1 A_CustomMissile ("BurningRayFake", 28, 0, 0) 
 BISH E 6 A_CustomMissile ("BurningRayFake", 28, 0, 0) 
 Goto See
 BISH E 0 A_CustomMissile ("FireBallMaj", 28, 0, -2) 
 BISH E 8 A_CustomMissile ("FireBallMaj", 28, 0, 2) 
 Goto See
 BISH D 1 A_MonsterRail
 BISH D 1 A_FaceTarget
 BISH D 1 A_MonsterRail
 BISH E 1 A_FaceTarget
 BISH E 1 A_MonsterRail
 BISH E 1 A_FaceTarget
 BISH F 1 A_MonsterRail
 BISH F 1 A_FaceTarget
 BISH F 2 A_MonsterRail
 Goto See
 BISH E 3 A_CustomMissile ("hailmis", 28, 0, 0)
 BISH F 3 A_CustomMissile ("hailmis", 28, 0, 0)
 Goto see
 BISH D 0 A_CustomMissile ("ene", 25, -1, 0)
 BISH D 0 A_CustomMissile ("ene", 27, -1, 0)
 BISH D 0 A_CustomMissile ("ene", 29, -1, 0)
 BISH D 0 A_CustomMissile ("ene", 31, -1, 0)
 BISH D 0 A_CustomMissile ("ene", 25, 1, 0)
 BISH D 0 A_CustomMissile ("ene", 27, 1, 0)
 BISH D 0 A_CustomMissile ("ene", 29, 1, 0)
 BISH D 0 A_CustomMissile ("ene", 31, 1, 0)
 BISH D 0 A_CustomMissile ("ene", 27, 3, 0)
 BISH D 0 A_CustomMissile ("ene", 29, 3, 0)
 BISH D 0 A_CustomMissile ("ene", 27, -3, 0)
 BISH D 0 A_CustomMissile ("ene", 29, -3, 0)
 Goto see
 Pain:
 BISH D 3
 BISH C 3 A_Pain
 Goto See
 Death:
 POSS H 5
 POSS I 5 A_Scream
 POSS J 5 A_Fall
 POSS K 5
 POSS L -1
 Stop
 XDeath:
 POSS M 5
 POSS N 5 A_XScream
 POSS O 5 A_Fall
 POSS PQRST 5
 POSS U -1
 Stop
 Raise:
 POSS KJIH 5
 Goto See
 }
 }
I have seen him succesfully use all of his attacks aside from the last two. In case it matters...

Code: Select all

ACTOR hailmis -1 
{ 
 Radius 15
 Height 40 
 Speed 15 
 Damage 9
 Projectile 
 States 
 { 
 Spawn: 
 HAIL ABCDABCDABCDABCDABCDABCDABCD 1  
 Death: 
 HAIL C 0 A_CustomMissile ("hailbit", 28, 0, 0) 
 HAIL C 0 A_CustomMissile ("hailbit", 28, 0, -15) 
 HAIL C 0 A_CustomMissile ("hailbit", 28, 0, -30) 
 HAIL C 0 A_CustomMissile ("hailbit", 28, 0, 15) 
 HAIL C 0 A_CustomMissile ("hailbit", 28, 0, 30) 
 HAIL C 0 A_CustomMissile ("hailbit", 28, 0, 45) 
 HAIL C 0 A_CustomMissile ("hailbit", 28, 0, -45) 
 HAIL C 0 A_CustomMissile ("hailbit", 28, 0, 60) 
 HAIL C 0 A_CustomMissile ("hailbit", 28, 0, -60) 
 HAIL C 0 A_CustomMissile ("hailbit", 28, 0, -75) 
 HAIL C 0 A_CustomMissile ("hailbit", 28, 0, 75) 
 HAIL C 0 A_CustomMissile ("hailbit", 28, 0, 90) 
 HAIL C 0 A_CustomMissile ("hailbit", 28, 0, -90) 
 HAIL C 0 A_IceGuyDie
 Stop 
ACTOR hailbit -1 
{ 
 Radius 8
 Height 16 
 Speed 15 
 Damage 1
 Projectile 
 States 
 { 
 Spawn: 
 HBIT ABABABABABAB 1  
 Death: 
 HBIT A 1 A_IceGuyDie
 Stop 
 } 
} 
projectile Ene
 {
 Sprite SBS2
 Frames "1:ABCDEFGHIJKLMNOP"
 DeathSprite MWND
 DeathFrames "EFGHI"
 Radius 5
 Height 6
 Speed 20
 Damage 1
 NoBlockmap
 NoGravity
 ActivatePCross
 ActivateImpact
 NoTeleport
 DamageType Ice
 }
 } 
User avatar
Giest118
Posts: 2914
Joined: Fri Dec 05, 2003 11:02 pm

Post by Giest118 »

Why in the holy hell have you given your projectile actor(s) a DoomEdNum of -1? And furthermore, your hailmis actor doesn't seem to have the two '}'s at the end of its definition thing.

EDIT: Why have you given those projctile actors DoomEdNums at all?

EDIT2: Why is the 'ene' projectile defined the old-fashioned way?

EDIT3: Furthermore, the ene projectile is defined the old fashioned way, and hence should only use one '}' at the end. But it'd be wiser to redefine it the 'new' way.
User avatar
Kate
... in rememberance ...
Posts: 2975
Joined: Tue Jul 15, 2003 8:06 pm

Post by Kate »

giest118 wrote:Why in the holy hell have you given your projectile actor(s) a DoomEdNum of -1?
-1 means they are not placable in a level editor. Of course it's the same as omitting the number altogether..
giest118 wrote:And furthermore, your hailmis actor doesn't seem to have the two '}'s at the end of its definition thing.
You're right.. That could be causing the problem...
giest118 wrote:EDIT: Why have you given those projctile actors DoomEdNums at all?
Good question... As I said before giving them a doomednum of -1 is the same as omitting them, so why bother adding them?
giest118 wrote:EDIT2: Why is the 'ene' projectile defined the old-fashioned way?
It's OK to do it that way if there's no special action that the projectile needs to perform. (As in this case)
User avatar
HotWax
Posts: 10002
Joined: Fri Jul 18, 2003 6:18 pm
Location: Idaho Falls, ID

Post by HotWax »

Talonos wrote:Something to do with Beefcake, apperantly...
Actually, it's BeefCafe, or to be more specific it's the hexadecimal number 0xBEEFCAFE, which if you care is the number 3,203,386,110 in decimal. You don't need to understand that statement except to know that, in addition to 0-9, A-F are legal digits in hex, and so BEEFCAFE, however funny looking, is a legal value. In fact, the number was specifically designed to catch the eye of someone looking at the crash log, because it tells the programmer whereabout in the code the crash occured.

Normally, when you declare a variable without initializing it, memory is set aside to hold that value, but the actual memory isn't changed (this would take unnecessary clock cycles) until specifically requested by the programmer. If a variable were accidentally read before a value was assigned, they'd contain completely random data. This random data can create huge problems when used improperly -- if the variable is a pointer into memory, for example, trying to use it as such will result in the program accessing a completely random block of memory, which may or may not be outside the memory allocated to the program. Typically, this results in a "This program has performed an illegal operation and will be shut down" error, but in the case of ZDoom, which has built-in error handling, it results in an ACCESS_VIOLATION error. Now, if ZDoom just left the value alone when declaring the variable, the crashlog would have said something like "EDX=26c99e7f", which is not terribly helpful. In the code, though, ZDoom initializes the pointer to 0xbeefcafe, so that when the access attempt is made and causes a crash, the value at EDX pops right out at you and flags this issue as a pointer that was accessed without being set to something useful first.

I'm not entirely sure if it was id who coded things this way, or Randy, or somebody else whose code he borrowed. But, it's darn funny nonetheless. :P
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Post by randi »

HotWax wrote:I'm not entirely sure if it was id who coded things this way, or Randy, or somebody else whose code he borrowed.
It was me. The value BEEFCAFE was chosen because of its similarity to special fillers such as DEADBEEF and ABADCAFE used by the Amiga debugging tool Mungwall.
User avatar
Chilvence
Posts: 1647
Joined: Mon Aug 11, 2003 6:36 pm
Contact:

Post by Chilvence »

randy wrote:Mungwall.
Whoah.. Programs had real names back then.
User avatar
Xaser
 
 
Posts: 10774
Joined: Sun Jul 20, 2003 12:15 pm
Contact:

Post by Xaser »

Heh. I thought Randy made beefcafe because he likes steak or something... :P
User avatar
Talonos
Posts: 789
Joined: Mon May 03, 2004 7:08 am
Location: At college!

Post by Talonos »

Okay, sorry. the missing }} is a copy-paste error. Any other ideas? I've double checked it, and it still doesn't work.
User avatar
Giest118
Posts: 2914
Joined: Fri Dec 05, 2003 11:02 pm

Post by Giest118 »

You also have too many }s at the end of your ene projectile.
User avatar
MasterOFDeath
... in rememberance ...
Posts: 2024
Joined: Sat Apr 03, 2004 10:58 am

Post by MasterOFDeath »

Yeah you do. 1 "}" is enough. :P
User avatar
randi
Site Admin
Posts: 7749
Joined: Wed Jul 09, 2003 10:30 pm
Contact:

Post by randi »

Perhaps if you provided a complete, spawnable monster...

BTW, using doomednums in the 9xxx range is bad, because I might use the same number as you for something in a future ZDoom.
User avatar
Ixnatifual
Posts: 2287
Joined: Fri Dec 12, 2003 6:44 pm
Contact:

Post by Ixnatifual »

Mmmm... beefcake.
User avatar
MasterOFDeath
... in rememberance ...
Posts: 2024
Joined: Sat Apr 03, 2004 10:58 am

Post by MasterOFDeath »

Your choice, white cake with chunks of meatloaf in it, or chocolate with chunks of salsbury steak in it. :D
User avatar
Lexus Alyus
Posts: 4220
Joined: Tue Jul 15, 2003 5:07 pm
Location: Nottingham, UK
Contact:

Post by Lexus Alyus »

What is beefcake?

:twisted:
User avatar
Ixnatifual
Posts: 2287
Joined: Fri Dec 12, 2003 6:44 pm
Contact:

Post by Ixnatifual »

*drools*
Locked

Return to “Editing (Archive)”