Jump to content

Doom RPG Port Reverse Engineering Update (version 0.2.2) Source Code Release


Recommended Posts

8 hours ago, Gerardo194 said:

Gracias @EkinoxGMaunque ya respondí en tu otro thread jajaja, sería mejor continuar por aquí.

Hola si ya te mande por ahi un mensaje

Share this post


Link to post
  • 1 month later...
  • 3 weeks later...
  • 3 months later...
  • 2 months later...
  • 4 weeks later...

Thanks so much for this, I've been wanting to play Doom RPG for years!

 

Do you know if there's a way to remove/replace the hurt dog sounds? They bum me out

Share this post


Link to post
On 3/13/2023 at 9:16 AM, dstarr3 said:

Thanks so much for this, I've been wanting to play Doom RPG for years!

 

Do you know if there's a way to remove/replace the hurt dog sounds? They bum me out

Tried doing this mod myself just now, it's easy. The file I'm referring to is 5089.wav. Deleting it from DoomRPG.zip causes the program to halt, but you can replace the file with silence and it's all good.

Share this post


Link to post
  • 6 months later...

Hello, i'm going to post as though if this is a General for DOOM RPG if you don't mind:

first off, I finished the game! got the rank of chump though. I presume it's a speed thing but I wonder if people here had any advice on how to improve said ranking.

Second, the only advice the game told me is to go on doomrpg.com/hound. Of course knowing how old this game is and the site in general not working I tried to check the archives. I did not find anything related to "dommrpg.com/hound". Not helped that the old webiste url in general needed n.x in it for some reason.

Third is if anyone knows the effective range of the weapons. I thought that a shotgun is a few panels, pistols you can try to snipe but have a huge chance of missing, and plasma and rockets you can hit across the room

Share this post


Link to post
On 6/28/2022 at 11:11 PM, Erick194 said:

As we promised, the Doom RPG port for PC is finally here. created using SDL2 and BREW version doomrpg.mod original file reverse 
engineering.

 

This is my first port made for PC and I hope this works for you too. 

 

Special thanks goes to @Anarkavre as thanks to him we got the original Brew game files.

 

You need to get the original files to be converted into a friendly format for the port, you can get them from Archive.org, you can search 
"Doom RPG BREW" on SOFTWARE menu.

 

Run the BarToZip program to convert the file doomrpg.bar into a DoomRPG.zip, then you run the DoomRPG.exe

Hope you enjoy it, best regards.

 

Bugfixes:

* Accuracy upgrade (+1 Accuracy) purchase is correctly added to both player and stats.
* Game prologue messages are displayed correctly with the corresponding text.

 

Español

Como lo prometimos el port de Doom RPG para pc esta aquí, este port está creado con SDL2 y se utilizó ingenieria inversa del
archivo doomrpg.mod del juego original de la version BREW.

 

Este es mi primer port que he creado para pc, espero que sea funcional para ustedes también.

 

Agradecimientos especiales a Anarkavre ya que gracias a el obtuvimos los archivos originales del juego de la version BREW.

 

Es necesario tener los archivos originales para ser convertidos en un formato más amigable para el port, puedes consegir los 
archivos alojados en Archive.org, lo pueden buscar en el apartado de SOFTWARE con el nombre de "Doom RPG BREW"

 

Ejecutan el programa BarToZip para convertir el archivo doomrpg.bar a DoomRPG.zip, luego ejecutan el port DoomRPG.exe

 

Espero que lo disfruten, saludos.

 

Correcciones:

* La compra de mejoras de precisión (+1 Accuracy) se agrega correctamente al jugador y a las estadísticas.
* Los mensajes del prólogo del juego se muestran correctamente con el texto correspondiente.

 

DoomRPG_Port.zip

DoomRPG_Port - v 0.2.zip

 

image.png.377a562edf9f3e32b1c3a3deed541378.pngimage.png.a5381aa95ccc874c15106d8ba7157cab.pngimage.png.5690df6ab42017c72c58a11ff06647f8.png

how do you make it work i have been trying for hours and never worked HOW?!?!?!?image.png.e473905f7ce32338845afc31f6b0e7ab.png

Edited by SuperMug

Share this post


Link to post

I'm having similar issue to @SuperMug. The bar to zip works fine but when I launch the .exe it says z_free: freed a pointer without ZONEID. I got Doom II RPG working fine but I'd like to play this one first.

Share this post


Link to post
  • 1 month later...
  • 1 month later...
On 10/23/2023 at 2:37 PM, SuperMug said:

how do you make it work i have been trying for hours and never worked HOW?!?!?!?image.png.e473905f7ce32338845afc31f6b0e7ab.png

I was checking and apparently it is the BarToZip program that generates the problem, since it depends on an external executable to convert qcp audio to wav.

I would appreciate it if you tried this new version of BarToZip and let me know if there are any errors.

BarToZip.zip

Share this post


Link to post

The monsters seem to move randomly in many situations in this port, unlike both J2ME and BREW (when it doesn't crash) version where they move towards you. If they can attack you, they're usually normal. But especially if you're waiting around the corner, in this port they seem to move randomly (including away from you). Yes, in J2ME they do occasionally move away, but nowhere that often.

Share this post


Link to post
9 hours ago, tempun2 said:

The monsters seem to move randomly in many situations in this port, unlike both J2ME and BREW (when it doesn't crash) version where they move towards you. If they can attack you, they're usually normal. But especially if you're waiting around the corner, in this port they seem to move randomly (including away from you). Yes, in J2ME they do occasionally move away, but nowhere that often.

It is very possible that you are right, it may be the system that handles random numbers, thank you for your observation, I will be reviewing the behavior of the enemies to see if we can find a solution.

Share this post


Link to post
12 hours ago, Erick194 said:

It is very possible that you are right, it may be the system that handles random numbers, thank you for your observation, I will be reviewing the behavior of the enemies to see if we can find a solution.

I think Doom RPG has its own PRNG (in DoomRPG.c in the published code). I've noticed that Entity.c:Entity_aiGoal_MOVE() is buggy. AFAICT, it is intended to move monster towards its target, picking a random direction if two ones would place the monster equally close to the target.

    closestPathDist = 9999;
/* [irrelevant code setting i10 omitted] */
    if (Entity_checkLineOfSight(entity, srcX, srcY, srcX + 64, srcY, i10)) { /* AFAIU checks if monster can move there */
        pathDist = Entity_calcPath(entity, sX + 1, sY, dX, dY, 0, i10);
        if (pathDist < closestPathDist) { /* always true! */ 
            closestPathDist = pathDist;
            entity->visitOrder[entity->visitOrderCount++] = 2;
        }
        else if (pathDist == closestPathDist) {
            entity->visitOrder[entity->visitOrderCount++] = 2;
        }
    }

Entity_calcPath() returns some kind of pseudo-distance, which is smaller than 9999.

AFAIU, this means that the east direction, if the monster can move there, is always added to the entity->visitOrder[] array. Then one direction is picked out of entity->visitOrder[] array pseudo-randomly:

    switch (entity->visitOrder[(DoomRPG_randNextByte(&entity->doomRpg->random) & 3) % entity->visitOrderCount]) {
        /* [code] */
        case 2:
        entity->monster->x = srcX + 64;
        entity->monster->y = srcY;
        break;
        /* [more stuff] */

AFAIU, the monster moving east happens with probability of about 1/2 - even if it would move monster away from you. Which seems to actually happen.

 

Share this post


Link to post
28 minutes ago, tempun2 said:

I think Doom RPG has its own PRNG (in DoomRPG.c in the published code). I've noticed that Entity.c:Entity_aiGoal_MOVE() is buggy. AFAICT, it is intended to move monster towards its target, picking a random direction if two ones would place the monster equally close to the target.


    closestPathDist = 9999;
/* [irrelevant code setting i10 omitted] */
    if (Entity_checkLineOfSight(entity, srcX, srcY, srcX + 64, srcY, i10)) { /* AFAIU checks if monster can move there */
        pathDist = Entity_calcPath(entity, sX + 1, sY, dX, dY, 0, i10);
        if (pathDist < closestPathDist) { /* always true! */ 
            closestPathDist = pathDist;
            entity->visitOrder[entity->visitOrderCount++] = 2;
        }
        else if (pathDist == closestPathDist) {
            entity->visitOrder[entity->visitOrderCount++] = 2;
        }
    }

Entity_calcPath() returns some kind of pseudo-distance, which is smaller than 9999.

AFAIU, this means that the east direction, if the monster can move there, is always added to the entity->visitOrder[] array. Then one direction is picked out of entity->visitOrder[] array pseudo-randomly:


    switch (entity->visitOrder[(DoomRPG_randNextByte(&entity->doomRpg->random) & 3) % entity->visitOrderCount]) {
        /* [code] */
        case 2:
        entity->monster->x = srcX + 64;
        entity->monster->y = srcY;
        break;
        /* [more stuff] */

AFAIU, the monster moving east happens with probability of about 1/2 - even if it would move monster away from you. Which seems to actually happen.

 

Oh excellent for showing me those fragments of the code, I will review it later in the BREW version decompile, it is possible that I missed something in the code.

Share this post


Link to post

@tempun2 Ok yes I found a mistake, in these lines

if (Entity_checkLineOfSight(entity, srcX, srcY, srcX + 64, srcY, i10)) {
        pathDist = Entity_calcPath(entity, sX + 1, sY, dX, dY, 0, i10);
        if (pathDist < closestPathDist) {
            closestPathDist = pathDist;
            entity->visitOrder[entity->visitOrderCount++] = 2;
        }
        else if (pathDist == closestPathDist) {
            entity->visitOrder[entity->visitOrderCount++] = 2;
        }
    }
    if (Entity_checkLineOfSight(entity, srcX, srcY, srcX - 64, srcY, i10)) {
        pathDist = Entity_calcPath(entity, sX - 1, sY, dX, dY, 1, i10);
        if (pathDist < closestPathDist) {
            closestPathDist = pathDist;
            entity->visitOrder[entity->visitOrderCount++] = 3;
        }
        else if (pathDist == closestPathDist) {
            entity->visitOrder[entity->visitOrderCount++] = 3;
        }
    }
    if (Entity_checkLineOfSight(entity, srcX, srcY, srcX, srcY + 64, i10)) {
        pathDist = Entity_calcPath(entity, sX, sY + 1, dX, dY, 2, i10);
        if (pathDist < closestPathDist) {
            closestPathDist = pathDist;
            entity->visitOrder[entity->visitOrderCount++] = 1;
        }
        else if (pathDist == closestPathDist) {
            entity->visitOrder[entity->visitOrderCount++] = 1;
        }
    }
    if (Entity_checkLineOfSight(entity, srcX, srcY, srcX, srcY - 64, i10)) {
        pathDist = Entity_calcPath(entity, sX, sY - 1, dX, dY, 3, i10);
        if (pathDist < closestPathDist) {
            entity->visitOrder[entity->visitOrderCount++] = 0;
        }
        else if (pathDist == closestPathDist) {
            entity->visitOrder[entity->visitOrderCount++] = 0;
        }
    }

It should be that way

if (Entity_checkLineOfSight(entity, srcX, srcY, srcX + 64, srcY, i10)) {
        pathDist = Entity_calcPath(entity, sX + 1, sY, dX, dY, 0, i10);
        if (pathDist < 9999) {
            closestPathDist = pathDist;
            entity->visitOrderCount = 1;
            entity->visitOrder[0] = 2;
        }
        else if (pathDist == 9999) {
            entity->visitOrder[entity->visitOrderCount++] = 2;
        }
    }
    if (Entity_checkLineOfSight(entity, srcX, srcY, srcX - 64, srcY, i10)) {
        pathDist = Entity_calcPath(entity, sX - 1, sY, dX, dY, 1, i10);
        if (pathDist < closestPathDist) {
            closestPathDist = pathDist;
            entity->visitOrderCount = 1;
            entity->visitOrder[0] = 3;
        }
        else if (pathDist == closestPathDist) {
            entity->visitOrder[entity->visitOrderCount++] = 3;
        }
    }
    if (Entity_checkLineOfSight(entity, srcX, srcY, srcX, srcY + 64, i10)) {
        pathDist = Entity_calcPath(entity, sX, sY + 1, dX, dY, 2, i10);
        if (pathDist < closestPathDist) {
            closestPathDist = pathDist;
            entity->visitOrderCount = 1;
            entity->visitOrder[0] = 1;
        }
        else if (pathDist == closestPathDist) {
            entity->visitOrder[entity->visitOrderCount++] = 1;
        }
    }
    if (Entity_checkLineOfSight(entity, srcX, srcY, srcX, srcY - 64, i10)) {
        pathDist = Entity_calcPath(entity, sX, sY - 1, dX, dY, 3, i10);
        if (pathDist < closestPathDist) {
            entity->visitOrderCount = 1;
            entity->visitOrder[0] = 0;
        }
        else if (pathDist == closestPathDist) {
            entity->visitOrder[entity->visitOrderCount++] = 0;
        }
    }

I'll send you the executable via direct message and let me know if you see any difference, so I can make a new update to the executable on GitHub.

 

 

Well, you were right here the first video with the code uncorrected

 

And here is another video with the code corrected

 

 

Edited by Erick194
Add videos

Share this post


Link to post

 

3 hours ago, Erick194 said:

It should be that way


if (Entity_checkLineOfSight(entity, srcX, srcY, srcX + 64, srcY, i10)) {
        pathDist = Entity_calcPath(entity, sX + 1, sY, dX, dY, 0, i10);
        if (pathDist < 9999) {
            closestPathDist = pathDist;
            entity->visitOrderCount = 1;
            entity->visitOrder[0] = 2;
        }
        else if (pathDist == 9999) {
            entity->visitOrder[entity->visitOrderCount++] = 2;
        }
    }

I'll send you the executable via direct message and let me know if you see any difference, so I can make a new update to the executable on GitHub.

Seems to work correctly for me, at least with respect to that problem. I'd suggest replacing those 9999's in the quote fragment with closestPathDist so as to have magic constants in one place and for consistency with the rest of the code, but it's your choice.

Share this post


Link to post

Well, I've tried playing Sector 1 twice on the new build and twice had an Infernis somehow get through the locked door. Maybe it happens on the old build too,

Basically, stand in the secret area at position 18 10, next to the secret door in secret area, and you'll hear the Infernis activation sound. This is, maybe, normal (can't test in Melange, it has no sound) - what isn't is meeting the Infernis before the first passcode locked door (at 4 5). It should not be able to get through. Can't repro on 0.2.1, but that would need the Infernis to move west and the east-moving bug makes this unlikely. In my 2 playthroughs of BREW version on Melange, this didn't happen either, but I haven't tried very hard.

Perhaps it's related, but if you move near the green door in Sector 1, you'll hear the cacodemon activation sound (it shouldn't be able to see you, but Maybe BREW had this bug as well.)

Share this post


Link to post

 

9 hours ago, tempun2 said:

Well, I've tried playing Sector 1 twice on the new build and twice had an Infernis somehow get through the locked door. Maybe it happens on the old build too,

Basically, stand in the secret area at position 18 10, next to the secret door in secret area, and you'll hear the Infernis activation sound. This is, maybe, normal (can't test in Melange, it has no sound) - what isn't is meeting the Infernis before the first passcode locked door (at 4 5). It should not be able to get through. Can't repro on 0.2.1, but that would need the Infernis to move west and the east-moving bug makes this unlikely. In my 2 playthroughs of BREW version on Melange, this didn't happen either, but I haven't tried very hard.

Perhaps it's related, but if you move near the green door in Sector 1, you'll hear the cacodemon activation sound (it shouldn't be able to see you, but Maybe BREW had this bug as well.)

This happens on real devices, I have a Casio G'zone Ravine 2 and I have the game installed, and the monster activation sound plays without you seeing it directly.

 

You could also see this video of Doom Rpg running on real hardware on a zeebo.

 

https://youtu.be/XMZJT68w4Sk?si=YO5n-hSqvtcV6kqs

Edited by Erick194

Share this post


Link to post
1 hour ago, Erick194 said:

This happens on real devices, I have a Casio G'zone Ravine 2 and I have the game installed, and the monster activation sound plays without you seeing it directly.

OK. But does the Infernis bug I described above occur there also?

Share this post


Link to post
2 hours ago, tempun2 said:

OK. But does the Infernis bug I described above occur there also?

I'm not really sure, but I'll try it later when I get home.

Share this post


Link to post
22 hours ago, tempun2 said:

OK. But does the Infernis bug I described above occur there also?

That's it, I remembered and yes the Infernis should not go through the door, in the test executable I sent you I had a line of code misspelled, I noticed shortly after I sent you the executable and I didn't update the one I sent you.

 

Practically the Infernis is making noclip to the door.

 

//-----------------------------------------------------------------//
    else if (entity->def->eSubType == 10) {
        i10 &= ~1025; // <- With the error on the line
    }
//-----------------------------------------------------------------//
    else if (entity->def->eSubType == 10) {
        i10 &= ~1024; // <- Without the mistake on the line
    }
//-----------------------------------------------------------------//

 

And an example regarding the activation sound recorded on the physical device.

 

 

Edited by Erick194

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...