Yamagi's Quake II port

PS3 Yamagi's Quake II port 0.03

Sugaridze

Developer
Update 0.03
https://www.psx-place.com/threads/yamagis-quake-ii-port.37215/page-3#post-367975

Update 0.02 (pkg creation bundle)
https://www.psx-place.com/threads/yamagis-quake-ii-port.37215/page-2#post-361812

Update 0.02pre (1st Hardware refresher release)
https://www.psx-place.com/threads/yamagis-quake-ii-port.37215/page-2#post-361715

Update 0.01 (1st Software refresher release)
https://www.psx-place.com/threads/yamagis-quake-ii-port.37215/#post-342788

Original post below
.
Hello everyone!

Not small prelude

I'm glad to write my first post here. I've joined PSX-Place at November last year and since then had nothing to say here. You guys are awesome, and the amount of work that was done to make tools to homebrew development for PS3 is astonishing.

My experience in homebrew development is so little, so it's easier to say that I don't have any. And actually I got my hands on softmod to my PS3 SUPER SLIM! only last summer, can you imagine: only to backup my games. Somewhere at mid-October, after watching some MVG's videos, I became interested that scene have made for PS3. I've got surprised how much and the same time how little was done on PS3 compared It's unique interesting hardware (thank you sAnie I guess).

I started learning PSL1GHT, read some papers on original SDK, got amazed seen RSXGL. I started tinkering with ps3toolchain at November (time I've joined PSX-Place). Initial idea was to port PC exclusive game from PS3's era or prior which was never had native version and have source port at nowadays. The first thing came to mind was re3 (GTA3 port) which not so long ago (at the time) was shot down by Rackstar due to the upcoming demastered collection. Yes, I know that GTA3 can be played on early PS3 models, but this is the PS2 version, moreover it's not a subject. The work went not welldue to my complete lack of knowledge of software porting and complexity of re3 project. After about a week I've lowered my ambitions and switched to no so complex game engine - Quake II's and started learning it's source code.

My choice on Quake II was based on my awareness of huge amount of ports and the knowledge of how many game engines were made based on Quake II's engine.And yet it is a fully 3D game with an OpenGL renderer. Looking at RSXGL I've got inspired to make GL game run on PS3. About a month took to learn how idTech2 works. And still working with it I'm amazed at what a good piece of software it is. For target code to port I choose some project called Thenesis Quake II which aimed to port Yamagi's Quake II to systems with embedded graphics (so called OpenGL ES). Everything was going well until I moved to work on rendering in December. I kept getting memory access errors in the render initialization part. I. I couldn't figure out what was wrong then, and even now I don't know what caused these errors. At end of year I abandoned work on it.

Words on RSXGL's shaders part

Returned to work at the last days of April, still focusing on RSXGL and Thenesis's code, but started from scratch focusing on renderer (or refresher if speaking in terms of Quake II). I don't get errors in the initialization part like it used to, but all screws up at shader's binding part, as I figure out it's some kind of error with shader's variables. Even then adding new names to gears example everything breaks, not sure is it problem only in my toolchain or whole RSXGL. I've read several messages from Crystal about RSXGL and decided to abandon it too.

Actual work started

Without RSXGL I'm not attached to the OpenGL and Thenesis's code which actually ruins modular design of Quake 2 and I've switched to recent version of Yamagi's Quake II. I did little work implementing system specific part for PS3 and in about a week of work managed to got it working. Yesterday in process of starting adding client's code (this part responsible for rendering, sound and user input) got it running with image and somewhat playable framerate. Today I've done implementing input part. And the following video is a showcase of playable first level (need to add 6 lines of code to make second level to load I think)

Showcase video


Game runs better then I expected - even at 720p it's around 14-16 fps. In RPCS3 I'm getting numbers around 5-7. Some details I left at video description. TL;DR: I don't plan to release it yet, but I will almost certainly do so in future, actually planning to release it when I start creating renderer module for hardware accelerated graphics.

Things I want you to ask about

1. As I mentioned above I've implemented own input subsystem independent of SDL2's one. Actuallyt wasn't really necessary, SDL2 Input works right out the box, I think it even supports keyboard and mouse, because in RPCS3 I got camera moving by dragging cursor above window and LMB worked as attack button. So I wish to get rid of SDL2 layer (including screen update part) how did you think is it bad idea?
2. Currently I'm aiming my port to be a patch for the Yamagi's Quake II 8.xx source tree as I believe this will make it easier to maintain in the future, but this may lead to disadvantages in terms of optimization. Realistically speaking - does a port of 25 years old game to 16 years old hardware based on fairly new codebase that has been maintained for years needed by someone to be updated further more by someone else rather then me?

Thank you for attention. It will be a pleasure to answer any of your questions and read recommendations.
 
Last edited:
Maybe Vita port could help?
Thank you for your suggestion. I refer to it time to time already. Took workaround for virtual memory allocation from it.
Vita port based on original Quake II's source code and uses some kind of OpenGL 1.x (vitaGL) RSXGL tried to implement OpenGL 3.x and RSX's shader language is kinda like 3 too, so there is not much what I can took from it.
 
Thank you for your suggestion. I refer to it time to time already. Took workaround for virtual memory allocation from it.
Vita port based on original Quake II's source code and uses some kind of OpenGL 1.x (vitaGL) RSXGL tried to implement OpenGL 3.x and RSX's shader language is kinda like 3 too, so there is not much what I can took from it.
AFAIK the best RSX performance will always be with libgcm.
When it comes to opengl, it's not natively supported and wrappers like rsxgl may be slower than s#ny's official PSGL implementation (which iirc is based on Nvidia cg).

The PS3 architecture is made for high speed parallel computing through the 6 dedicated SPUs capable of handling 128 bit vector operations with little overhead.
To get the best possible performance in a rendering engine, it's recommended to offload any heavy calculations that you would normally make on the PPU or possibly on the RSX itself, on the SPUs in a distributed way.
 
Last edited:
if u need people for test I'm here. I have a cfw slim ps3 with latest evilnat. I haven't PC so I can't compile.
ps=retroarch have quake core? I haven't try that
 
20220719_141931.jpg

thats the result of quake1 core i think... lower fps and rendering problem
 
Hello everyone. Long needed update here.
I stopped work at May 17th and had some IRL related stuff to do for month and a half. I've been free since end of June and was able to complete the work for this update post done at the end of the first week of July as I originally planned but I've been lazy. Sorry.
TL;DR: here is .self file:

yq2ps3.self.zip

In May I completed removal of SDL2 - it reduced .self size by 30% and as I observe improved fps a bit.
Also made the sound work. Still don't know why it didn't work with SDL because in the end I made similar code to one in SDL2_PSL1GHT.
I've spent past few days transitioning existing code into Yamagi's Quake II source tree so this project is now a 'fork' as it should be.

Notes on build:
  • Tested work on RPCS3 and HEN softmoded Super slim model.
  • Online play not working: accessing "join game" entry causes the game crash, so don't do this.
  • Sound works. Supports music: to make it work drop the unpacked Quake II's music into:
    <path to QUAKE2>/USRDIR/baseq2/music/
    Heard some sound stutters maybe need to increase buffer size or a performance issue.
    Sometimes in emulator game starts without sound.
  • Save/Load works without using the PS3's save system. On save/load prints fullpath to savefile.
  • Level loading works. I've completed the first 3 levels. It would be great if someone tried to beat the full game.
  • Fullscreen modes:
    • "no" and "native fullscreen" are identical - image is drawn from the top left corner with specified resolution. Resolutions higher then the maximum system resolution are reset to 640 by 480:
    • "fullscreen window" - actual fullscreen with maximum supported resolution.
Installation:
I insist you to install it on the RPS3 first to be familiar with files placement.
Since this is homebrew, you need a PS3 that can run homebrew.

First you must have totally legit copy of Quake II in order to take pak[0-3].pak from it in to run the game. These files are copyrighted by Id and I will not redistribute them.
Using ftp or installed file browser create the following catalog structure on PS3:
/dev_hdd0/game/QUAKE2
├── USRDIR
│‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎└── baseq2
│‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎ ‎‏‏‎ ‎‏‏‎ ‎├── pak0.pak
│‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‏‎ ‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎├── pak1.pak
│‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎ ‎‏‏‎ ‎‏‏‎ ‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎‎‏‏‎ ‎‏‏‎ ‎‏‏‎ ‎└── pak2.pak
└── yq2ps3.self

It's important to put everything in /dev_hdd0/game/QUAKE2 this path is hardcoded into .self and if you make mistakes in the path or put files in a different directory, the game would load into the console with message that it can't find game files.
To launch use mmCM or other thing that can start .self files and run yq2ps3.self.

Note on first launch:
I don't provide a config.cfg so game starts with 320x240 resolution without configured gamepad controls. You need to go into settings to set things to you likings:
  • Select - opens a menu and used in it to go backwards;
  • DPAD - move between menu entries, slide things;
  • Cross - interact with menu entry;
  • Circle - as Select go backwards in menu.
Gamepad bindings are configured in: Menu>Options>Customize gamepad>Customize buttons
Resolution configured in: Menu>Video>Video mode
To apply the resolution change scroll down in the same menu to Apply entry.

To save changes on restart, exit the game using: Menu>Quit it will write your config into config.cfg in game directory

If you get any crashes, don't restart the game right away, but copy the qconsole.log from the game folder and drop a message here describing what you did before the crash, I'll try to figure out what went wrong and fix it.

Source code:
Here's two archives:
1) old_repo.zip - old repository on which I've worked until mid-May. There are remnants in the commit history from when it was an attempt to port re3, which I wrote about in the first post. And, more importantly, the code for version which I've showcased before - with use of SDL2, as well some other versions at various stages. The commit history goes back to the point where I got rid of using SDL2 completely. I think this might be useful as example if someone tries to port other open-source PC game.

2) snapshot_38b05abc.zip - new repository up to the point at which provided yq2ps3.self was compiled. Now it's fork of Yamagi's team project from version 8.10. I'll continue work on this repository.

Compilation
To compile you need Linux machine with installed and configured ps3toolchain. In source root execute:
make -f Makefile.ps3
 
Dear Sugarizde,

thank you kindly for this port. I play at 480p and I think it's running at nearly 60fps, I can't determine exactly however.
I encountered a bug: I shot with the shotgun and during the reloading animation I hit the water resulting in a freeze with a sound loop (like a scratched disc). Please the the photo attached, the log, however, I can't post with my mobile phone, even tapatalk won't allow, so I will send you a private message with the log.
Your work is much appreciated here. Do you think the mission packs or even Quake 3 could be possible, also? Would be awesome. For brutal Doom on PS3 I would die.

Cheers! Ben
691d91495a7de74e390b01997a2fad49.jpg


Edit: I can't send private messages, so here is a we transfer link to the log https://we.tl/t-zodEFwCQO6
 
Last edited:
I tried this, but when I started a new game it said it couldn't load the map. Itb also said it couldn't play the demo. All PAKs are in the correct place, maybe something's wrong with one of them...

EDIT - I'm almost positive I placed the PAKs in the right place...
 
I tried this, but when I started a new game it said it couldn't load the map. Itb also said it couldn't play the demo. All PAKs are in the correct place, maybe something's wrong with one of them...

EDIT - I'm almost positive I placed the PAKs in the right place...

filenames case sensitive?
.
 
if the original author @Sugaridze doesn't mind, I was thinking to create an open-source repository on GitHub and upload the two source branches that he shared, so they remain available in a future and someone wants to fork and continue the work.

I don't have time to work on it, but for preservation I think it will be useful still
 
Dear Sugarizde,

thank you kindly for this port. I play at 480p and I think it's running at nearly 60fps, I can't determine exactly however.
I encountered a bug: I shot with the shotgun and during the reloading animation I hit the water resulting in a freeze with a sound loop (like a scratched disc). Please the the photo attached, the log, however, I can't post with my mobile phone, even tapatalk won't allow, so I will send you a private message with the log.
Your work is much appreciated here. Do you think the mission packs or even Quake 3 could be possible, also? Would be awesome. For brutal Doom on PS3 I would die.

Cheers! Ben
691d91495a7de74e390b01997a2fad49.jpg


Edit: I can't send private messages, so here is a we transfer link to the log https://we.tl/t-zodEFwCQO6

Same thing here, I just walked into the water and the game froze. There was a ship passing overhead, maybe there were too many sounds occurring at once?

EDIT - log file.
 

Attachments

Last edited:
  • Sound works. Supports music: to make it work drop the unpacked Quake II's music into:
    <path to QUAKE2>/USRDIR/baseq2/music/
    Heard some sound stutters maybe need to increase buffer size or a performance issue.
    Sometimes in emulator game starts without sound.

Tracks need to named 02.ogg, 03.ogg, etc., not Track02.ogg, etc.

EDIT - Reckoning and Ground Zero add-ons use standard Quake music. Quake uses tracks 2-11, Ground Zero uses tracks 12-21, Reckoning uses some from both.
 
Last edited:
@JediKnight007 @Bentheman Thank you for a lot of feedback! Sorry for not responding in time.

I aware that shareware/demo versions of Quake 2 won't work. Not quite sure why though.
Glitchy sound that you heard entering the water and game froze is not related to sound issue. If put it simply: game crashes (can't say why) and last moments of sound continues to loop because sound playback not crashed.

Happy to see it even started on someone else's consoles!
 
@JediKnight007 @Bentheman Thank you for a lot of feedback! Sorry for not responding in time.

I aware that shareware/demo versions of Quake 2 won't work. Not quite sure why though.
Glitchy sound that you heard entering the water and game froze is not related to sound issue. If put it simply: game crashes (can't say why) and last moments of sound continues to loop because sound playback not crashed.

Happy to see it even started on someone else's consoles!

Welcome to the forum ( a bit late :) )

I did not notice this when you first posted this, but great to see, i hope to see more :)

I need to write some news about it, I did tweet about it the other day on the site's twitter:
https://twitter.com/PSXPlace/status/1613365266418896897
 
About that @bucanero said.
I don't mind if you put it in public repository. If you do so put link to this thread into description. So if at some point I complete hardware accelerated version (it will be open source and proper repository) it can be related to old by this thread.

Speaking of which, things went well until mid September. I've done 2D graphics (GUI), level rendering, colored lights and dynamic lights.

I haven't touched code from since then and project at frozen state now. I hope I get back to it in near future.

Edit: Added screenshots

Lightmaps.png

Colored lightmaps
unknown.png

Dynamic lightmaps. Projectile light in starting room.
 
Last edited:
Do you think the mission packs or even Quake 3 could be possible, also? Would be awesome. For brutal Doom on PS3 I would die.

I figured out how to play mods/mission packs with this port!

1. Place the mod's folder in /dev_hdd0/game/QUAKE2/USRDIR
(this is next to baseq2, not in it!)
2. Start Quake 2.
3. Bring up the main menu, go to Game, scroll down and select Mods.
4. Choose your mod and select Apply.

Tested with The Reckoning addon (also known as xatrix). More testing to follow.

Bug: everytime I start a new game, Quake 2 freezes. But it still creates a save, and on next boot, the save game is there, ready to be loaded.

EDIT - after further testing, I've had no issues with new games. Maybe I was just unlucky...

@Bentheman: Brutal Doom is a GZDoom mod, somebody would have to port that, if it is compatible with the PS3's architecture.

@Sugaridze :. would it be possible to add an on-screen keyboard for typing console commands? Or maybe have the PS3's native OSK come up?
 
Last edited:

Similar threads

Back
Top