Log In  


Cart #rtype-5 | 2022-04-12 | Code ▽ | Embed ▽ | No License
195

After months of hard work, here is the NEW release (1.3) of Irem’s R-Type* pico-8 port, featuring the 4 stages in a 32kb cart! (Similar to the PC-Engine port, with 4 in a 256kb hu-card.)

In addition, there are:

  • 30 enemies with most attack patterns and weapon replicated (albeit simplified)
  • 4 HUGE bosses
  • 3 force types with 2 levels of power
  • 60 fps action with arcade-style graphics
  • Awesome 5 tracks soundtrack by the great @dhostin (YouryKiki) based on Masato Ishizaki's original score, you can listen to the OST on SoundCloud

Hope you enjoy it and please, give me some feedback on performance, especially on lower-end machines.

TheRoboZ

Instructions:

🅾️ button to shoot, hold to charge the beam
❎ to detach/recall the force sphere. (hold to auto-fire. after a while auto-firing will detach the force so be careful!) The force can be positioned in front and behind, has 3 powers up levels and can be used defensively too, absorbing the small enemy bullets.

(I strongly suggest to play with keyboard or pad as on the phone it might be a bit harder)


Version 1.4

  • FIXED fsign bug reported on April 11
  • Token reduction
  • Optimized sprite rotation
  • Picodraw cached string to table conversion
  • Fixed bug in detaching cargo in stage 3
  • Improved collision bounding boxes in soem cases
  • Beam draw improvement

Version 1.3

  • fix for pico 0.2.4 black palette bug
  • fixed stage 2 music bug, boss music plays again if coming from stage 1
  • added score recap at stage clear

Version 1.2

  • stage 4 (2 new enemies and 1 new boss)
  • NOTE: stage 4 boss cannot be damaged with normal bullets, you need to use the beam or a force weapon

  • soundtrack available on https://soundcloud.com/youry-kiki/sets/r-type-pico8
  • swapped fire buttons

  • increased special weapon damage
  • added different explosion for missiles
  • fix autofire too fast with force weapons
  • fix autofire firing force while holding button down
  • fixed circle beam/missiles gfx
  • fixed missiles explosion drawn twice
  • missiles only seeks forward as in arcade
  • misc. fixes/improvements to better match arcade version

Version 1.1

  • auto-fire if you hold down (❎), see instructions. thanks @dw817
  • fixed shooting/sounds after death, thanks @Felice
  • fixed problems with music cues/checkpoint restarting and enemy removal(stage 3 mainly) after player death
  • fixed missiles not resetting after player death, thanks to @extar and his awesome let's play
  • fixed excessive beam damage due to being stuck in some situation where a bg tile was behind an enemy (first and third bosses as seen in @extar 's video

What’s missing compared to the arcade (mainly down to token limit):

  • "Option bits" power up (little spheres flying above and/below the ship)
  • continue screen/high scores table
  • The pow-capsule enemy doesn't land/walk
  • No 1-up

Development Notes:

The idea for this came as a way to expand and improve the background graphic system of my previous Masters of the Universe game with scrolling, meanwhile implementing more functionality in picodraw as explained here.
I am pretty satisfied with the technical results and picodraw now evolved a lot with the addition of cloning groups and sprite support. Programming the game was a fun “old times” experience since I had no idea how the original worked and had to keep playing on M.a.M.E. trying to understand enemies patterns, but got a bit tedious at time, while fighting token limits to implement them, specially near the end.

Thank you

The following contributions taught me some incredible techniques that allowed me to complete the game

@sparr/ @Felice for their fillp extension that allows object coordinates fill patters, without this I wouldn’t even have tried as the jittering was really annoying,

@Freds72/@paranoidcactus for their Journey to poom article
showing me the invaluable “properties factory” function that I adapted to my needs and saved me at least 3 times when I overshot token limits. Freds72 also contributed some last minute optimization tricks that will probably allow me an additional update.

@ElGregos for his snake tweetcart, showing me a simple way to implement a more complex movement for the second boss

Without the above, the game would have been way more limited

*R-Type is a side-scrolling shoot'em up game, and the first game in the series. It was originally released in July 1987 by Irem for the Arcades, with ports to home consoles and computers in the following years.

195


1

I remember when you started and posted your demo 6-months ago from today, I was suitably impressed then. Even more so now that you have completed it, @TheRoboZ.

Obviously gold star work. Unfortunately it is a painful reminder to show me just how far my gaming reflexes have fallen in this day and time.

If maybe there was an option for auto-fire - I think there was a 3rd button in the original arcade game that did so. Maybe make it optional in the beginning game menu to have auto-fire for those who have played and never plan to use the standard power-up shot for anything.

[ ] Standard shooting, powers up when held
[ ] Auto-fire, rapidfire when held


I think I can add an auto-fire option in a future update (already planned after the next release of pico8 because I saw new stuff in the release notes that could help reclaim some tokens)


1

Absolutely incredible! Amazing piece of coding. Have a star - I wish I could give more.


Awesome! 👾


This is great! Very nice Pico 8 - Port!


Nice port!

Not sure if it's something you had to overlook because of tokens, but I notice after I die I can still keep firing and hearing "pew pew pew" even though nothing happens.


Excellent work (and very good job with the music!)

Happy to have indirectly contributed :]


1

@Felice yeah this is one of the rough shortcuts I had to take for token reasons, but I might clean it up in a future update


Version 1.1 Released, changes:

  • auto-fire if you hold down (🅾️), see instructions. thanks @dw817
  • fixed shooting/sounds after death, thanks @Felice
  • fixed problems with music cues/checkpoint restarting and enemy removal(stage 3 mainly) after player death
  • fixed missiles not resetting after player death, thanks to @extar and his awesome let's play
  • fixed excessive beam damage due to being stuck in some situation where a bg tile was behind an enemy (first and third bosses as seen in @extar 's video

Auto-fire. Delicious. I noticed that when you hold (O) however the indestructible ball is also launched every time. If there was a way to have it held until two conditions take place.

  1. (O) is not held or touched.
  2. (O) is tapped or held.

Then launch the ball and do not launch it if just caught and (O) is held down.


1

@dw817 for now there aren't enough tokens to change it. I think I can fix it when the new pico version will be out.


1

Version 1.2 Released, changes:

  • stage 4 (2 new enemies and 1 new boss)
  • NOTE: stage 4 boss cannot be damaged with normal bullets, you need to use the beam or a force weapon

  • soundtrack available on https://soundcloud.com/youry-kiki/sets/r-type-pico8
  • swapped fire buttons

  • increased special weapon damage
  • added different explosion for missiles
  • fix autofire too fast with force weapons
  • fix autofire firing force while holding button down
  • fixed circle beam/missiles gfx
  • fixed missiles explosion drawn twice
  • missiles only seeks forward as in arcade
  • misc. fixes/improvements to better match arcade version

even more impressive packing!
minor code/perf comments:

  • saves 1 token
local e=add(explos,{})
  • Felice fillp uses slow band/shr/.., suggest to replace by operators (+save tokens)
  • min/max(0,x) == min/max(x)
  • round function can be made faster/smaller:
function round(n)
 return (n+0.5)\1
 -- return n%1 < .5 and n\1 or ceil(n)
end
  • use @/% faster/smaller peek/peek2 equivalents
  • memset(24336,0,16) is 1 token less than poke4(unpack(split"24336,0,0,0,0"))
  • you can regain some compression ratio (around 95%) by stripping out trailing blanks (I use this Python script to minify my games):
# read infile and write minified version to outfile
def minify_file(infile, outfile):
    # minifying main
    main_code = ""
    with open(infile, "r", encoding='utf-8') as f:
      main_code = f.read()
    # rules
    minify_rules=[
      (re.compile('---',re.MULTILINE),'==='),
      (re.compile('--\\[\\[.*?\\]\\]',re.DOTALL),''),
      (re.compile('--[ ]*.*$',re.MULTILINE),''),
      (re.compile('^[ \t]*',re.MULTILINE),''),
      (re.compile('[ \t]*$',re.MULTILINE),''),
      (re.compile('\n\s*\n*',re.MULTILINE),'\n'),
      (re.compile('===',re.MULTILINE),'---')
    ]
    for rule in minify_rules:
      main_code = rule[0].sub(rule[1],main_code)
    with open(outfile, "w", encoding='utf-8') as f:
      f.write(main_code)

Thank you @freds72, this is like a Hail Mary at the last second and gives me enough tokens (~25 wich is massive considering how much I struggled to get even 2/3 more in this release) to either fix any bug that pops up in this release or implementing one or two entries in my refinement list (which I plan to do with next pico-8 release).
I suggest @zep to add the min/max optional 0 in the manual, as I was using it several times. Also the add trick is appreciated, I had the feeling there should be a more elegant way to do it but forgot add() returns the added item. For minimization now it's not that urgent since I think I am done with picodraw stuff. I am using Visual Studio Code automatic trailing space removal (which I didn't know of when writing previous carts...) but I also find indentation space eating a lot of compression so I remove most in simple functions but I like to keep code as readable as possible.


You've come a long way on this, @TheRoboZ.

Just wanted to give you one more bit of applause for having the cheat option. I am really bad at action games and wouldn't last more than a minute on the real arcade thing.

Here I can play your game and explore it to conclusion. Thanks so much !


seems to be brocken with 0.2.4. It plays the sound, but the screen is black


@GPI Thanks for the heads up. I had a quick look and it seems that after setting the palette to all black (memset(24336,0,16)) to hide drawing operations while creating explosions, it is not reset to default automatically by reload() as it was in pico's previous version.
@zep is this intended or is it a bug?
Anyway It's an easy fix that I can do tomorrow. Even better, with this new version I can use the new sprite/screen memory mapping to avoid the palette setting altogether.


1

Fixed 0.2.4 compatibility and minor adjustements

Version 1.3

  • fix for pico 0.2.4 black palette bug
  • fixed stage 2 music bug, boss music plays again if coming from stage 1
  • added score recap at stage clear

3

Tinkering with the wide screen version (previewed in the following clip)

I found a way to reduce tokens, so I managed to fix a couple annoyances I had left. Now updated to V 1.4

Optimized sprite rotation
Picodraw cached string to table conversion
Fixed bug in detaching cargo in stage 3
Improved collision bounding boxes in soem cases
Beam draw improvement


One has to ask, @TheRoboZ, how did you get widescreen in Pico-8 ?


Same as in Nebulus, using the multi screen setup but with only 2 horizontal screens. Then the video is from the webplayer with added shaders which crops/rescale to remove the unused part. There are still some bugs to fix then I will release it


2-linked screens, @TheRoboZ ? OMY. I can see the advantage of a resolution like this though. Let me calculate it for a single Pico-8 screen memory size ...

Hmm ... It could be done. The resolution would be 180x90 pixels, a perfect wide-screen and still have the same 4-bits per pixel taking 8100-bytes instead of 8192.


doesn’t work like that - see display_x and display_y launch parameters in wiki +
_map_display ‘secret’ function.
you get multiple pico displays stitched together, up to you to select the screen & draw - this is not mapped in memory as 1 big screen



[Please log in to post a comment]