I really like WarioWare DIY but it's got a lot of limitations I don't like, such as a lack of integer variables and no buttons, and it'd be nice to have something that wasn't as limited. I also feel like the NES would be a cool target for playing microgames on (and it'd be awesome to have a big 512KB cart stuffed with tons of microgames as a community project).
I've been working on an experimental compiler specifically for making microgames with, where you define a map, define a list of actors, place the actors on the map in locations and describe the behavior of the actors, primarily through chaining together premade behaviors.
So far it's actually looking pretty feasible? I've got things to the point where this:
gets translated into this:
and I've got a whole bunch of behavior primitives written, though the actual rest of the engine is far from done, as is any actual stuff to put the microgames together in a ROM, though I imagine that wouldn't be hard. The rest of the sample file I'm using is here with the output here. That shows off some math (including optimizations to use INC and DEC when possible), and conditionals using OR and AND, and other features.
I guess the question is, is this worth doing? Expressing it through JSON like this doesn't really seem that much easier than just writing the instructions yourself, though it could probably benefit from being able to accept a file that's in more convenient-to-write form, where you could add comments. I'm not really interested in making a GUI editor for this, but maybe an existing one could be tweaked to work with this?
I've been working on an experimental compiler specifically for making microgames with, where you define a map, define a list of actors, place the actors on the map in locations and describe the behavior of the actors, primarily through chaining together premade behaviors.
So far it's actually looking pretty feasible? I've got things to the point where this:
Code:
"player": {
"graphic": "$01",
"size": [16, 16],
"run": [
["set", "speed", 2],
["8way-movement", 255]
]
},
"getme": {
"graphic": "$e8",
"size": [16, 16],
"run": [
["set", "speed", 1],
["ball-movement"],
{
"if": ["touching-type", "actor:player"],
"then": [
["destroy"],
{
"if": ["not", "find-type", "actor:getme"],
"then": [
["win-game"]
]
}
]
}
]
},
"graphic": "$01",
"size": [16, 16],
"run": [
["set", "speed", 2],
["8way-movement", 255]
]
},
"getme": {
"graphic": "$e8",
"size": [16, 16],
"run": [
["set", "speed", 1],
["ball-movement"],
{
"if": ["touching-type", "actor:player"],
"then": [
["destroy"],
{
"if": ["not", "find-type", "actor:getme"],
"then": [
["win-game"]
]
}
]
}
]
},
gets translated into this:
Code:
.proc actor_run_player
lda #2
sta ActorSpeed,x
lda #255
jsr Actor8WayMovement
Exit:
rts
.endproc
.proc actor_run_getme
lda #1
sta ActorSpeed,x
jsr ActorBallMovement
lda #ActorTypes::player
jsr ActorTouchingType
jcc lbl_12
lda #0
sta ActorType,x
lda #ActorTypes::getme
jsr ActorFindType
jcs lbl_14
jsr WinGame
lbl_14:
lbl_12:
Exit:
rts
.endproc
lda #2
sta ActorSpeed,x
lda #255
jsr Actor8WayMovement
Exit:
rts
.endproc
.proc actor_run_getme
lda #1
sta ActorSpeed,x
jsr ActorBallMovement
lda #ActorTypes::player
jsr ActorTouchingType
jcc lbl_12
lda #0
sta ActorType,x
lda #ActorTypes::getme
jsr ActorFindType
jcs lbl_14
jsr WinGame
lbl_14:
lbl_12:
Exit:
rts
.endproc
and I've got a whole bunch of behavior primitives written, though the actual rest of the engine is far from done, as is any actual stuff to put the microgames together in a ROM, though I imagine that wouldn't be hard. The rest of the sample file I'm using is here with the output here. That shows off some math (including optimizations to use INC and DEC when possible), and conditionals using OR and AND, and other features.
I guess the question is, is this worth doing? Expressing it through JSON like this doesn't really seem that much easier than just writing the instructions yourself, though it could probably benefit from being able to accept a file that's in more convenient-to-write form, where you could add comments. I'm not really interested in making a GUI editor for this, but maybe an existing one could be tweaked to work with this?