It is currently Thu Dec 14, 2017 9:34 pm

All times are UTC - 7 hours



Forum rules


Related:



Post new topic Reply to topic  [ 35 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
PostPosted: Tue Nov 14, 2017 7:08 pm 
Offline
User avatar

Joined: Tue Apr 05, 2016 5:25 pm
Posts: 159
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!

Quote:
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.

Quote:
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:
 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.

Quote:
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


Top
 Profile  
 
PostPosted: Tue Nov 14, 2017 8:58 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2427
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.


Top
 Profile  
 
PostPosted: Tue Nov 14, 2017 9:30 pm 
Offline
User avatar

Joined: Tue Apr 05, 2016 5:25 pm
Posts: 159
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


Top
 Profile  
 
PostPosted: Wed Nov 15, 2017 3:16 am 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2427
I tried clicking on build, but the ball bouncing demo looks exactly the same.


Top
 Profile  
 
PostPosted: Thu Nov 16, 2017 3:17 pm 
Offline
User avatar

Joined: Tue Apr 05, 2016 5:25 pm
Posts: 159
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


Top
 Profile  
 
PostPosted: Thu Nov 16, 2017 4:24 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2427
All I'm getting is this.

Attachment:
command prompt.png
command prompt.png [ 15.27 KiB | Viewed 576 times ]


Top
 Profile  
 
PostPosted: Thu Nov 16, 2017 6:32 pm 
Offline
User avatar

Joined: Tue Apr 05, 2016 5:25 pm
Posts: 159
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


Top
 Profile  
 
PostPosted: Sun Nov 19, 2017 12:29 am 
Offline

Joined: Sun Nov 23, 2014 12:16 pm
Posts: 181
Quote:
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.


Top
 Profile  
 
PostPosted: Sun Nov 19, 2017 3:10 pm 
Offline
User avatar

Joined: Tue Apr 05, 2016 5:25 pm
Posts: 159
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


Top
 Profile  
 
PostPosted: Sun Nov 19, 2017 3:32 pm 
Offline
User avatar

Joined: Mon Sep 15, 2014 4:35 pm
Posts: 3153
Location: Nacogdoches, Texas
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:
.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:
;=========================================================================================

Just putting ";===" makes it apparent that something new is starting, but it's not very obvious unless you look for it.


Top
 Profile  
 
PostPosted: Sun Nov 19, 2017 4:48 pm 
Offline
User avatar

Joined: Tue Apr 05, 2016 5:25 pm
Posts: 159
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


Top
 Profile  
 
PostPosted: Sun Nov 19, 2017 10:31 pm 
Offline

Joined: Sun Nov 23, 2014 12:16 pm
Posts: 181
I will make a video describing what Lunar Magic can do.

https://www.youtube.com/watch?v=gANeGtb3F0E&feature=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


Top
 Profile  
 
PostPosted: Mon Nov 20, 2017 1:14 am 
Offline
User avatar

Joined: Mon Jan 23, 2006 7:47 am
Posts: 79
relevant ;)


Top
 Profile  
 
PostPosted: Mon Nov 20, 2017 6:14 am 
Offline
User avatar

Joined: Tue Apr 05, 2016 5:25 pm
Posts: 159
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


Top
 Profile  
 
PostPosted: Mon Nov 20, 2017 9:09 pm 
Offline

Joined: Wed May 19, 2010 6:12 pm
Posts: 2427
I just thought of something. Are you going to have some kind of sprite priority sorting?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 35 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group