OType

Want to talks about games you like, would like to see developed on the Oric, it's here.
User avatar
Iapetus
Flying Officer
Posts: 135
Joined: Thu Mar 19, 2009 10:47 pm

Re: OType

Post by Iapetus »

So awesome...

Twilighte we miss you. :(
Twitter: @newIapetus
Ko-fi:iapetusretrostuff
itch.io: Iapetus
Youtube: Iapetus Retro Stuff
User avatar
8bit-Dude
Flying Officer
Posts: 141
Joined: Tue Mar 14, 2017 1:33 pm
Location: Japan

Re: OType

Post by 8bit-Dude »

I have just seen the video and am blown away by the sprite animation Twilighte achieved.
Was the code for the OType gfx made available? Or do any other Twilighte game contains the same technique and has code availability?
User avatar
ibisum
Wing Commander
Posts: 1643
Joined: Fri Apr 03, 2009 8:56 am
Location: Vienna, Austria
Contact:

Re: OType

Post by ibisum »

I believe the O-type project started off as SWIV, and when Twilighte renamed it, he nevertheless didn't change his repo .. so the code is in the miniserve SVN, under "/users/twilighte/Swiv" ..
User avatar
NekoNoNiaow
Flight Lieutenant
Posts: 272
Joined: Sun Jan 15, 2006 10:08 pm
Location: Montreal, Canadia

Re: OType

Post by NekoNoNiaow »

Dbug wrote: Mon May 28, 2018 5:46 pm For the details, Chema is correct: It is AIC; so the scroll vertically need to be in multiple of two steps, sprites move by 6 pixel laterally, there's no attribute conflicts because it's AIC so all the attributes are on the left side of the play field.
Oki, so the scroll step is two lines because AIC uses one paper/color combination for the even lines and another for the odd ones.
This said, if one is willing to also copy the color attributes at the left side of the play field, then it becomes possible to only scroll by one line.

The inconvenient is obviously that the top line of the screen may stick out like a sore thumb since it will initially appear alone, without being complemented by its "parent" line (which has not yet scrolled into the screen). But I presume it should be relatively simple to alter this first line to use slightly muted colors to simulate a "fade in".
User avatar
Dbug
Site Admin
Posts: 4437
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: OType

Post by Dbug »

NekoNoNiaow wrote: Sat Apr 20, 2019 3:25 am Oki, so the scroll step is two lines because AIC uses one paper/color combination for the even lines and another for the odd ones.
This said, if one is willing to also copy the color attributes at the left side of the play field, then it becomes possible to only scroll by one line.
The problem is that the scroll is far from 50fps, so there's a large probability that copying the line and attribute will not happen atomically, so you can get bright flashes caused by having some of the graphics displayed with the wrong set of colors.
User avatar
NekoNoNiaow
Flight Lieutenant
Posts: 272
Joined: Sun Jan 15, 2006 10:08 pm
Location: Montreal, Canadia

Re: OType

Post by NekoNoNiaow »

Dbug wrote: Sat Apr 20, 2019 8:23 am The problem is that the scroll is far from 50fps, so there's a large probability that copying the line and attribute will not happen atomically, so you can get bright flashes caused by having some of the graphics displayed with the wrong set of colors.
Damn, you are right, I completely forgot about the absence of vsync.
User avatar
Chema
Game master
Posts: 3013
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: OType

Post by Chema »

Scrolling the attributes will alter the colours of the ships when they are at a fixed location.

About the syncing it is possible to do it, but what Dbug says is that it takes longer than the blank period to update the scroll. Probably longer than a frame time.

I think I managed to scratch 7000 cycles for updating by using only part of the screen height. What scroll size could you have as a best case (bunch of lda/sta pairs) in that time?
User avatar
NekoNoNiaow
Flight Lieutenant
Posts: 272
Joined: Sun Jan 15, 2006 10:08 pm
Location: Montreal, Canadia

Re: OType

Post by NekoNoNiaow »

Chema wrote: Sat Apr 20, 2019 9:40 pm Scrolling the attributes will alter the colours of the ships when they are at a fixed location.
Yes, which is why I suggested to copy the attributes, not just the pixel data. This way the colors are preserved.
Chema wrote: Sat Apr 20, 2019 9:40 pmAbout the syncing it is possible to do it, but what Dbug says is that it takes longer than the blank period to update the scroll. Probably longer than a frame time.
I seem to be interpreting what DBug says differently than you do. To me (I may be wrong obviously), it seems that he is saying that since the copy cannot be aligned to vsync, there are bound to be lines where the attributes and pixel data will not be in sync, which will lead to color artifact.
This would probably take the form of a line of colored pixels scrolling up (or down) across the screen at a speed proportional to the VSYNC mismatch.

Moreover, I do not think copying the attributes would increase the copy time unreasonably.
Only two additional bytes to be copied per line need to be copied, one for the ink attribute and one for the paper attribute.

The O-Type scrollable area where graphics are drawn seems to consist at first glance of 18 characters horizontally.
Adding two bytes per line would increase this to 20, that is a 2/18 = 1/9th increase, that is around 10%.
This said, these bytes do not strictly need to be copied since we already know in advance what they must be. A dedicated routine could simply output them directly which would be much faster than a copy since no read would be needed.

So, yup, that would slow down the copy, but this would allow smoother and slower scrolling.
That compromise would not necessarily suit every game obviously.
Chema wrote: Sat Apr 20, 2019 9:40 pm I think I managed to scratch 7000 cycles for updating by using only part of the screen height. What scroll size could you have as a best case (bunch of lda/sta pairs) in that time?
The O-Type video seems to show that the copy is already not VSYNC aligned: there is ample tearing as the screen scrolls along so copy time is not the issue.
As far as I understand it, the issue is that the ULA could catch up to the copy (or the reverse), this is likely/possible since there is no VSYNC. The consequence would be that it would display a line of old pixel data with the new attributes (or the reverse, depending on when ULA/copy intersect).

I completely agree with you that screen copy time is important and tricky to reduce, I would even wager that this idea would deserve its own thread. ;)
User avatar
Chema
Game master
Posts: 3013
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: OType

Post by Chema »

NekoNoNiaow wrote: Mon Apr 22, 2019 9:10 pm
Chema wrote: Sat Apr 20, 2019 9:40 pm Scrolling the attributes will alter the colours of the ships when they are at a fixed location.
Yes, which is why I suggested to copy the attributes, not just the pixel data. This way the colors are preserved.
I understood. What I mean is that the player's ships (enemies too?) also use AIC, so if they are still at, say, the bottom of the play area and you scroll attributes one row up, their colors will change.

About the vsync thing, I am sorry if I misunderstood. In any case, it is possible to get an interrupt in sync with the vertical retrace, as was proposed here viewtopic.php?f=8&t=78&hilit=vsync&start=15#p15173
User avatar
NekoNoNiaow
Flight Lieutenant
Posts: 272
Joined: Sun Jan 15, 2006 10:08 pm
Location: Montreal, Canadia

Re: OType

Post by NekoNoNiaow »

Chema wrote: Tue Apr 23, 2019 1:12 pm I understood. What I mean is that the player's ships (enemies too?) also use AIC, so if they are still at, say, the bottom of the play area and you scroll attributes one row up, their colors will change.
Hum... ok, I now understand what you mean. Nothing better than a good example! Thanks. ;)

In the context of OType this is indeed an issue since enemies and player are moving in increments of two lines, so to avoid having them jiggle up and down one line as scrolling occurs they would have to be copied one line down compared to the scrolling copy, thus inverting their attributes.

I can envision two possible solutions:
  • unproven: invert the odd and even lines of sprites every frame.
    Since sprites have an effective color granularity of two lines, swapping the lines should hopefully lead to the same blended color effect.
    This obviously needs to be verified graphically but I am hopeful that this would work, although this could result in annoying flickering if the frame rate is too low.
  • guaranteed: have two versions of each sprite, one aligned on even lines, one aligned on odd lines.
    This way, we are guaranteed to have correctly colored sprites for each possible Y position of the sprites on screen.
    The inconvenient is that this requires double the RAM for moving sprites but this might be worth it.
I would not be surprised if there were other methods to work around this issue though.
Chema wrote: Tue Apr 23, 2019 1:12 pm About the vsync thing, I am sorry if I misunderstood. In any case, it is possible to get an interrupt in sync with the vertical retrace, as was proposed here viewtopic.php?f=8&t=78&hilit=vsync&start=15#p15173
Do not be sorry! ;)
Oh, nice technique. If it really works, this would indeed be great and would solve the vsync flickering issue.
User avatar
Dbug
Site Admin
Posts: 4437
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: OType

Post by Dbug »

For the ones eventually interested in continuing the game, the source code (not sure if it's the last version) is available on <a href="https://www.defence-force.org/ftp/forum ... /">here</a>, and here is the entire story for the game
Synopsis
Its world war 2, the conflict is at its height. Two alien scout ships come to investigate and are shot down accidentally in the cross fire over Berlin. They emergency land in the outskirts and are transported to a secret base in the heart of Bavaria.
Captured Scientists from a research base in Poland are brought in to discover there origin, the generals believing its of American or British origin. The scientists are led by Dr Piotr Puschev.
Dr Alsven and his team discover the dead aliens within and realise the true identity. Further investigations discover hand weapons and in one experiment the explosion is enough to clear an escape passage for some of the scientists including Dr Puschev.

Dr Puschev reaches Britain with just one of his colleagues, Aleksander Potangsky. The rest of his team are shot or captured. One of the pursuing Nazi generals manages to remain undercover on entering Britain and pursues Dr Puschev and his comrade.
However the duo manage to reach British intelligence who immediately setup a covert operation to send in their best team (led by Sam Rushdon) to investigate and attempt to substantiate his claims. Dr Puschev draws a rough map of the location of the base and volunteers to join the team. Aleksander Potangsky volunteers to remain at HQ to support in the research program, providing valuable intel.

Meanwhile more alien ships start to descend on planet earth this time with greater shielding and armoury. They bombard all the major cities and as the team head for Berlin it becomes clear the gravity of the situation.
If they are not defeated by the Nazi onslaught their fate will still be at the hands of an alien nation who seem dedicated to mass slaughter of the human kind.

Level 1 - The flight of discovery
Scene 1
Dr Piotr Puschev and Sam Rushdon(with his team) head for the airfield in there trucks while being pursued by the Nazi general.
Spyhunter style race with guns, road spurs and road works.

Scene 2
Piotr, Sam and his team board the airship bound for Bavaria. The Nazi general manages to secretly board
Slowly the Nazi general manages to pick off each member of Sam's team leaving just him and Piotr to play a game of wits against the agressor.
Meanwhile Dr Puschev(Piotr) gives as much intel on the alien crafts as he can recall to Sam.
Ideas for gameplay please

Scene 3
On landing somewhere in Bavaria, both Piotr and Sam head for the secret base on foot guided by the map drawn by Piotr. However the Nazi general has notified local authorities and there whereabouts and possible intentions.
007 Licence ot Kill/Rambo style scrolling shooter heading away from aerodrome, through local town and up into the hills.

Scene 4
The duo reach the secret bavarian base which is mostly underground and camouflaged as a Hydro-electric generating plant.
Keeping with the previous gameplay the duo must reach the ships.

Level 2 - Flight into the unknown
Scene 1
Sam and Piotr manage to lock themselves inside the secure hanger holding the two alien crafts. They find them relatively unscathed. They decide to attempt to fly them back to British soil.
Gameplay trainer for flying alien craft.

Scene 2
In their absence the alien invasion has taken a sinister turn defeating the German onslaught and devastating British and US defences.
The alien craft must now face ground to air fire from German gunners, Air to air combat from the remaining airbourne planes in an attempt to head back to UK soil.
Vertical shmup

Scene 3
Sam and Piotr reach britain but face an increasing barrage of fighter planes and ground based weaponry from the British defences since they see no difference between their craft and the alien onslaught.
Wishing not to kill his own countrymen, Sam decides to head out to sea and Piotr follows. They land on a remote island in the scottish isles to discuss the situation. They realise these craft are not mere air based flying craft but vehicles capable of space travel. They realise the only way to stop this madness is to head out to the oncoming storm and attempt to destroy the alien menace.
Vertical Shmup in upper atmosphere starting with weather balloons, bombers, fighter planes and alien craft.

Level 3 - The final frontier
Scene 1
The ships now face the onslaught of the oncoming alien hoards which they must defeat. However Aleksander is still providing intel and working with British cypher experts at Bletchley park have been able to decipher the Alien language. It is revealed that it is possible to fool the onslaught into believing the two alien craft contain their own. Experiments run the previous day on transmitting the carrier wave cipher appear to show the same technology can be adapted to fool alien craft into thinking that british airplanes are also their own. This major breakthrough suddenly emphasises the importance both of Aleksander's work and of the duo heading into space.

Meanwhile Sam has worked out how to use the onboard communications and is able to speak directly to British HQ. He passes on the intel to Piotr.
Gameplay continues as Shmup in space.

Scene 2
Sam and Piotr discover a massive wormhole that appears to have been opened by the aliens. It is being sustained by 8 sentinels around its curcumference.
So they decide to collapse it but must destroy all sentinels. But each one is heavily guarded by shields and battlements.

Scene 3
In the mayhem of destroying the last sentinel, the collapse of the wormhole pulls all craft local to it back into itself, dragging Sam and Piotr screaming into the oblivion of space. However they appear on the other side, whereupon communication is immediately lost to Earth. The cipher was broken in the wormhole collapse and now an alien homeworld and 1001 alien dreadnoughts and ships turn their heads towards two lonely craft drifting in space and so the final battle begins.

Vertical Shmup facing battle cruisers, dreadnoughts, alien fighter craft, carriers, etc.

Level 4 - Worlds apart
Scene 1
Whilst Sam and Piotr have somehow managed it through the alien defences they now face the alien planets. There are a total of 5 planets that coexist almnost against physics since they rotate only miles apart, their atmospheres constantly blending with one another. But this has happened for eons. And the craft now attempt to seek passage through the gap.

Shmup

Scene 2
Next worlds (depending on motivation)

Level 5 - To weild so much power
At the very centre of the alien solar system lies a single sun. around the sun are sentinels similar to those found around the artificial wormhole. Both Piotr and Sam realise that these sentinels are capturing the immensity of the suns energy and somehow transforming it into a usable energy by the ships for interstella transport and creating the wormholes.
Sam and Piotr realise that in order to hold any hope of Earths survival (if it still exists) they must destroy the sentinels.

End game
They die saving earth and most of its inhabitants
image_2023-05-08_183509379.png
image_2023-05-08_183509379.png (6.1 KiB) Viewed 1705 times
User avatar
Chema
Game master
Posts: 3013
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: OType

Post by Chema »

This one was a really mammoth project... as if a vertical scrolling shmup in groud/air/space was not enough!

The technical demos are impressive with a relatively usable vertical scroll in HIRES, which is not something easy to do at all!
User avatar
Dbug
Site Admin
Posts: 4437
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: OType

Post by Dbug »

Well, if it was easy, he would probably not have done it :D
User avatar
Chema
Game master
Posts: 3013
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: OType

Post by Chema »

Dbug wrote: Mon May 08, 2023 7:32 pm Well, if it was easy, he would probably not have done it :D
Indeed :lol:
Post Reply