Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Sign in to follow this  
Quasar

Vanilla Strife player_t mapping complete!

Recommended Posts

Kaiser and I have completed mapping out the player_t structure in Strife. Unlike most of the other structures, this one suffered extensive changes, a couple of which are somewhat surprising - particularly the use of a 40-integer array to track what maps you've used the map/scanner on.

EDIT: Updated 10/11/2009

player_t (sizeof == 1025)
-------------------------------------------------------------------------------
0: mobj_t *mo
4: playerstate_t playerstate (0 = PST_LIVE, 1 = PST_DEAD, 2 = PST_REBORN)
8: ticcmd_t cmd
   0: byte forwardmove
   1: byte sidemove
   2: short angleturn
   4: short consistency
   6: char chatchar
   7: byte buttons
   8: byte buttons2 (inventory / updown-look related)
   9: int inventoryitem
21: fixed_t viewz
25: fixed_t viewheight
29: fixed_t deltaviewheight
33: fixed_t bob
37: int health
41: short armorpoints (note: was int in DOOM!)
43: short armortype   (note: was int in DOOM!)
45: int powers[6]
    45: berserk
    49: shadowarmor
    53: envirosuit
    57: map/scanner (1 = map, 2 = scanner)
    61: comm unit
    65: targeter
69: int sigiltype
73: int nukagecount
77: int questflags
81: int pitch      (ranges from 90 to -110)
85: int centerview (if asserted, pitch +=/-= 8 until pitch == 0)
89: inventory_t inventory[32]
    89: int sprite
    93: int mobjtype
    97: int amount
    (x32)
473: int st_refresh (used in P_TouchSpecialThing etc, wakes up status bar)
477: short numinventory    (# of unique items possessed)
479: short inventorycursor (used in P_GiveInventoryItem etc)
481: short accuracy (Set to 50 in P_SpawnPlayer if deathmatch)
483: short stamina
485: int keys[27] (sizeof == 0x1B * 4 in ST_Responder)
     485: Base Key
     489: Govs Key
     493: Pass Card Key
     497: ID Card
     501: Prison Key
     505: Hand Print
     509: Power Key 1
     513: Power Key 2
     517: Power Key 3
     521: Gold Key
     525: ID Badge
     529: Silver Key
     533: Oracle Key
     537: Military ID
     541: Order Key
     545: Warehouse Key
     549: Brass Key
     553: Red Crystal
     557: Blue Crystal
     561: Chapel Key
     565: Catacomb Key
     569: Security Key
     573: Core Key
     577: Mauler Key
     581: Factory Key
     585: Mine Key
     589: New Key 5
593: int backpack
597: int attackdown (used in A_WeaponReady etc) 
601: int usedown
605: int inventorydown (signals item use action)
609: int frags[8]
641: int readyweapon
645: int pendingweapon
649: int weaponowned[11]
     649: Punch Dagger (lowest priority in P_CheckAmmo, no ammo used)
     653: Electric Crossbow
     657: Assault Rifle
     661: Mini-Missile Launcher
     665: HE Grenade Launcher
     669: Flamethrower (uses ammo 705)
     673: Mauler (requires 20 ammo in P_CheckAmmo [highest priority weapon])
     677: Sigil (set to 1 by P_SpawnPlayer if gamemap == 10)
     681: Poison Bolt Crossbow
     685: WP Grenade Launcher
     689: Mauler Torpedo (requires 30 ammo in P_CheckAmmo [which doesn't work!])
693: int ammo[7]
     693: bullets
     697: electric bolts
     701: poison bolts
     705: energy cells
     709: mini missiles
     713: he grenades
     717: wp grenades
721: int maxammo[7]
749: int cheats
     0x01: CF_NOCLIP
     0x02: CF_GODMODE (also set if -work used)
     0x04: CF_NOMOMENTUM (unused vanilla DOOM hack in P_XYMovement)
     0x08: inventory use disabled if set (set when on fire)
     0x10: autouse health state (0 = off, 1 = on)
753: int refire (Set to 0 in P_SpawnPlayer; used in A_ReFire)
757: short killcount (incremented in P_KillMobj if target->flags & MF_COUNTKILL)
759: char *message
763: int damagecount
767: int bonuscount
771: mobj_t *attacker
775: int extralight
779: int fixedcolormap
783: short allegiance (copied to teleport beacon in P_SpawnTeleportBeacon)
785: pspdef_t psprites[5]
     785: state
     789: tics
     793: sx
     797: sy
     (x5: gun, flash, targeter l/r/center)
865:  int mapstate[40]
1025: END    

Share this post


Link to post
Catoptromancy said:

I have officially declared this thread as consisting of awesome.

I agree! You guys are awesome :) I just can't wait until Disassembly reaches the point at which you are comfortable enough to get to writing Chocolate-Strife ;)

Share this post


Link to post

The first post has been updated with new information:

* Weapon and ammo order are finalized (thanks to SeHackEd largely).
* All gaps have been eliminated except in ticcmd_t and at the end of the keys array (size is currently uncertain).
* Found psprites array. Note that Strife has 5 psprites, 3 of which are used to implement the targeter powerup.

Share this post


Link to post
Quasar said:

The structure is now completely mapped, with no unknown fields. Hooray!

Wow, this is fantastic! O.o What's still "unknown" strife-wise?

Share this post


Link to post
MP2E said:

Wow, this is fantastic! O.o What's still "unknown" strife-wise?

It's all down to the nitty gritty details now. All of the architecture is laid out and identified. We just have to find some way to create an organized body of knowledge that will allow transformation of DOOM into Strife without missing anything :)

There are of course some functions of which our understanding is poor - some of them just because we need to figure out other parts first, which will cause them to make sense, and others because Watcom chewed them up and spit them out (the code to fire grenades is a good example, it looks like a grenade exploded on it).

Anyway it's all within our grasp; I am highly confident that there's nothing we cannot figure out definitively at this point.

Share this post


Link to post

I'm always glad to hear news regarding this, even if it doesn't benefit me directly. Thanks to your hard work (especially with the involvement in getting the Raven sources GPL'd), we have the potential to enjoy all of the Doom-based games in a broader range of ways.

Do keep us informed with your findings related to Strife. :)

Share this post


Link to post

I'm very happy about any and all progress in making strife support better as well as the future of Strife in EE. :D

Share this post


Link to post
Quasar said:

Kaiser and I have completed mapping out the player_t structure in Strife.

Basically this is the data for each player unit (as in health, ammo, inventory and so on)? If so, congrats.

Share this post


Link to post

Guys, not to be picky, but this thread was almost a year old ;) I pasted the link on IRC for Kaiser's benefit so he could see the list of keys - heheh.

Share this post


Link to post

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
Sign in to follow this  
×