Post subject: Changing game rules using lua
Joined: 9/12/2014
Posts: 536
Location: Waterford, MI
It should be very possible to change the rules in a game using lua and its memory manipulation. For instance, say if we wanted to make zelda NES into a soccer game and not action adventure: Memory addresses needed: Zeldas X/Y Knights X/Y [some other enemy] X/Y Coins X/Y Water X/Y As well as all their HPs Zelda would be a player on the field. Knights would be the opposing team [some other enemy] would be on zelda's team. The coin would be used as a soccer ball and water would be the goal on left and right. Now in the lua script, for moving the ball(coin), we would do something like: If zeldaX+2 == ballx then ball += 2 end if That would prevent zelda from the getting the coin. That goes for everyone else. For the goal, we would have something like: if ballx > water then team1+=1 end if if ballx < water then team2+=1 end if So yeah, it should be possible to change rules this way. You could also have more variables, but they wont be visible on the NES screen just the console. Or you could use grass addresses to write msgs.
Masterjun
He/Him
Site Developer, Skilled player (1970)
Joined: 10/12/2010
Posts: 1179
Location: Germany
Playing a different game inside a game, cool idea! Now where does this idea have anything with TASing though?
Warning: Might glitch to credits I will finish this ACE soon as possible (or will I?)
Joined: 9/12/2014
Posts: 536
Location: Waterford, MI
Masterjun wrote:
Playing a different game inside a game, cool idea! Now where does this idea have anything with TASing though?
Its sorta like ACE playarounds, but that's not possible with all games, and changing the rules of games may provide entertainment for some. Like imagining what soccer in zelda would be like. Its really just for playarounds. I guess we can say "lua" playarounds and not ACE playarounds if that makes sense.
Post subject: Re: Changing game rules using lua
Editor, Expert player (2312)
Joined: 5/15/2007
Posts: 3855
Location: Germany
InfamousKnight wrote:
For instance, say if we wanted to make zelda NES into a soccer game and not action adventure
Hey, I had the same idea. I think if it can be accomplished with ACE, it would be more impressive than if you did it with lua. It would make for a fun project either way.
Editor, Skilled player (1171)
Joined: 9/27/2008
Posts: 1085
If we're using FCEUX lua, best use things like memory.registerexec and memory.setregister for more lua-side control. Merely adjusting memory on frame boundaries surely wouldn't be enough. Move the Program Counter to skip over the rupee collection routine and have perfect detection of when it would otherwise be collected. If necessary, memory.writebyte a short piece of code in some unused spot of RAM and force the PC there. I haven't looked too deeply into other emulators for instruction level control offered by lua functions. But I did have a touch of fun messing about with the debugger and coming up with a useful script that uses memory.registerexec for handy information.
Joined: 9/12/2014
Posts: 536
Location: Waterford, MI
Changing ram addresses using scripts can also make games longer and complex that wouldn't be possible with the hardware limitations. For instance, Indiana Jones and raiders of the lost ark for the 2600 can be expanded to show more of the movie rather than some stripped down version by changing values through a script. Thus giving the illusion that major rom expansion was done when really we just had a script changing ram throughout.
Site Admin, Skilled player (1235)
Joined: 4/17/2010
Posts: 11264
Location: RU
Posting this masterpiece again: Link to video
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.