Yamagi's Quake II port

PS3 Yamagi's Quake II port 0.03

filenames case sensitive?
.

PAK files need to be in lowercase. Maybe external files/folders too?

Video playback is supported. Place them in a folder named video. Standard Quake 2 videos go in baseq2. Other mods/add-ons go in their respective folders.

Zaero was a planned commercial addon that got canceled but was later released for free. According to one list it's the best Quake 2 mod. Unfortunately, it needs a little editing to get it to run on PS3...

1. Download it here and extract it.
2. You need a PAK editor, I recommend Pakscape.
3. Open the PAK and extract the video folder, then delete it from the PAK.
4. (optional) Extract default.cfg, then delete it from the PAK. (can't edit configs if they're inside a PAK)
5. (optional) Delete the saves and scrnshot folders from the PAK. (saves ~18 MB)
6. Save the PAK.
7. Move the extracted videos to the external video folder.
8. zlogo.cin is corrupt, either delete it or rename it so it doesn't play.

EDIT - it turns out that leaving the video folder in the PAK is the right thing to do, zlogo.cin plays when left inside the PAK.

However, this mod does not work right. There are certain enemies and items (including a required keycard) that do not spawn. This is evident by the log file, and by watching the demo and playthroughs on YouTube.

Quake 2 mods, unlike its predecessor and sequel, are written for specific platforms (Windows, Linux, Mac). If you see a mod with a DLL file it almost certainly won't work correctly on the Linux-like PS3. (see here) Even Linux mods don't work on PS3 (SO files are the Linux equivalent of a DLL). Ground Zero, The Reckoning, and mods without a DLL/SO should be fine.
 
Last edited:
Bugs:
- running doesn't seem to work, either by binding a button to "+speed" or turning on Always Run in the menu.

- quicksaving has to be done multiple times before it actually saves, it constantly gives this message...

"Quick Saving...
Saving game...
Couldn't change to /dev_hdd0/game/QUAKE2/USRDIR/grinspq1/save/current
Couldn't change to /dev_hdd0/game/QUAKE2/USRDIR/grinspq1/save/current
Done. "

- that walk-into-water-and-freeze bug happened again, this time in the first deathmatch map (I've been trying to get 3ZB2 bots working, no luck yet). It also happened on a mod I was trying out.

EDIT - it happened 3 more times in 3 different mods. It seems to happen with "murky" water rather than clear.

Bot support is not gonna happen because bot code is stored in DLL/SO files, bummer. :apologetic:
 
Last edited:
I have uploaded @Sugaridze source code repos to GitHub for future devs that might want to work on it :)

The "old repo" (for reference): https://github.com/bucanero/quake2-ps3-old

The latest repository (used to build the .self binary): https://github.com/bucanero/quake2-ps3

I was able to keep branches and commit history, so it should be a good reference for any developer that wants to jump into PSL1GHT and PS3 development.

Note: added the release .self here too: https://github.com/bucanero/quake2-ps3/releases/tag/v0.1-alpha
 
Last edited:
I get back to work on port. Hardware renderer "almost complete". By quotes I mean it does hardware rendering on RPCS3 on which I done all it's development, but crashes before first frame on real hardware. This will take a while to figure causes of this.

UPDATE: It took way less time to fix than I expected. Still where are more bugs on real PS3. Framerate underwhelming :(
 
Last edited:
I get back to work on port. Hardware renderer "almost complete". By quotes I mean it does hardware rendering on RPCS3 on which I done all it's development, but crashes before first frame on real hardware. This will take a while to figure causes of this.
Are you aware of this
Maybe you can find some stuff you could implement into your port... It's compatible with bsd based systems. And there are still people playing this. I was just thinking about this last night. Maybe i will try to port this on PS3. Have to learn more things btw. Thank you for your great work.
 
I get back to work on port. Hardware renderer "almost complete". By quotes I mean it does hardware rendering on RPCS3 on which I done all it's development, but crashes before first frame on real hardware. This will take a while to figure causes of this.

did you see my message about github? if you're that user I can transfer the repository
 
did you see my message about github? if you're that user I can transfer the repository
Oh.. Sorry. I saw it, but I don't know what to say. It is indeed my active github profile. Transfer ownership if you wish so. I don't insist on it, my authorship recorded in commit history, after all. Next update will be on same tree as quake2-ps3. So I either create new repo or continue from that one.
 
Are you aware of this
Maybe you can find some stuff you could implement into your port... It's compatible with bsd based systems. And there are still people playing this. I was just thinking about this last night. Maybe i will try to port this on PS3. Have to learn more things btw. Thank you for your great work.
Yes, I know about Cube 2 and know people who playing it nowadays. Being highly inspired by Quake it's working on own engine. I think it's possible to port this on PS3, but it may be harder comparable to Quake 2, because of age, amount of existing source ports.
 
I saw some old wii port, about 11 years ago, so i assumed that is possible to make it run on PS3. That one was running about 24 fps if i remember correctly, but as i said it was a long time ago and i think it was on software rendering.
If you need any help/testing i am willing to try. I don't have much skill, but i know a thing or two about quake based engines like goldsrc etc. Some basic editing stuff and such. So you can dm me if you need something like that. Thank you once again. You did a great job.
 
New version here!

I have completed the work on hardware refresher to the point of playable experience but there are still some issues with performance and scrolling (see Known problems much of programmer talk).

Important:
Game folder now is /dev_hdd0/game/QUAKE2_00 ( _00 added to the end of old one). Aside from that installation and launch instructions and notes from previous release applied to this one as well.

yquake2-ps3_v0_02_pre.self.zip

This is still highly early in development version, bugs, crashes (system freezes with looping sound) still might and will occur. If you find such problems let me know here or on GitHub. By the way, Yes! I finally created own open repository to this port.

https://github.com/TooManySugar/yquake2-ps3

Notes on build:

  • Game folder now is /dev_hdd0/game/QUAKE2_00
  • First version of hardware refresher running on PS3, based on OpenGL3 refresher of Yamagi Quake 2;
  • "developer" cvar set to 1, game prints a lot of information in console and log;
  • Built with HUNK_TRACK, all hunk memory allocations is tracked and printed to console and log;
  • Fixed sounds shutdown on long rendering frames (bug fix);
  • No annoying sound looping on game loading (bug fix).

Known problems:
  • Performance - on some scenes framerate could drop below 10 fps. It fully related to how Quake 2's engine draws world - it splits world model into separate faces and draws them separately, which leads to up to 20k draw calls for simple triangles. PS3 can draw with ease objects with hundreds of thousands triangles I've tested it. If someone more experienced with RSX programming knows how to overcome this, help will be much appreciated;
  • Scroll surfaces not scrolling - on surfaces with scrolling textures scroll not applied, I believe it's conveyor belts and something else. Quite complicated bug of corruption of Model Matrix in some shaders by setting scroll and overbrightbits uniform consts in others. Choosing between the correct geometry of important objects and texture animation on rare objects, I chose the first one. Also, help much appreciated.

I've planned to introduce pkg building release, allowing to create .pkg with all required contents ('.pak's, music) on user's PCs (linux/windows). This aims to remove reliance on mmCM (or such tool) to install and launch game without distributing copyrighted files with pkg. But just before writing this release notes I found out that built that way pkg's EBOOT.bin can't start game or load save on real hardware (but game with demoscene works). For now my primary focus to fix it for proper v0.02 release with "prepkg" archive.
 
About your issue, i read it in your thread, try to add in the makefile :
SCETOOL_FLAGS += --self-ctrl-flags 4000000000000000000000000000000000000000000000000000000000000002
SCETOOL_FLAGS += --self-cap-flags 00000000000000000000000000000000000000000000007B0000000100000000

@Zar proposed to use Capability flags and and Encrypted Capability flags.

Haven't use scetool for this flags to use, but using geohot's make_self_npdrm, in which as I see they are hardcoded. Plain capability flags looks the same for usual .self, npdrm and suggested self-ctrlf-flags option. For encrypted ones - they differ from each other in geohot's tool and with suggested (suggested differs by 1 byte with used in sprx). Changed encrypted and tried - nothing seems to changed.

Also tried make EBOOT.BIN with scetool have no luck starting it on PS3 - error 80029530

Am I missing something with scetool?

Code:
scetool.exe 
-0 SELF 
--compress-data=TRUE
--skip-sections=TRUE
--key-revision=0A
 -3 1010000001000003
 -4 01000002
 -5 APP
--self-app-version=0001000000000000
--self-fw-version=0003005500000000
--self-ctrl-flags 4000000000000000000000000000000000000000000000000000000000000002
--self-cap-flags 00000000000000000000000000000000000000000000007B0000000100000000
 --encrypt yq2ps3.elf EBOOT.BIN
 
EBOOT need a his special argument like content_id
Here is the cmd used in psl1ght (I just added the ctrl and cap flags), i wrote them like u did, 1 line per arg.

scetools
--self-app-version=0001000000000000
--sce-type=SELF
--compress-data=TRUE
--self-add-shdrs=TRUE
--skip-sections=FALSE
--key-revision=1
--self-auth-id=1010000001000003
--self-vendor-id=01000002
--self-fw-version=0003004000000000
--self-type=NPDRM
--np-license-type=FREE
--np-app-type=EXEC
--np-real-fname=EBOOT.BIN
--self-ctrl-flags 4000000000000000000000000000000000000000000000000000000000000002
--self-cap-flags 00000000000000000000000000000000000000000000007B0000000100000000
--np-content-id= [PUT UR CONTENT_ID HERE - it looks like "EP0001-NPEB01234_00-0000000000000000" ]
--encrypt [ path to input - INPUT.ELF ] [ path to EBOOT.BIN ]
 
but you don't need to use it, just type "make pkg" it will build the pkg for you. (everything is inside ppu_rules)

if you have extra files to include in the PKG include them inside a directory, the directory must be declared in makefile as
PKGFILES
 
Surprisingly enough, it looks like together with @Zar we faced the same issue. As it was mentioned problem is in stack size. I have function to copy contents of one file to another with static buffer:

Code:
void CopyFile(char *src, char *dst)
{
    FILE *f1, *f2;
    size_t l;
    byte buffer[65536]; // funny but even buffer size is the same
     // ...
}

Now I commented out code which used it and game not stacks where it was when running from XMB launched EBOOT.BIN.
 
  • Like
Reactions: Zar
Proper 0.02 release

yquake2-ps3_v0_02_prepkg.zip

Notes from pre-release also applied to this one with addition:
  • "logfile" cvar set to 2 by default, log file updates on every print to console - no buffering applied, this (sometimes) makes log more useful after crushes;

Now use new distribution form. No need to use 3rd party apps to install and launch game anymore. The idea is to create .pkg by yourself.

PKG creation
Extract contents of archive to a new folder (archive's root contains multiple files and folders).
Among extracted files where is folder pkg - contents of this folder will be included in .pkg and later will extracted by PS3 into /dev_hdd0/game/QUAKE2_00/. In containing within pkg USRDIR folder create new folder with name baseq2 (case sensitive), in which place yours totally legally obtained pak[0-2].pak files from Quake 2. Structure would look like this:

yq2ps3_v0_02_prepkg‎‏‏‎‎‏‏‎‎‏‏‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎<== 1. Folder in which you extracted archive's contents
├── create_pkg.bat‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎<== 4. Run this on Windows
├── create_pkg.sh‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎<== 4. Run this on Linux
├── pkg
│‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎├── ICON0.PNG
│‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎├── PARAM.SFO
│‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎└── USRDIR
│‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎├── baseq2‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎<== 2. New folder, name is case sensitive
│‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎│‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎├── pak0.pak‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎<== 3. Placed .pak files
│‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎│‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎├── pak1.pak‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎<=│
│‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎│‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎└── pak2.pak‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎<=│
│‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎├── EBOOT.BIN
│‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎└── README.txt
├── tools
│‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎├── CREDITS.txt
│‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎├── pkg-linux
│‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎└── pkg-win64.exe
└── version

Launch create_pkg .bat or .sh depending on which platform you are Windows or Linux (OS X is possible, I don't have PC running it to verify).
Process will take some time as it encrypting contents of pkg folder, with base game takes around 45s on my Ryzen 5 3500U laptop.
In the end yquake2-ps3_v0_02.pkg file will be created. Deliver it to PS3 in a way that you prefer and install like any other .pkg. Launch as usual game from XMB menu.

Quit using in game menu, not yet added hooks for XMB's "Quit game", otherwise system will freeze and reboot.
 

First impressions...

- delete the old config.cfg and let the game create a new one, otherwise it'll crash to the XMB.

- videos play but all you see is a pink screen.

- framerate was real choppy, I tried to change to a lower resolution, and then go back to windowed mode, but on both occasions it crashed to XMB. Maybe all of the logging is affecting the FPS? (this happens sometimes with RetroArch)
 
First impressions...

- delete the old config.cfg and let the game create a new one, otherwise it'll crash to the XMB.

- videos play but all you see is a pink screen.

- framerate was real choppy, I tried to change to a lower resolution, and then go back to windowed mode, but on both occasions it crashed to XMB. Maybe all of the logging is affecting the FPS? (this happens sometimes with RetroArch)

Thank you for first feedback!

- I will look into config backward compatibility, most likely same issue as with resolution/video mode setting.
- Video playback is not implemented, I know which part of engine does it and in this version it just skips actual drawing.
- How choppy framerate is? By mean of unplayable or really low fps in some locations?

Video settings menu with hardware refresher now... Just not change anything there outside of brightness, fov and UI scale. Everything else... let's say it's WIP, settings left from OpenGL3 refresher which expect game to run in desktop environment which is not really an option here.

Answering your question:
Short answer is No.
Long is Yes, drawing log/console on screen affecting performance, but not as much as word drawing. During normal gameplay logging near to none, most of logs I done is related to game systems and assets loading and unloading. If I disable world drawing (i.e. only pink screen with gun, enemies, pickups, etc.) on RPCS3 fps is consistently above 55 (In average PS3 games on my PC performance is lower than on PS3).

Actually you can check out difference yourself!
In config.cfg add line
set r_drawworld "0"
and on next launch game will not draw world, this setting is not saving upon restart.
 
- How choppy framerate is? By mean of unplayable or really low fps in some locations?

I would say unplayable, there doesn't seem to be any place where the FPS is better (like a wide-open area with no enemies is just as bad as a small area with enemies). Just running around the first level, it was choppy everywhere. There is also a lot of "SB" console messages (forgot the actual message), is that sound buffer?
 

Similar threads

Back
Top