Fast scrolling game howto, anyone?

Want to talks about games you like, would like to see developed on the Oric, it's here.
User avatar
Chema
Game master
Posts: 2512
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: Fast scrolling game howto, anyone?

Post by Chema » Wed Mar 13, 2013 5:27 pm

Well, tried to have it by Saturday, but failed :)

Seriously, I have had quite a nightmare of a week, so very Little time for doing things. However I did work on something I want to add: procedural generation.

I worked on a MATLAB script that allows me to make quick tests and see the results. I have a basic method for creating ships with a basic set of tiles. For now just the main bodies. I am also using the internal random generator; soon I'll have to replace with something that can be implemented on the Oric.

Results are quite good, imo, but the script is already quite large and I am unsure if it could survive the transition to compact 6502 code. We will see, but dreaming is inexpensive :)

Here is an animated gif with the results. Beware that after porting, changing the generator and fixing a couple of details, final results may differ quite a lot from these. However it serves to show what kind of things it can do.
naves.gif
naves.gif (215.43 KiB) Viewed 9955 times
Still need to populate the ship with ornaments (windows, turrets, defences,...) and make the layout increase in difficulty each time the generator is called, or depending on the value of some variable. Something that sounds not too easy to do without eating all the Oric's memory.

User avatar
Dbug
Site Admin
Posts: 3051
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Fast scrolling game howto, anyone?

Post by Dbug » Wed Mar 13, 2013 6:23 pm

Hmmm...

Just got an idea:

The restriction in terms of numbers of available characters applies only to what is currently being displayed, but since you consider using procedural generation then you can add an arrow in your quiver: Create various styles of tiles, or possibly some variants of some tiles with 'rare' variants, and do real-time redefinition of some of the characters each time you introduce a new row of tiles. This way you can add variety without becoming mad with the manual editing :)

There was a number of arcade games that streamed the landscape tiles in real time from the floppy drive while playing to provide a super long and smooth gameplay experience, that's something similar :)

Saint Dragon: http://www.youtube.com/watch?v=S_yfCYfwylI
Ninja Warriors: http://www.youtube.com/watch?v=WSJ2L35CSog

User avatar
Chema
Game master
Posts: 2512
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: Fast scrolling game howto, anyone?

Post by Chema » Wed Mar 13, 2013 7:40 pm

Indeed that could be interesting...

However, I was only considering procedural generation for the ship as a whole. At each level a ship is created, you do whatever you have to do, going back and forth and when finished the next ship is created... Did not think about creating them on-the-fly...

User avatar
Chema
Game master
Posts: 2512
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: Fast scrolling game howto, anyone?

Post by Chema » Tue Mar 26, 2013 8:12 pm

Still quite little time for Oricing (I am starting to sound repetitive, I know), but I have been playing with procedural generation a bit...

Here is the result, remember the ship does not have any ornaments yet... just the overall shape:
http://youtu.be/sjHKII6tgtw

Oh, you surely noticed there is a small radar plot in the bottom. I know it is a bit crude and ugly, but I made it work, so I know what kind of things can be done here, and the possible limitations.

The procedural generation is eating nearly 1.5K already, and it will get bigger than that!

I know there are still many things to polish, remember I am just testing things...

User avatar
Dbug
Site Admin
Posts: 3051
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Fast scrolling game howto, anyone?

Post by Dbug » Tue Mar 26, 2013 8:19 pm

I really like the small map.
If you can get it accurate enough, then it would allow the type of gameplay that exists in Defence Force where you can zoom past at full speed just using the minimap to locate enemies :)
That gives you some "long distance" warning to help compensate with the fast scroller.

Looks good in Blue as well :)

User avatar
ibisum
Wing Commander
Posts: 1131
Joined: Fri Apr 03, 2009 8:56 am

Re: Fast scrolling game howto, anyone?

Post by ibisum » Wed Mar 27, 2013 11:58 am

I'm just in awe at what you are making happen on the Oric, guys. ;) Never in my wildest dreams would I have imagined. Oh, if I had a time machine, some way to go back in time to my teenage self, and say: "ibisum, just wait .. one day, the Oric will have *amazing* software being written for it.."

vrozos
Officer Cadet
Posts: 63
Joined: Mon Nov 21, 2011 12:36 pm
Location: Athens, Greece
Contact:

Re: Fast scrolling game howto, anyone?

Post by vrozos » Wed Mar 27, 2013 9:11 pm

Ha ha. I am also fantasizing this time-machine, but for a much more naughty use. To send back this beautiful games written today and leave 80's Specy users speechless :)

User avatar
barnsey123
Flight Lieutenant
Posts: 379
Joined: Fri Mar 18, 2011 10:04 am
Location: Birmingham

Re: Fast scrolling game howto, anyone?

Post by barnsey123 » Thu Apr 18, 2013 4:11 pm

Radar's looking cool.
Perhaps you could have this as a Powerup (start with no radar)
In later levels your radar could get jammed and you have to destroy the enemy ECM station to get it back (or earn an ECCM powerup to jam the jammer...)

Looking great

User avatar
Chema
Game master
Posts: 2512
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: Fast scrolling game howto, anyone?

Post by Chema » Fri May 17, 2013 2:22 pm

I know I've been silent for a while, but I have not been totally inactive. I have a rough idea about the game objectives and, if I am able to succeed, it will have elements of a shoot-em-up combined with a bit of a puzzle. We will see; now it is only in my mind.

I have also progressed a bit on generating the ship, but still nothing to show you.

But I also decided it was time for me to start learning about producing music and sfx. Not that WAVE was not valid for this, because it is amazing, but more because I wanted to work by myself in this field. And I have now something working. It is not really exciting, and still needs work, but it is able to play a tune and, if everything goes as expected, also will be able to play the in-game sfx.

Here is a video with a demo:
http://youtu.be/02rGVbJLSqs

Cheers!

User avatar
Xeron
Emulation expert
Posts: 389
Joined: Sat Mar 07, 2009 5:18 pm
Contact:

Re: Fast scrolling game howto, anyone?

Post by Xeron » Fri May 17, 2013 9:10 pm

Cool! Glad to see you're still working on it :)

User avatar
Dbug
Site Admin
Posts: 3051
Joined: Fri Jan 06, 2006 10:00 pm
Location: Oslo, Norway
Contact:

Re: Fast scrolling game howto, anyone?

Post by Dbug » Sat May 18, 2013 7:45 am

How do you edit the music? Is it directly in source code with some fancy macros, or did you write an editor?

User avatar
Chema
Game master
Posts: 2512
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: Fast scrolling game howto, anyone?

Post by Chema » Sat May 18, 2013 9:36 am

No, no editor planned at all. Just, as you guessed, some macros. It is just a technical demo, anyway, but using a song.

Patterns are just lists of notes and other commands, such as ENV,0, G_, E_, ... , END, which sets the envelope and plays the notes until an END is reached. There is one list of patterns to play for each channel, treated independently. And inside patterns and pattern lists there are commands, not all implemented yet. I am not using the AYenvelope generation, because it prevents me to alter the volume as I would like, so evelopes and such are done by software.

Those commands tell the player to do a wait, or rest without silencing the channel, silence the channel, change the envelope and vibrato or ornament or whatever is the name (small changes in the frequency of the note), set a bit in a bit field, alter the volume, the tempo, set an offset to the note playing, perform loops, adding noise,... You know.

If everything goes as expected, the same routine should also work for profdicing in game sfx. Just set a pointer to the sfx data in one of the channels and that should be all.

Cheers

User avatar
ibisum
Wing Commander
Posts: 1131
Joined: Fri Apr 03, 2009 8:56 am

Re: Fast scrolling game howto, anyone?

Post by ibisum » Sat May 18, 2013 11:57 am

Really nice stuff! I'm very much enjoying your development progress .. excited to see the next ship video! :)

User avatar
Chema
Game master
Posts: 2512
Joined: Tue Jan 17, 2006 10:55 am
Location: Gijón, SPAIN
Contact:

Re: Fast scrolling game howto, anyone?

Post by Chema » Mon May 20, 2013 1:45 pm

Thanks for your replies. I have to work a bit more on the actual game to have something to demonstrate in a video, but I will try to do it as soon as I can.


@Dbug: this is a piece of how music is stored:

A song is made of a list of patterns (bit 7 clear, so up to 128 different patterns possible) and commands (bit 7 set), one per channel. This should save some memory by taking benefit of loops, for instance. Also it may serve the purpose of playing sfx. If a sfx is just such a list, you can make it play through any channel it at any time, just by setting the pointers correctly:

Code: Select all

_Tune1B	.byt ORN, 0, ENV, 3, 11, ENV, 1,         13,0,1,13,2,3,13,0,1,13,2,4,13,5,  6, 6      ,END
This will translate to "Set ornament 0 and Envelope 3" (an "instrument"), "play pattern 11", "set envelope 1", "play patterns 13,0,...6,6" and "List finished".

A pattern is a list of commands (if bit 7 is set) or notes (if bit 7 clear, so enough to cover 8 octaves * 12 notes/octave). Commands here are simpler: just 4 bits for the parameter and 3 bits for the command ID. Commands here include things like a RST(n) or SIL to silence the channel. I have a set of macros defining the base OCTave to use and each note:

Code: Select all

_ow_p4
	.byt OCT*12+CS_,(OCT-1)*12+B_, (OCT-1)*12+B_,RST+2,(OCT-1)*12+B_,RST, SIL, RST+7
	.byt END
OCT is the base octave and it is just for reference, but can be changed through a command.

Notes with different duration are implemented by a software envelope (set of 8 volume values) which start with increasing from 0 and end up at a volume which is not 0 (something like 0,6,8,10,12,13,14,14 would do) along with a combination of RST commands:

You can take a music sheet and enter notes and durations quite directly.

There are also ornaments or sets of 8 pitch offsets to create vibrattos (as Twi calls them). Pattern List commands let you change the base octave, and the ENVelope and ORNament, such as if you were changing the instrument the patterns is played with.

You can also add NOISE to a channel and such things...

Does all this make sense?


Mmm, now that I think about it, maybe this should have gone into the Audio Tools forum...

User avatar
ibisum
Wing Commander
Posts: 1131
Joined: Fri Apr 03, 2009 8:56 am

Re: Fast scrolling game howto, anyone?

Post by ibisum » Tue May 21, 2013 9:10 am

This is awesome, I'm seeing the opportunity for an expanded Tracker to come of this, beyond the scrolling game engine .. well, *with* the scrolling game engine, maybe you could make a nice music editor as well .. :)

Post Reply