Rockbox Technical Forums

Rockbox Development => Feature Ideas => Topic started by: __builtin on June 15, 2019, 11:23:36 PM

Title: Port of Wolfenstein 3-D
Post by: __builtin on June 15, 2019, 11:23:36 PM
This port is old news by now, but I've decided to give it a new topic because I'd like to actually merge it this time around.

As you might know, I've been working sporadically on a port of Wolfenstein 3-D (http://gerrit.rockbox.org/r/#/c/1653/) to run on the Rockbox SDL runtime (old screenshots attached). I'm posting for a couple of reasons. First, I'd like to get the port tested on some more targets. As always, just ask and I should be able to provide a build.

More importantly, there are some licensing issues that I'd like cleared up before proceeding to merge the patch (this same question has been cross-posted to the -dev mailing list). The license of the original Wolfenstein 3-D source code itself is unclear. Id software officially released the code under a custom, restrictive license. However, over the years, various source ports claim that it is GPL compatible (see https://github.com/AlumiuN/Wolf4SDL, for example), and I think it's doubtful that id would waste their time chasing down infringing users of a 27-year old game.

That leads to the question of whether or not we should (whatever that might mean) include my port in master. Thoughts?
Title: Re: Port of Wolfenstein 3-D
Post by: Chronon on June 16, 2019, 06:16:55 PM
The license here doesn't appear to be GPL compatible.

https://github.com/id-Software/wolf3d (https://github.com/id-Software/wolf3d)

OTOH, there's this browser version here which was uploaded to Github 2 years later, which is explicitly GPL:
https://github.com/id-Software/wolf3d-browser/blob/master/COPYING.txt (https://github.com/id-Software/wolf3d-browser/blob/master/COPYING.txt)
Title: Re: Port of Wolfenstein 3-D
Post by: __builtin on June 16, 2019, 11:20:19 PM
I'm fairly certain the browser version shares no code with the original.

I did come across this page, which claims that the original is GPL-licensed: https://maniacsvault.net/ecwolf/wiki/Source_code

That page points out that Doom (which we currently distribute) was never "officially" announced as GPL, and it looks like Debian has marked Wolf4SDL (the same source port I used) as GPL, with backing from John Carmack himself: https://metadata.ftp-master.debian.org/changelogs//contrib/w/wolf4sdl/wolf4sdl_1.7+svn262+dfsg1-5_copyright

So it appears that we *should* be fine.
Title: Re: Port of Wolfenstein 3-D
Post by: Chronon on June 17, 2019, 12:25:03 AM
I was just bringing up the browser engine as an example that suggests that they aren't fundamentally opposed to a GPL engine for Wolfenstein 3d. 

If this is substantially the same situation as Doom then I don't have any objections, and if Debian is treating it as GPL that seems like a pretty good precedent.
Title: Re: Port of Wolfenstein 3-D
Post by: csussman on June 21, 2019, 10:26:42 AM
Can you make a build for iBasso DX50?
Title: Re: Port of Wolfenstein 3-D
Post by: rockbox_dev123 on July 01, 2019, 07:25:54 PM
When trying to compile this and give some feedback I'm getting:

Code: [Select]
make: *** No rule to make target '/rockbox/build/apps/plugins/wolf3d.o', needed by '/rockbox/build/apps/plugins/wolf3d.rock'.  Stop.
Pulled via:
git clone git://git.rockbox.org/rockbox
git fetch http://gerrit.rockbox.org/rockbox refs/changes/53/1653/15 && git checkout FETCH_HEAD

Am I failing to include the actual source for wolf3d somehow?
Title: Re: Port of Wolfenstein 3-D
Post by: __builtin on July 01, 2019, 09:16:41 PM
That's actually my fault. I forgot to include the overlay loader stub (that's all wolf3d.c is, really). Should be fixed in the latest patch set.

And, csussman: I don't have the Android toolchain installed so I'm currently unable to build for DX50. The build farm should handle it once I merge it, though.
Title: Re: Port of Wolfenstein 3-D
Post by: rockbox_dev123 on July 01, 2019, 09:55:20 PM
That's actually my fault. I forgot to include the overlay loader stub (that's all wolf3d.c is, really). Should be fixed in the latest patch set.

And, csussman: I don't have the Android toolchain installed so I'm currently unable to build for DX50. The build farm should handle it once I merge it, though.

Compiled and running on an ipod6g - although I can't work out how to open the first door - the OK/SELECT button doesn't seem to do anything - despite working in the games menus.

Sound is working nicely.

Its pretty late so thats good enough for now.
Title: Re: Port of Wolfenstein 3-D
Post by: __builtin on July 01, 2019, 10:22:24 PM
Compiled and running on an ipod6g - although I can't work out how to open the first door - the OK/SELECT button doesn't seem to do anything - despite working in the games menus.

That's odd. Are you approaching the door before pressing SELECT?

EDIT: Looks like the problem is with the default configuration. Go to "Controls" and set "Open=Up" and "Fire=Select".
Title: Re: Port of Wolfenstein 3-D
Post by: rockbox_dev123 on July 02, 2019, 03:33:55 PM
Compiled and running on an ipod6g - although I can't work out how to open the first door - the OK/SELECT button doesn't seem to do anything - despite working in the games menus.
EDIT: Looks like the problem is with the default configuration. Go to "Controls" and set "Open=Up" and "Fire=Select".

Played some wolf3d on my commute home, was able to nearly finish the first level after multiple attempts.

I'd say that it is very stable - and as for licensing my $0.02 is merge it.

Makes me wonder if a Quake1 sdl port would be possible with the hardware restrictions of the ipod6g - it would be extremely cumbersome to play - but a cool feat to port.

Only thing I would say - is if you are able to make some platform specific config decisions then it would go a long way to improving the ports usability - sound only works if you enable it yourself in the settings and the same goes for usable controls to be able to play.
Title: Re: Port of Wolfenstein 3-D
Post by: __builtin on July 02, 2019, 04:08:48 PM
Before merging, I still need to rebase the MAME code in the port to after they transitioned to GPLv2+. That shouldn't be too hard, but it'll take some time.

As for Quake, I managed to get it running on SDL as well a while back (http://gerrit.rockbox.org/r/#/c/1673/). It doesn't quite work, though, and it's a huge pain to debug. Maybe I'll find some time for that as well.
Title: Re: Port of Wolfenstein 3-D
Post by: __builtin on July 10, 2019, 02:28:11 PM
Alright, I merged the game into master yesterday. I haven't tested it on any hardware other than ipod6g, so I'd appreciate some feedback on whether it works on other devices.
Title: Re: Port of Wolfenstein 3-D
Post by: cela on July 16, 2019, 05:47:17 PM
Alright, I merged the game into master yesterday. I haven't tested it on any hardware other than ipod6g, so I'd appreciate some feedback on whether it works on other devices.

Just tested, fully working on Sony nwz-E384, Creative Zen x-fi2 and Sansa Fuze+ including sound effects and music. Thanks!
Title: Re: Port of Wolfenstein 3-D
Post by: csussman on May 13, 2020, 07:47:39 PM
I tried wolf3d on the iBasso DX50 and it seems to work. It could use better key mapping though, it only uses five buttons. The fire and open keys are the same, the back and change weapon are the same, and there's no menu button.

Quake and duke3d are also like this.

Thank you for these ports.
Title: Re: Port of Wolfenstein 3-D
Post by: __builtin on May 13, 2020, 09:11:53 PM
Thanks for letting me know! It should be possible to change the key mapping from within each game, though not all buttons will send a virtual keypress event to the game.
Title: Re: Port of Wolfenstein 3-D
Post by: csussman on May 14, 2020, 12:00:04 AM
I tried changing the keys in the game but there's no button for going back from the control selection to the main menu. Also there are only 5 keys to choose from. (left, right, top middle of screen, bottom middle of screen, and bottom left of screen) Also, so I can't choose the buttons anyway. None of the other hard buttons or screen areas do anything.