Quake 2 on Falcon030

All 680x0 related coding posts in this section please.

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

User avatar
alexh
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2595
Joined: Wed Oct 20, 2004 1:52 pm
Location: UK - Oxford
Contact:

Re: Quake 2 on Falcon030

Postby alexh » Tue Feb 09, 2016 6:09 pm

Can you render alternate lines and give it that TV look?

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

Re: Quake 2 on Falcon030

Postby dml » Tue Feb 09, 2016 6:19 pm

Could do - although in low res on VGA, it might look more like window blinds! Perhaps a bit less chunky looking on real RGB displays for the few who still have functional ones...



-

User avatar
dhedberg
Atari Super Hero
Atari Super Hero
Posts: 558
Joined: Mon Aug 30, 2010 8:36 am
Contact:

Re: Quake 2 on Falcon030

Postby dhedberg » Tue Feb 09, 2016 10:14 pm

Well, it's a game which make the number of frames per second important. I rather have more frames per second than more lines... and if it enables you to further optimize things, it'll bring more happiness to you as well! ;-)

Of course there's a trade off, lower resolution also usually means that effects such as lighting will be less noticeable.
Daniel, New Beat - http://newbeat.atari.org

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

Re: Quake 2 on Falcon030

Postby calimero » Tue Feb 09, 2016 10:20 pm

I think that lower resolution with better fps is better solution (esp. if you have more benefits than higher fps)!

I use Falcon on old RGB monitor so I have free, hardware anti-aliasing :D go for 160 columns mode, maybe there would be even more benefits down the way...!
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
Eero Tamminen
Atari God
Atari God
Posts: 1562
Joined: Sun Jul 31, 2011 1:11 pm

Re: Quake 2 on Falcon030

Postby Eero Tamminen » Tue Feb 09, 2016 10:37 pm

Letterbox ratio can look nice. It suits less well Quake style free-roam 3D games, but would be a good match for more cinematic things.

One possibility is gearing the engine just towards demos and machinima, especially if the 90's tools for editing quake demo files are still around. Physics handling could be ripped out of the engine (or made optional) if they can be encoded to the demo file with post-processing, the engine would do just gfx (and audio) rendering. There could be special effects for scene transitions etc.

I think people would be more interested about playable game than demo engine though...

nemodhs
Atariator
Atariator
Posts: 28
Joined: Sat Aug 31, 2013 2:29 pm

Re: Quake 2 on Falcon030

Postby nemodhs » Tue Feb 09, 2016 10:45 pm

Well, 320 x (up to) 160 with chunky columns actually sounds pretty nice. Would certainly give a nice widescreen flair. Could work great with some scenery. :) As always, great fun hearing about your thoughts/ideas/progress.

User avatar
Foxie
Atariator
Atariator
Posts: 24
Joined: Wed Feb 03, 2016 7:12 pm

Re: Quake 2 on Falcon030

Postby Foxie » Wed Feb 10, 2016 1:15 am

As another point of reference, I'm designing a 3D game with a viewport size of 320x140. I think the "wide" viewport works really well in 3D, it much more closely resembles how we actually see an environment with our own eyes. Perhaps for some games a wide field of view would make it too easy. It really depends on the map design.

I'm a bit confused about the "160 columns" reference. Are there really only 160 horizontal pixels? The videos on Youtube look sharper than that!

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

Re: Quake 2 on Falcon030

Postby calimero » Wed Feb 10, 2016 4:55 am

dml wrote:Could do - although in low res on VGA, it might look more like window blinds! Perhaps a bit less chunky looking on real RGB displays for the few who still have functional ones...
-

Hm. If you set e.g. 320x480 on vga and draw every second line Falcon memory bandwidth would be still spent equaly as in "normal" 320x480 mode? (Too bad that there is no hardware mode, like for doubling pixels, for making tv-alike scanline effect on vga... Yesterday I played Doom on Mac and tv-scanline effect make it much prettyer, although darker! :))
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
alexh
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2595
Joined: Wed Oct 20, 2004 1:52 pm
Location: UK - Oxford
Contact:

Re: Quake 2 on Falcon030

Postby alexh » Wed Feb 10, 2016 2:49 pm

LCDTV's definitely on their RGB (and possibly on their VGA inputs) can apply a built in hardware video scaler function. Perhaps there is a potential here? Render the correct letterboxing and/or aspect ratio and LCDTV owners get a nice full screen for free?

User avatar
Foxie
Atariator
Atariator
Posts: 24
Joined: Wed Feb 03, 2016 7:12 pm

Re: Quake 2 on Falcon030

Postby Foxie » Wed Feb 10, 2016 5:58 pm

calimero wrote:Hm. If you set e.g. 320x480 on vga and draw every second line Falcon memory bandwidth would be still spent equaly as in "normal" 320x480 mode?


This gives me an idea (if it's not what you meant?) How about using the horizontal interrupt to switch the colour depth to 2 colours on every other scanline? Thus for each of the 240 pairs of VGA scanlines, one of them shows the image in truecolour (or 256 colours) while the other scanline is in 2 colours and displays black.

In addition to giving you a fine-pitch scanline effect, this would increase the amount of memory bandwidth available to the CPU - during the 2 colour scanlines, the amount of display data fetched from ST RAM is minimal. As most people know, displaying 320x240 in truecolour practically hogs all the ST RAM bandwidth just maintaining the display. Blanking every other line would more than double the useful bandwidth.

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

Re: Quake 2 on Falcon030

Postby mikro » Wed Feb 10, 2016 6:16 pm

Foxie wrote:
calimero wrote:Hm. If you set e.g. 320x480 on vga and draw every second line Falcon memory bandwidth would be still spent equaly as in "normal" 320x480 mode?


This gives me an idea (if it's not what you meant?) How about using the horizontal interrupt to switch the colour depth to 2 colours on every other scanline?

I think this is exactly what he meant with the exception that you even don't need that 2-colour depth hack, you could put 'no video here' instruction to Videl. But it's all futile due to following reasons: 1. Scanline changes are very unstable on VIdel, esp. on VGA 2. Change like that (whether yours or the 'no signal' way) requires quite some amount of Videl register accesses, therefore you would be already in the middle of the line when the writes are over, again, especially on VGA. 3. HBlank / Timer-B changes are expensive so even if you saved something, it would cost you maybe even more to set it up.

I'd love to be proven wrong. :)

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

Re: Quake 2 on Falcon030

Postby dml » Wed Feb 10, 2016 9:56 pm

I've been busy with more unexpected work stuff so my replies are slow to catch up.

Well, it's a game which make the number of frames per second important. I rather have more frames per second than more lines... and if it enables you to further optimize things, it'll bring more happiness to you as well!


I think that lower resolution with better fps is better solution (esp. if you have more benefits than higher fps)!


Letterbox ratio can look nice. It suits less well Quake style free-roam 3D games, but would be a good match for more cinematic things.


Well, 320 x (up to) 160 with chunky columns actually sounds pretty nice. Would certainly give a nice widescreen flair. Could work great with some scenery.


So it seems that FPS is the winner here - and widescreen aspect not an issue. So I'll try that configuration next!

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

Re: Quake 2 on Falcon030

Postby dml » Wed Feb 10, 2016 10:03 pm

Foxie wrote:As another point of reference, I'm designing a 3D game with a viewport size of 320x140. I think the "wide" viewport works really well in 3D, it much more closely resembles how we actually see an environment with our own eyes. Perhaps for some games a wide field of view would make it too easy. It really depends on the map design.


I also think it could work well with some stuff. Hopefully it doesn't break anything in the projection/clipping/texturing but I'll do some experiments and see.

Foxie wrote:I'm a bit confused about the "160 columns" reference. Are there really only 160 horizontal pixels? The videos on Youtube look sharper than that!


Until now there were 256 columns x 128 lines, so a bit less than 320x full-width image.

I was talking about switching to chunky columns, which if left alone would need 256x2 = 512 pixel width display. Reducing to 160 chunky columns results in a 320x pixel full-width image and saves some time processing columns.

There is a high cost for scanlines because of the way the engine processes them, and currently it renders 128 lines. I don't want to increase it too much beyond that. And I don't want to use chunky scanlines because its particularly ugly. This led me to consider rotating the framebuffer and rendering 'vertical scanlines', since only 160 are needed max - and rendering more 'horizontal columns' (up to 200) which will be cheaper, and look decent. It's a performance detail of the engine more than pixel count - the total pixel count doesn't change much in that config.

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

Re: Quake 2 on Falcon030

Postby dml » Wed Feb 10, 2016 10:06 pm

calimero wrote:Hm. If you set e.g. 320x480 on vga and draw every second line Falcon memory bandwidth would be still spent equaly as in "normal" 320x480 mode? (Too bad that there is no hardware mode, like for doubling pixels, for making tv-alike scanline effect on vga... Yesterday I played Doom on Mac and tv-scanline effect make it much prettyer, although darker! :))


Yes and yes. Although while you gain a sort of TV effect, it doesn't save you any time - purely visual as you say.

The VGA modes could have done with better support for resolution (and raster) hacks given the slow memory speed and the cost of 16bit graphics generally. But its just about workable as is.

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

Re: Quake 2 on Falcon030

Postby dml » Wed Feb 10, 2016 10:09 pm

alexh wrote:LCDTV's definitely on their RGB (and possibly on their VGA inputs) can apply a built in hardware video scaler function. Perhaps there is a potential here? Render the correct letterboxing and/or aspect ratio and LCDTV owners get a nice full screen for free?


Hmm. I didn't think about that.

On the one hand this is easy, but on the other I have some hacks which don't allow fractional aspect ratios (funny pixel sizes other than 1:1, 2:1, 1:2 etc). These issues might be resolved later - its easy to resolve the vertex projection issue - but the texturing one is a *%&£ so it might be a while before I can play with that.

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

Re: Quake 2 on Falcon030

Postby dml » Wed Feb 10, 2016 10:13 pm

Foxie wrote:This gives me an idea (if it's not what you meant?) How about using the horizontal interrupt to switch the colour depth to 2 colours on every other scanline? Thus for each of the 240 pairs of VGA scanlines, one of them shows the image in truecolour (or 256 colours) while the other scanline is in 2 colours and displays black.

In addition to giving you a fine-pitch scanline effect, this would increase the amount of memory bandwidth available to the CPU - during the 2 colour scanlines, the amount of display data fetched from ST RAM is minimal. As most people know, displaying 320x240 in truecolour practically hogs all the ST RAM bandwidth just maintaining the display. Blanking every other line would more than double the useful bandwidth.


While this is a nice idea - and is correct - I think Mikro is right. The cost and difficulty of doing so on a VGA monitor puts it out of reach.

I spent quite a long time trying to achieve a raster-splitscreen on a single VGA scanline for the Doom game and it was a nightmare. You have half the time and twice the MFP wobble to deal with - and no reliable way to sync-lock since the CPU is not a constant-time device like the 68k in the ST - and the Videl puts snow on the screen when you touch the HW registers during the display line. So just getting one raster to work at the cost of 2-3 dead scanlines seemed like a win! eek!

I don't think its impossible with enough effort and hackery but overall its unlikely to buy back lost Videl cycles. Probably the opposite.

User avatar
Cyprian
Atari God
Atari God
Posts: 1405
Joined: Fri Oct 04, 2002 11:23 am
Location: Warsaw, Poland

Re: Quake 2 on Falcon030

Postby Cyprian » Wed Feb 10, 2016 10:39 pm

dml wrote:and no reliable way to sync-lock since the CPU is not a constant-time device like the 68k in the ST

actually, ST sync code works fine on 68030 in TT.
http://dhs.nu/bbs-coding/index.php?request=4006
Jaugar / TT030 / Mega STe / 800 XL / 1040 STe / Falcon030 / 65 XE / 520 STm / SM124 / SC1435
SDrive / PAK68/3 / CosmosEx / SatanDisk / UltraSatan / USB Floppy Drive Emulator / Eiffel / SIO2PC / Crazy Dots / PAM Net
Hatari / Aranym / Steem / Saint
http://260ste.appspot.com/

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

Re: Quake 2 on Falcon030

Postby dml » Wed Feb 10, 2016 10:48 pm

TBH the main issue I had was trying to hide the 'snow' using different configurations of videl register updates, so didn't spend much time on the hardsync experiments. It was quite painful getting something that worked on both RGB & VGA and didn't sparkle on the latter:-/

[BTW I wasn't aware that sync-lock from ST did work on TT - it may still work on Falcon but not sure about ops executing from STRam during that, with Videl competition, maybe it's a stable, if complex pattern though]

User avatar
Cyprian
Atari God
Atari God
Posts: 1405
Joined: Fri Oct 04, 2002 11:23 am
Location: Warsaw, Poland

Re: Quake 2 on Falcon030

Postby Cyprian » Wed Feb 10, 2016 11:23 pm

yep, Falcon has more advanced memory access management that the TT. The CPU can be 'blocked' by memory refresh cycles, Videl ect. The TT has the same memory access scheme as the ST - odd memory cycles are for CPU, even for Shifter and the CPU is never delayed by e.g. refresh cyles.
Would be cool to verify that. Unfortunately I can't do that, my Falcon is just dead.
Jaugar / TT030 / Mega STe / 800 XL / 1040 STe / Falcon030 / 65 XE / 520 STm / SM124 / SC1435
SDrive / PAK68/3 / CosmosEx / SatanDisk / UltraSatan / USB Floppy Drive Emulator / Eiffel / SIO2PC / Crazy Dots / PAM Net
Hatari / Aranym / Steem / Saint
http://260ste.appspot.com/

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

Re: Quake 2 on Falcon030

Postby dml » Sun Feb 14, 2016 10:51 am

Made some decent progress on aspect ratio changes and its running at 128x128 now with chunky columns (256x128 screen area). So I'm looking now at the changes needed to increase this to 320x which maintains current pixel size but with a wider FOV.

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 » Sun Feb 14, 2016 11:40 am

128x128 should be enough resolution for anybody ;)

Have been working from your PM of six months ago to find my way around the Hatari debugger today, proving invaluable now I've managed to get the symbols loaded properly!

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

Re: Quake 2 on Falcon030

Postby dml » Mon Feb 15, 2016 9:23 am

LaceySnr wrote:Have been working from your PM of six months ago to find my way around the Hatari debugger today, proving invaluable now I've managed to get the symbols loaded properly!


Glad you're getting use out of that :) Eero is by far the best source for information but a compact debugger 'cheat sheet' would probably be a good thing. There isn't that much to learn to make it useful but it can be hard to remember the exact syntax for some things (e.g. memory breakpoints for a specific data size)

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

Re: Quake 2 on Falcon030

Postby Eero Tamminen » Mon Feb 15, 2016 9:40 pm

Debugger cheatsheet sounds like a nice idea. If somebody comes up with a good one, I'll add it to the Hatari manual and/or as separate doc/ file.

One should also remember that debugger has built-in help. Most subcommands one can see with TAB-completion (if Hatari is built with readline) and all the commands provide "help" output. If help output is missing something, or should have (more) examples, that's easy to fix...

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

Re: Quake 2 on Falcon030

Postby dml » Tue Feb 16, 2016 9:59 am

Quick update:

I got most of the aspect ratio stuff sorted without many changes, and while it doesn't do funny pixel ratios yet, it can do arbitrary window sizes using fixed ratios (1:1, 2:1 etc). So currently it's running fine in 'letterbox' format 320x128, using chunky columns. The only fiddly part was the frustum setup for clip-testing in the BSP part.

So it is a bit faster than before. The increase in fill area slightly makes up for the gains, but still a net win for both.

Having a consistently higher framerate also allows the surface cache to be updated only during CPU-idletime without so much texture popping, which also allows the framerate to stay high while moving around (usually it drops while moving since all newly visible texture surfaces must be updated before use).

There is now room in the pixel drawing to change the texture addressing from abs to rel updates, which allows savings on chunky columns drawn with software doubling (RGB mode, or VGA without Videl doubling). For VGA with Videl doubling, the situation is as before, and no more optimizations can be made in the pixel part just now for that mode.

grab0037.png
grab0036.png


There is another optimization about half-way done, which records the clipping flags for all geometry passing through the BSP phase, and should allow the later stages to bypass all clipping for all geometry well inside the view frustum (4 edges of the screen + camera viewplane). This saves time on the DSP side only, and steals a tiny amount from the CPU side so it's hard to tell how effective this will be - just need to try it and see.

This would have been done a long time ago, but it is not easy - there is currently no convenient space on the DSP to record the face clipping states between BSP and geometry stages, and it costs to pass things back to the CPU only to be returned later, so a different strategy is needed to associate faces with clipping states without adding to the traffic.

Some things are now very difficult to measure in Hatari because while each release does fix emulation bugs, it seems to get faster with each one. e.g. I now see 14fps vs 10fps on real HW in 'fatal1', and 10fps vs 7fps in 'base1'. This should get corrected in time but for now the profiling capability can't be used very effectively for things involving CPU/DSP ratios. The screenshots above are actually around 9.5fps on real HW - almost approaching par with BadMooD. Overall though, still slower relative to typical map content and given the lack of dynamic objects etc...
You do not have the required permissions to view the files attached to this post.

User avatar
shoggoth
Nature
Nature
Posts: 854
Joined: Tue Aug 01, 2006 9:21 am
Location: Halmstad, Sweden
Contact:

Re: Quake 2 on Falcon030

Postby shoggoth » Tue Feb 16, 2016 10:10 am

I'm still polling this thread @ 3000Hz freq - but I really got my fix today. Amazing, dml. I didn't expect it to look that good with doubled pixels, but it's still really pretty, and given better FPS I think it looks like a good move.
Ain't no space like PeP-space.


Social Media

     

Return to “680x0”

Who is online

Users browsing this forum: No registered users and 2 guests