Superfeather Game Engine v0.5.2b "Flying Kobold"

A place where you can keep others updated about your SNES-related projects through screenshots, videos or information in general.

Moderator: Moderators

User avatar
HihiDanni
Posts: 186
Joined: Tue Apr 05, 2016 5:25 pm

Re: Superfeather Game Engine v0.5 "Flying Kobold"

Post by HihiDanni »

UnDisbeliever wrote:This is awesome, we need more SNES homebrew code in the wild.

I've read through the code and understand how the engine works. I love the simplicity of this engine (unlike mine which is a little all over the place). I hope you keep it up as the engine expands.
Thanks!
I did have a bit of trouble recognising the start of a routine due to the lack of spacing. Would it be possible to add a second blank line in-between the routines to improve readability?
I'm a big fan of line breaks to visibly separate portions of code so this is on my todo list.
You need to expand the Memory Bank Details section.

The code bank table is a little confusing. I do not believe a beginner to the 65816 would read it and realise that they cannot jsr addr or jmp addr from the hi bank to the lo bank.
Honestly, I'm not sure how to properly explain it myself, but I think adding these two rows to the table would help:

Code: Select all

 jsr addr, jmp addr              | code0lo, code0hi | code0hi | code1lo, code1hi | code1lo
 access function pointers in RAM | NO               | YES     | NO               |  YES 
The phrase "Indirect addressing via RAM is not available when running code in Code 0 Lo or Code 1 Lo" is also confusing. I initially though you were talking about direct page indirect address but after scratching my head for a few minutes realised you were talking about function pointers.
That's a good idea. I'll try to be more explicit about referring to function pointers. It's one of those gotchas I noticed while I was trying out the feasibility of doing HiROM program bank with LoROM data bank.
I do not like the fact I have to pass the object pool index to DeleteObject. This prevents me from writing a routine for deleting objects when they go outside the active window and reusing it across different pools (unless I store the pool in the object, which complicates the object's init routine).
When I designed the object pool system, my intention was that a given type of object would only ever be used in one specific pool and that DeleteObject would be called by the object itself. But since CreateObject is pretty fast, I could probably afford to do some record keeping there so the user doesn't have to.

I had also envisioned the objects themselves taking care of the out-of-screen logic, since AddSprite does a preliminary range check of its own. If the function exits with the overflow bit set, you can delete the object right there, or do a more precise check (since the range used by AddSprite is a bit... asymmetric). This is the technique used in the Bounceballs example.
SNES NTSC 2/1/3 1CHIP | serial number UN318588627
psycopathicteen
Posts: 3140
Joined: Wed May 19, 2010 6:12 pm

Re: Superfeather Game Engine v0.5 "Flying Kobold"

Post by psycopathicteen »

psycopathicteen wrote:I don't know how to use LUA, so how do I get it to run the compiler?
I asked this question a few posts ago.
User avatar
HihiDanni
Posts: 186
Joined: Tue Apr 05, 2016 5:25 pm

Re: Superfeather Game Engine v0.5 "Flying Kobold"

Post by HihiDanni »

You don't need to know any Lua. You should just be able to run the build.sh or build.bat (depending on your platform) and it will run the Lua script for you.
SNES NTSC 2/1/3 1CHIP | serial number UN318588627
psycopathicteen
Posts: 3140
Joined: Wed May 19, 2010 6:12 pm

Re: Superfeather Game Engine v0.5 "Flying Kobold"

Post by psycopathicteen »

I tried clicking on build, but the ball bouncing demo looks exactly the same.
User avatar
HihiDanni
Posts: 186
Joined: Tue Apr 05, 2016 5:25 pm

Re: Superfeather Game Engine v0.5 "Flying Kobold"

Post by HihiDanni »

You'll have to be a bit more specific than that. It sounds like you opened the .bat file via the shell. Command Prompt windows opened this way will self-close after they're done. You probably want to open the Command Prompt yourself and run the .bat file from there. Don't use an Administrator prompt or you may run into issues with user permissions on any files generated.
SNES NTSC 2/1/3 1CHIP | serial number UN318588627
psycopathicteen
Posts: 3140
Joined: Wed May 19, 2010 6:12 pm

Re: Superfeather Game Engine v0.5 "Flying Kobold"

Post by psycopathicteen »

All I'm getting is this.
command prompt.png
User avatar
HihiDanni
Posts: 186
Joined: Tue Apr 05, 2016 5:25 pm

Re: Superfeather Game Engine v0.5 "Flying Kobold"

Post by HihiDanni »

So as it turns out, Wine CMD is not an accurate substitute for Windows CMD. I tested the buildsystem in Wine and it handled the forward slashes just fine but they end up confusing native Windows. This should be fixed in 0.5.1.

New version also has a few small changes to the documentation. See original post for the download.
SNES NTSC 2/1/3 1CHIP | serial number UN318588627
Erockbrox
Posts: 397
Joined: Sun Nov 23, 2014 12:16 pm

Re: Superfeather Game Engine v0.5.1 "Flying Kobold"

Post by Erockbrox »

A level editor will come in a future release.
I will make you a deal.

If you can give me a level editor that looks equivalent to Lunar Magic (the super mario world editor) with drag and drop support for sprites and blocks then I will make a professionally made SNES game. Deal?

Lunar Magic screen shot:

Image

Also, on super mario world central, anyone can upload custom sprites and blocks onto their database and these resources can easily be used in anyone's game.

For your game engine, it would be great if a similar setup were possible, for example a site where anyone can upload their sprites, blocks, code for others to use and share in their own games.
User avatar
HihiDanni
Posts: 186
Joined: Tue Apr 05, 2016 5:25 pm

Re: Superfeather Game Engine v0.5.1 "Flying Kobold"

Post by HihiDanni »

From a level designer's perspective, what sort of functionality are you looking for? It will be easier to meet your needs if you provide a more concrete list of requirements.

My initial plan was to use a metatile system as the basis for levels but I could also add support for in-memory direct 16x16 tiled levels if you'd like.
SNES NTSC 2/1/3 1CHIP | serial number UN318588627
User avatar
Drew Sebastino
Formerly Espozo
Posts: 3496
Joined: Mon Sep 15, 2014 4:35 pm
Location: Richmond, Virginia

Re: Superfeather Game Engine v0.5.1 "Flying Kobold"

Post by Drew Sebastino »

HihiDanni wrote:I could also add support for in-memory direct 16x16 tiled levels if you'd like.
Just do this, lol. If this game engine is meant for your typical person who just wants to make an SNES game but doesn't know much about programming or cares about compression (I know I don't), then they're just going to want to edit the tile map directly. You might as well also support 8x8 tiles while you're at it.

Reading the code in the game engine, I know the stuff like the metasprite routine isn't meant to be touched by the majority of people, but do you think that maybe you should make all the names not so shorthanded? I'm sure you explain what everything does in the documentation, but it's a bit intimidating in my opinion.

This might be overkill to you, but here's a sample of my code. I made it so I'm biased, but it's very readable to me.

Code: Select all

.proc palette_uploader
  sep #$10
  rep #$20
  lda a:PaletteRequestCounter
  beq palette_uploader_no_request
  lda #$4300
  tcd
  lda #$2200
  sta $00
  ldx #$00
  stx a:$2115

palette_uploader_loop:
  lda a:PaletteRequestLoWordTable,x
  sta $02

  ldy a:PaletteRequestBankByteTable,x
  sty $04

  lda a:PaletteRequestTransferSizeTable,x
  sta $05

  ldy a:PaletteRequestCgramAddressTable,x
  sty a:$2121

  ldy #$01		;Initiate DMA transfer (channel 0)
  sty a:$420B

  inx
  inx
  cpx #2*PaletteRequest32x32SlotNumber
  beq palette_uploader_done
  cpx a:PaletteRequestCounter
  bne palette_uploader_loop

palette_uploader_done:
  lda #$0000
  tcd
  stz a:PaletteRequestCounter
palette_uploader_no_request:
  rts
.endproc
Also, I use a lot of these to break up my routines:

Code: Select all

;=========================================================================================
Just putting ";===" makes it apparent that something new is starting, but it's not very obvious unless you look for it.
User avatar
HihiDanni
Posts: 186
Joined: Tue Apr 05, 2016 5:25 pm

Re: Superfeather Game Engine v0.5.1 "Flying Kobold"

Post by HihiDanni »

Can you give me an example of a routine that is using too much shorthand? I need some examples before I'll know what to fix and how. The only big difference I notice between your style and mine is that you use snake_case for function names while I use CamelCase.

I already mentioned that whitespace between routines is something I'd like to fix.

The big issue with raw tilemaps is that they're not very scalable as they take up a lot of memory. This is specifically why metatiles exist, which is how games like Sonic can have such large levels. But storing a raw array of 16x16 tiles lets you edit them more easily, especially during gameplay, which makes that method more suitable toward Mario or Zelda type games. Depending on how the map is stored in ROM, the editor may or may not have direct tilemap access, if the raw array is merely the target of load-time decompression.

I took a quick look at a video of Lunar Magic and it seems that terrain is built out of resizable rectangular elements. It's a novel idea, though you kind of lose the raw tile access (at least, during edit time). And when you decompress to a raw tilemap you still have the same scalability issues. But I like this as well as the metatile format so I want to include both of them, so users can choose which would be best suited for their game.
SNES NTSC 2/1/3 1CHIP | serial number UN318588627
Erockbrox
Posts: 397
Joined: Sun Nov 23, 2014 12:16 pm

Re: Superfeather Game Engine v0.5.1 "Flying Kobold"

Post by Erockbrox »

I will make a video describing what Lunar Magic can do.

https://www.youtube.com/watch?v=gANeGtb ... e=youtu.be

I forgot to add that you can:

- highlight multiple blocks/sprites and move them around in a group
- highlight blocks/sprites and copy and paste them, even from one level to another
- hit a button on the keyboard and run an emulator of your choice with your game loaded
creaothceann
Posts: 610
Joined: Mon Jan 23, 2006 7:47 am
Location: Germany
Contact:

Re: Superfeather Game Engine v0.5.1 "Flying Kobold"

Post by creaothceann »

My current setup:
Super Famicom ("2/1/3" SNS-CPU-GPM-02) → SCART → OSSC → StarTech USB3HDCAP → AmaRecTV 3.10
User avatar
HihiDanni
Posts: 186
Joined: Tue Apr 05, 2016 5:25 pm

Re: Superfeather Game Engine v0.5.1 "Flying Kobold"

Post by HihiDanni »

Erockbrox wrote:I forgot to add that you can:

- highlight multiple blocks/sprites and move them around in a group
- highlight blocks/sprites and copy and paste them, even from one level to another
- hit a button on the keyboard and run an emulator of your choice with your game loaded
The raw SNES tilemap editor already features multi select and copy/paste so I'll be sure to add support for that in the level editor too.

I'll look into a button to run the game. Edits will be done to separate files so changes will need reassembly of the ROM. My current process is to keep a console window open, click on it and press Up + Enter, then click on bsnes-plus and press Shift +Tab to reload the ROM. I can probably streamline it for other users though.

I'll watch the video itself when I'm not on mobile.
SNES NTSC 2/1/3 1CHIP | serial number UN318588627
psycopathicteen
Posts: 3140
Joined: Wed May 19, 2010 6:12 pm

Re: Superfeather Game Engine v0.5.1 "Flying Kobold"

Post by psycopathicteen »

I just thought of something. Are you going to have some kind of sprite priority sorting?
Post Reply