Sonic and Sega Retro Message Board: I come forth asking a question - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
Page 1 of 1
    Locked
    Locked Forum

I come forth asking a question

#1 User is offline Tribeam 

Posted 12 January 2012 - 04:18 PM

  • I code Lua and Lua accessories
  • Posts: 65
  • Joined: 08-January 07
  • Gender:Male
Hey Retro, long time no see, hell last time I posted here was when I released that palette editor thing...

The Story:
Been a while since I got into this stuff, then recently I came back to mess around some more. Now I'm working on a new tool(still using Lua). this tool will have a remade palette editor, real time level editing/saving/loading tool, real time changing of generic stuff like lives, rings, zone, act, etc. I guess you can say the new tool is like a crazy new debug hooked right into the game. But Tribeam...why?, I don't know.. why not? heh. Anyway while working on this tool, during a boring session, I decided to play around with some ASM and unfortunately I don't have time to be learning a new language. However I did learn the bare basics of how it works and I decided to try something new. Try to get Lua and ASM to communicate between each other. First I started off small, getting Lua to play any sound I want with a simple "Gamesound(id)" function. Then I moved on to changing the music speed whenever I wanted. Then I decided to try something else(though this didn't require any ASM editing) while playing LBZ and curious as to how LBZ changes its chunks instantly, I attempted to make a copy/paste like function in Lua, simply copychunks(x2, y2, x2, y2, x3, y3). It worked fairly well(though still unsure about how to get the screen to refresh). This is when an idea hit me. If someone(me) was to hook Lua in to possibly everything I can imagine would work, this could probably make for an interesting hack by breaking a few limits, spawn items at will, animate chunk changes(I guess like MGZ does?), move objects at will(maybe a floating platform like seen in Mario3 that follows a line path), draw images outside the genesis palette(32bit), mouse interactions, make new objects that Lua specifically uses to make new crazy enemies and bosses, the list goes on.


The Question
Before I decide to dive into this further, I got 1 part of me that says "this could work", then there's another part that says "this is stupid and the community will never go for it blah blah".

So I come here asking what does Retro think?
Should I dump this idea in the trash or continue on and see what can come of it?


Some Notes
I'm not suggesting this as a new way for the community to hack, basically just a way for me heh.

Also if I do go forward with this, I'd need an ASM person(or some) to help me


Some Code:
ASM
AIZ1_ScreenEvent:
		jsr	DrawTilesAsYouMove(pc)
		
; start lua checks

; Play sound functionality for Lua
Lua_CheckSound:
		cmpi.b	#$1, ($FFFFEF00).w			; check if activator value is 1
		bne.s 	Lua_End								; if not skip

Lua_PlaySound:
		move.w	($FFFFEF02).w,d0			; else set sound id value to d0
		jsr	(Play_Sound).l							; play that sound
		move.w	#$0, ($FFFFEF00).w		; change activator value to 0(so it doesn't repeat)

Lua_End:

; end lua checks
...



Lua
function Game_PlaySound(id)
	memory.writeword(0xFFEF02, id)
	memory.writebyte(0xFFEF00, 0x01)
end


#2 User is offline FeliciaVal 

Posted 12 January 2012 - 05:13 PM

  • Posts: 689
  • Joined: 04-March 10
  • Gender:Female
  • Location:Spain
for some reason I think this would help a lot of people and if it's something that you'd like to do, so I say go for it!
I find it really interesting and now im curious as what you come up with it

#3 User is offline GT Koopa 

Posted 13 January 2012 - 01:12 AM

  • Posts: 1460
  • Joined: 23-February 09
  • Gender:Male
  • Location:Elgin, IL
  • Project:Flicky Turncoat DX, T.L.W.S. Vs M.G.W.
  • Wiki edits:6
I tend to scatter a lot of my work with the swapping out chunks trick, as seen here.

Basically I took the Labyrinth Zone act 3 code and used it elsewhere, and activate it via various means.

Sonic 2 has a switch chunk code as well. However, it is even better as you can switch it on screen, something I want to figure out for sonic 1. Here I use it to make the CNZ boss fight more interesting for the pinch. (1:00 in for those who don't wait)


Now Sonic 3&K, why are there templates of the swapped in and out chunks off to the side out of the level? Does the game(s) use a special kind of code that says replace this selected area with this preplanned array of chunks? If so, does it save time and is it efficient?
This post has been edited by GT Koopa: 13 January 2012 - 01:13 AM

#4 User is offline Cinossu 

Posted 23 January 2012 - 01:45 AM

  • inverted with love~
  • Posts: 2657
  • Joined: 21-June 04
  • Gender:Male
  • Location:London, UK
  • Project:Sonic the Hedgehog Extended Edition
  • Wiki edits:474
180

View PostGT Koopa, on 13 January 2012 - 01:12 AM, said:

Now Sonic 3&K, why are there templates of the swapped in and out chunks off to the side out of the level? Does the game(s) use a special kind of code that says replace this selected area with this preplanned array of chunks? If so, does it save time and is it efficient?

If I remember correctly, what's actually happening there is silent player positioning, as in the player is actually warping to those areas rather than the chunks changing in the level. But I could be wrong.

#5 User is offline flamewing 

Posted 23 January 2012 - 07:12 AM

  • Emerald Hunter
  • Posts: 766
  • Joined: 11-October 10
  • Gender:Male
  • Location:Brasil
  • Project:Sonic Classic Heroes; Sonic 2 Special Stage Editor; Sonic 3&K Heroes (on hold)
  • Wiki edits:12

View PostCinossu, on 23 January 2012 - 01:45 AM, said:

If I remember correctly, what's actually happening there is silent player positioning, as in the player is actually warping to those areas rather than the chunks changing in the level. But I could be wrong.

Playing in Gens rerecording with a memory watch in Sonic's position shows that this is not the case. It is more likely that the game routines copy from a preprogrammed location. This is more flexible than the S2 method, and avoids having to hard-code the replacement chunk IDs, so it makes sense.

Page 1 of 1
    Locked
    Locked Forum

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users