Quake 2 on Falcon030

All 680x0 related coding posts in this section please.

Moderators: exxos, simonsunnyboy, Mug UK, Zorro 2, Moderator Team

User avatar
Ragstaff
Atari Super Hero
Atari Super Hero
Posts: 609
Joined: Mon Oct 20, 2003 3:39 am
Location: Melbourne Australia
Contact:

Re: Quake 2 on Falcon030

Postby Ragstaff » Thu Dec 29, 2016 7:05 am

Just wanted to say look after yourself, Doug, I'm always amazed by your work but don't work too hard!

FedePede04
Atari Super Hero
Atari Super Hero
Posts: 934
Joined: Fri Feb 04, 2011 12:14 am
Location: Denmark
Contact:

Re: Quake 2 on Falcon030

Postby FedePede04 » Fri Dec 30, 2016 1:50 am

I hope that you feel or soon will feel better.
we need you wisdom here take care.
Atari will rule the world, long after man has disappeared

sometime my English is a little weird, Google translate is my best friend :)

User avatar
LaceySnr
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 111
Joined: Wed Jun 26, 2013 5:00 am
Contact:

Re: Quake 2 on Falcon030

Postby LaceySnr » Sat Dec 31, 2016 5:44 am

Yeah, take care of yourself Doug! I'll stop asking tedious questions ;)

User avatar
dml
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3468
Joined: Sat Jun 30, 2012 9:33 am

Re: Quake 2 on Falcon030

Postby dml » Sat Dec 31, 2016 12:38 pm

Thanks everyone! Happy new year to all, when it arrives :-)

User avatar
dml
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3468
Joined: Sat Jun 30, 2012 9:33 am

Re: Quake 2 on Falcon030

Postby dml » Sun Jan 01, 2017 10:59 pm

Q2 engine now compiled, linked and running with Atari GCC 6.2...

User avatar
dml
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3468
Joined: Sat Jun 30, 2012 9:33 am

Re: Quake 2 on Falcon030

Postby dml » Tue Jan 03, 2017 8:02 pm

Small update after a long pause...

I recently had a bit of success fiddling around with the original ID sources, and got the game to run on f030 with the original rasterizer + FPU, using a simple pixel fixup pass each frame. It's awesomely slow of course (like <0.15fps) but it's complete.

It needs something like 128-256mb of ram to run (!) so Hatari TT-ram saves the day. Fortunately the memory-hungry part is in the rasterizer and model loading. i.e. it mostly goes away if you un-plug the original rasterizer device.

I had a shot at tidying up my own renderer (if you remember: it is not based on ID's sources) to use data types very similar to the real ones, for those areas which are exposed from the renderer (not very much). If I get anywhere with that I might be able to plug the custom f030 renderer into the Id game codebase - as was done with BadMood. And it may then be able to run in a much smaller memory footprint. And less messy this time (the BadMood 'glue' procedure was awful :D ).

There's a weird part where collision detection reads model data for the server to work with, but is not actually part of the renderer device - still it has to interoperate with some of the same data. This is the bit I'm having to rework most, because my version looks nothing like Id's. But with any luck it'll get fixed.

The game would still run very slowly for other reasons, but would at least mean the f030 renderer is the 'same shape' as the rendering device for the original Idtech engine. This in turn could provide other benefits - although I won't go into that just now...

User avatar
dml
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3468
Joined: Sat Jun 30, 2012 9:33 am

Re: Quake 2 on Falcon030

Postby dml » Tue Jan 03, 2017 8:57 pm

Here's the result of that experiment (i.e. the original sources only, with minimal changes to make it run on Falcon): https://www.youtube.com/watch?v=S2RCGctOxsw

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1512
Joined: Sun Jul 31, 2011 1:11 pm

Re: Quake 2 on Falcon030

Postby Eero Tamminen » Tue Jan 03, 2017 9:49 pm

Thanks! That sounds very promising. I actually went and nostalgically looked again through all your awesome Quake videos in Youtube. :-)

Btw. I think the mono lightmap stuff from "Atari Quake 2: Beyond Q2, part #2" would be enough even without textures. While I like flat shaded stuff, the lightmaps really make that shine. At the small resolution Falcon is able to support, full Quake textures are a bit too busy anyway. How much do you think that would help with eventual performance?

I recently played through Limbo, and I really liked its monochromatic style. Similar coloring in Beyond Q2 video looked nice and with a bit different music it could bring something different to Quake everybody thought they knew... Have you given any thought to whether/how to handle music in Quake yet (as that doesn't anymore use the MIDI like Doom did)?

User avatar
dml
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3468
Joined: Sat Jun 30, 2012 9:33 am

Re: Quake 2 on Falcon030

Postby dml » Tue Jan 03, 2017 10:08 pm

Eero Tamminen wrote:Thanks! That sounds very promising. I actually went and nostalgically looked again through all your awesome Quake videos in Youtube. :-)


:D

While I'm not finished with all the other projects, they're sort of complete enough to be left for a bit, while I play with this one a bit more.

Eero Tamminen wrote:Btw. I think the mono lightmap stuff from "Atari Quake 2: Beyond Q2, part #2" would be enough even without textures. While I like flat shaded stuff, the lightmaps really make that shine. At the small resolution Falcon is able to support, full Quake textures are a bit too busy anyway. How much do you think that would help with eventual performance?


Fewer textures is always good, it means you can optimise more specifically for the space that remains.

In any case I haven't implemented a texture cache yet so all textures need to be fully resident for any map, and thats super wasteful. While it does generally run fine in 14mb a lot of that is still texture waste. Most of the ram should really be dedicated to the surface cache for lightmaps instead.

TBH the lightmap-combining stage is the most expensive and awful part of the whole thing. It was designed with a Pentium in mind, not an Atari. I take a few liberties as it is (lazy combine, spread over frames), but even then it wastes machine time and lots of ram if you move around the map quickly and new rooms come into view.

I might do more about this in future but its not very easy. Axis/Oxy made some good points about texture atlas preprocessing and aligning the large textures in memory, to use slightly faster combining code. But its a bit harder to make it work so well with 16bit colour (not to mention an extra stage introduced to map preprocessing - which I currently don't control at all - I load raw maps). I'm also considering treating surfaces with mostly constant light levels as a special case. Full-bright surfaces are already special but other 'flat' lit surfaces are not.

More clever ways to light and texture surfaces without all the ram and cpu waste is a good thing, so ill try to use whatever opportunities i can. Optimising for maps with few textures seems like a good strategy.

Eero Tamminen wrote:I recently played through Limbo, and I really liked its monochromatic style. Similar coloring in Beyond Q2 video looked nice and with a bit different music it could bring something different to Quake everybody thought they knew... Have you given any thought to whether/how to handle music in Quake yet (as that doesn't anymore use the MIDI like Doom did)?


Not really thought about it. It could be literally streamed - but tbh doing a 1:1 Quake or Quake II port isn't really my plan anyway (and is difficult due to the quantity of AI using full 3D collision detection = expensive). It might just be an intermediate step on the way to something else though.

User avatar
jvas
Captain Atari
Captain Atari
Posts: 441
Joined: Fri Jan 28, 2005 4:30 pm
Location: Budapest, Hungary
Contact:

Re: Quake 2 on Falcon030

Postby jvas » Wed Jan 04, 2017 11:30 am

dml wrote:Here's the result of that experiment (i.e. the original sources only, with minimal changes to make it run on Falcon): https://www.youtube.com/watch?v=S2RCGctOxsw


Doug, have you tried to run your code on a faster machine (CT60) ?

User avatar
dml
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3468
Joined: Sat Jun 30, 2012 9:33 am

Re: Quake 2 on Falcon030

Postby dml » Wed Jan 04, 2017 12:16 pm

jvas wrote:Doug, have you tried to run your code on a faster machine (CT60) ?


Nope - only in Hatari 2.0. I think it will still run slowly though because the rasterizer is in C - its just the reference version. You might get 5fps if lucky.

vido
Atari Super Hero
Atari Super Hero
Posts: 521
Joined: Mon Jan 31, 2011 7:39 pm

Re: Quake 2 on Falcon030

Postby vido » Wed Jan 04, 2017 12:30 pm

dml wrote:
jvas wrote:Doug, have you tried to run your code on a faster machine (CT60) ?


Nope - only in Hatari 2.0. I think it will still run slowly though because the rasterizer is in C - its just the reference version. You might get 5fps if lucky.

Would it be possible to compile it for the Coldfire?
Maybe it could run on the FireBee?

User avatar
dml
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3468
Joined: Sat Jun 30, 2012 9:33 am

Re: Quake 2 on Falcon030

Postby dml » Wed Jan 04, 2017 12:54 pm

vido wrote:Would it be possible to compile it for the Coldfire?
Maybe it could run on the FireBee?


It could be compiled for Coldfire but I doubt it will run - it flips into Falcon 16bit truecolour mode and then runs conversion passes over the framebuffer.

I guess it could be *made* Firebee friendly quite easily since the Falcon bits are minimal - there are only 4 or 5 functions needing replaced. However I don't have one and working on that would probably be a bit of a tangent for me anyway.

Oh, and there is no input device yet so its a rolling demo only until I sort that out.


The immediate goal here is to get the Falcon030 rasterizer into a state where Q II thinks its talking to a 'real' rasterizer (like the opengl one), without exploding. This helps make the rasterizer self-contained and helps estimate the overhead from the game/server side. If I can get that far I'll start filling in obvious holes like keyboard/mouse - and I still don't have fast triangle mesh support in the f030 renderer so thats another big-ish job ahead sometime.

mikro
Atari God
Atari God
Posts: 1263
Joined: Sat Sep 10, 2005 11:11 am
Location: Brisbane, Queensland, Australia
Contact:

Re: Quake 2 on Falcon030

Postby mikro » Wed Jan 04, 2017 1:07 pm

vido wrote:
dml wrote:
jvas wrote:Doug, have you tried to run your code on a faster machine (CT60) ?


Nope - only in Hatari 2.0. I think it will still run slowly though because the rasterizer is in C - its just the reference version. You might get 5fps if lucky.

Would it be possible to compile it for the Coldfire?
Maybe it could run on the FireBee?

Has there been any work done on FireBee's Falcon XBIOS/video support? I vaguely remember that being the reason why I didn't port Quake (its C = slow variant, of course) or any other games.

I guess the easy check would be fullscreen mode of ScummVM or OpenTTD, does it work?

(sorry for hijacking the thread, feel free to write me a PM)

User avatar
dml
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3468
Joined: Sat Jun 30, 2012 9:33 am

Re: Quake 2 on Falcon030

Postby dml » Wed Jan 04, 2017 7:20 pm

Collection of Quake II trick jumps, using patterns of rockets and hand grenades to reach sneaky corners of the map without wearing out your shoes.

Jump



Probably wouldn't want to play head to head with those players. I remember how to rocket jump but don't remember any of *those* tricks...


User avatar
calimero
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2028
Joined: Thu Sep 15, 2005 10:01 am
Location: STara Pazova, Serbia
Contact:

Re: Quake 2 on Falcon030

Postby calimero » Wed Jan 04, 2017 8:48 pm

I always wonder if these "trick" in games (Counter Strke, Unreal, Quake...) was planed by programers or they are bugs exploited by users...? :)

btw
how much more demanding Quake II is than Quake?

I see that NovaCoder adapt Quake II for Amiga 060: https://www.youtube.com/watch?v=MX34Ju3SI3Y
using Atari since 1986.http://wet.atari.orghttp://milan.kovac.cc/atari/software/ ・ Atari Falcon030/CT63/SV ・ Atari STe ・ Atari Mega4/MegaFile30/SM124 ・ Amiga 1200/PPC ・ Amiga 500 ・ C64 ・ ZX Spectrum ・ RPi ・ MagiC! ・ MiNT 1.18 ・ OS X

User avatar
Trixster
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 145
Joined: Sat Nov 07, 2015 1:15 pm
Location: York

Re: Quake 2 on Falcon030

Postby Trixster » Thu Jan 05, 2017 2:50 pm

AmiQuake2 on Amiga 060 is interesting but even at 80mhz (the generally accepted limit of 060 speed on Amigas) it's little more than a techdemo as it's still too slow to be playable, the fpu just isn't fast enough at 43 MFLOPS. The first timedemo only returns 8.5fps average on my 80mhz A1200. That's with a 320x200 viewport. The other thing about the last version of AmiQuake2 (1.14) was you can't alter the size of the viewport to try and speed things up. NovaCoder's videos of earlier builds appear to run with a smaller window size than what's now available.

AmiQuake fairs a little better with an average 16.3 in timedemo 1 at 320x200 but again it slows quite a lot in later levels so you have to shrink the viewport somewhat to get a smooth experience.

Both either need more power, or more Doug-style optimisations! Have a look at AmiQuake Doug when you're done! ;)
Last edited by Trixster on Fri Jan 06, 2017 9:11 am, edited 2 times in total.
Atari Falcon + CT60e | Atari 2600 | Atari Jaguar | A1200 + 80mhz B1260 + Indi AGA2 + Ide-fix Express
A4000/060 Cyberstorm Mk2 + Indi AGA + Voodoo3 + Sonnet G3 400Mhz PPC | Saturn | PS1 | CPC6128
Acorn A3020 + 4MB | A3000 + 2MB | BBC B | Acorn Atom | BBC Master Turbo | A500 | SNES | C64

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1512
Joined: Sun Jul 31, 2011 1:11 pm

Re: Quake 2 on Falcon030

Postby Eero Tamminen » Thu Jan 05, 2017 8:43 pm

Trixster wrote:Both either need more power, or more Doug-style optimisations! Have a look at AmiQuake Doug when you're done! ;)


Isn't it more the other way round, AmiQuake guys should take a look at Doug's optimizations once he's done?

Btw. You should note that for doing this level of optimization may first require Amiga emulator with profiling capabilities as good as what Hatari has (you can e.g. automate getting CPU & DSP callgraphs and annotated assembly dumps for the heaviest frames in a demo run). But Amiga doesn't have DSP, so maybe there's less need for something that can profile both at the same time, and provide info on which of the sync points could be optimized...

User avatar
Trixster
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 145
Joined: Sat Nov 07, 2015 1:15 pm
Location: York

Re: Quake 2 on Falcon030

Postby Trixster » Fri Jan 06, 2017 9:05 am

NovaCoder has retired from Amiga coding tfn, so at the moment no-one's announced they've picked up where he left off.
Atari Falcon + CT60e | Atari 2600 | Atari Jaguar | A1200 + 80mhz B1260 + Indi AGA2 + Ide-fix Express
A4000/060 Cyberstorm Mk2 + Indi AGA + Voodoo3 + Sonnet G3 400Mhz PPC | Saturn | PS1 | CPC6128
Acorn A3020 + 4MB | A3000 + 2MB | BBC B | Acorn Atom | BBC Master Turbo | A500 | SNES | C64

User avatar
dml
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3468
Joined: Sat Jun 30, 2012 9:33 am

Re: Quake 2 on Falcon030

Postby dml » Fri Jan 06, 2017 7:23 pm

Thanks for the info!

Trying to make more progress this evening - adding a sampling profiler to the Q2 code to get an estimate of costs for non-rendering stuff. i.e. the scary parts I haven't really got a handle on yet.

In the process of doing that, and taking a sharp blade to some less critical areas of Q2 and adjusting the displaymode, the framerate has also increased by a factor of nearly 10 (to 1.0fps) without any optimization work. This is Hatari though, and the FPU speed is not to be trusted so its really only an indication at this point...

I've only just started this process but the first test does look a *bit* promising. I'll post something soon...

User avatar
dml
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3468
Joined: Sat Jun 30, 2012 9:33 am

Re: Quake 2 on Falcon030

Postby dml » Fri Jan 06, 2017 7:51 pm

Here's an early profile capture from the original game code (hacked to pieces, but still rendering map + running game server + AI + collisions)

grab0003.png


So if you ignore '--profiling--' 'R:FinishUpd' 'R:DrawEdges' - all of which would get replaced by the F030 rasterizer - it leaves 'undefined' which is basically all the game code (AI, weapon hits, collisions, other server stuff). These things are definitely happening during the attract sequence.

So this suggests the game needs around 60ms per update, (6.5% total or about 3 VBLs).

This is not a bad ballpark to be in - it is still a *lot* of compute, but it could have been a lot worse. The faster Hatari FPU is hiding some of the cost since this is a 3D engine and uses the FPU extensively, but even assuming that it means there is about 3 VBLs worth of compiled code needed to update the game state for all the entities on the map, and not more than that.

If running the game without rendering, it's equivalent to around 16fps. On a real machine with 16MHz 68882, probably nearer 5fps to be honest. Still it's something to work with.

I'll try to get a measurement on real HW soon but it involves some messing around with boxes and cables. Might not happen immediately.
You do not have the required permissions to view the files attached to this post.

User avatar
dml
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3468
Joined: Sat Jun 30, 2012 9:33 am

Re: Quake 2 on Falcon030

Postby dml » Fri Jan 06, 2017 9:56 pm

Here's a Hatari capture with the profiler running. I now have some visibility of all the pieces involved.

Game Performance



I don't have time to break all this down right now, but it looks to me like a lowly Falcon030 might be able to run the game code as-is, without a total rewrite.

A lot of the time I thought was game compute cycles turns out to be other stuff entirely - console drawing - something I can probably remove or squash. Not 100% sure yet, but it looks that way.

I'll need to repeat this in full singleplayer mode and multiplayer dm, to see if its doing shortcuts in the attract mode - but I figure it can't be.

It'll take me a while to make complete sense of all of this but it is going in the right direction...


EvilFranky
Atari Super Hero
Atari Super Hero
Posts: 843
Joined: Thu Sep 11, 2003 10:49 pm
Location: UK
Contact:

Re: Quake 2 on Falcon030

Postby EvilFranky » Fri Jan 06, 2017 10:08 pm

Great to see updates on this thread again Doug, thanks!

User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 11924
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: Quake 2 on Falcon030

Postby wongck » Sat Jan 07, 2017 12:53 am

Great to see it being worked on again.
Looking forward to use it on my Falc.
My Stuff: FB/Falcon CT63+CTPCI_ATI_RTL8139 14+512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list

User avatar
calimero
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2028
Joined: Thu Sep 15, 2005 10:01 am
Location: STara Pazova, Serbia
Contact:

Re: Quake 2 on Falcon030

Postby calimero » Sat Jan 07, 2017 9:17 am

Interesting to see how much CPU time is spent on game logic and how much on rendering!

So in game logic is included and collision detection or this part of code is in rendering?

Btw what is min. PC requirement for Qauke II? Something like 233MHz Pentium for 10FPS...??
And 16MHz 68030 would be something like 4MHz Pentium (in integer department) or even worse...?? :D
using Atari since 1986.http://wet.atari.orghttp://milan.kovac.cc/atari/software/ ・ Atari Falcon030/CT63/SV ・ Atari STe ・ Atari Mega4/MegaFile30/SM124 ・ Amiga 1200/PPC ・ Amiga 500 ・ C64 ・ ZX Spectrum ・ RPi ・ MagiC! ・ MiNT 1.18 ・ OS X


Social Media

     

Return to “680x0”

Who is online

Users browsing this forum: No registered users and 4 guests