Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - [Coding competition 2015] Anguna - the Prison Dungeon by sverx

Reply to topic

Rate this entry!

1 (Poor) 0% 0%
2 0% 0%
3 0% 0%
4 15% 15%
5 21% 21%
6 36% 36%
7 26% 26%
8 0% 0%
9 (Excellent) 0% 0%
This poll has expired.
Author Message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 12330
  • Location: London
Reply with quote
[Coding competition 2015] Anguna - the Prison Dungeon by sverx
Post Posted: Fri Mar 13, 2015 5:29 pm
http://www.smspower.org/Homebrew/AngunaThePrisonDungeon-SMS

Quote
This is my attempt at porting to SEGA Master System the Nathan Tolbert's great GBA homebrew "Anguna" http://www.tolberts.net/anguna/ (available also for DS, where it uses the XM replay library I wrote from 2008 on: libXM7 http://wcms.teleion.it/users/cgq/nds/libxm7/ )

Nathan has been very kind in letting me use the original source and he also provided me a lot (a LOT!) of help in understanding how the game engine works. I thought the SMS 8 KB RAM wouldn't be enough to handle the whole game variables when in the vast game 'overworld', but they would be enough at least to handle the Prison Dungeon, which is made up of smaller rooms... so I decided to start the port (using devkitSMS/SMSlib) and see how far this can be pushed.

The biggest hurdle so far is handling the HUD life bar when a dungeon room scrolls vertically. I mean, horizontally it's a breeze, just turn on the horizontal scroll lock VDP feature and that's it. Vertically means redefine the bar tiles making them 'unscroll' (scroll the opposite direction), but also the tilemap is changing, so I have to replace three lines of it when scrolling 8 pixels. Also, I have to mask the upper border of the image so that to make it look like it's scrolling inside a window. This is achieved by turning off and on again the display at specific scanlines.

Unfortunately this is already overkilling. At 60 Hz, when walking in a room scrolling vertically, the first graphical glitches start to appear... to mark that I'm asking too much to the CPU :|
So, please, test it at 50 Hz. And on emulators only. When everything turns black you've left the dungeon. Or hit an unnoticed bug.

sverx\2015
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 2199
Reply with quote
Post Posted: Fri Mar 27, 2015 9:11 pm
... current release (0.07) should also run on hardware.
Also, Nathan is 'demaking' Anguna to Atari 2600, follow his blog here :)
  View user's profile Send private message Visit poster's website
  • Joined: 08 Oct 2012
  • Posts: 109
  • Location: Colmar PA, United States
Reply with quote
Post Posted: Sat Mar 28, 2015 12:27 am
The game freezes when I press a button. Graphics are nice though.
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 2199
Reply with quote
Post Posted: Sat Mar 28, 2015 8:36 am
A bug that probably slipped in with the v0.07. Use only the D-pad to navigate. And it's more a techdemo than a game, still...
  View user's profile Send private message Visit poster's website
  • Joined: 23 Mar 2013
  • Posts: 558
  • Location: Copenhagen, Denmark
Reply with quote
Post Posted: Sat Mar 28, 2015 10:25 am
I did it! I escaped from the prison! Ahh, freedom - at last!

And I think I even may have found a secret, dark passage along the way.

This looks super-duper promising! I'll look forward to follow the further development.
  View user's profile Send private message Visit poster's website
  • Joined: 23 Mar 2013
  • Posts: 558
  • Location: Copenhagen, Denmark
Reply with quote
Post Posted: Sat Mar 28, 2015 10:47 am
.... by the way. Regarding the challenges involved with the status bar and vertical scrolling: Might it be a solution to simply drop the scrolling, and then have a room-by-room gameplay? Then Anguna will be a little like Golden Axe Warrior... Not bad. But don't get me wrong. I really love scrolling!

Or reduce the elements in the HUD to something that can be displayed using only a few sprite tiles?
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 2199
Reply with quote
Post Posted: Sat Mar 28, 2015 11:54 am
I've been discussing this a lot with Nathan... well, I guess removing the scrolling would completely change the concept behind the game... if you happen to try the GBA (or NDS) version and you escape the Prison Dungeon you'll reach the OverWorld, and you'll see that the game without 4-ways scrolling won't do.
Of course I can remove this HUD completely... but my technical challenge was to make a non-sprite HUD stay in place even scrolling both directions.
I can't say now what's the future of this port. I mean, there are other projects I'm exploring at the moment...
  View user's profile Send private message Visit poster's website
  • Joined: 17 Sep 2013
  • Posts: 114
  • Location: Gravataí, RS, Brazil
Reply with quote
Post Posted: Sat Mar 28, 2015 1:21 pm
How about using a legacy video mode for the status bar?
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 2199
Reply with quote
Post Posted: Sat Mar 28, 2015 1:25 pm
please elaborate on this (I know what 'legacy modes' are, but I don't get what you mean...)
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 08 Jul 2001
  • Posts: 7887
  • Location: Paris, France
Reply with quote
Post Posted: Sat Mar 28, 2015 1:56 pm
If you switch mode mid-frame to use an old SG-1000 mode that doesn't have scrolling, you'll get locked scrolling which can be a convenient trick.

(It's not emulated by MEKA, maybe some emulator supports that)
  View user's profile Send private message Visit poster's website
  • Joined: 17 Sep 2013
  • Posts: 114
  • Location: Gravataí, RS, Brazil
Reply with quote
Post Posted: Sat Mar 28, 2015 2:13 pm
sverx wrote
please elaborate on this (I know what 'legacy modes' are, but I don't get what you mean...)


You could use Mode 1 or 2 for the status bar, since in those modes there is no scroll, you will be able to scroll the game area freelly. You just have to switch between modes in a line interrupt. You will break compatibility with the Genesis (But I believe you could than use mode 5 for the status bar, you will just have to test if you are on a Genesis).

Here is a old post were I upload a small demo showing this effect, there are others disadvantages as well, bu they are manageble. Theres a small advantage also:Tiles in modes 1 and 2 use less memory.

http://www.smspower.org/forums/14918-VerticalRasterEffects#80557

Back then, only worked in the real thing, now, I know that Emulicius suport this feature.
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 2199
Reply with quote
Post Posted: Sat Mar 28, 2015 2:15 pm
unfortunately I think it won't be enough. When you scroll vertically, the HUD will anyway occupy some tile lines in the tilemap, not only the topmost ones...
  View user's profile Send private message Visit poster's website
  • Joined: 08 Nov 2014
  • Posts: 89
Reply with quote
Post Posted: Sat Mar 28, 2015 2:19 pm
Very nice looking Sverx!
  View user's profile Send private message
  • Joined: 17 Sep 2013
  • Posts: 114
  • Location: Gravataí, RS, Brazil
Reply with quote
Post Posted: Sat Mar 28, 2015 2:43 pm
sverx wrote
unfortunately I think it won't be enough. When you scroll vertically, the HUD will anyway occupy some tile lines in the tilemap, not only the topmost ones...


It works, but you will have a different tilemap for the HUD. Actually you will just have to have the top lines on that tilemap, witch fit just fine in 32 bytes in your case. The regular Mode 4 tilemap will have only gameplay tiles.

If you checked my demo you may thougth that I took advantage on the fact that both tiles on the legacy and mode 4 are the same, but that's was just laziness, I could fit diferent patterns if I wanted .
  View user's profile Send private message
  • Joined: 17 Sep 2013
  • Posts: 114
  • Location: Gravataí, RS, Brazil
Reply with quote
Post Posted: Sat Mar 28, 2015 2:46 pm
sverx wrote
unfortunately I think it won't be enough. When you scroll vertically, the HUD will anyway occupy some tile lines in the tilemap, not only the topmost ones...


It works, but you will have a different tilemap for the HUD. Actually you will just have to have the top lines on that tilemap, witch fit just fine in 32 bytes in your case. The regular Mode 4 tilemap will have only gameplay tiles.

If you checked my demo you may thougth that I took advantage on the fact that both tiles on the legacy and mode 4 are the same, but that's was just laziness, I could fit diferent patterns if I wanted .

I just updated a new version with diferent paterns for the scrolling and locked area. check it on emulicious, and look the Tilemap feature on that, you will see only the mode 4 tilemap scrolling
DemoStatusBar.zip (5.01 KB)
new version
DemoStatusBar.zip (5.01 KB)

  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 2199
Reply with quote
Post Posted: Sat Mar 28, 2015 2:48 pm
Oh, I see what you mean now. Interesting, and indeed worthy a test :)
  View user's profile Send private message Visit poster's website
  • Joined: 01 Feb 2014
  • Posts: 387
Reply with quote
Post Posted: Mon Mar 30, 2015 9:06 am
Really nice. It shows a lot of promise.

After wandering around for a while, the screen went black when I entered a room. Did I a) finish the game, b) crash the game or c) enter a room where I would have needed a torch or something?
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 2199
Reply with quote
Post Posted: Mon Mar 30, 2015 9:14 am
probably a) or eventually b) but surely not c)
  View user's profile Send private message Visit poster's website
  • Joined: 17 Sep 2013
  • Posts: 114
  • Location: Gravataí, RS, Brazil
Reply with quote
Post Posted: Mon Mar 30, 2015 10:38 am
There is another option for the status bar. You could do the same way as Ys's status bar. The disadvantage is that you would have 8 pixels spliting the HUD from the game screen. But it wouldn't break compatibilty with the Genesis (At least you wouldn't have to code a diferent status bar for that).
But personally, I'd like to see the HUD utilizing the legacy modes. In my opinion is such a nice feature that no one saw back in the day. I mean, there's a lot a games that have a status bar and have to scroll vertically, such as Shinobi, and Ys itself.
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 2199
Reply with quote
Post Posted: Mon Mar 30, 2015 11:00 am
gvx32 wrote
There is another option for the status bar. You could do the same way as Ys's status bar.


I haven't checked how it does that. Care to explain more details? :) Thanks!
  View user's profile Send private message Visit poster's website
  • Joined: 17 Sep 2013
  • Posts: 114
  • Location: Gravataí, RS, Brazil
Reply with quote
Post Posted: Mon Mar 30, 2015 11:44 am
Well it basically uses a 16 pixel bar and masks off the 8 extra pixels by turning off the Vdp in the right moment, its kind hard to explain, but if you play the american version on Ys on an emulator and check the Tilemap Viewer on Meka or emulicious, you will se what i,m talking about. It's not a general solution, but it will fit for your case.
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 2199
Reply with quote
Post Posted: Mon Mar 30, 2015 11:48 am
Sounds very similar to what I'm doing already... I'll have a check later
  View user's profile Send private message Visit poster's website
  • Joined: 23 Mar 2013
  • Posts: 558
  • Location: Copenhagen, Denmark
Reply with quote
Post Posted: Mon Mar 30, 2015 11:54 am
Can you tell a little about how the level is made? Have you made your own level editor, or are you using a tool like Tiled, or maybe just a text editor to punch in meta tile codes by hand?
  View user's profile Send private message Visit poster's website
  • Joined: 05 Sep 2013
  • Posts: 2199
Reply with quote
Post Posted: Mon Mar 30, 2015 12:00 pm
Levels were done by Nathan when he was coding his GBA homebrew. He used Tiled and there are two maps (layers) of tiles for each level. Then a custom perl script is used to prepare the data.
In my version I just modified slightly the perl script to generate the level data, then a specific function loads the two maps of the level to build a single tilemap in RAM where some tiles are behind and some in front of sprites. Also collision data is generated at this time and stored in the same RAM map.
  View user's profile Send private message Visit poster's website
  • Joined: 23 Mar 2013
  • Posts: 558
  • Location: Copenhagen, Denmark
Reply with quote
Post Posted: Mon Mar 30, 2015 12:02 pm
Ah - I see. Very nice indeed. Thanks! :)
  View user's profile Send private message Visit poster's website
  • Joined: 30 Mar 2015
  • Posts: 1
  • Location: United States
Reply with quote
Post Posted: Mon Mar 30, 2015 5:45 pm
sverx wrote
He used Tiled


Actually, I think I used Mappy Tile Editor (sorry, can't link to it, I'm too new here) for that game. Although I've switched to using Tiled for new projects.


Looks great, Sverx!
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 2199
Reply with quote
Post Posted: Mon Mar 30, 2015 6:16 pm
Oh, right, I knew it! Sorry!
Thanks for stopping by Nathan :)

edit: Mappy Tile Editor
  View user's profile Send private message Visit poster's website
  • Joined: 29 Mar 2012
  • Posts: 375
  • Location: Spain
Reply with quote
Post Posted: Tue Mar 31, 2015 1:15 pm
Sverx!, did you use the devkit Here? :-)
  View user's profile Send private message
  • Joined: 05 Sep 2013
  • Posts: 2199
Reply with quote
Post Posted: Tue Mar 31, 2015 1:29 pm
sure!

Quote
...so I decided to start the port (using devkitSMS/SMSlib) and see how far this can be pushed...


;)
  View user's profile Send private message Visit poster's website
  • Joined: 29 Mar 2012
  • Posts: 375
  • Location: Spain
Reply with quote
Post Posted: Tue Mar 31, 2015 1:37 pm
oh!, just skipped that!
  View user's profile Send private message
Reply to topic



Back to the top of this page

Back to SMS Power!