<- 1  -   of 75 ->
^^
vv
List results:
Search options:
Use \ before commas in usernames
Yeah. I mean, the old engine kinda lets you build new objects as well (as prefabs), but just being able to arbitrary give anything a model, collision, health, etc. sounds a lot more modular.
.NET itself isn't component based, WinForms is to a certain degree though, WPF even more so.
Edit history:
Antidote: 2016-08-10 04:55:24 am
Antidote: 2016-08-10 04:26:26 am
Pretty big breakthrough with PATH tonight, I finally figured out the bitmaps at the end, and we are now able to load them completely! The code for it is actually pretty simple, so I'm rather annoyed at myself for not figuring it out a long time ago.

How the bitmaps are read is as simple as this code snippet:
Code:
u32 bitCount = (((regionCount * (regionCount - 1)) / 2) + 31) / 32;
u32 data1[bitCount];
u32 data2[bitCount];
u32 data3[((((regionCount * regionCount) + 31) / 32) - bitCount) * 2];


Basically it guarantees that the data is always on either a 32bit boundary, (basically each entry is always 4 bytes), and the amount is roughly the half the squared region count.
Edit history:
Aruki: 2016-08-11 07:56:19 pm
Finally was able to put all the research I did on pak file ordering to the test. Built in support in PWE today for generating a pak dependency list from scratch and writing a new pak based on the contents of the files without any access to the original pak or any prewritten file list like PakTool uses. The results: The per-area toggle for dependencies I mentioned is completely spot-on... with dependencies, almost all of my generated pak lists have nearly exactly the same number of assets as the original. Frigate and Magmoor are both an exact match for the original pak (6586 assets in Frigate, 4166 in Magmoor). Phen is off by 1 and Mines is off by 2. Chozo and Tallon are the worst with Chozo being off by 7 and Tallon being off by 5... still pretty close really!

The new generated paks work ingame but the load times suck - there's still a couple things I can do to improve them so I'll have to get that in before I can really say whether this is sufficient. Still a very big step forward!

edit: update - after applying those fixes my load times are good! Very very happy to finally have completely custom paks working!
I run this here hotel of an evening
Oooh, does this mean an update is on the horizon?
An update's been on the horizon for a while, I've been working on this stuff since the last release (3 months ago). It's going to be a bit longer still.
URDE is going to have a pretty massive update here as well, we're starting to get into the nitty gritty of the runtime.
Edit history:
Aruki: 2016-08-15 02:21:35 am
New particle stuff added in Echoes

Code:
NEW PART PARAMETERS
ADV9 (Real)
DFLG (Bitfield)
FXBO (Vector)
FXBR (Real)
INDM (Bool)
PMOV (Vector)
RDOP (Bool)
VAV1 (Vector)
VAV2 (Vector)
VAV3 (Vector)
VMPC (Bool)
XTAD (Int)

NEW ELSC PARAMETERS
DFLG (Bitfield)
TEXR (UV)

NEW SWHC PARAMETERS
CLTX (Bool)
DFLG (Bitfield)

NEW WPSC PARAMETERS
B1CL - Color
B1PO - Vector
B1RT - Real
B1SE - Real
B1TX - UV
B2CL - Color
B2PO - Vector
B2RT - Real
B2SE - Real
B2TX - UV
BHBT - Bool
DP1C - Bool
DP2C - Bool
EELT - Bool
F60H - Bool
FOFF - Real
NDTT - Bool
RB1A - Bool
RB2A - Bool
RTLA - Bool
RWPE - Bool
SVBD - Bool
TECL - Color
TLEN - Real
TLPO - Vector
TSCL - Color
TSZE - Real
TTEX - UV

SRSC PARAMETERS
SPWN - SpawnSystemKeyframeData

SPSC PARAMETERS
DEOL - Bool
FRCO - Bool
FROV - Vector
GIVL - Int
GORN - Vector
GTRN - Vector
IGGT - Bool
IGLT - Bool
IVEC - Vector
LSCL - Vector
ORNT - Vector
PCOL - Color
PSLT - Int
SCLE - Vector
SPWN - SpawnSystemKeyframeData
TRNL - Vector
VBLN - Real
VLM1 - ModVector
VLM2 - ModVector
VMD1 - Bool
VMD2 - Bool

NEW INT FUNCTIONS
DIVD(Int, Int)
ISWT(Int, Int)
KEYF(KeyframeEmitterData)
KPIN(Int)
PCRT()
PDET()
RTOI(Real, Real)

NEW BITFIELD FUNCTIONS
BITF()

NEW REAL FUNCTIONS
GTCP()
KEYF(KeyframeEmitterData)
KPIN(Real)
OCSP(Int)
PAP9()
PNO1(Real, Real, Real, Int)
PNO2(Real, Real, Real, Real, Int)
PNO3(Vector, Real, Real, Int)
PNO4(Vector, Real, Real, Real, Int)
PRN1(Real)
PRN2(Real, Real)
PRN3(Vector)
PRN4(Vector, Real)
TOCS(Bool, Int, Int, Int)

NEW VECTOR FUNCTIONS
ISWT(Vector, Vector)
KEYF(KeyframeEmitterData)
KPIN(Vector)
NORM(Vector)
PAP1()
PAP2()
PAP3()
PENV()
PETR()
PEVL()
PINV()
PITR()
PIVL()
PNCV()
RNDV(Real)

NEW MODVECTOR FUNCTIONS
BOXV(Vector, Vector, ModVector)
SPHV(Vector, Real, ModVector)

NEW COLOR FUNCTIONS
ISWT(Color, Color)
KEYF(KeyframeEmitterData)
KPIN(Color)
MDAO(Color, Real)
MULT(Color, Color)
VRTC(Vector, Real)

NEW EMITTER FUNCTIONS
ELPS(Vector, Vector, Vector, Real, Bool)
PLNE(Vector, Vector, Vector, Real, Real, Real)


I didnt really do CRSC properly, just kept adding unknown stuff as I ran into it until I could get through every file. My parsing implementation for MP1 isn't complete either (just enough so it works) so I have no idea what's new if anything.

Also although a bunch of new stuff has been added I'm pretty sure nothing was removed compared to MP1.
Edit history:
Antidote: 2016-08-15 04:48:12 am
With some help from dolphin's memory dumping I was able to compile a complete list of CAi states and triggers along with their addresses, I needed it so I could verify that I got the vtable correct (and I did Dancing), but it's definitely useful for others, so here it is!
https://gist.github.com/Antidote/470a9a86e3d42e004fa3240b096da34b

These are NTSC 0-00 addresses, but the indices and names should still be valid for any other version.
Edit history:
Aruki: 2016-10-01 06:47:03 pm
Aruki: 2016-10-01 06:46:53 pm
Aruki: 2016-10-01 06:46:22 pm
Aruki: 2016-09-29 12:52:40 pm
I read a paper on the process of modding multiplayer support into Torchlight and it inspired me to attempt to compile+run custom C++ code in Metroid Prime. To test, I wrote a function that changes the player's health to 73 and patched it to execute in place of CPlayerGun::StopChargeSound. After a lot of work and a lot of help from Ninji (the main programmer on Newer Super Mario Bros Wii, a mod which uses a lot of custom C++ code), I've managed to get it working. Here's a video of it in action:

https://twitter.com/Paraxade0/status/781527320225996805

To get this running I wrote a custom build script in Python. The script requires an installation of the Dolphin SDK and CodeWarrior v2.3.3 (the version that comes with the Dolphin SDK), as from what I've been told devkitPPC uses a different C++ ABI than CodeWarrior so it's not directly compatible with the game code. The script uses CodeWarrior to compile/link your code into a .preplf file, then my script converts the .preplf file to a .rel module. To load the rel, I wrote a function that loads the rel into memory and links it into the game (memory for it is allocated via the game's new[] operator), and added it to the dol via a new text section, then patched a call at the beginning of CMain::RsMain to PPCSetFpIEEEMode to call my custom function instead (the custom function calls PPCSetFpIEEMode too). Patching CPlayerGun::StopChargeSound was handled by the build script, which checked over the dol and found every instruction that branches to that function, and generated some C++ code that modifies the branch instruction to point to my UpdatePlayerHealth function instead. This generated code was compiled into the rel and called from the rel's _prolog() function, which is called after the rel is linked to the game.

So essentially I can compile some custom code to a .rel and make the game link the .rel in at runtime, and the .rel can handle any patches needed to the main dol, which means further dol changes are unnecessary. I still need to implement a system for loading symbols from the dol (which would require some sort of custom text file that associates symbols with an address in the dol) and automatically resolving them in the build script, which would allow for writing headers representing the game classes and then allowing custom code to be able to access them, allowing much easier access to game data at runtime, subclassing the game's classes (like CEntity, CActor or CAi), etc. It also needs a better patching system implemented (the current version just has the address to StopChargeSound hardcoded, and I don't have a means of also calling the original function yet).

The process of making headers for all the game classes is obviously gonna be pretty time consuming... URDE's headers are a huge help, but they can't be used directly due to reliance on C++11 features and some instances where the class structure doesn't -exactly- match the structure from the original game. It'd also ideally require a reimplementation of rstl (the game's STL implementation). So it's definitely a lot more than I can do by myself. I obviously can't redistribute CodeWarrior or the Dolphin SDK, but I'd like to make the tools available and open-source so anyone who can find them can help work on this and contribute headers.

Anyway, it'd be cool to know if anyone's up for working on this with me, and I'm gonna try getting the script into a presentable state and figuring out the best way to structure this as an open-source repo, lol (all my projects have been closed-source so far).
Edit history:
Antidote: 2016-09-29 01:34:30 pm
It's a good thing I RE'd CGameAllocator, which helped us understand the underlying issue.
I've made a repo! https://github.com/parax0/PrimeAPI

Like I said, it requires an installation of the Dolphin SDK and Code Warrior 2.3.3 (needs to be a copy that has GC/Wii compiling functionality unlocked). Once you have everything installed it's actually really easy to get code running ingame. There's a PATCH_SYMBOL macro and you supply it with the name of the original symbol from the base game, and the name of your custom function that you want to be called instead. The build system handles everything else for you. Here's an example of a module I wrote that uses PrimeAPI to update the player's health every frame:

Code:
#include <PrimeAPI.h>
#include <CStateManager.h>
 
// Forward decls
void _prolog();
bool UpdatePlayerHealth(CStateManager&);
 
// Patches
PATCH_SYMBOL(CPlayer::IsUnderBetaMetroidAttack(CStateManager&) const, UpdatePlayerHealth(CStateManager&))
 
// Impls
void _prolog()
{
    MODULE_INIT;
}
 
bool UpdatePlayerHealth(CStateManager& rStateMgr)
{
    // Fetch current health
    float *pPlayerHealth = (float*) (*((char**) 0x804578CC) + 0x2AC);
    float health = *pPlayerHealth;
   
    // Update current health
    health += 1.f;
    if (health >= 100.f)
        health = 1.f;
   
    *pPlayerHealth = health;
   
    // Let the caller know we are not being attacked by a beta metroid
    return false;
}


You can see the end result here: https://twitter.com/Paraxade0/status/783207248826728448

Another example of a simple patch I tested which causes you to take damage whenever an enemy takes damage:

Code:
PATCH_SYMBOL(CAi::HealthInfo(CStateManager&), CPlayer::HealthInfo(CStateManager&)


It's pretty fun to mess around with and I imagine it'll only get better with more/better headers available. Really hope to see some people trying it out and contributing to the repo!
Edit history:
yonic: 2016-12-01 09:21:11 am
yonic: 2016-12-01 08:43:35 am
yonic: 2016-12-01 08:41:13 am
Game designer and Metroid Prime fan
Not very sure if this belongs here, but here goes.

I'm very interested on making a vector and a bitmap fonts out of Metroid Prime's v4 FONT but I'm having problems making separate versions of each channel. Also, having to repack the new textures in GGuiSys and export them with HECL didn't give me any results. Seems like it might be ignoring the new TXTRs.

I tried making my own TXTR converter with my short knowledge of CoffeeScript but the results aren't that promising.


(Different results of same 3e75f7c6.TXTR)

HECL would shine if it had a way of manually converting selected files, apart from the whole pack.
The problem with the font TXTRs is they aren't really encoded the same way as normal C4/C8 textures. There's some documentation on how font textures are encoded on the wiki here: http://www.metroid2002.com/retromodding/wiki/FONT_(File_Format)#Textures

I think PWE defaults to the font implementation instead of normal C4/C8 decoding because C4/C8 are exclusively used by fonts in the Retro games, so you might be able to dump out the texture using PWE's texture converter. It's in one of the menus in the model viewer.
Game designer and Metroid Prime fan
Quote from Parax:
The problem with the font TXTRs is they aren't really encoded the same way as normal C4/C8 textures. There's some documentation on how font textures are encoded on the wiki here: http://www.metroid2002.com/retromodding/wiki/FONT_(File_Format)#Textures

I think PWE defaults to the font implementation instead of normal C4/C8 decoding because C4/C8 are exclusively used by fonts in the Retro games, so you might be able to dump out the texture using PWE's texture converter. It's in one of the menus in the model viewer.


This is so strange. PWE seems to be running on background, but it's not showing up. It doesn't even write a log file or display any error of the sort. I guess it's probably because of Windows 10 AU since it's giving me tons of problems (like Visual Studio files getting corrupted), but I don't know for sure.
Edit history:
yonic: 2016-12-01 10:33:48 pm
yonic: 2016-12-01 10:32:14 pm
yonic: 2016-12-01 10:31:43 pm
yonic: 2016-12-01 10:31:32 pm
yonic: 2016-12-01 10:30:08 pm
yonic: 2016-12-01 10:24:23 pm
Game designer and Metroid Prime fan
Alright, I managed to run PWE and convert the TXTRs, and started working on the font.

It's interesting that, at least in the PAL version of Metroid Prime, three or four styles of the same font are used. Looks like they are adapted for different uses. The original NTSC and Player's Choice versions seem to have just one or two.

1. HUD Style. Used mostly on the visors, the pause menu, the map legend, and in the in-game notification windows (item get windows). I guess this style is adapted to the tilt and deformations of the helmet's HUD.


2. Bordered Style. Used on the room names shown in the map, when scanning, and on the text that appears when selecting a beam or a visor. It is also used on the title menu, the saving menus, and the narrator subtitles on cutscenes. This is the style I'm using as a base for the fonts I'm making since it seems to be the only style featured in the original NTSC version. My best guess of the bordered version of the fonts is that they have darker versions of the filled glyphs' palletes, and are used for adding a bit of contrast and enhancing readability. Japanese characters use this style only.


3. Hi-res Style. Used on all cutscenes that have text on them: The Samus's arrival to and escape from the Orpheon cutscenes, the Impact Crater escape cutscene, all of the area introduction sequences, the elevator cutscenes, the teleportation from Tallon Overworld to Impact Crater, and the short area text that appears before Samus gets out of the Save Stations or her ship. It is also used on the first message that shows up when you get an upgrade. I think it's also used on the Game Over and Mission Final screens, as well as the Pause screen titles [ Logbook ], [ Inventory ] and [ Options ].


4. There might be a fourth style exclusive to the energy counter, although it looks very similar to the HUD style, the glyphs have the resolution of the Hi-res Style, plus the . and : characters may represent the Energy Tanks in some way.
Edit history:
DJGrenola: 2016-12-02 06:30:46 am
Evidence suggests that the fonts in the Prime games were generated automatically from vector fonts using a piece of software very similar to this one (see the Prime 1 Japanese credits font, which is just good old Microsoft Arial). This will have made it possible for them to generate straightforwardly as many variant TXTRs from a single typeface as they needed.

AFAIK the original vector font they used has not been tracked down; it may have been Retro-internal, but from the name fields in the font files, we know it's called "Deface".
Game designer and Metroid Prime fan
Yeah, I noticed the name on the FONT file. I'd say it's very likely that it's a custom font designed by either a company outside of Retro, like FONTWORKS who designed the system font featured in all Nintendo consoles since GameCube except DS, or an artist that is credited in all Trilogy credits like Danny Richardson. At the early times of the GameCube, games used to experiment with custom typefaces, and some were kept for the following games.

A year ago I found this font which resembles a lot like the original, but it's more recent than the Deface font.
Quote from DJGrenola:
AFAIK the original vector font they used has not been tracked down; it may have been Retro-internal, but from the name fields in the font files, we know it's called "Deface".


If there's any doubt, there's also a debug texture in MP2 that straight up refers to it as "13pt Deface font".



I'm pretty sure it's a totally custom font given there's no trace of it online. I think the MP1 demo disc doesn't have Deface and instead uses fonts like Arial, though I can't remember for sure.

Quote:
all of the area introduction sequences, the elevator cutscenes


These actually use textures with the text baked into them, not an actual font. For instance the Chozo Ruins one is 2AF13ACD.TXTR (TXTR_ChozoRuinsBillboard) in NoARAM.pak.
I run this here hotel of an evening
I hate to be impatient, but is the PWE update still being worked on? I miss it lol

No rush though. Done right > done quickly anyday :)
Quote from Odylg:
I hate to be impatient, but is the PWE update still being worked on? I miss it lol

No rush though. Done right > done quickly anyday :)


Yes. I don't have a whole ton to say about it until it's done unfortunately.
Edit history:
Antidote: 2016-12-04 12:31:17 am
Antidote: 2016-12-04 12:30:10 am
Antidote: 2016-12-04 12:29:30 am
Antidote: 2016-12-04 12:22:53 am
Quote from yonic:
HECL would shine if it had a way of manually converting selected files, apart from the whole pack.

That's not what HECL is intended for, though you actually can extract individual paks.
Code:
hecl extract <image> [file or directory to extract]


EDIT: HECL is intended as a complete extract utility to be used in conjunction with URDE which is our editor/engine.

EDIT2:
Metroid Prime 2 does actually use Deface
FONT_Deface13B.yaml from HECL
Code:
DNAType: FONT
version: 0x00000004
unknown1: 0x00000010
lineHeight: 0x00000015
verticalOffset: 0x0000000E
lineMargin: 0x00000000
unknown2: False
unknown3: False
unknown4: 0x00000007
fontSize: 0x0000000C
name: Deface
textureId: MP2/GGuiSys/TXTR_744BCBB3.png
textureFormat: 0x00000002
Speaking of which, how is URDE coming along?
By the way, part of the reason why this thread is kinda dead lately is probably cuz we're doing a lot more talking in the #the_lab channel on the Metroid Prime speedrunning discord. If you wanna see more frequent updates you can join the server and keep an eye on the channel: https://discord.gg/xE7CnjJ (I'm Aruki on the discord server)

Where the PWE update currently stands is that MP1/2 repacking is almost fully functional. I still need to do more work on MP3 and DKCR and then after that there are some more backend and UI changes I'll have to make to make sure all the existing functionality works correctly with the new game project system. Don't have any ETA yet. Probably looking like early 2017 at this point.
URDE hit a bit of a rut due to me trying to find work and Jack going to school, but we're getting back into the groove again.