Rolling and Rotating scrolltext (Old School VIII)

I made today a little Monkey X Pro demonstration: Rolling and rotating scrolltext (Old School VIII). Now it works perfectly. Like in Old School VII, the letters fade in and out at the bottom of the circle of letters. I have used my Font 2 PNG program to grab individual characters of a ttf-font to png-images for the program. Perhaps I will later share the source code of the demonstration…

Enjoy the nostalgia! 🙂

The idea behind the code of the rolling and rotating scrolltext:

  • At every update frame 30 characters (png-images) from the scrolltext are drawn in a form of a circle, each character with 12 degrees step (12 *30 = 360), let angle related to this angle be angle1
  • When drawing the character images, the angle that increases in 12 steps is added to each character in addition to this angle is added other angle variable, let this be angle2, that is decreased (the direction of rolling and rotating) by 1 degrees at every update frame
  • Because of my (probably clumsy but working 🙂 )implementation:
  • in DrawImage method rotation angle is angle1 + angle2 + constant that adjusts the letters to the right place on the circle

As to he fade out and fade in for the letter images, you may adjust the letters with alpha values as you best you see it is sensible, probably somewhere at the bottom of the circle.

That’s it! Do try to make make your own version with programming language of your choice. I recommend my Font 2 PNG program for the font.

Good luck!

Old School VI 2 and VII Videos

I recently made version 2 from my poor Old School VI video. Today I got finished Old School VII video. Both demonstrations are programmed in Monkey X Pro. VII has that nice demo scene style synth music like Old School V. 🙂

In the Old School VII the the new letters fade in to the screen as the scroll text goes on and when the letters have gone the whole circle, they fade out…

Let the nostalgia flow through you!

First Old School VII:

…then Old School VI 2

I hope you enjoy the videos!

Shortly about my early Amiga times

My first Amiga was Commodore Amiga 500 with Kickstart 1.3 plus TV-modulator in order to get the picture to TV. The contents on the TV were hardly readable as it comes to any text. For playing games quality of graphics output was decent.

Later I got SCART cable to connect the graphics output of Amiga to TV. That was something else, one could even read the text on the TV without getting red eyes and tears. 🙂 A bit later I finally got a 14” monitor to use with Amiga SCART cable as the connect cable for graphics and sound output.

It was 1988 when SoundTracker 2.5 was released, which was the first SoundTracker that didn’t crash on Amigas with Kickstart 1.3. I don’t have any real education on making music. The way I have learned making music was listening to ”real” music and music modules other people had composed with Amiga. As I got my Amiga 500’s audio output connected to an old Pioneer amplifier with big speakers it was simply amazing to listen to Amiga’s music that was built with 8-bit samples.

Working with an Amiga 500 with only 512kb of (CHIP) RAM was quite a limitation. Usually I didn’t use Workbench (Amiga’s graphical user interface) but AmigaDos as operating system environment when programming with Amiga. This was because Workbench of course took some of the limited amount of memory available for the user.

Here’s a video from one unfinished Amiga project I was working 2003 – 2004 (not from my early Amiga times, though 🙂 ):

With only one disc drive (with Amiga 500 I didn’t ever have a hard disk) all the AmigaDos commands were read from directory named ”c” – c for command. For the sake of speed (disc drives are slow) it was possible to put the most used AmigaDos commands to RAM disc or make them “permanent” to RAM memory. I don’t remember the AmigaDos command to do this, but this was faster than reading from the RAM disc anyway… Putting AmigaDos commands to RAM of course also decreased the amount of available memory for example for a text editor and testing the compiled and linked assembly program…

Later, when I bought an additional disc drive, Senator, to my Amiga 500 working got easier: It wasn’t only the question of available memory, but also the available space on a single disc. Full capacity of Amiga’s DD disc is 880kb, the space available after formatting the disc was of course a little less.

When working with the additional disc drive, I made boot disc of my own to start the system, where I had put all the needed AmigaDos commands, libraries, applications and so on. My own work was on the additional disc drive. Ah, how things got easier…

The description above compared to working with desktop systems nowadays may be a bit amusing to younger generations… 🙂

Bouncing of the ball when it touches the Bat (80s Krakout style)

It’s night when I’m writing this. I came up with a little Monkey X tutorial on how to program the bouncing of the ball, when it touches the bat in the “old school way” — like in the popular C64 game Krakout in the 80s.

In the video for the tutorial you can see, that as the ball touches the bat for the first time, delta y doesn’t change. This is because both the ball and the bat are uneven as height in pixels; now both the ball and the bat have a middle point.

This is just a short piece of code, that doesn’t handle the case, when the ball is at the horizontal top or bottom of the bat. There’s some extra work for anyone who wants to make an 80s style Krakout game. 🙂

The delta y for the ball is calculated simply how the ball’s y-position is related to the middle point to the bat. The “scale” variable is used to adjust the max y-speed of the ball. If you are new to Monkey X, remember that with Pro version, you can compile the code to the Android target among many other targets. See the Store page.

Source code below:

Feel free to use and improve the source above in your own projects.

Here’s the graphics to download (license: public domain), except the background picture:

 

 

The bat is 32 x 73 pixels as size, the ball is 16 x 17 pixels.

 

For comparing to the C64’s popular Krakout, see the video below:

Many years ago I started to program Krakout style game in the spirit of the good old Commodore 64, but as usual, something went wrong. Three months work with multiple levels and a level editor programmed in Blitz3D were lost because I hadn’t taken backups of the files, when I, well, “fixed” the Windows installation I had at the time…

Shortly about my Amiga gaming history (1987 – 1993)

Soft start for this year, look back in time… In older blog post I wrote about my computer gaming history on Vic 20 and on Commodore 64, now something about my Amiga times…

My first Commodore Amiga was Amiga 500, which I got eventually upgraded with additional disc drive and 2 MB of (real) FAST memory.

Although I was more into programming, demo scene demos and making music with Amiga than playing games in my Amiga times, I had some fine moments with games too.

One of the first — if not the first — game that I saw on Amiga was Hybris in 1987 at my friend’s place, while I was still using my good old Commodore 64. Seeing Hybris on Amiga was quite a blast for me: I thought it was graphically and musically at the same level than coin up games I’ve seen as a kid.

Take a look and be amazed: 🙂

I remember, that I always wondered (and still do), how the programmers had the time and skill to program this kind of quality game in those early years of Amiga games. All those attack waves, complicated movements of enemy ships, so many bobs (blitter objects) in addition to sprite usage, all movement in one 50hz frame, though smooth scrolling was made every second frame. One thing that probably helped to make this game possible was the use of only 256 pixels as width of the screen; this allowed the programmer(s) to use assembly instruction lsl instead of mulu when calculating the position of an object to the screen. Assembly instruction mulu is much slower than lsl, which shifts the bits to the left making multiplications needed somewhat fast.

Some time at my high school (lukio) times I programmed a program that took an IFF image as input and as output the program produced a binary file that consisted of coordinates to “attack wave” one had drawn with some painting program, for example Deluxe Paint. If the drawn attack wave crossed itself, the problem which way to follow was solved by using different colors… Quite clumsy, but that’s me… 🙂 Anyway this program made possible an arbitrary possibilities of continuous attack waves (at least almost).

One early gem in the world of Amiga games is Faery Tale Adventure. It took quite a lot of time to finish this game. The labyrinth of the wizard took a lot of patience to get through. Fortunately one of my cousins was an expert to draw maps of games and had a lot of patience. 🙂

Below is a long play video of the game:

One game I played with my friends a lot was Ports of Call. Though this game is quite one-sided in a way that in practice it is best to use only the route between San Francisco and Cape Town. Though, with friends this game was still fun to play.

This game is nowadays available to PC and smart phones as free game.

As to strategy games, Kingdoms of England was fun to play with friends. Though, again there is one thing, that made this game in practice pointless: The choice of starting place in the map. There was one area in the map that as starting area gave the player too much advantage: The one who gets at the beginning of the game most tax income, will win the game, if one uses the resources one has in sensible way.

But again with friends this game was still fun to play, because we could as human players make agreement, that the one who had most advantage at the beginning of the game, wouldn’t attack human players, but only against computer’s troops. Another way to play this game in reasonable way, was to agree, that none of as human players don’t choose as starting area the area which makes it too easy to get more tax income at the beginning of the game a lot faster than others.

Video below:

The sequel to Kingdoms of England, Kingdoms of England II: Vikings, has more elements as it comes to strategy. But there is one bug in the game: The computer as opponent can build a castle one playing turn faster than human players (it takes many playing turns to build a castle that can’t be built bigger anymore)…

A good game that taught a lot of strategy and sensible usage of resources is Empire: Wargame of the Century. Video below:

I wasn’t really into flight simulators, but with a friend Sky Chase was a good game; against computer the game was pointless: Too easy. When the game begins, the two plains are flying to opposite directions and the only thing one has to do to shoot down the computer controlled plane is, to turn one’s plain 180 degrees and fire. 🙂

 A game I had a lot of fun with friends was North and south. The game has fine graphics and lots of humor too. 🙂

 Shadow of the Beast was technically fine with excellent music. At first the game was very difficult, but eventually it got easier with practice, though I never finished it completely. I was only a few steps away from the end, but somehow I managed to fail. Though I saw the end: My friend managed to finish the game.

Just a quick mention of good game that I had only as demo from an Amiga magazine, namely nice mind game Bill’s tomato game.

At the time original and good view on teaching strategy — and sympathy to the poor lemmings — were the Lemmings games. Video below from the first Lemmings game:

A game that I still can’t believe is possible to implement on an Amiga 500 with only 512kb of CHIP memory is Turrican II. How on earth the programmers managed to implement all those many details, smooth scrolling, huge levels and so on — all happening in one 50hz frame! This game truly gave the player challenge for sometime! And the music of the game: One of the finest hours of Chris Hülsbeck on Amiga! It must be mentioned that in the intro there is 7 channel music, replay routine coded by the musician himself (Amiga has only 4 hardware channels).

One game was interesting in the way that some levels had completely different concept of gaming, namely Batman the Movie. The game is a mixture of a platform game, car game, flying game and puzzle solving.

As to racing games, the Lotus Turbo Challenge games were excellent. Video from second Lotus game:

Ah, one early gem in the world of Amiga games: Battle Chess. At the time I saw this game for the first time, I was still using good old Commodore 64. Seeing this kind of chess game on an Amiga 500 was amazing! Video below:

One game I almost forgot is Flood. If my memory servers me right, I had this game only as a demo, but it was something somehow new. Mind / puzzle game that was some how original at the time. See the video:

 Well, that was something I can remember from my good old Amiga times… If I remember some more games I had fine moments with my friends, I may update this post later… Of course this is just a brief view back in time…

Star field Cube

This one goes to nostalgia, old school and to my hobby corner. 🙂

Below is the video regarding this post:

The video starts with traditional old school 2D stars, then the video continues with 3D cube that has the 2D star field as texture. Each face of the cube is transparent, so you see the starfields of the cube from different faces at once… The cube fades into the background slowly…

I haven’t done much 3D programming in Blitz3D, but this kind of code is quite easy for a beginner like me to put together.

I remember, that in the good old Amiga days I saw an amazing Amiga demo, that had star field in rotating cube. Those Amiga demos were a lot more complicated to program, since they were low level assembly code using directly Amiga’s hardware. The idea to program this in Blitz3D came from one Amiga demo music remix tune, that has little speech in it: “A star field in a box. Oh my God, it’s rotating!” 🙂

Unique Random Integers

For example in my Memorable Ladies games it is the case that I needed a method that gives a random integer for example between 0…31 so that any integer that has once been drawn, doesn’t get drawn anymore.

One way to handle this (how I didn’t do it) could be for example to use Rand-function (depending on programming language one is using) that gives an integer between nm (m > n) and make a list of numbers that are already drawn and use Rand-function again between nm, if the integer given by Rand has already been drawn.

But in the worst case this could lead to infinite loop… In practice probably not, though. In order to avoid the infinite loop (the case where Rand function gives repeatedly a number that has already been drawn), one could for example increase the drawn number by 1 until unused number is found or go on to m and if needed start from n and increase the value by 1 until unused number is found.

In Memorable Ladies games speed isn’t critical factor, when the numbers are drawn, so in this particular case the routine doesn’t necessarily need to be fast. In addition the amount of data can be considered very small.

What I came up, was something where every random number is (in practice) necessarily unique and without possibility to get stuck on infinite loop.

The idea goes like this:

  • Let us assume that we need n integers between 0….n – 1

  • Make a list of numbers with type ”number” where type ”number” has as a member an integer between 0…n – 1 (the numbers can be in increasing order)

Loop

  • Draw an integer between 0…n – 1. Let this be i.

  • Get from the list ith ”number” element and get the integer that is in that ”number” element as a member and then delete that element from the list

  • Decrease n by 1

  • Repeat until list is empty

Even if in the original list of type ”number” the integers are ordered from 0 to n – 1, one would get this way an unique random integer each time (except if Rand gives zero (0) n times).

There are more sophisticated ways to do this, especially if the set of needed integers is large.

id-100271132

Image courtesy of Stuart Miles at FreeDigitalPhotos.net

For the sake of nostalgia… Let be mentioned what kind of random number generator I have used with Amiga with MC68040’s built-in FPU in assembly. As such this doesn’t give an unique random number, though.

(In the source code of my old Quest of Love demo you can see this in practice)

Let us assume, that we need an integer between 0…n.

The idea:

  • Get the vertical beam value from $dff006

  • ”Scale” the previous value with desired integer in order to get it big enough

  • Use FPU’s fsin instruction (sine function) to that value

  • Use FPU’s fabs instruction (absolute value) to the value we got in the previous step

    Now we have a floating point value between 0…1

  • Multiply that value by n

  • Convert the value of previous step to integer

That’s it!

If we would like to have an integer between n…m (0 < n < m) the additional steps would be

  • Let z = mn

  • Add z to the integer we got in the last step earlier

The two steps above are only the idea to get the value to the desired interval; in assembly there are not variables at all as we know them in programming languages of higher level.

This idea probably gives you a good idea how to get random integers with Monkey X’s Rnd() that gives a random value between 0…1. 🙂

Probably the most common way is to do something like following:

value = Rnd() * 100 Mod n

This gives a random integer between 0…n – 1 (0 < n <= 100 above). Notice that in the sentence above there are two possibilities to get zero: 1) Rnd() gives 0, 2) Rnd() gives 1 and n = 100.

Shortly about my computer gaming history (1984 – 1987)

It all started in 1984, when in Finland the prices of home computers were significantly reduced. One could buy a home computer for under 1000 Finnish marks. That’s about 167 euros. My parents bought me a Commodore Vic 20, that costed 999 Finnish marks.

I really liked the first (and at the time only) game I got with Vic 20: Radar Rat Race. See below a picture of the module:

rrr

Below is a YouTube video from the game:

I remember that the game had some bug though: When one got far enough, playing the game became somehow impossible.

Another game I liked, was Fire Galaxy. Below is a little video from the game:

A bit later my Commodore 64 times began.

At those days I saw many C64 games. The most remarkable games from me at the time were Ultima IV: Quest of the Avatar and Ultima V: Warriors of Destiny. Ah, the story of the games and all the philosophy in them… Especially the three principles (of the eight virtues): Love, Truth and Courage. These define the good in the games. Evil is defined as ”principles” of the opposite of the mentioned: hate, falsehood and cowardice.

As to choosing the character in these games, I always  answered the philosophical questions as myself, not by trying to get my character certain quality. As a result of this, my character became to be of the weakest profession in the game: The shepherd.

Intro from C64’s Ultima IV:

Intro from Ultima V (C64/C128):

When running the game on the C64, there isn’t background music, the sound effects only, because the game is so huge, that C64 hasn’t enough memory for the music.

Boulder Dash and Boulder Dash II were my favourites too.

Below is a video from both games:

I played a lot also Delta, a game by a Finnish programmer Stavros Fasoulas (music by famous Rob Hubbard), see the video below:

One good game for the C64 that teaches also some strategy is Paradroid. There are many remakes of this classic game also to PC.

Commodore 64’s Tetris has incredible music!

There are many games in the world of Commodore 64 that I wasn’t really interested in, but the music is incredible. As an example I must mention Cybernoid II:

Some games were simple and fun to play with good graphics and music, but let the player down with one thing: There was no ending of anykind! I remember playing ”endlessly” both International Karate and IK+ with black belt, but the games just went on and on…

As an youngster I decided, that if I was ever to program a computer game, it would always have an ending.

One incredible C64 game I remember, is Wizball:

Some C64 games I liked, were kind of games that often other people didn’t like. As an example let me mention Armourdillo:

the music of Armourdillo:

If my memory serves my right, I played Armourdillo with music.

Another game, that I almost forget as an example of a game that other people often didn’t seem to like was Master of Lamps:

For the third example of game that the other people didn’t seem to like, but was fun to me as a kid is Poster Paster:

As to Defender of the Crown, I liked C64’s version more than Amiga’s, altough the Amiga version has better graphics and music.

One very good game I almost forgot to the C64 is Thrust:

With Spy vs. Spy II we both, I and one of my friends had lots of fun. We made lots of traps to each other in order to get to that submarine and win the game. There might be one “room” filled with so many traps while we were playing the game, that in practice there was only one special way to get through the room.

One special game from the year 1984: Ghostbusters. Why this game was special? At the time I was Vic 20 user and to me (and to many others) it was simply amazing to hear so authentic speech from a movie in a computer game! What a miracle computer C64 was: With it one can even listen little parts of authentic speech from a movie in a game. How we were amazed!

A game that made many of us laugh, when we were kids, is Super Pipeline II. A fun quality game with nice music and funny graphics and not too hard to finish.

One funny detail from the past in the 80s in our C64 times was C64’s Commando; first the other boys told how hard game Commando is. Eventually one of my friends tried to play Commando for the first time in his life (and this was the first time he saw the game too) and this one friend managed to finish the game from the very beginning to the end at his first try — how the other boys were confused. “Yeah, really hard game!”, he said with little sarcasm.

A game that required fast thinking and good reflexes and gave us visually something new compared to what we had seen before was Cosmic Causeway:

For the end let be mentioned some early gems in the world of Commodore 64 games: M.U.L.E., Archon and Archon II.

Videos below:

Perhaps I come back later with my Amiga gaming history…

Missile Attack in Monkey X

Again, some nostalgia. In older blog post I presented a shortened version of my old implementation of Amiga’s “Missile Attack”. This night I made the game in Monkey X and the source can be directly compiled to Android target.

The game is quite simple one: Just shoot the missiles before they get to the bottom of the screen.

If a missile goes to the left or right side of the screen, you see the colors of the background changing — and also when you fire a shot. This gives the game more life. 🙂

Below is the source code:

Source code license: GNU General Public License 3.0.

Below is the video of the game on Android tablet and on computer screen:

I may make a better version of the game later on this summer…

Old School V – A Weird Sine Wave Scroller Made in Monkey X

This is getting to be a nightmare, this is the 5th Old School demonstration made in Monkey X. Probably the last in the series. I must have be bitten by a nostalgia bug.

In this version the lightning effect affects the font too — see the better quality video with new music:

Below is the source code:

The strange variable coefficient causes the weird sine wave effect.

In order to get the lightning effect working for the font, one must create in addition to font.png file files font_n.png and font_s.png. The Mojo2 renderer does the job from that on.

File font.png is light blue as color, font_n.png is graphically the same but white. Font_s.png is darkened version of font_n.png.

As mentioned in the first Old School post, n stands for normal, s stands for specular.

I hope you get the same nostalgic feeling from the video as I get… As always, feel free to use the source.